Commit 1e9eb32
fix(otel): preserve all exemplars per data point (#1662)
insert_exemplars wrote every exemplar of a data point to the same static
columns (exemplar_time_unix_nano, exemplar_span_id, exemplar_trace_id,
exemplar_value), so each exemplar overwrote the previous one and only the
last survived. This affected Sum, Histogram, ExponentialHistogram (and
Gauge) metric types.
Serialize all exemplars into a single nested `exemplars` array column
(array of objects), the OTel-faithful representation recommended in the
issue. Each element carries exemplar_time_unix_nano, exemplar_span_id,
exemplar_trace_id, exemplar_value, and any filtered attributes.
Add the P_OTEL_FLATTEN_EXEMPLARS flag (default false) to opt back into
the legacy flat columns for backward compatibility.
Also stops exemplar attributes from leaking into the physical-series
hash: `exemplars` is added to OTEL_METRICS_KNOWN_FIELD_LIST so exemplar
contents no longer fragment series identity.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent d6a3b5a commit 1e9eb32
2 files changed
Lines changed: 245 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
295 | 303 | | |
296 | 304 | | |
297 | 305 | | |
| |||
0 commit comments