You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When performing tail-based sampling with various services, there is a normally a need to sample traces based on a combination of policies like latency/string attribute exclusion/error status in spans etc. These conditions can be defined using and / or conditions.
For example: Let's say we need to build tail-based sampling policies for services A and B based on below conditions:
Policy 1 - For service A, sampling is done either on the string attribute should_sample as yes or on the latency>3000 ms.
(
(Service == A)
AND
((latency > 3000ms) OR (string_attribute 'should_sample' == 'yes'))
)
Policy 2 - For service B , sampling is done either on the string attribute should_sample as no or (latency>4000ms and containing an error status code).
(
(Service = B)
AND
(
((latency > 4000) AND (status_code = ERROR))
OR
(string_attribute 'should_sample' == 'no')
)
)
I am unable to implement these policies using and policies.
Is it currently possible to implement this using the existing policies in the OpenTelemetry Collector config? Any suggestions/alternatives to try?
The text was updated successfully, but these errors were encountered:
rahulgupta92
changed the title
Defining nested Tail- based sampling policies in OpenTelemetry Collector
Defining nested Tail-based sampling policies in OpenTelemetry Collector
May 31, 2022
And's are supported, Or's aren't. I believe @mottibec talked about Or's in the past, but I don't remember from the top of my head why we don't have them.
The processor or's between all policies so for your use case you can have 2 separate policies one for latency and one for string attribute and you will get the same result.
When performing tail-based sampling with various services, there is a normally a need to sample traces based on a combination of policies like latency/string attribute exclusion/error status in spans etc. These conditions can be defined using
and
/or
conditions.For example: Let's say we need to build tail-based sampling policies for services A and B based on below conditions:
Policy 1 - For service A, sampling is done either on the string attribute
should_sample
asyes
or on thelatency>3000 ms
.Policy 2 - For service B , sampling is done either on the string attribute
should_sample
asno
or (latency>4000ms
and containing anerror
status code).I am unable to implement these policies using
and
policies.Is it currently possible to implement this using the existing policies in the OpenTelemetry Collector config? Any suggestions/alternatives to try?
The text was updated successfully, but these errors were encountered: