ddtrace Sampling¶
Warning
The current example uses ddtrace version 0.114.0
(latest version) for testing
Prerequisites¶
-
Enable the DataKit ddtrace Collector
-
Prepare Shell
java -javaagent:D:/ddtrace/dd-java-agent-0.114.0.jar \
-Ddd.service.name=ddtrace-server \
-Ddd.agent.port=9529 \
-jar springboot-ddtrace-server.jar
Installation and Deployment¶
1 Configuration of the Sampler Section in ddtrace.conf
¶
## Sampler config used to set global sampling strategy.
## sampling_rate used to set global sampling rate.
[inputs.ddtrace.sampler]
sampling_rate = 0.1
2 Test Script¶
3 Enable Sampling¶
- Enable sampling on the collector side
The sampling_rate
range is (0,1). If it is outside this range, traces are discarded.
If full tracing is required, there is no need to configure [inputs.ddtrace.sampler]
.
- Enable sampling on the application side
Sampling is enabled on the application side using -Ddd.trace.sample.rate
, with a range of (0,1).
This is marked as sampled, meaning all traces are collected while being marked for sampling.
- Sampling Priority
Both sampling methods have the same effect. If both are configured, the sampling configuration on the collector side will not take effect.
Summary
-Ddd.trace.sample.rate
> sampling_rate