Enable exemplar recording in your SDK: in the OpenTelemetry SDK, configure the exemplar filter to TraceBased (only records with an active span context are eligible) so exemplars carry real trace and span IDs
Record histogram or gauge measurements inside an active span context; the SDK automatically attaches the current trace ID and span ID as an exemplar to the histogram bucket that contains the measurement
Export metrics via the OTLP exporter to a backend that stores exemplars (Prometheus with --enable-feature=exemplar-storage, Grafana Mimir, Google Managed Prometheus); exemplars are included in the OTLP payload natively
When using the Prometheus exporter in the OTel Collector, verify that exemplars appear in the /metrics output (look for # line with traceID and spanID labels); check the Collector's otelcol_prometheus_exporter_* metrics if exemplars are missing
In Grafana, set the exemplar data source for a Prometheus panel to your Tempo or Jaeger trace backend; Grafana renders exemplar dots on the metric graph that link directly to the correlated trace
Use exemplars to triage latency spikes: when p99 latency rises, click the exemplar dot nearest the spike to open the trace, identify the slow span, and drill into the root cause without manual trace ID lookup
Known gotchas
Prometheus scrapes exemplars only when the scraping interval is shorter than the exemplar staleness period (default 5 minutes in Prometheus); if the scrape interval is too long, exemplars may expire before being scraped
Exemplars are attached to histogram and gauge observations only—summary metrics do not carry exemplars; prefer histograms over summaries when exemplar-based trace correlation is a requirement
The OTel Collector prometheus exporter had a known issue where exemplars were received but not exposed on the /metrics endpoint in some versions; verify the behaviour on your deployed version and upgrade if exemplars are missing from the scrape output
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp