-
Notifications
You must be signed in to change notification settings - Fork 451
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
Equivalent of opentracing's 'sampling.priority 1' tag? #1920
Comments
A See |
@marcalff - but there seems to be no way to set that? |
The trace flags should typically:
See The |
@marcalff - thanks for the hints, you meant like this?
The ASSERT inside the for failed, looks like it won't take the flag from the parent context. |
@VivekSubr - Do you want to force sample a Span by override the default behavior of the configured sampler? I think you would need a custom sampler to achieve it. |
@lalitb - are there any examples of how to write custom samplers? |
Thanks for all the help! I think I'm almost there, just one weird issue with custom sampler - it doesn't seem to receive set attributes? Here's a test case -
And here's my sampler: https://github.com/VivekSubr/Client-Server/blob/main/opentelemetry/jaeger/sampler.h I can see that attributes recieved by 'ShouldSample' is always size 0, it should have picked by the SetAttribute one right? |
Yeah, since it has be done with startSpan... Not really a replacement for the sampling.priorty tag, since that could be done any any time. |
Yes that's correct, the sampling decision is taken during span creation and the span attributes are not populated at that time. |
Making sampling decision through span attribute - this is not possible as of now, and not supported as per the specs.
|
@VivekSubr - Do you have further comments here, or if we can close this issue as something not supported in specs. |
No, thanks, closing. |
Hello!
Opentracing had a way to force sample a span, by setting 'sampling.priority' tag to 1 we could force sampling of a particular span by a trace ratio sampler.
Looking at this library, there seems to be no equivalent way? A similar discussion in the golang lib suggests using a custom sampler: open-telemetry/opentelemetry-go#2651
Can something like that be done here? Or some other, better way?
The text was updated successfully, but these errors were encountered: