query-metrics
What it does
This skill runs searches on metrics stored in Axiom. It is for people who track system or app measurements and want answers without writing every query by hand.
When to use it
- βWhen you want to find which metrics are available in your Axiom datasets.
- βWhen you need the value of a metric over a time range.
- βWhen you want to find which metrics carry a particular service or host name.
Skill link
https://github.com/openclaw/clawhub/blob/main/.agents/skills/query-metrics/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βShow me the request count metric for my API service over the last day.β
5 new skills a week. 1 minute to read.
How it works
The agent lists the metrics and their tags, reads the query rules, and runs a query against your dataset over the time range you pick. It refines the query until the result answers your question.
Technical content (original SKILL.md)
Original text by the author, straight from 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
scripts/datasets <deploy> --kind otel:metrics:v1β list metrics datasets.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.scripts/metrics-info <deploy> <dataset> metricsβ list metrics with{type, temporality, unit}metadata. Read this before writing the query (see Choosing a Query Shape).scripts/metrics-info <deploy> <dataset> tags [<tag> values]β explore filter dimensions.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 avgproduces nonsense. Usebucket β¦ usingwith the histogram functions frommetrics-spec; quantiles are float specs to those functions, andtemporalityselects the variant (CumulativevsDeltainterpolation). Consultmetrics-specfor 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
FAQ
Do I need to know the query language?
Not in detail. The agent reads the query rules first and writes the query for you.
What setup does it need?
Your Axiom access settings must be configured first, as described in the skill's readme.
Can it find metrics by name?
It searches tag values, so it is best for finding metrics that carry a known service or host name.
Details
Original description by the author
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
Popularity
- GitHub stars
- 9.5k
- Ranking position
- #12263
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
axiom-alerting
9.5kHelps your agent create and manage Axiom monitors and notification routes through the Axiom API, and check that alerts behave as expected.
axiom-sre
9.5kHelps your agent investigate production incidents and bugs step by step, testing each guess against Axiom logs before drawing a conclusion.
building-dashboards
9.5kHelps your agent design Axiom dashboards with fitting charts, queries and filters, starting from the decisions the dashboard must support.
controlling-costs
9.5kHelps your agent find unused data in Axiom and build dashboards and monitors that track and cut logging costs.
Similar skills
gitcrawl
394kLets your agent search a saved archive of GitHub issues and pull requests, group duplicates, and check their current status on GitHub.
slacrawl
394kLets your agent search and count messages in a local Slack archive, check how fresh that archive is, and refresh it when needed.
goplaces
394kHelps your agent search for places, get their details and reviews, and resolve place names using Google Places, with JSON output for scripts.