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
Sampling Trouble #800
Comments
Thanks for the feedback. I think the sampling method in the start span only called for span without a parent. For span with a parent, it will respect the sampling result of the parent spans. Alternatively, you can set the sampling result for individual spans using SpanBuilder::sampling_result. I can see a benefit to changing the behavior to run sampler for every span but it comes with a performance overhead. Gonna need to investigate it a little further |
I believer this may be both a documentation issue AND a bug. Additionally when looking at the I realize that both of these will have performance implications. Before I got on and put the work I figure I would comment first. |
* Move Sampling header into `Sampler` * Enrich classes to have links in tracing module Relates open-telemetry#800
* Move Sampling header into `Sampler` * Enrich classes to have links in tracing module Relates open-telemetry#800 Signed-off-by: Harold Dost <github@hdost.com>
@hdost yeah I think we should sampling at every span creation. Do you want to take this issue as you are already working on it? |
* Move Sampling header into `Sampler` * Enrich classes to have links in tracing module Relates open-telemetry#800 Signed-off-by: Harold Dost <github@hdost.com>
* Move Sampling header into `Sampler` * Enrich classes to have links in tracing module Relates open-telemetry#800 Signed-off-by: Harold Dost <github@hdost.com>
Relates open-telemetry#800 Signed-off-by: Harold Dost <h.dost@criteo.com>
Relates open-telemetry#800 Signed-off-by: Harold Dost <h.dost@criteo.com>
Relates open-telemetry#800 Signed-off-by: Harold Dost <h.dost@criteo.com>
* Move Sampling header into `Sampler` * Enrich classes to have links in tracing module Relates #800 Signed-off-by: Harold Dost <github@hdost.com>
* Sampling should always defer to the existing sampler. The logic before this patch reflected something similar to what is described in the ParentBased sampler. Relates open-telemetry#800
Relates open-telemetry#800 Signed-off-by: Harold Dost <h.dost@criteo.com>
* Sampling should always defer to the existing sampler. The logic before this patch reflected something similar to what is described in the ParentBased sampler. Relates open-telemetry#800 Signed-off-by: Harold Dost <h.dost@criteo.com>
Also currently working on this in #839 , I believe it should be patched but I'm looking into how best to handle the |
* Sampling should always defer to the existing sampler. The logic before this patch reflected something similar to what is described in the ParentBased sampler. * Maintaining pre-sample to allow for `tracing-opentelemetry` to continue working Relates open-telemetry#800 Signed-off-by: Harold Dost <h.dost@criteo.com>
* Sampling should always defer to the existing sampler. The logic before this patch reflected something similar to what is described in the ParentBased sampler. * Maintaining pre-sample to allow for `tracing-opentelemetry` to continue working Relates open-telemetry#800 Signed-off-by: Harold Dost <h.dost@criteo.com>
* Sampling should always defer to the existing sampler. The logic before this patch reflected something similar to what is described in the ParentBased sampler. * Maintaining pre-sample to allow for `tracing-opentelemetry` to continue working Relates open-telemetry#800 Signed-off-by: Harold Dost <h.dost@criteo.com>
* Sampling should always defer to the existing sampler. The logic before this patch reflected something similar to what is described in the ParentBased sampler. * Maintaining pre-sample to allow for `tracing-opentelemetry` to continue working Relates open-telemetry#800 Signed-off-by: Harold Dost <h.dost@criteo.com>
@kevincox we've added some further docs and updated the implementation as of 0.18.0 |
Do you have a link to these docs? I think I will also need to open another ticket for propagating sample rate information but I can do that in a more targeted ticket? To summarize the status of the original points:
|
I don't think 2 is resolved. I have opened a new issue focused on it: #886 |
I was trying to use the
opentelemetry::sdk::trace::ShouldSample
API and am having trouble. I figured that I would at least write it down here in case others have the same issue or this could be used to improve the library. This is likely just a documentation problem, but I really struggled.My goal was to export traces to Honeycomb with sampling. I managed to do something simple like this:
I'm sure the code could be slightly better, for example there is definitely some bias on the sampling depending on the sampleRate used. However this had a lot of problems:
opentelemetry::sdk::trace::Sampler
but it isn't even clear to me what most of the code does.sampleRate
attribute on the root span. Child spans and events don't have the value set which means that they are weighted incorrectly in graphs.opentelemetry::sdk::trace::Sampler
seems to think that it can base sampling decisions off of the parent span, but my Sampler is never called with anything but the root.It would be nice if something like this was easy and documented.
The text was updated successfully, but these errors were encountered: