Skip to content

Commit c3dbb72

Browse files
committed
Document the usage of the RateSampler
1 parent 536e28d commit c3dbb72

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/index.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,24 @@ API
9696

9797
.. _integrations:
9898

99+
100+
Sampling
101+
--------
102+
103+
It is possible to sample traces with `ddtrace`.
104+
While the Trace Agent already samples traces to reduce the bandwidth usage, this client sampling
105+
reduces performance overhead.
106+
107+
`RateSampler` samples a ratio of the traces. Its usage is simple::
108+
109+
from ddtrace.sampler import RateSampler
110+
111+
# Sample rate is between 0 (nothing sampled) to 1 (everything sampled).
112+
# Sample 50% of the traces.
113+
sample_rate = 0.5
114+
tracer.sampler = RateSampler(sample_rate)
115+
116+
99117
Integrations
100118
------------
101119

0 commit comments

Comments
 (0)