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/tailsampling] fix InvertNotSampled decision precedence when inside and sub policy #33671

Merged

Conversation

jamesrwhite
Copy link
Contributor

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 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 #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:

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.
@jamesrwhite jamesrwhite requested review from jpkrohling and a team as code owners June 20, 2024 10:54
@github-actions github-actions bot added the processor/tailsampling Tail sampling processor label Jun 20, 2024
@jamesrwhite jamesrwhite changed the title [processor/tailsampling] fix inverted not sampled AND policy [processor/tailsampling] fix InvertNotSampled decision precedence when inside and sub policy Jun 20, 2024
@jpkrohling jpkrohling assigned jpkrohling and unassigned crobert-1 Jun 20, 2024
@jpkrohling
Copy link
Member

Thank you for the PR! This might need a changelog entry:
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#adding-a-changelog-entry

@jamesrwhite
Copy link
Contributor Author

@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.

@jpkrohling
Copy link
Member

I believe this is a bug fix.

@jpkrohling jpkrohling merged commit e2fda02 into open-telemetry:main Jun 20, 2024
154 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 20, 2024
@jamesrwhite jamesrwhite deleted the fix-and-policy-invert-not-sampled branch July 2, 2024 17:37
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this pull request Jul 11, 2024
…hen inside and sub policy (open-telemetry#33671)

**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` 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.

**Link to tracking Issue:**
open-telemetry#33656

**Testing:**

I tested manually that this fixes the issue described in
open-telemetry#33656
and also updated the tests. If you have any suggestions for more tests
we could add let me know.

**Documentation:**
hyang023 pushed a commit to hyang023/opentelemetry-collector-contrib that referenced this pull request Jul 16, 2024
…edence when inside and sub policy (open-telemetry#33671)"

This reverts commit e2fda02.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
processor/tailsampling Tail sampling processor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants