Query Prometheus exemplars

  • POST GET /_prometheus/{index}/api/v1/query_exemplars
  • POST GET /_prometheus/api/v1/query_exemplars
Auth

Get the exemplars of the series selected by a PromQL expression over a time range. The endpoint mirrors the Prometheus /api/v1/query_exemplars 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/query_exemplars.

Query parameters

query string required

The PromQL expression that selects the series.

start string required

The start of the range, as an RFC 3339 timestamp or Unix time in seconds.

end string required

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

timeout string

The evaluation timeout, as a number of seconds or a duration such as 30s. It must be positive and is capped by the xpack.prometheus.query.timeout cluster setting.

Responses

application/json
status string required

The status of the request: success.

data object[] required

The exemplars, grouped by series.

seriesLabels map string to string required

The labels of the series that the exemplars belong to.

exemplars object[] required
labels map string to string required

The labels of the exemplar, such as trace_id.

value string required

The exemplar value, as a string.

timestamp number required

The exemplar timestamp, in Unix seconds.