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
vincentfree pushed a commit to ing-bank/opentelemetry-collector-contrib that referenced this pull request May 6, 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
open-telemetry#37760

#### Related Issues

-
open-telemetry#36673
-
open-telemetry#33656
-
open-telemetry#36795
-
open-telemetry#34296
-
open-telemetry#34085
-
open-telemetry#29637
-
open-telemetry#27049
- Probably more 😅

---------

Signed-off-by: Sean Porter <[email protected]>
vincentfree pushed a commit to ing-bank/opentelemetry-collector-contrib that referenced this pull request May 6, 2025
Documentation for the recently added [drop policy
type](open-telemetry#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]>
# Conflicts:
#	processor/tailsamplingprocessor/README.md
atoulme pushed a commit that referenced this pull request May 9, 2025
#### Description

Users can now use the newly added [Drop policy
type](#39668)
to explicitly drop (not sample) specific traces regardless of other
policy decisions. This pull-request deprecates the invert sample
decisions.
 
This pull-request introduces a feature gate/flag,
`processor.tailsamplingprocessor.disableinvertdecisions`, to disable the
invert sampling decisions. The gate/flag influences the underlying
policy evaluation for simplicity. With the gate/flag enabled, the
string, numeric, and boolean filter policies still support
`invert_match`, which continues to flip the decision for the individual
policy (only `Sampled` and `NotSampled`). Letting `invert_match` be
simple.

#### Related Issues

-
#36673
-
#33656
-
#36795
-
#34296
-
#34085
-
#29637
-
#27049
- Probably more 😅

---------

Signed-off-by: Sean Porter <[email protected]>
vincentfree pushed a commit to ing-bank/opentelemetry-collector-contrib that referenced this pull request May 20, 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
open-telemetry#37760

#### Related Issues

-
open-telemetry#36673
-
open-telemetry#33656
-
open-telemetry#36795
-
open-telemetry#34296
-
open-telemetry#34085
-
open-telemetry#29637
-
open-telemetry#27049
- Probably more 😅

---------

Signed-off-by: Sean Porter <[email protected]>
dragonlord93 pushed a commit to dragonlord93/opentelemetry-collector-contrib that referenced this pull request May 23, 2025
Documentation for the recently added [drop policy
type](open-telemetry#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]>
dragonlord93 pushed a commit to dragonlord93/opentelemetry-collector-contrib that referenced this pull request May 23, 2025
…metry#39833)

#### Description

Users can now use the newly added [Drop policy
type](open-telemetry#39668)
to explicitly drop (not sample) specific traces regardless of other
policy decisions. This pull-request deprecates the invert sample
decisions.
 
This pull-request introduces a feature gate/flag,
`processor.tailsamplingprocessor.disableinvertdecisions`, to disable the
invert sampling decisions. The gate/flag influences the underlying
policy evaluation for simplicity. With the gate/flag enabled, the
string, numeric, and boolean filter policies still support
`invert_match`, which continues to flip the decision for the individual
policy (only `Sampled` and `NotSampled`). Letting `invert_match` be
simple.

#### Related Issues

-
open-telemetry#36673
-
open-telemetry#33656
-
open-telemetry#36795
-
open-telemetry#34296
-
open-telemetry#34085
-
open-telemetry#29637
-
open-telemetry#27049
- Probably more 😅

---------

Signed-off-by: Sean Porter <[email protected]>
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