Repository navigation
Conversation
Pull request dashboard statusWaiting on reviewers · refreshed 2026-11-09 19:55 UTC Review the latest changes. Also blocked by: Merge conflicts. Status above doesn't look right?
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9307 +/- ##
=======================================
- Coverage 89.8% 89.8% -0.1%
=======================================
Files 357 358 +1
Lines 23987 24009 +22
=======================================
+ Hits 21562 21581 +19
- Misses 2425 2428 +3
🚀 New features to boost your workflow:
|
# Conflicts: # CHANGELOG.md
pellared
marked this pull request as ready for review
November 9, 2026 13:52
pellared
requested review from
MrAlias,
XSAM,
dashpole,
dmathieu and
ps-mir
as code owners
November 9, 2026 13:52
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain, although tests and benchmarks were not independently run during the review.
No open issues 🎉
What changed in this PR
Updates stdouttrace to use non-OTLP attribute formatting, following stdoutlog in #9150 and addressing #9305 so NaN and infinity values no longer prevent spans from being exported.
Changes:
- Adds exporter-local JSON wrappers for span, event, link, resource, and scope attributes.
- Preserves input spans during timestamp removal and retains per-span error handling and success accounting.
- Adds representation and error-handling regression tests, benchmarks, package documentation, and changelog entries.
No review findings remain. Tests and benchmarks were not independently run during this review.
| File | Description |
|---|---|
exporters/stdout/stdouttrace/trace.go |
Uses JSON wrappers and removes timestamps from owned copies. |
exporters/stdout/stdouttrace/trace_test.go |
Updates expected output and non-finite success accounting. |
exporters/stdout/stdouttrace/nonfinite_test.go |
Adds attribute-format, input-preservation, and error regression tests plus benchmarks. |
exporters/stdout/stdouttrace/json.go |
Implements exporter-local non-OTLP attribute wrappers. |
exporters/stdout/stdouttrace/doc.go |
Documents the attribute representation. |
CHANGELOG.md |
Records the format change and non-finite export fix. |
Review effort: Balanced
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NaN and infinities in span attributes currently fail JSON encoding and leave affected spans unwritten. Share the attribute package's non-OTLP formatting for every export, following merged #9150.
Attribute values use native JSON types: strings, booleans, finite numbers, arrays, objects, and
nullfor empty values. Bytes use Base64 strings; special floats become"NaN","Infinity", and"-Infinity". JSON-looking strings stay strings, and user map entries namedTypeorValueremain ordinary data. Integer precision and signed zero are retained.Span, event, and link attributes remain ordered arrays of single-attribute objects; resource and instrumentation scope attribute sets become JSON objects. Empty sets are
{}, nil resources remainnull, and populated scope attributes and scope/library metadata are retained.Use exporter-local
json.RawMessagewrappers so every span is encoded once. Timestamp removal updates owned span/event copies without copying events twice or mutating input spans. Shared attribute marshaling and other exporters are unaffected. Ordinary export errors retain their span indices, later spans are attempted, and observability success counts remain accurate. Focused race tests andmake precommitpass.Fixes #9305.
Eight-sample benchmarks below compare against main
dfb660c5eusing the same fixtures on both versions. Finite scalar attributes retain 26 allocations but use about 46% more bytes. The 1024-element float-array case uses one fewer allocation but about 145% more bytes; nested attributes drop from 40 to 27 allocations with an 11% byte increase. Timestamp removal uses 24 allocations instead of 22 and about 50% more bytes. The memory growth comes from canonical string formatting andjson.RawMessageconversion. Shared-host timing variation, especially for timestamp removal, limits timing conclusions. Non-finite rejection paths are excluded because they do not provide a comparable successful-export baseline.Benchmark commands:
GOMAXPROCS=16 make benchmark/./exporters/stdout/stdouttrace ARGS='-bench=BenchmarkExporterAttributes -benchmem -count=8 -benchtime=200ms'andGOMAXPROCS=16 make benchmark/./exporters/stdout/stdouttrace ARGS='-bench=BenchmarkExporterWithoutTimestamps -benchmem -count=8 -benchtime=100ms'. The timestamp baseline used-benchtime=200ms; updated timestamp samples used100ms.