Open hyang023 opened 3 months ago
Pinging code owners:
processor/tailsampling: @jpkrohling
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:
inverse_match
option at all (see https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/tailsamplingprocessor/internal/sampling/boolean_tag_filter.go) - Should that filter be extended to also suppport this option, or is there a reason to not include this option here? I guess this would need to be addressed in a separate PR as it's not directly related to this issue, but if needed I can also work on thisIs this intended, or should the numeric tag filter also take attributes of the resource into account?
Probably just an oversight/bug.
is there a reason to not include this option here
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.
Is this intended, or should the numeric tag filter also take attributes of the resource into account?
Probably just an oversight/bug.
is there a reason to not include this option here
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
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