Skip to content

fix(otel): compose baggage filter options - #59

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

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

Conversation

@josuegiron

Copy link
Copy Markdown
Member

Summary

WithBaggageAllowList, WithBaggageDenyList and WithBaggageFilter used to assign the same BaggageFilter field, so only the last option took effect. They now compose in the order given: a member is logged only when every filter keeps it, and each filter receives the value returned by the previous one. WithBaggageFilter(nil) is ignored (it used to clear earlier filters); assigning the BaggageFilter field directly still replaces them. Documented on the options, the field and in the README.

Verification

gofmt -l ., go vet ./..., go test -race ./..., govulncheck ./... in otel/; new table test covers allow/deny in both orders, a redacting filter with an allow list in both orders, and a nil filter.

🤖 Generated with Claude Code

WithBaggageAllowList, WithBaggageDenyList and WithBaggageFilter each
replaced the handler's filter, so only the last option applied. They now
compose in option order; a nil filter is ignored.

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