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

[QUESTION] Possibility to use duration as policy for tail-based sampling #4967

Closed
tsologub opened this issue Feb 19, 2020 · 5 comments
Closed
Assignees
Labels
processor/tailsampling Tail sampling processor

Comments

@tsologub
Copy link

Does Otel collector provide a possibility to use duration as a policy?
I am trying to achieve that with the following collector configuration:

...
processors:
  batch:
  queued_retry:
  tail_sampling:
    decision_wait: 10s
    policies:
      - name: sample-long-running-requests
        type: numeric_attribute
        numeric_attribute: {key: duration, min_value: 1000, max_value: 10000}
...
@pjanotti
Copy link
Contributor

Hi @tsologub, the internal format carry duration as fields of the span, not as an attribute. So it won't work, you need a sampling policy to handle that. Would you be interested in writing one? I can give you some pointers.

@pjanotti
Copy link
Contributor

Alternatively, if you control the instrumentation you can add an attribute named duration to work as you intended.

@tsologub
Copy link
Author

Would you be interested in writing one?

sure. I'd be glad to. Give me some pointers, examples where can I start?

@pjanotti
Copy link
Contributor

You need to implement a policy evaluator (see example here). This is an object with a simple interface: the method Evaluate that tells if a trace should be sampled or not. Your criteria for Evaluate should check the difference between EndTime and StartTime for each span to see if it satisfies the criteria configured for the evaluator.

@bogdandrutu bogdandrutu transferred this issue from open-telemetry/opentelemetry-collector Aug 30, 2021
@alolita alolita added the processor/tailsampling Tail sampling processor label Sep 30, 2021
@jpkrohling
Copy link
Member

This has been recently implemented with the latency policy (#3750).

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

No branches or pull requests

4 participants