How do exemplars help you jump from a slow-latency graph to a specific trace?
AdvancedScenarioPrometheus and PromQL at Scale
Answer
Situation read → A p99 spike tells you "something is slow" but not which request. Exemplars attach a trace ID to a specific histogram observation.
What I'd do →
- Instrument the app so histogram observations include the trace ID (OpenTelemetry or Prometheus client libraries with exemplar support). Expose in OpenMetrics format.
- Start Prometheus with
--enable-feature=exemplar-storageand scrape using OpenMetrics. - In Grafana, set the Prometheus data source's exemplar link to the Tempo data source using the
trace_idlabel. - In a latency panel, enable Exemplars. Click a dot to open the trace.
Why → You move from aggregate to individual evidence in one click, shrinking the diagnosis time.
Interview tip → Exemplars are sparse samples, not full coverage. They are pointers, not a replacement for tracing.
More on Prometheus and PromQL at Scale
Prometheus memory has grown to 60 GB and keeps climbing. How do you find the cause?IntermediateA developer added `user_id` as a metric label. What is the problem and what do you advise?BeginnerYour dashboard shows the average of per-pod p99 latencies. Why is it wrong, and how do you compute a correct fleet-wide p99?IntermediateChoose histogram bucket boundaries for a service with a 300 ms latency SLO.AdvancedYou have 500 short-lived batch jobs that finish before Prometheus can scrape them. How do you capture their metrics?IntermediateYour EC2 fleet autoscales constantly. How do you keep Prometheus targets up to date?Intermediate