Langsung ke konten
Skillpedia
Analisis & spreadsheet9.5k Β· #12263

query-metrics

Fungsinya

Skill ini menjalankan pencarian pada metrik yang tersimpan di Axiom. Skill ini ditujukan untuk orang yang melacak pengukuran sistem atau aplikasi dan ingin jawaban tanpa menulis setiap kueri secara manual.

Kapan dipakai

  • βœ“Saat Anda ingin mengetahui metrik apa saja yang tersedia di dataset Axiom Anda.
  • βœ“Saat Anda membutuhkan nilai sebuah metrik dalam rentang waktu tertentu.
  • βœ“Saat Anda ingin mencari metrik yang memuat nama layanan atau host tertentu.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/openclaw/clawhub/blob/main/.agents/skills/query-metrics/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œTampilkan metrik jumlah permintaan untuk layanan API saya selama sehari terakhir.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mendaftar metrik beserta tag-tagnya, membaca aturan kueri, lalu menjalankan kueri pada dataset Anda untuk rentang waktu yang Anda pilih. Agent memperbaiki kueri sampai hasilnya menjawab pertanyaan Anda.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum

Apakah saya perlu tahu bahasa kueri?

Tidak secara mendalam. Agent membaca aturan kueri lebih dulu dan menulis kuerinya untuk Anda.

Pengaturan apa yang dibutuhkan?

Pengaturan akses Axiom Anda harus sudah dikonfigurasi lebih dulu, seperti yang dijelaskan di readme skill.

Apakah metrik bisa dicari berdasarkan nama?

Skill ini mencari nilai tag, jadi paling cocok untuk mencari metrik yang memuat nama layanan atau host yang sudah diketahui.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
9.5k
Peringkat
#12263
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa