Skip to content

Commit e4027c4

Browse files
authored
Update sample rand precision (#12868)
1 parent ac7be59 commit e4027c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

develop-docs/sdk/telemetry/traces/index.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ To improve the likelihood of capturing complete traces when backend services use
230230

231231
The random value (`sample_rand`) is set according to the following rules:
232232

233-
1. When tracing is enabled and a new trace is started, the SDK generates a `sample_rand` value for the current execution context. A `sample_rand` is a float (`0.1234` notation) in the range of `[0, 1)` (including 0.0, excluding 1.0).
233+
1. A `sample_rand` is a float (`0.123456` notation) in the range of `[0, 1)` (including 0.0, excluding 1.0), with six digits after the decimal point.
234+
1. When tracing is enabled and a new trace is started, the SDK generates a `sample_rand` value for the current execution context.
234235
1. This also applies to Tracing without Performance where we simply want to generate `sample_rand` every time a new trace is started. This `sample_rand` value can then be stored on `PropagationContext`.
235236
1. It is _recommended_ to generate the random number deterministically using the trace ID as seed or source of randomness (make sure to do this atomically so multiple threads accessing the same random instance don't mix their seeds). The exact method by which the random number is created is implementation-defined and may vary between SDK implementations.
236237
1. The `sample_rand` is part of the DSC (Dynamic Sampling Context) and as with other values on the `baggage` header, the `sample_rand` value from the current execution context should be propagated to downstream SDKs. It should also be sent to other system as part of the `baggage` header if Performance is disabled and sampling decision is deferred.

0 commit comments

Comments
 (0)