本文へスキップ
Skillpedia
分析とスプレッドシート9.5k · #12263

query-metrics

できること

このスキルは、Axiomに保存された指標を検索します。システムやアプリの計測値を追跡している人が、すべてのクエリを手で書かずに答えを得るためのものです。

使う場面

  • ✓Axiomのデータセットにどの指標があるか調べたいとき。
  • ✓ある時間範囲での指標の値が必要なとき。
  • ✓特定のサービス名やホスト名を持つ指標を探したいとき。

スキルのリンク

https://github.com/openclaw/clawhub/blob/main/.agents/skills/query-metrics/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/openclaw/clawhub/blob/main/.agents/skills/query-metrics/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“過去1日間の、APIサービスのリクエスト数の指標を見せてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは指標とそのタグを一覧にし、クエリのルールを読みます。そのうえで、選んだ時間範囲でデータセットに対してクエリを実行します。質問に答えが出るまでクエリを調整します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Querying Axiom Metrics

All script paths are relative to this skill's folder; invoke as scripts/<name>. The target dataset must be of kind otel:metrics:v1.

Setup, prerequisites, and ~/.axiom.toml configuration: see README.md. Edge-deployment routing is automatic — the scripts read each dataset's edgeDeployment and route to the right regional endpoint without configuration.

Workflow

  1. scripts/datasets <deploy> --kind otel:metrics:v1 — list metrics datasets.
  2. scripts/metrics-spec — required before composing any query. MPL evolves; the spec is the source of truth. Also use it to answer general MPL/metrics questions.
  3. scripts/metrics-info <deploy> <dataset> metrics — list metrics with {type, temporality, unit} metadata. Read this before writing the query (see Choosing a Query Shape).
  4. scripts/metrics-info <deploy> <dataset> tags [<tag> values] — explore filter dimensions.
  5. scripts/metrics-query <deploy> '<MPL>' <start> <end> — execute. Iterate.

If the user names a specific entity (service, host, …), scripts/metrics-info <deploy> <dataset> find-metrics "<value>" finds the metrics carrying it. find-metrics searches tag values, not metric names — don't use it for general discovery.

Choosing a Query Shape

The metrics-info listing returns each metric's {type, temporality, unit}. Read these before composing — never assume a metric is a simple scalar.

Field Values Drives
type Gauge, CounterMonotonic, CounterNonMonotonic, Histogram Required pre-aggregation operators.
temporality Cumulative, Delta, null Whether counter values are running totals or per-interval deltas. null is normal for Gauges.
unit UCUM string (Cel, kW.h, s, %, [ppm], …) or null Display unit; preserve when reporting results.

Rules per type (consult metrics-spec for exact operator names — they evolve):

  • Gauge — instantaneous value. Align directly with avg/min/max/sum. Don't apply a rate; you'd be averaging meaningless deltas of an instantaneous value.
  • CounterMonotonic + Cumulative — running total (resets aside). The raw values are rarely what you want. Convert to a per-second rate first, then align/aggregate.
  • CounterMonotonic + Delta — already per-interval. Sum/align without a rate step.
  • CounterNonMonotonic — can go up or down (queue depth, balance). Intent is ambiguous: rate, delta, or current value all make sense for different questions. Ask the user before picking one.
  • Histogram — not a scalar. align using avg produces nonsense. Use bucket … using with the histogram functions from metrics-spec; quantiles are float specs to those functions, and temporality selects the variant (Cumulative vs Delta interpolation). Consult metrics-spec for the exact signatures.
  • temporality: null — "not applicable for this instrument type" (the norm for Gauges), not "missing data".

When surfacing numbers, attach the unit (treat null as unitless). If you combine metrics with mismatched units in arithmetic, warn rather than silently producing a meaningless number.

Query Metrics

scripts/metrics-query [-w pixels] [--pixel-per-point n] <deploy> '<MPL>' <start> <end>
Parameter Notes
deploy Name from ~/.axiom.toml (e.g. prod).
MPL Pipeline string. Dataset is parsed from the MPL itself.
start / end RFC3339 (2025-01-01T00:00:00Z) or relative (now-1h, now).
-w / --chart-width <px> Optional. Target chart width in pixels; lets the server resolve $__interval.
--pixel-per-point <n> Optional. Pixels per point (server default 10); with -w sets the bucket count.

Always single-quote the MPL string in the shell. MPL is full of backticks; inside double quotes the shell executes them as command substitution, silently mangling the query (or running whatever the identifier names).

Bound the output before grouping. group by <tag> returns one series per tag value with no cap — on a high-cardinality tag this floods the output. Check cardinality first (describe, or tags <tag> values) and prefer plain group using <agg> while exploring.

Examples:

scripts/metrics-query prod -w 1200 \
  '`my-dataset`:`http.server.duration` | align to $__interval using avg' \
  now-1h now

scripts/metrics-query prod -w 1200 \
  '`my-dataset`:`http.server.duration`
   | wh
よくある質問

クエリ言語を詳しく知っている必要がありますか?

詳しい知識は必要ありません。エージェントがまずクエリのルールを読み、クエリを書きます。

どのような設定が必要ですか?

スキルのreadmeに書かれているとおり、先にAxiomへのアクセス設定を行う必要があります。

名前で指標を探せますか?

タグの値を検索するため、既知のサービス名やホスト名を持つ指標を探すのに最適です。

詳細

作者による元の説明

Runs metrics queries against Axiom MetricsDB via scripts. Discovers available metrics, tags, and tag values. Use when asked to query metrics, explore metric datasets, check metric values, or investigate OTel metrics data.

repo: openclaw/clawhub

人気

GitHubのスター
9.5k
ランキング
#12263
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル