Dynamic sampler decision based on instrument #3855
Unanswered
goldyliang
asked this question in
Q&A
Replies: 2 comments 4 replies
-
Or can I create an extension for exporter which inherits an existing one, but add the logic of go/no go based on inspection on the span's data? |
Beta Was this translation helpful? Give feedback.
0 replies
-
hi @goldyliang! The agent and SDK use "head-based" sampling, making their decision at the start of each span, when the span duration is not available yet. You may want to look into tail-sampling provided by the OpenTelemetry Collector. Or alternatively you could possibly implement some kind of tail-sampling in the SpanProcessor pipeline for your exporter depending on your needs. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am looking for the way to build a dynamic sampler which can decide sampling (sending to exporter) the current span or not based on a condition. The condition can not be judged at the entrance of the span but has to be judged while a certain method is hit based on the arguments of that method.
Our use case is to only sample “slow” requests. The condition of “slow” depends on the duration of the request and also how much data has been transferred during it which is available as a method argument at the entrance of a certain method.
I am thinking an instrument module as extension instead of the sampler would work, but can the sampling flag be altered at the point of method instruments?
Beta Was this translation helpful? Give feedback.
All reactions