Skip to content

Commit 9db9ef7

Browse files
author
Emanuele Palazzetti
committed
[docs] minor style changes for sampling docs
1 parent a03b415 commit 9db9ef7

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/index.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -358,23 +358,23 @@ Priority sampling
358358
Priority sampling consists in deciding if a trace will be kept by using a `priority` attribute that will be propagated
359359
for distributed traces. Its value gives indication to the Agent and to the backend on how important the trace is.
360360

361-
The sampler can set the priority to the following values::
361+
The sampler can set the priority to the following values:
362362

363-
- `AUTO_REJECT`: the sampler automatically decided to reject the trace
364-
- `AUTO_KEEP`: the sampler automatically decided to keep the trace
363+
- ``AUTO_REJECT``: the sampler automatically decided to reject the trace
364+
- ``AUTO_KEEP``: the sampler automatically decided to keep the trace
365365

366366
For now, priority sampling is disabled by default. Enabling it ensures that your sampled distributed traces will be complete.
367367
To enable the priority sampling::
368368

369369
tracer.configure(priority_sampling=True)
370370

371-
Once enabled, the sampler will automatically assign a priority of 0 or 1 to traces, depending on their service and volume.
371+
Once enabled, the sampler will automatically assign a priority to your traces, depending on their service and volume.
372372

373373
You can also set this priority manually to either drop a non-interesting trace or to keep an important one.
374-
For that, set the `context.sampling_priority` to -1 or 2.
374+
For that, set the ``context.sampling_priority`` to one of the following:
375375

376-
- `USER_REJECT`: the user asked to reject the trace
377-
- `USER_KEEP`: the user asked to keep the trace
376+
- ``USER_REJECT``: the user asked to reject the trace
377+
- ``USER_KEEP``: the user asked to keep the trace
378378

379379
When not using distributed tracing, you may change the priority at any time,
380380
as long as the trace is not finished yet.
@@ -383,16 +383,16 @@ Changing the priority after context has been propagated causes different parts o
383383
to use different priorities. Some parts might be kept, some parts might be rejected,
384384
and this can cause the trace to be partially stored and remain incomplete.
385385

386-
If you change the priority, we recommend you do it as soon as possible, when the root span has just been created.
387-
386+
If you change the priority, we recommend you do it as soon as possible, when the root span has just been created::
388387

389388
from ddtrace.ext.priority import USER_REJECT, USER_KEEP
390389

391390
context = tracer.context_provider.active()
392-
# Indicate to not keep the trace
391+
392+
# indicate to not keep the trace
393393
context.sampling_priority = USER_REJECT
394394

395-
# Indicate to keep the trace
395+
# indicate to keep the trace
396396
span.context.sampling_priority = USER_KEEP
397397

398398

0 commit comments

Comments
 (0)