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

Defining nested Tail-based sampling policies in OpenTelemetry Collector #10476

Closed
rahulgupta92 opened this issue May 31, 2022 · 4 comments
Closed
Labels

Comments

@rahulgupta92
Copy link

rahulgupta92 commented May 31, 2022

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?

@rahulgupta92 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
@jpkrohling
Copy link
Member

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.

@mottibec
Copy link
Contributor

mottibec commented Jul 7, 2022

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.

@codeboten codeboten added the needs triage New item requiring triage label Sep 16, 2022
@evan-bradley evan-bradley added waiting for author processor/tailsampling Tail sampling processor and removed needs triage New item requiring triage labels Sep 30, 2022
@github-actions
Copy link
Contributor

Pinging code owners: @jpkrohling. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@jpkrohling
Copy link
Member

I'm closing this, as I believe this has been addressed. If that's not the case, let me know and I'll reopen this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants