Slide 3 of 5

Take it further with traces

Take it further with traces

If you also collect traces, the same pattern extends to a third signal using exemplars. An exemplar is a trace ID attached alongside a metric sample, not as a label, so the metric stays low-cardinality while a latency spike becomes one click away from the exact slow trace.

  • Attach the trace ID to the metric as an exemplar, not a label.
  • Keep the trace ID on logs as structured metadata, so logs link to the same trace.

Exemplars require a tracing backend such as Tempo, and exemplar support enabled on your metrics data source.

Script

If you also collect traces, the same pattern extends to traces through exemplars.

An exemplar is a trace ID attached alongside a metric sample rather than as a label. The metric stays low-cardinality, and a latency spike becomes one click away from the exact slow trace.

The setup mirrors what you’ve already done. Attach the trace ID to the metric as an exemplar, not a label, and keep the trace ID on logs as structured metadata so logs link to the same trace.

Two requirements apply before you try it. Exemplars need a tracing backend such as Tempo, and exemplar support must be enabled on your metrics data source.