Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[processor/redaction] Introduce blocked_key_patterns parameter #37664

Merged
merged 4 commits into from
Feb 25, 2025

Conversation

odubajDT
Copy link
Contributor

@odubajDT odubajDT commented Feb 4, 2025

Description

  • added blocked_key_patterns parameter to mask values of attributes, which keys match at least one of the defined patterns
  • refactored tests to make them easier to extend

Link to tracking issue

Fixes #35830

Follow-up

#38161

@github-actions github-actions bot added the processor/redaction Redaction processor label Feb 4, 2025
@odubajDT odubajDT force-pushed the redaction-blocked-patterns branch from 7c82c57 to b3a192a Compare February 4, 2025 12:42
@odubajDT odubajDT marked this pull request as ready for review February 4, 2025 13:01
@odubajDT odubajDT requested a review from a team as a code owner February 4, 2025 13:01
@odubajDT odubajDT force-pushed the redaction-blocked-patterns branch from b3a192a to 71decca Compare February 11, 2025 13:55
@odubajDT odubajDT force-pushed the redaction-blocked-patterns branch from be2df19 to b8eed15 Compare February 25, 2025 06:34
@odubajDT odubajDT changed the title [processor/redaction] Introduce blocked_key_patterns and support hashing instead of masking values via hash_function parameter [processor/redaction] Introduce blocked_key_patterns parameter Feb 25, 2025
@@ -43,6 +45,11 @@ func newRedaction(ctx context.Context, config *Config, logger *zap.Logger) (*red
// TODO: Placeholder for an error metric in the next PR
return nil, fmt.Errorf("failed to process block list: %w", err)
}
blockKeysRegexList, err := makeRegexList(ctx, config.BlockedKeyPatterns)
if err != nil {
// TODO: Placeholder for an error metric in the next PR
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have an issue for any TODO in the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this TODO comment was copied from a block right above this. I have zero context what needs to be done here, but added it also here, since it's present in every block that is creating regex list

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, fair, feel free to file an issue to investigate the mysterious TODOs then, but no need for it to block merging this PR :)

…shing instead of masking values via 'hash_function' parameter

Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
@odubajDT odubajDT force-pushed the redaction-blocked-patterns branch from 2e982da to 28c2244 Compare February 25, 2025 15:11
@mx-psi mx-psi merged commit d22aafc into open-telemetry:main Feb 25, 2025
157 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 25, 2025
atoulme pushed a commit that referenced this pull request Mar 4, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
- added `hash_function` parameter to support hashing the values (or
substrings of values) instead of masking them with a fixed string. By
default fixed string masking is performed

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes #35830

#### Depends on


#37664

---------

Signed-off-by: odubajDT <[email protected]>
Co-authored-by: Evan Bradley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
processor/redaction Redaction processor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[processor/redaction] Add support for keys patterns and ability to specify mask string
3 participants