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
Clarified that agent MUST include sample_rate in transactions and spans (#480)
* Clarified that agent MUST include sample_rate in transactions and spans
* Qualified that sample_rate must be included only when it's available
* Rephrase not to imply that there might be more than one case
Rephrase not to imply that there might be more than one case when sampling rate is not available
* Update specs/agents/tracing-sampling.md
Co-authored-by: Colton Myers <[email protected]>
* Uppercase relevant occurrences of "must"
Co-authored-by: Colton Myers <[email protected]>
{"span":{"name":"SELECT FROM table","sample_rate":0.1,...}}
70
70
71
-
For non-sampled transactions the `sample_rate` field _must_ be set to 0,
71
+
See [Propagation section of this document](#propagation) for details about the case when the sampling rate is not available.
72
+
73
+
For non-sampled transactions the `sample_rate` field MUST be set to 0,
72
74
to ensure non-sampled transactions are not counted in transaction metrics.
73
75
This is important to avoid double-counting,
74
76
as non-sampled transactions will be represented in metrics calculated from sampled transactions.
@@ -98,7 +100,7 @@ In the future we may introduce options to agents to stop sending non-sampled tra
98
100
As mentioned above, the sampling decision must be propagated throughout the trace.
99
101
We adhere to the W3C Trace-Context spec for this, propagating the decision through trace-flags: https://www.w3.org/TR/trace-context/#sampled-flag
100
102
101
-
In addition to propagating the sampling decision (boolean), agents must also propagate the sampling rate to ensure it is consistently attached to to all events in the trace.
103
+
In addition to propagating the sampling decision (boolean), agents MUST also propagate the sampling rate to ensure it is consistently attached to to all events in the trace.
102
104
This is achieved by adding an `s` attribute to our [`es``tracestate` key](tracing-distributed-tracing.md#tracestate) with the value of the sampling rate.
103
105
e.g.
104
106
@@ -107,7 +109,7 @@ e.g.
107
109
As `tracestate` has modest size limits we must keep the size down.
108
110
This is ensured as the `transaction_sample_rate` configuration option has a maximum precision of 4 decimal places.
109
111
110
-
For non-root transactions the agent must parse incoming `tracestate` headers to identify the `es` entry and extract the `s` attribute.
112
+
For non-root transactions the agent MUST parse incoming `tracestate` headers to identify the `es` entry and extract the `s` attribute.
111
113
The `s` attribute value should be used to populate the `sample_rate` field of transactions and spans.
112
114
If there is no `tracestate` or no valid `es` entry with an `s` attribute,
113
-
then the agent must omit `sample_rate` from non-root transactions and their spans.
115
+
then the agent MUST omit `sample_rate` from non-root transactions and their spans.
0 commit comments