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] Replace invert sampled with drop policy #37760

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

portertech
Copy link
Contributor

@portertech portertech commented Feb 6, 2025

Description

This pull-request replaces the use of InvertSampled and InvertNotSampled decisions with 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. Other policy types will either return Sampled or NotSampled. 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 what it should be.

This is a breaking change, as existing top-level (not within an and or composite) string, numeric, and boolean filter policies used to impact the final decision with its invert_match. They will need to be replaced with a drop, effectively wrapping them.

Using an example invert_match policy from the readme:

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

This pull-request also optimizes decision policy evaluation. It will make an earlier decision when drop policy is not used, making a decision on the first Sampled. This reduces tick/decision latency, leading to improved stability and performance.

Related Issues

@github-actions github-actions bot added the processor/tailsampling Tail sampling processor label Feb 6, 2025
@github-actions github-actions bot requested a review from jpkrohling February 6, 2025 20:47
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.

1 participant