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

change OR to AND logic for filtering logs #12198

Merged
merged 1 commit into from
Jul 11, 2022

Conversation

zeitlinger
Copy link
Member

change OR to AND logic for filtering logs - as desribed, and as is done for span filtering

Fixes #11439

@zeitlinger zeitlinger requested a review from a team as a code owner July 8, 2022 16:57
Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

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

I see what's fixed in this PR, but I don't understand how it fixes #11439

Comment on lines -96 to -97
if mp.severityTextFilters != nil && mp.severityTextFilters.Matches(lr.SeverityText()) {
return true
Copy link
Member

Choose a reason for hiding this comment

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

Why this didn't work for #11439 before?

Copy link
Member Author

Choose a reason for hiding this comment

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

if the severity didn't match, it would simply go to the next check (attributes) - and this would match (empty expected attributes means it always matches).

I've added a missing test case that reproduced this behavior.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense. Thanks for clarifying!

Comment on lines -96 to -97
if mp.severityTextFilters != nil && mp.severityTextFilters.Matches(lr.SeverityText()) {
return true
Copy link
Member

Choose a reason for hiding this comment

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

Makes sense. Thanks for clarifying!

@dmitryax dmitryax merged commit 2452d43 into open-telemetry:main Jul 11, 2022
atoulme pushed a commit to atoulme/opentelemetry-collector-contrib that referenced this pull request Jul 16, 2022
change OR to AND logic for filtering logs - as desribed, and as is done for span filtering
ag-ramachandran referenced this pull request in ag-ramachandran/opentelemetry-collector-contrib Sep 15, 2022
change OR to AND logic for filtering logs - as desribed, and as is done for span filtering
@zeitlinger zeitlinger deleted the log_filter branch October 18, 2022 16:52
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.

[processor/attributes] log_severity_texts does not filter
3 participants