v2

latestOpenAPI 3.1.0raw.githubusercontent.com2026-02-1261033.5 KB

List label names

Return the sorted list of all label names present in the database. Optionally filtered by series selectors and/or a time range.

When match[] selectors are provided, only label names from series matching those selectors are returned. When start and/or end are provided, only series with samples in that time range are considered.

Also accepts POST with a application/x-www-form-urlencoded body containing the same parameters.

get/api/v1/labels

Query parameters

match[]string[]

Optional series selectors to filter which label names are returned. When provided, only label names that appear on series matching at least one of these selectors are included. Multiple selectors are combined with logical OR.

startstring

Start timestamp to limit the time range considered. Only label names from series with samples within [start, end] are returned. RFC 3339 or Unix seconds.

endstring

End timestamp to limit the time range considered. RFC 3339 or Unix seconds.

limitinteger

Maximum number of label names to return. A value of 0 disables the limit.

Response

Sorted list of label names as strings. Always includes built-in labels like __name__ if any metric data exists.

status'success' | 'error' required
datastring[]

Alphabetically sorted list of label names. Includes built-in labels like __name__ if any metric data exists.

errorstring

Human-readable error message (present when status is error).

errorTypestring

Error category (present when status is error).