Agent skill

Axiom Metrics Query

by openclaw in openclaw/clawhub

Explores and queries OpenTelemetry metrics in Axiom MetricsDB, listing datasets, metrics and tags first and picking the right aggregation for each metric's type.

MITAuto-check passedDevOps & Cloud

Install Axiom Metrics Query

skills CLI
$ npx skills add openclaw/clawhub --skill query-metrics -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install openclaw/clawhub query-metrics --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/openclaw/clawhub.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/query-metrics .claude/skills/query-metrics && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
query-metrics
GitHub stars
9.5k
Token cost
~2.6k tokens
SKILL.md length
1,193 words
Files
9 (incl. scripts)
Skills in repo
57
Repo updated
First seen
Licence
MIT

At a glance

Explores and queries OpenTelemetry metrics in Axiom MetricsDB, listing datasets, metrics and tags first and picking the right aggregation for each metric's type.

  • Works in 5 steps: scripts/datasets --kind otel:metrics:v1… → scripts/metrics-spec — required before… → scripts/metrics-info metrics — list… → …
  • Finding out what metrics exist in an Axiom OTel dataset
  • SKILL.md covers Workflow, Choosing a Query Shape, Query Metrics and Discovery (metrics-info), plus 2 more sections
  • Calls curl

What it does

The skill runs a set of scripts against Axiom datasets of kind otel:metrics:v1, with edge-deployment routing handled automatically from each dataset's configuration. The workflow lists metrics datasets, reads the MPL query language spec since the language evolves, lists metrics with their type, temporality and unit, explores tag dimensions, and only then runs a query over a time range, iterating as needed. A find-metrics command searches tag values for a named entity such as a service or host, not metric names.

Query shape follows the metric's type: a Gauge is an instantaneous value aggregated directly with avg, min, max or sum without a rate; a monotonic counter with cumulative temporality is a running total that needs a per-second rate conversion before aggregating; a monotonic counter with delta temporality is already per-interval and can be summed directly. The unit field, in UCUM form, is kept when reporting results.

When your agent uses it

  • Finding out what metrics exist in an Axiom OTel dataset
  • Writing an MPL query for a counter or gauge metric
  • Looking up which metrics carry data for a specific service or host
  • Checking a metric's rate correctly before aggregating it

Example prompts

  • “List the metrics in the production OTel dataset and show their types.”
  • “Query the request latency gauge for the last hour, averaged by host.”
  • “Find every metric tagged with the checkout-service host over the past day.”

Requirements

  • An Axiom account configured in ~/.axiom.toml

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. scripts/datasets --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…
  3. scripts/metrics-info metrics — list metrics with {type, temporality, unit} metadata. Read this before writing the query (see Choosing a…
  4. scripts/metrics-info tags [ values] — explore filter dimensions.
  5. scripts/metrics-query '' — execute. Iterate.

What it can do on your machine

Read from SKILL.md and the folder at commit a18bc74. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 7 files in scripts/, which the agent can run.

    Shell commands in SKILL.md call:

    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use curl, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Axiom Metrics Query loads about 2.6k tokens when it runs. Until then it costs about 59 tokens; SKILL.md has 1,193 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~59
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from openclaw/clawhub at commit a18bc74, republished under its MIT licence (© openclaw). 1,193 words, ~2,625 tokens.

Download SKILL.mdSave it as .claude/skills/query-metrics/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
query-metrics
description
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.

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.

FieldValuesDrives
typeGauge, CounterMonotonic, CounterNonMonotonic, HistogramRequired pre-aggregation operators.
temporalityCumulative, Delta, nullWhether counter values are running totals or per-interval deltas. null is normal for Gauges.
unitUCUM string (Cel, kW.h, s, %, [ppm], …) or nullDisplay 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

bash
scripts/metrics-query [-w pixels] [--pixel-per-point n] <deploy> '<MPL>' <start> <end>
ParameterNotes
deployName from ~/.axiom.toml (e.g. prod).
MPLPipeline string. Dataset is parsed from the MPL itself.
start / endRFC3339 (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:

bash
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`
   | where `service.name` == "frontend" and method == "GET"
   | align to $__interval using avg
   | group by status_code using sum' \
  now-1d now
Adaptive resolution ($__interval)

Hardcoding a step (align to 5m) makes charts look wrong at other zoom levels — too sparse zoomed in, too dense zoomed out. Prefer the system parameter $__interval wherever a Duration is expected, and pass the chart width so the server picks the step:

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

The metrics service computes $__interval from the query's time range and the target chart width, then snaps it up to a nice resolution from the ladder 1s, 5s, 10s, 15s, 30s, 1m, 5m, 10m, 15m, 30m, 1h, 12h, 1d, 1w, 1M, 1Y. It never drops below a metric's stored resolution.

  • No declaration needed — the server auto-registers $__interval; do not add param $__interval: Duration; (the edge forwards the query verbatim and the metrics service injects the parameter).
  • Bucket count ≈ chart-width / pixel-per-point (pixel-per-point default 10). Omit -w and the server targets ~500 buckets.
  • Works anywhere a Duration is valid, e.g. bucket to $__interval using histogram(0.5, 0.95).
  • Set -w to your render width (e.g. the metrics-chart skill's plot width) so one bucket ≈ one pixel column. The value is forwarded under the request body's queryOptions (chart-width, pixel-per-point).
Show full SKILL.md (485 more words)Show less
Parameters

MPL can declare parameters (param $svc: string;). Pass values with repeated -p name=value. The script applies the API's param__ prefix; values are forwarded verbatim as MPL literals (string literals include their quotes).

bash
scripts/metrics-query \
  -p svc='"frontend"' \
  -p window='5m' \
  prod \
  'param $svc: string; param $window: Duration;
   `otel-metrics`:`http.server.duration` | where `service.name` == $svc | align to $window using avg' \
  now-1h now

Required parameters must be supplied; optional ones may be omitted. Resulting request body shape:

json
{
  "apl": "param $svc: string; …",
  "startTime": "now-1h",
  "endTime": "now",
  "params": { "param__svc": "\"frontend\"", "param__window": "5m" }
}

Literal syntax per type lives in metrics-spec.

Discovery (metrics-info)

Time range defaults to the last 24h; override with --start / --end. Both accept RFC3339 (offsets allowed) or relative now / now-<N><unit> with <unit> in s m h d w, resolved to RFC3339 UTC client-side. This is narrower than metrics-query, which forwards times to the server unparsed and so also accepts forms like now-1y; in metrics-info anything outside now / now-<N>[smhdw] must already be RFC3339 or the request 400s.

CommandReturns
metrics-info <d> <ds> metricsAll metrics, keyed by name, with {type, temporality, unit}.
metrics-info <d> <ds> metrics --by-typeSame listing grouped by type (client-side reshape).
metrics-info <d> <ds> metrics --type Gauge --type HistogramFiltered listing (repeatable, OR semantics; composes with --by-type).
metrics-info <d> <ds> metrics <metric> infoSingle metric's {type, temporality, unit}. Non-zero exit if absent.
metrics-info <d> <ds> metrics <metric> describeBundle: metadata + all tags + tag values in one call (replaces 1+1+N round trips). Flags: --no-values (tag names only), --values-limit N (cap per-tag values; default 50, 0 = unlimited).
metrics-info <d> <ds> metrics <metric> tagsTags carried by a specific metric.
metrics-info <d> <ds> metrics <metric> tags <tag> valuesTag values for that metric.
metrics-info <d> <ds> metrics <metric> tags <tag> typeProbe whether the tag is int/float/string/bool. Returns {type, present_types}; mixed if multiple types coexist, absent if not present.
metrics-info <d> <ds> tagsAll tags in the dataset.
metrics-info <d> <ds> tags <tag> valuesAll values for a tag (across metrics).
metrics-info <d> <ds> find-metrics "<value>"Metrics that carry the given tag value (not metric name).

Error Handling

HTTP errors return JSON with code and message; some include a detail object:

json
{"code": 400, "message": "MPL syntax error: …"}

Syntax errors (400) include an annotated source pointer listing the valid operators at the failure position — read it, it usually names the fix.

CodeCause
400Invalid query syntax or bad dataset name
401Missing/invalid auth
403No permission
404Dataset not found
429Rate limited — back off and retry; don't tight-loop
500Internal error

Requests time out client-side after 120s (AXIOM_MAX_TIME to override; AXIOM_CONNECT_TIMEOUT for the 10s connect timeout).

On 500, re-run with curl -v to capture the traceparent / x-axiom-trace-id header and report it — the trace ID is what the backend team needs to debug.

Scripts

ScriptUsage
scripts/setupCheck requirements and config.
scripts/datasets <deploy> [--kind <kind>]List datasets with edge deployment.
scripts/metrics-specFetch the MPL query spec.
scripts/metrics-query [-w px] [--pixel-per-point n] <deploy> <mpl> <start> <end>Execute a query; use $__interval + -w for adaptive resolution.
scripts/metrics-info <deploy> <dataset> ...Discover metrics, tags, values.
scripts/axiom-api <deploy> <method> <path> [body]Low-level API calls.
scripts/resolve-url <deploy> <dataset>Resolve to the edge deployment URL.

Run any script without arguments for full usage.

© openclaw, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (scripts) in .agents/skills/query-metrics of openclaw/clawhub.

  • SKILL.md
  • README.md
  • scripts/axiom-api
  • scripts/datasets
  • scripts/metrics-info
  • scripts/metrics-query
  • scripts/metrics-spec
  • scripts/resolve-url
  • scripts/setup

Open the folder on GitHubat commit a18bc74

Compare with similar skills

Axiom Metrics Query next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Axiom Metrics Query compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Axiom Metrics Query this skillopenclaw/clawhub9.5k—~2.6kAutomated safety check: PassMIT
OpenTelemetry Pipeline Metrics Speccomet-ml/opik22k—~3.2kAutomated safety check: PassApache-2.0
Agent Platform Alert Configurationgoogle/skills21k—~4.2kAutomated safety check: PassApache-2.0
Logfire Instrumentationbasicmachines-co/basic-memory4.1k—~2.3kAutomated safety check: PassAGPL-3.0
Developing Funboost Mixinydf0509/funboost892—~2.1kAutomated safety check: PassNone
Archestra Dev Observabilityarchestra-ai/archestra4.3k—~1.2kAutomated safety check: PassCustom licence

Similar skills

  • Specifies how to instrument an opik-backend pipeline with per-stage OpenTelemetry metrics for throughput, latency, errors and queue delay by workspace.

    22k GitHub stars~3.2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Official

    Writes Terraform alerting policies for AI agents that emit OpenTelemetry metrics, covering reliability, cost, safety, security and quality signals on Google Cloud.

    21k GitHub stars~4.2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Logfire Instrumentation

    basicmachines-co/basic-memory

    Adds Pydantic Logfire tracing, logging and metrics to Python, JavaScript or TypeScript and Rust projects, with the correct setup order and library extras.

    4.1k GitHub stars~2.3k tokensUpdated today
    DevOps & CloudAuto-check passed
  • 当需要为 funboost 创建 Consumer 或 Publisher 的 Mixin 扩展类时使用。触发场景:添加监控、熔断、限流、链路追踪等横切关注点,编写自定义前置/后置处理钩子。关键词:mixin, consumeroverridecls, publisheroverridecls, ConsumerMixin, 自定义消费者, hook, 拦截器, 熔断器, 监控…

    892 GitHub stars~2.1k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed
  • Archestra Dev Observability

    archestra-ai/archestra

    A skill your agent uses when changing Archestra tracing, metrics, OpenTelemetry, Tempo, Grafana, Prometheus, LLM/MCP spans, observability labels, or local observability setup.

    4.3k GitHub stars~1.2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Frontmcp Observability

    agentfront/frontmcp

    A skill your agent uses when adding tracing, structured logging, metrics, or monitoring to a FrontMCP server.

    146 GitHub stars~4.6k tokensUpdated today
    DevOps & CloudAuto-check passed

More from openclaw/clawhub

All 57 skills in this repo
  • Creates and manages Axiom monitors and notifiers end to end through the v2 API, with scripts for each CRUD operation and a recommended create-validate-tune workflow.

    9.5k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Axiom Dashboard Builder

    openclaw/clawhub

    Designs and deploys Axiom dashboards through the API, choosing chart types and writing APL or metrics queries, with templates and migration notes for Splunk and Grafana.

    9.5k GitHub stars~4.9k tokensUpdated today
    Auto-check passed
  • Axiom Cost Control

    openclaw/clawhub

    Finds unused data in Axiom by analyzing query patterns, then deploys a cost dashboard and ingest monitors to keep spend under the contract limit.

    9.5k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Axiom SRE Investigator

    openclaw/clawhub

    Investigates incidents and production problems with hypothesis-driven debugging, queries Axiom observability data when available, and keeps secrets out of commands and output.

    9.5k GitHub stars~7.1k tokensUpdated today
    Auto-check passed
  • Axiom Eval Writer

    openclaw/clawhub

    Scaffolds evaluation suites for the Axiom AI SDK: eval files, scorers, flag schemas and axiom.config.ts, generated from plain descriptions of an AI capability.

    9.5k GitHub stars~4.1k tokensUpdated today
    Auto-check: warnings
  • Drafts, previews, sends and records email for an existing ClawHub content rights case through the admin CLI, with a dry run and your sign-off before anything goes out.

    9.5k GitHub stars~984 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Axiom Metrics Query

What does Axiom Metrics Query do?

Explores and queries OpenTelemetry metrics in Axiom MetricsDB, listing datasets, metrics and tags first and picking the right aggregation for each metric's type. The skill runs a set of scripts against Axiom datasets of kind otel:metrics:v1, with edge-deployment routing handled automatically from each dataset's configuration. The workflow lists metrics datasets, reads the MPL query language spec since the language evolves, lists metrics with their type, temporality and unit, explores tag dimensions, and only then runs a query over a time range, iterating as needed.

When should I use Axiom Metrics Query?

Axiom Metrics Query fits situations like: finding out what metrics exist in an Axiom OTel dataset; writing an MPL query for a counter or gauge metric; looking up which metrics carry data for a specific service or host; checking a metric's rate correctly before aggregating it.

How do I install Axiom Metrics Query in Claude Code?

Run `npx skills add openclaw/clawhub --skill query-metrics -a claude-code`. Or copy the skill folder (.agents/skills/query-metrics in openclaw/clawhub) into .claude/skills/query-metrics in your project. Claude Code loads it when a task matches its description.

How do I install Axiom Metrics Query in Codex?

Run `npx skills add openclaw/clawhub --skill query-metrics -a codex`. Or copy the skill folder (.agents/skills/query-metrics in openclaw/clawhub) into .agents/skills/query-metrics in your project. Codex loads it when a task matches its description.

Can I use Axiom Metrics Query in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add openclaw/clawhub --skill query-metrics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/query-metrics, .gemini/skills/query-metrics, .github/skills/query-metrics and .opencode/skills/query-metrics in your project.

What does Axiom Metrics Query need to run?

Going by SKILL.md and its folder, Axiom Metrics Query needs the command-line tools its instructions call (curl). Our summary lists: An Axiom account configured in ~/.axiom.toml.

Does Axiom Metrics Query access the network?

SKILL.md contains no URLs. Its commands use curl, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Axiom Metrics Query safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Axiom Metrics Query use?

Axiom Metrics Query is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Axiom Metrics Query use?

About 2.6k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Axiom Metrics Query?

Skills that share tags, products or a category with Axiom Metrics Query: OpenTelemetry Pipeline Metrics Spec (comet-ml/opik, 22k stars), Agent Platform Alert Configuration (google/skills, 21k stars), Logfire Instrumentation (basicmachines-co/basic-memory, 4.1k stars) and Developing Funboost Mixin (ydf0509/funboost, 892 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Axiom Metrics Query?

openclaw (a GitHub organization) maintains it in openclaw/clawhub, which has 9,489 GitHub stars. The repository holds 57 skills in this directory. The repository was last updated on October 6, 2026.

Source: openclaw/clawhub on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.