Get Prometheus label values

  • GET /_prometheus/{index}/api/v1/label/{name}/values
  • GET /_prometheus/api/v1/label/{name}/values
Auth

Get the sorted deduplicated values of one label on the matching time series. Label names can use the OpenMetrics U__ encoding for characters that are not valid in Prometheus label names. An unknown label returns an empty list. The endpoint mirrors the Prometheus /api/v1/label/{name}/values endpoint.

Required privileges

Index
read

Path parameters

index string optional

An index expression that restricts which indices are considered, for example metrics-generic.prometheus-*. If you omit it, the default expression metrics-* is used. Only indices with index.mode: time_series are considered.

Leave it out to use /_prometheus/api/v1/label/{name}/values.

name string required

The name of the label.

Query parameters

match[] string[]

Repeated series selectors, for example up{job="prometheus"}. If you omit all of them, every series in the time range is considered.

start string

The start of the time range, as an RFC 3339 timestamp or Unix time in seconds. Defaults to 24 hours before end.

end string

The end of the time range, as an RFC 3339 timestamp or Unix time in seconds. Defaults to the current time.

limit number

The maximum number of label values to return. 0 means no limit from the request.

Responses

application/json
status string required

The status of the request: success.

data string[] required

The sorted label values.

warnings string[]

Warnings, such as a notice that the results were truncated because of limit.