Files
Om Kulkarni 8fa4bdc773 exporters/prometheus: preserve exemplar trace/span IDs over filtered attribute labels (#9031)
## Summary

Fixes #6718.

prometheus client-go rejects exemplars whose combined label runes exceed
`prometheus.ExemplarMaxRunes` (128). `addExemplars` let that error
propagate up from `prometheus.NewMetricWithExemplars` and dropped every
exemplar for the data point when the limit was hit, even though the
trace and span ID labels alone are well within the limit and are the
most valuable part of an exemplar.

This checks each exemplar's combined label length against the limit
before building the exemplar. When it would exceed the limit, the
filtered-attribute-derived labels are dropped and only the trace and
span IDs are kept, with a warning logged via `global.Warn` so the
truncation is visible instead of silent.

## Test plan

- [x] Added `TestExemplarsExceedingLabelLimit`, verified it fails
without the fix (exemplar dropped entirely) and passes with it
(trace/span IDs preserved, filtered attributes dropped).
- [x] `go test ./... -race`
- [x] `make precommit`
2026-10-26 09:39:36 +00:00
..
2026-07-15 08:46:29 +02:00
2026-07-15 08:46:29 +02:00
2024-03-26 20:13:54 +01:00