Skip to content

fix(otel): log baggage members under a baggage group - #60

Open
josuegiron wants to merge 1 commit into
masterfrom
fix/otel-baggage-group
Open

josuegiron wants to merge 1 commit into
masterfrom
fix/otel-baggage-group

Conversation

@josuegiron

Copy link
Copy Markdown
Member

Summary

When baggage logging is enabled, members are now logged under one baggage group ("baggage":{"request_id":"r1"} in JSON, baggage.request_id on span events) instead of as top-level attributes, so a member key cannot duplicate a record key such as msg, level, time, source, trace_id or span_id. Adds the exported constant BaggageKey. No group is added when the filters drop every member. README and doc comment updated.

Output change: baggage keys move under baggage; ships in a minor otel release.

Verification

gofmt -l ., go vet ./..., go test -race ./..., govulncheck ./... in otel/. New BenchmarkHandleBaggage: before ~1.2-1.6 us/op, 128 B, 1 alloc; after ~1.4 us/op, 208 B, 2 allocs.

🤖 Generated with Claude Code

Baggage members were added as top-level record attributes, so a member
key could duplicate a record key such as msg or level. Log them under
the new BaggageKey group instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant