/v1/metrics supplies the exact names, kinds, units, and label dimensions to copy into queries. Don’t guess names.
GET /v1/metrics — the catalogue
Lists metrics observed over the last 24 hours by default. Pass since/until to widen discovery up to a 30-day span — useful for finding a metric that stopped emitting days ago — and trust the echoed range_start/range_end.
metrics.truncated: false; a missing dimension only when that metric’s dimensions.truncated: false; dimension values are exhaustive only when values.truncated: false. The 200-metric cap is alphabetical, so a wider window can push a busy project past it and drop later-named metrics.
Pick the query idiom from kind
- The catalogue lists a histogram’s base name only — append
_bucket,_count, or_suminside the__name__matcher.histogram_avg,histogram_count, andhistogram_sumare also available. - Summaries never appear in the catalogue.
kindcannot distinguish delta-temporality sums from cumulative ones. Querying a delta series returns400VALIDATION_ERROR(delta-temporality is not supported here) — that’s terminal for the series; don’t rewrite the expression and retry.
Dotted names need __name__ selectors
Names are stored exactly as emitted, and real Mirador names are dotted (mirador.derived.client_slippage_bps) — which makes them invalid as bare PromQL identifiers. Write:
- Dotted metric:
{__name__="http.server.request.duration"} - Dotted label matcher:
{"http.route"="/pay"} - Dotted grouping key:
sum by ("http.route") (...)
__name__ matching must be exact — regex metric-name selection is rejected.
GET /v1/metrics/query — instant
Evaluates PromQL at one instant. query is required; time defaults to now.
GET /v1/metrics/query_range — range
Evaluates PromQL across a range. query and step are both required — omitting step is a 400. end defaults to now, start to one hour before end; both accept RFC 3339 or relative ages.
start and end when they land on the step — a one-hour range at 5m can contain 13 points. Ranges are point-count limited: on QUERY_TOO_BROAD, widen step or shorten the range.
Response envelope
A successful query is the familiar Prometheus shape:vector:[{metric, value: [unix_seconds, "value"]}]matrix:[{metric, values: [[unix_seconds, "value"], ...]}]scalar/string:[unix_seconds, "value"]
NaN, +Inf, and -Inf survive JSON — parse accordingly. An optional top-level warnings array carries non-fatal evaluation notes; surface the text verbatim and treat the result as a success.
A malformed or unsupported query is a
400 VALIDATION_ERROR, not an empty
result — and API errors use Mirador’s typed envelope,
not Prometheus’s. A successful empty result means the query ran and
matched nothing.Next Steps
Dashboards
The same PromQL powers dashboard widgets
Metric alerts
Fire notifications when a PromQL threshold crosses