Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Support delayed sampling #719

Closed
william-tran opened this issue Jun 23, 2020 · 3 comments
Closed

Support delayed sampling #719

william-tran opened this issue Jun 23, 2020 · 3 comments

Comments

@william-tran
Copy link

william-tran commented Jun 23, 2020

Requirement - what kind of business use case are you trying to solve?

I'd like to make sampling decisions according to service and operation name by leveraging remote controlled sampler.

Problem - what in Jaeger blocks you from solving the requirement?

Some instrumentation frameworks create a root span e.g. at servlet level, and use the HTTP method as the operation name; but then further refine the operation name as the request progresses through the stack, e.g. Spring MVC, which updates the operation name to the controller method. This prevents me from creating more specific sampling rules.

Proposal - what do you suggest to solve the problem or improve the existing situation?

Implement delayed sampling along the lines of https://github.com/jaegertracing/jaeger-client-go/tree/v2.24.0#delayed-sampling

Any open questions to address

See also:

@yurishkuro
Copy link
Member

I think it's reasonable to approach this piecemeal starting with shared SamplingState. Thread safety issues are the same as always. In the Go client we opted to avoid using mutexes for synchronization and instead use spinning lock principle via atomic CAS operations. It's worth doing a benchmark first to see what's more appropriate for Java. Note that the sampling state is read very frequently, for every span write operation.

@william-tran
Copy link
Author

Update on this:

I'm working on something internally first to validate the approach I'm taking. It doesn't go as far as the go client with a shared sampling state, but sample can be called on setOperationName AND on child context creation. This is to achieve something similar to https://github.com/openzipkin/openzipkin.github.io/wiki/secondary-sampling, but there's no ttl on the secondary sampling decision or reconnection or replacement of the unsampled parent with the one last sampled. I'm also fixing the concurrency bottleneck described here as there will be lots more calls to sample now.

@cptkng23
Copy link

@william-tran , @yurishkuro
Is this the issue to subscribe to for delayed sampling? If so, are there any plan to implement it in jaeger-java-client?

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

No branches or pull requests

3 participants