-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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/filter] 'and' operator is not working proper when we use '!=' in conditions #36564
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hi @vaibhhavv ! Pipeline2 should drop all the services other than the ones that contain both the attributes and forward them to the exporter. Do I understand this correctly that only traces where |
Hey @bacherfl 😄 For example, if a trace has resource attributes:
|
Thanks for the quick reply! I think in that case you need to adapt the condition, as with the current statement the condition requires both of the attribute values to be different in order to filter out the item. So, instead of
Try to change it to the following:
This way, the items will get filtered in case either |
@bacherfl I quickly checked it out. With But now the question that arises in my head is: normally
|
In this case, the expectation was to filter an item in case either |
But @bacherfl, If you see the requirement, I want those traces that have both |
Yes, so using the
is equivalent to
The latter expression might make it a bit more apparent that items will get filtered out if not both of the attributes match (i.e. if they don't fulfil the strict requirement of both attributes having the expected value) Note: The second expression is just a theoretic example, not sure if this works in the OTTL syntax |
ohhh @bacherfl, thanks for recalling De Morgan's law. 🙌 |
Component(s)
processor/filter
What happened?
Description
I am using OTel v0.111.0, Helm chart v0.108.0.
I am utilising
filter
processor, and observed that when I utilise the filter processor withand
operator along with==
, then it works perfectand
operator along with!=
, then it does not filter out things correctly.Note: In my case, I tested it for traces
Steps to Reproduce
Suppose you are receiving traces, on your OTel and you want to filter services on both below resource attributes and use them in pipeline
Working Filter
Not Working Filter
Expected Result
Actual Result
!=
operator, I see it not works as expected.Collector version
v0.111.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: