Repository navigation
fix(otel): compose baggage filter options - #59
Open
josuegiron wants to merge 1 commit into
Open
josuegiron wants to merge 1 commit into
josuegiron wants to merge 1 commit into
Conversation
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>
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.
Summary
WithBaggageAllowList,WithBaggageDenyListandWithBaggageFilterused to assign the sameBaggageFilterfield, 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 theBaggageFilterfield directly still replaces them. Documented on the options, the field and in the README.Verification
gofmt -l .,go vet ./...,go test -race ./...,govulncheck ./...inotel/; 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