[processor/redaction] Apply blocked_values patterns in configuration order - #49876
Merged
songy23 merged 3 commits intoJul 27, 2026
Merged
Conversation
yamoyamoto
requested review from
a team,
TylerHelmuth,
dmitryax,
iblancasa and
mx-psi
as code owners
July 26, 2026 09:21
|
|
Contributor
|
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
|
Pull request dashboard statusStatus last refreshed: 2026-07-27 16:17:10 UTC.
This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected. |
Member
|
/workflow-approve |
Member
|
/workflow-approve |
MovieStoreGuy
approved these changes
Jul 27, 2026
iblancasa
approved these changes
Jul 27, 2026
paulojmdias
approved these changes
Jul 27, 2026
Member
|
/workflow-approve |
singhvibhanshu
approved these changes
Jul 27, 2026
Member
|
/workflow-approve |
Contributor
|
Thank you for your contribution @yamoyamoto! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
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.
Description
Apply
blocked_valuespatterns in the order they are listed in the configuration.Previously the compiled patterns were stored in a map and applied in Go's unspecified map iteration order, so when two patterns matched overlapping regions of the same value, the result changed from run to run. See the tracking issue for details.
makeRegexListnow returns an order-preserving slice instead of a map. The other lists built by the same helper (allowed_values,blocked_key_patterns,ignored_key_patterns) are only used with any-match semantics, so this has no behavioral effect on them. No config schema change.Note: the map implicitly deduplicated identical pattern strings; with the slice, a duplicated pattern is now applied twice. This is only observable with
hash_functionconfigured. I kept the code simple rather than deduplicating, but can add it if preferred.Link to tracking issue
Fixes #49858
Testing
Added
TestBlockedValuesAppliedInConfigOrder: two overlapping patterns against777-7777@example.com, asserting the expected output for both orderings, on both the attribute and log body paths, repeated 10 times so a regression to nondeterministic ordering fails reliably.Documentation
Documented the ordering behavior in the README and added a
bug_fixchangelog entry.Authorship