-
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/tailsampling] fix InvertNotSampled
decision precedence when inside and sub policy
#33671
[processor/tailsampling] fix InvertNotSampled
decision precedence when inside and sub policy
#33671
Conversation
This fixes the handling of AND policies that contain a sub-policy with invert_match=true. Previously if the decision from a policy evaluation was NotSampled or InvertNotSampled it would return a NotSampled decision regardless, effectively downgrading the result. This was breaking the documented behaviour that inverted decisions should take precedence over all others. This is related to the changes made in open-telemetry#9768 that introduced support for using invert_match within and sub policies.
InvertNotSampled
decision precedence when inside and sub policy
Thank you for the PR! This might need a changelog entry: |
@jpkrohling I've added a changelog entry but I wasn't sure whether to classify this as a breaking change or not? The behaviour now matches the documentation with this change but it could be a breaking change for people if they were relying on the old behaviour. |
I believe this is a bug fix. |
…edence when inside and sub policy (open-telemetry#33671)" This reverts commit e2fda02.
update: didn't notice this was already covered in this bug. We implemented tail sampling using v0.100.0 of the collector, and want to upgrade to the latest version, but have encountered being unable to replicate behaviour we took from the documentation examples of this repo (namely, the backwards compatibility policy) since that upgrade. It seems that since v0.104.0 when this bug fix was merged that behaviour is no longer possible. I believe that the documentation examples are now not representative of the possible sampling decisions, which is misleading. We liked the pattern of being able to sample everything but an array of services, which you would then create policies on what traces to keep from those services, as it made for a lean set of policies. Our sampling used to work with the following, but now does not, as the "inverted not sample decision" is taking precedence over every subsequent "sample" or "not sample" policy made for those services - meaning those services will always NOT be sampled:
Keeping backwards compatibility with sampling services not ready to implement tail sampling at 100% is extremely important to us as we have such a large estate. I understand this bug fix was needed, but would love some help to see if this behaviour can in fact be replicated after this change - it was working so well for us! |
@karinhawk, we have another issue covering this, right? |
Description:
This fixes the handling of AND policies that contain a sub-policy with invert_match=true. Previously if the decision from a policy evaluation was
NotSampled
orInvertNotSampled
it would return aNotSampled
decision regardless, effectively downgrading the result.This was breaking the documented behaviour that inverted decisions should take precedence over all others.
This is related to the changes made in #9768 that introduced support for using invert_match within and sub policies.
Link to tracking Issue: #33656
Testing:
I tested manually that this fixes the issue described in #33656 and also updated the tests. If you have any suggestions for more tests we could add let me know.
Documentation: