Q: Describe the role of "Exemplars" in Prometheus and how they bridge the gap between metrics and traces.
Metrics are highly aggregated (e.g., "You had 50 requests take longer than 2 seconds"). Traces are highly specific. The painful gap histo...
🛠️ Production Runbook & Step-by-Step Resolution
Production Solution & Architecture
Metrics are highly aggregated (e.g., "You had 50 requests take longer than 2 seconds"). Traces are highly specific. The painful gap historically was: "Out of the thousands of traces generated in those 5 minutes, which specific trace ID belongs to one of those 50 slow requests?" Exemplars solve this. When an application increments a Prometheus histogram bucket indicating a 2-second delay, it attaches a specific TraceID to that specific observation as metadata (an Exemplar). In Grafana, when you view the spike on the latency graph, little diamonds (Exemplars) appear on the peak. Clicking the diamond instantly pivots you directly to the exact Jaeger trace that caused that specific data point, eliminating the need to manually hunt for correlated traces.
- Immediate Triage: Metrics are highly aggregated (e.g., "You had 50 requests take longer than 2 seconds"). Traces
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.