dd-trace-java
dd-trace-java copied to clipboard
Single Span Sampling
What Does This Do
Implementation of the single span sampling mechanism described in this RFC.
It introduces SpanProcessingWorker running in its own thread that is responsible for sampling single spans. It receives unsampled traces from PrioritizationStrategy and then sampled spans are sent to TraceProcessingWorker for serialization and transporting to the Agent.
graph TD
PS[PrioritizationStrategy]
pQ[primaryQueue]
sQ[secondaryQueue]
TPW[TraceProcessingWorker]
subgraph
ssQ[spanQueue]
SPW[SpanProcessingWorker]
or{Is Single Span Sampling enabled?}
end
PS--sampled traces-->pQ
PS--unsampled traces-->or
or--yes-->ssQ
or--no-->sQ
pQ--consumed by-->TPW
sQ--consumed by-->TPW
ssQ--->SPW
SPW--sampled spans-->pQ
SPW--unsampled spans*-->sQ
Motivation
This is a replacement for existing Analytics events that have been deprecated for a long time.