Add suggested string representation of complex attributes for non-OTLP protocols by trask · Pull Request #4848 · open-telemetry/opentelemetry-specification (original) (raw)
trask changed the title
Suggested string representation of complex attributes for non-OTLP protocols Add suggested string representation of complex attributes for non-OTLP protocols
trask marked this pull request as ready for review
trask mentioned this pull request
Merged via the queue into open-telemetry:main with commit adbab30
7 of 8 checks passed
github-merge-queue Bot pushed a commit that referenced this pull request
Context
- Deprecate Jaeger propagator and make propagator implementation optional.
(#4827)
- Deprecate OT Trace propagator and make propagator implementation optional.
(#4851)
Metrics
- Add normative language to the Metrics API/SDK spec concurrency requirements.
(#4868)
Logs
- Add optional
Exceptionparameter to Emit LogRecord.
(#4824)
- Add normative language to the Logging API/SDK spec concurrency requirements.
(#4885)
Resource
- Refine the handling of OTEL_RESOURCE_ATTRIBUTES.
(#4856)
Common
- Add string representation guidance for complex attribute value types (byte arrays, empty values, arrays, and maps) for non-OTLP protocols.
(#4848)
Compatibility
- Stabilize Prometheus Counter to OTLP Sum transformation.
(#4862)
- Stabilize Prometheus Gauge to OTLP Gauge transformation.
(#4871)
SDK Configuration
- Swap Tracer/Meter/LoggerConfig
disabledforenabledto avoid double negatives
(#4823)
- Declarative configuration: rename
ComponentProvidertoPluginComponentProvider,CreatePlugintoCreateComponentin effort to use consistent vocabulary
(#4806)
- Declarative configuration: Update instrumentation config behavior to return empty object when not set
(#4817)
pull Bot pushed a commit to weiyilai/opentelemetry-collector that referenced this pull request
Summary
Update float64AsString to return "NaN", "Infinity", and
"-Infinity" instead of "json: unsupported value: ..." for special
float values.
Fixes open-telemetry#14487
Problem
The current Value.AsString() for double values containing NaN,
+Inf, or -Inf returns strings like:
json: unsupported value: +Inf
json: unsupported value: NaNThe OpenTelemetry specification's suggested string
representation
for non-OTLP protocols specifies these should be "NaN", "Infinity",
and "-Infinity".
Fix
Updated float64AsString in pdata/pcommon/value.go to return
spec-compliant strings:
math.NaN()→"NaN"math.Inf(1)→"Infinity"math.Inf(-1)→"-Infinity"
Test Plan
- Updated existing
"bad float64"test case and addedNaNand-Infinitycases - Full
pdatatest suite passes with-race
This was referenced
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})