Skip to content

[processor/tailsampling] Drop policy type #39668

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

Merged
merged 2 commits into from
Apr 29, 2025

Conversation

portertech
Copy link
Contributor

@portertech portertech commented Apr 25, 2025

Description

This pull-request introduces a new policy type to explicitly drop traces regardless of other policy decisions. The new drop policy type behaves much like an and, however, it returns a Dropped decision when all of its policies return Sampled. A Dropped decision takes precedence over all others. The Dropped decision is not new, however, it was unused and therefor safe to use for this purpose. This new policy type is very approachable and capable.

This new policy type can be used to replace the top-level (not within an and policy) use of invert_match to control the final sampling decision. We could deprecate the current invert_match top-level decision logic. The string, numeric, and boolean filter policies still support invert_match, which continues to flip the decision for the individual policy. Let invert_match be simple.

Example:

{
    name: drop-it-like-its-hot,
    type: drop,
    drop: {
        drop_sub_policy: 
        [
            {
                name: do-not-sample,
                type: boolean_attribute,
                boolean_attribute: { key: app.do_not_sample, value: true },
            }
        ]
    }
}

This is a reduced version of a previous PR #37760

Related Issues

Signed-off-by: Sean Porter <[email protected]>
@portertech portertech requested a review from a team as a code owner April 25, 2025 20:07
@portertech portertech requested a review from bogdandrutu April 25, 2025 20:07
@github-actions github-actions bot added the processor/tailsampling Tail sampling processor label Apr 25, 2025
Signed-off-by: Sean Porter <[email protected]>
@atoulme
Copy link
Contributor

atoulme commented Apr 29, 2025

You are codeowner of this component.

@atoulme atoulme merged commit d2825ea into open-telemetry:main Apr 29, 2025
173 checks passed
@github-actions github-actions bot added this to the next release milestone Apr 29, 2025
Copy link
Contributor

@jmacd jmacd left a comment

Choose a reason for hiding this comment

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

LGTM

atoulme pushed a commit that referenced this pull request May 2, 2025
Documentation for the recently added [drop policy
type](#39668).
The examples replace the use of invert_match. I attempted to make as few
changes as necessary at this time. I intended to add further
documentation while deprecating the top-level invert_match
logic/decisions in a separate pull-request.

Signed-off-by: Sean Porter <[email protected]>
@portertech portertech deleted the tsp/drop-policy branch May 2, 2025 16:01
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.

4 participants