Chart a Range Query and Pull Its Exemplars
A 3-step recipe with Prometheus. We can help you get access.
Recipe · 3 steps
Chart a Range Query and Pull Its Exemplars
with Prometheus
Evaluate a PromQL expression over a time range and fetch its exemplars.
- Evaluate the expression once at the end of the window. A 400 or 422 here means the expression is malformed and the range query would fail the same way, only after far more work on the server.
- Evaluate the expression at every step across the range, producing the matrix of time series a chart renders.
- Retrieve exemplars over the same window. Exemplars carry the trace or log IDs attached to individual observations, which is what turns a latency spike on the chart into a specific trace to open.
What you'll need to have ready
- query: The PromQL expression to chart (e.g. histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m]))).
- start: Start of the range as a Unix timestamp or RFC3339 string.
- end: End of the range as a Unix timestamp or RFC3339 string.
- step: Resolution step width as a duration string (e.g. 15s, 1m, 1h).
For your developer
Arazzo workflow prometheus:range-query-with-exemplars, 3 operations: queryInstant → queryRange → queryExemplars. Specs on APIs.io.