本文へ移動
cccskills
無料GitHub で公開

obz-sls

Alibaba Cloud SLS (Simple Log Service) provider for obz. Supports metrics (PromQL), logs (SLS Query), and traces across project/store pairs. Requires AccessKey auth and provider-specific flags like --project, --logstore, --metricstore, and --trace-logstore. This skill should be used when the user mentions "SLS", "Alibaba Cloud", "obz -p sls", or needs to configure SLS provider instances.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.9 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

obz-sls: Alibaba Cloud SLS Provider

Quick Reference

FieldValue
Aliasessls
SignalsMetric, Log, Trace
Metric queryPromQL
Log querySLS Query
AuthAccessKey (access-key-id + access-key-secret)
Endpoint formathttps://<project>.<region>.log.aliyuncs.com

Supported Commands

SignalCommands
Metricquery, list, labels, label-values, series
Logsearch
Tracesearch, get

metric info is not supported by SLS.

Authentication

SLS always requires AccessKey credentials. Configure them in config.yaml under providers.<name>.auth:

# config.yaml
providers:
  sls:
    endpoint: http://cn-hangzhou.log.aliyuncs.com
    project: my-project
    logstore: my-logs
    metricstore: my-metrics
    auth:
      access-key-id: ${env:SLS_AK}
      access-key-secret: ${env:SLS_SK}

Then query with just -p:

obz metric query -p sls -q 'up'

Provider-Specific Flags

FlagTypeRequired ForDescription
--projectStringAll commandsSLS project name
--metricstoreStringMetric commandsMetric store within project
--logstoreStringLog commandsLog store within project
--trace-logstoreStringTrace commandsTrace log store within project

These flags are declared required: false at the CLI level (so other providers don't error), but SLS validates them at runtime. Missing a required flag produces a clear error message.

All flags can be pre-configured in config.yaml — when configured, the CLI flag can be omitted.

Config File Setup

Pre-configuring SLS avoids repeating long flag lists:

# ~/.config/obz/config.yaml
providers:
  sls-prod:
    provider: sls
    endpoint: https://my-proj.cn-hangzhou.log.aliyuncs.com
    project: my-proj
    metricstore: prom-store
    logstore: nginx-access
    trace-logstore: trace-store
    auth:
      access-key-id: ${env:SLS_AK}
      access-key-secret: ${env:SLS_SK}

Then query with just a name:

obz metric query -p sls-prod -q 'up'
obz log search -p sls-prod -q 'error' --from now-1h
obz trace search -p sls-prod -q '*' --from now-1h

SLS Query Language (Logs)

SLS Query supports full-text search, field filters, and boolean logic.

Full-text Search

error
"connection refused"

Field Filters

status:500
host:web-01
request_method:POST

Boolean Operators

error AND status:500
error OR warn
error NOT "health check"

Wildcards

host:web-*
status:5??

Combining Patterns

error AND status:500 AND request_method:POST NOT uri:/health

Common Pitfalls

  • Field names are case-sensitive and must match the indexed field exactly.
  • Bare words search across all text fields. Use field:value to target a specific field.
  • Wildcards work only in field filters, not in quoted phrases.
  • SLS Query is NOT the same as LogsQL or Datadog Log Query. Each provider has its own syntax.

PromQL (Metrics)

SLS metric stores support standard PromQL. MetricsQL extensions like keep_metric_names are not available here.

rate(http_requests_total[5m])
sum by (job) (up)
histogram_quantile(0.99, rate(http_duration_seconds_bucket[5m]))

Examples

Metric query:

obz metric query -p sls-prod -q 'rate(http_requests_total[5m])' --from now-1h

Log search:

obz log search -p sls-prod -q 'error AND status:500' --from now-1h

Trace search:

obz trace search -p sls-prod -q '*' --from now-1h

Trace get by ID:

obz trace get -p sls-prod abc123def456

List metric names:

obz metric list -p sls-prod

List label values:

obz metric label-values -p sls-prod job

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

obz-core

無料

Multi-backend observability CLI for querying metrics, logs, and traces across 12 backends. This skill should be used when the user runs obz commands, constructs metric/log/trace queries, configures providers, parses obz JSON output, or troubleshoots obz errors. Covers all core commands (metric query/list/info/labels/label-values/series, log search, trace search/get), global flags, time formats, output modes, config files, and exit codes.

日本語の概要は準備中です。原文の説明を表示しています。

alibaba/obz-cli282026年7月12日 更新

obz-dd

無料

Datadog provider for obz. Supports metrics (Datadog Query Language), logs (Datadog Log Query), and traces. Requires api-key and app-key configured under auth in config.yaml. Does not support metric labels, label-values, or series commands. This skill should be used when the user mentions "Datadog", "DD", "obz -p dd", Datadog Query Language, or needs to configure Datadog provider instances with regional endpoints.

日本語の概要は準備中です。原文の説明を表示しています。

alibaba/obz-cli282026年7月12日 更新

Elasticsearch provider for obz. Supports log search and trace operations using Elasticsearch Query DSL (Lucene-based). Requires --index flag. This skill should be used when the user mentions "Elasticsearch", "obz -p es", or needs to search logs or traces from an Elasticsearch cluster.

日本語の概要は準備中です。原文の説明を表示しています。

alibaba/obz-cli282026年7月12日 更新

GreptimeDB provider for obz. Covers PromQL metric query, labels, label-values, and series commands via GreptimeDB's Prometheus-compatible API. Use this skill when the user mentions "GreptimeDB", "Greptime", "obz metric -p greptimedb", or needs to query metrics stored in a GreptimeDB instance.

日本語の概要は準備中です。原文の説明を表示しています。

alibaba/obz-cli282026年7月12日 更新

Jaeger provider for obz. Covers trace search, trace retrieval by ID, and extension commands for service and operation discovery. This skill should be used when the user mentions "Jaeger", "obz trace -p jg", or needs to search distributed traces from a Jaeger backend.

日本語の概要は準備中です。原文の説明を表示しています。

alibaba/obz-cli282026年7月12日 更新

obz-loki

無料

Grafana Loki provider for obz. Covers log search using LogQL, a label-based query language for log aggregation. This skill should be used when the user mentions "Loki", "Grafana Loki", "LogQL", "obz log search -p loki", or needs to search logs from a Loki instance.

日本語の概要は準備中です。原文の説明を表示しています。

alibaba/obz-cli282026年7月12日 更新

alibaba のスキルをすべて見る

このスキルの問題を報告する