-
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] numeric attribute invert match evaluation not prioritized #34296
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I'd be happy to look into this and work on a fix |
After looking into this, I have two questions related to the policy evaluators:
|
Probably just an oversight/bug.
The invert match was added originally for the string only. In the name of consistency, it would be good to have it for all types though. |
Thanks @jpkrohling - In this case I will also consider the resource attributes in the numeric filter and for the boolean filter I would create a separate PR to also support the inverse option there |
…34416) **Description:** This PR fixes the behaviour of numeric attribute filters with the `inverse_match` option set to `true`. In this case, the numeric filter now returns `InvertNotSampled`/`InvertSampled` if its condition matches, to make sure a span with matching attributes is not sampled even though other policies might yield a `Sampled` result. **Link to tracking Issue:** #34296 **Testing:** Added unit tests **Documentation:** No changes here, as the expected behavior is already described in the docs --------- Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
…pen-telemetry#34416) **Description:** This PR fixes the behaviour of numeric attribute filters with the `inverse_match` option set to `true`. In this case, the numeric filter now returns `InvertNotSampled`/`InvertSampled` if its condition matches, to make sure a span with matching attributes is not sampled even though other policies might yield a `Sampled` result. **Link to tracking Issue:** open-telemetry#34296 **Testing:** Added unit tests **Documentation:** No changes here, as the expected behavior is already described in the docs --------- Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
…ute filter (#34730) **Description:** This PR adds the `invert_match` option for `boolean_attribute` filters, as discussed in #34296 (comment) **Link to tracking Issue:** #34296 **Testing:** Added unit tests **Documentation:** The existing documentation already covered the semantics of the `invert_match` option --------- Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
…ute filter (open-telemetry#34730) **Description:** This PR adds the `invert_match` option for `boolean_attribute` filters, as discussed in open-telemetry#34296 (comment) **Link to tracking Issue:** open-telemetry#34296 **Testing:** Added unit tests **Documentation:** The existing documentation already covered the semantics of the `invert_match` option --------- Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Component(s)
processor/tailsampling
What happened?
Description
as described in the tail sampling processor readme (https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/tailsamplingprocessor),
this functionality does not work for numeric attribute policies because its Evaluate function only returns
Sampled
orNotSampled
values notInvertNotSampled
orInvertSampled
even if invertMatch is trueThe Evaluate function in https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/tailsamplingprocessor/internal/sampling/numeric_tag_filter.go#L37 needs to be updated so that it can return
InvertNotSampled
orInvertSampled
when appropriateThis would likely require the addition of an invertHasSpanWithCondition in https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/tailsamplingprocessor/internal/sampling/util.go and then calling it from https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/tailsamplingprocessor/internal/sampling/numeric_tag_filter.go if invertMatch is true
Steps to Reproduce
Expected Result
Actual Result
Collector version
v0.105.0 but previous versions would also be affected
Environment information
Environment
this is not environment specific
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: