prometheus / client_java

Prometheus instrumentation library for JVM applications
http://prometheus.github.io/client_java/
Apache License 2.0
2.18k stars 798 forks source link

Add mechanism to mark Spans as "sampled for Exemplars" #843

Open jonatan-ivanov opened 1 year ago

jonatan-ivanov commented 1 year ago

In case of server-side sampling, it is necessary to let the sampler know that certain spans should not be dropped because their traceId/spanId were used to create Exemplars. Right now, there is no mechanism that users could use to inject their own logic to signal that a Span was sampled for Exemplars.

Since a Span can be anything (various tracers), this can be tricky so if there is no good general solution for this, some guidance in the documentation (maybe with examples) would be great to guide the users if they should implement their own Sampler or should they add this behavior to their SpanContextSupplier.

fstab commented 1 year ago

Great timing, I'm literally working on it right now. I'll give you an update next week.

0x006EA1E5 commented 1 year ago

Any update on this?