OpenTelemetry Rust JSON: checking exemplar values separately from metric values
A readable metric does not prove that its exemplar wire contract survived. Test the two independently.
OpenTelemetry Rust JSON: checking exemplar values separately from metric values
Collection of a metric does not establish preservation of its linked exemplar value. A JSON shape that differs from the consumer contract can leave the main metric visible while losing the example needed for diagnosis. Check them as separate preservation items to understand the exchange result accurately. [1, 2, 3]
What the primary source establishes
A report describes the Rust opentelemetry-proto with-serde path nesting Exemplar value differently from OTLP JSON, losing values during exchange with other producers or a Collector. It distinguishes direct proto use from the current Rust SDK's exemplar-recording support. [1]
The handover decision
Send a canonical exemplar and a Rust-serialized exemplar through the same consumer. Reconcile the metric value and exemplar value separately. Keep producer, metric_id, exemplar_value_present, and decoded_exemplar_value so preservation of the main metric does not conceal loss of its linked example. [1, 3]
A reference defined before the output
The illustrative exemplar carries integer value 7. Its value should remain present after reloading. An absent state fails even if the main metric still exists. This fixture checks retention of the exemplar value; it does not infer that an unaffected metric was also corrupted. [1, 3]
The scoped Truthound check
Truthound Core 3.3.2 can compare original and decoded presence states aligned by exemplar identity with ColumnPairValidator. Place compatible OTLP JSON decoding and official schema checks earlier. Do not collapse the metric and its exemplar into a single success flag. [1, 2, 3]
Limits and alternative choices
The report concerns directly built or decoded proto types, not proof that every Rust SDK metric transmission loses exemplars. Verify a ProtoJSON-compatible encoder and decoder through an actual Collector round-trip. For a workload that does not use exemplars, this shape difference does not establish current loss of metric values. [1, 3]
Application conditions
Prepare separate metric and exemplar records linked by identity, retaining source and decoded value-presence states.
Alternatives
Verify a ProtoJSON-compatible encoder and decoder through an actual Collector round-trip.
Limitations
The report concerns directly built or decoded proto types, not proof that every Rust SDK metric transmission loses exemplars.
Evidence
- Event checked
- Subject checked
- Modified
