Repository navigation
Conversation
Decode attributes using their declared types to avoid slice panics and integer precision loss. Support complex values and scope attributes from the pinned OpenTelemetry SDK, and retain trace flags and tracestate. Preserve these values in Jaeger conversion and bundle exports while accepting legacy bundles with empty scope attribute objects. Map only the sampled flag to Jaeger so OTel's random-ID flag is not treated as debug. Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This branch has not been deployed
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.
Fix trace decoding failures and data loss affecting build history and desktop bundle exports. The existing decoder stores attribute values in
any, butencoding/jsondecodes arrays as[]anyand numbers asfloat64. The attribute conversion code atbuildx/util/otelutil/span.go
Lines 275 to 340 in c43f837
9007199254740993becomes9007199254740992. Decode values according to their declared OTel types so slices survive and integers retain their precision, with errors for malformed values instead of panics or implicit coercion.Support the full attribute model exposed by the pinned OTel 1.46.0 dependency, including
EMPTY,BYTESLICE,SLICE, andMAP. Previously, these valid types caused the entire trace to fail decoding. Preserve nested values and instrumentation-scope attributes, preferInstrumentationScopewhen present, and retain compatibility withInstrumentationLibrary. Jaeger conversion now represents bytes as binary tags and complex values as JSON strings instead of silently dropping them.Preserve trace flags and tracestate during decoding and bundle export. The previous decoder recognized only the exact flags string
"01", so"03"lost both the sampled and random-ID bits. OTel defines the random-ID flag as0x02, while Jaeger uses that bit for debug. Preserve the OTel flags internally and transfer only the shared sampled bit to Jaeger.Keep older bundles readable while fixing scope-attribute preservation in new exports. The bundle sanitizer encoded spans by value, bypassing
attribute.Setpointer-receiver JSON marshaler and writing scope attributes as{}. Encode spans by pointer to preserve their attributes, and continue accepting the legacy object representation.I used Codex to investigate the issues, then cross-checked the changes with Claude Code. That review caught a compatibility issue with scope attributes in older bundles, which was reproduced and fixed before a follow-up review.