You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/GettingStarted.md
+20-7Lines changed: 20 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -722,9 +722,10 @@ overhead.
722
722
723
723
Priority sampling consists in deciding if a trace will be kept by using a priority attribute that will be propagated for distributed traces. Its value gives indication to the Agent and to the backend on how important the trace is.
724
724
725
-
* 0: Don’t keep the trace.
726
-
* 1: The sampler automatically decided to keep the trace.
727
-
* 2: The user asked the keep the trace.
725
+
The sampler can set the priority to the following values:
726
+
727
+
*`Datadog::Ext::Priority::AUTO_REJECT`: the sampler automatically decided to reject the trace.
728
+
*`Datadog::Ext::Priority::AUTO_KEEP`: the sampler automatically decided to keep the trace.
728
729
729
730
For now, priority sampling is disabled by default. Enabling it ensures that your sampled distributed traces will be complete. To enable the priority sampling:
Once enabled, the sampler will automatically assign a priority of 0 or 1 to traces, depending on their service and volume.
736
737
737
-
You can also set this priority manually to either drop a non-interesting trace or to keep an important one. For that, set the `context#sampling_priority` to 0 or 2. It has to be done before any context propagation (fork, RPC calls) to be effective:
738
+
You can also set this priority manually to either drop a non-interesting trace or to keep an important one. For that, set the `context#sampling_priority` to:
739
+
740
+
*`Datadog::Ext::Priority::USER_REJECT`: the user asked to reject the trace.
741
+
*`Datadog::Ext::Priority::USER_KEEP`: the user asked to keep the trace.
742
+
743
+
When not using [distributed tracing](#Distributed_Tracing), you may change the priority at any time,
744
+
as long as the trace is not finished yet.
745
+
But it has to be done before any context propagation (fork, RPC calls) to be effective in a distributed context.
746
+
Changing the priority after context has been propagated causes different parts of a distributed trace
747
+
to use different priorities. Some parts might be kept, some parts might be rejected,
748
+
and this can cause the trace to be partially stored and remain incomplete.
749
+
750
+
If you change the priority, we recommend you do it as soon as possible, when the root span has just been created.
0 commit comments