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: specification/trace/sdk.md
+25-24Lines changed: 25 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -506,32 +506,32 @@ to use ProbabilitySampler.
506
506
**Status**: [Development](../document-status.md)
507
507
508
508
The `ProbabilitySampler` implements simple, ratio-based probability sampling using randomness features specified in the [W3C Trace Context Level 2][W3CCONTEXTMAIN] Candidate Recommendation.
509
-
OpenTelemetry follows W3C Trace Context Level 2, which specifies 56 bits of randomness,
510
-
[specifying how to make consistent probability sampling decisions using 56 bits of randomness][CONSISTENTSAMPLING].
509
+
W3C Trace Context Level 2specifies 56 bits of randomness.
510
+
OpenTelemetry follows that model and [specifies how to make consistent probability sampling decisions using the 56 bits of randomness][CONSISTENTSAMPLING].
511
511
512
-
The `ProbabilitySampler`sampler MUST ignore the parent `SampledFlag`.
512
+
The `ProbabilitySampler` MUST ignore the parent `SampledFlag`.
513
513
For respecting the parent `SampledFlag`, see the `ParentBased` sampler specified below.
514
514
515
515
Note that this is a non-composable form of probability
516
-
sampler. `ProbabilitySampler` directly implements the SDKs Sampler
516
+
sampler. `ProbabilitySampler` directly implements the SDK's Sampler
517
517
API, whereas [`ComposableProbability`](#composableprobability) is the
518
518
composable form for use with [`CompositeSampler`](#compositesampler).
The `ProbabilitySampler`sampler is typically configured using a 32-bit or 64-bit floating point number to express the sampling ratio.
524
+
The `ProbabilitySampler` is typically configured using a 32-bit or 64-bit floating point number to express the sampling ratio.
525
525
The minimum valid sampling ratio is `2^-56`, and the maximum valid sampling ratio is 1.0.
526
-
From an input sampling ratio, a rejection threshold value is calculated; see [consistent-probability sampler requirements][CONSISTENTSAMPLING] for details on converting sampling ratios into thresholds with variable precision.
526
+
From the input sampling ratio, a rejection threshold value is calculated; see [consistent-probability sampler requirements][CONSISTENTSAMPLING] for details on converting sampling ratios into thresholds with variable precision.
Given a Sampler configured with a sampling threshold `T` and Context with randomness value `R` (typically, the 7 rightmost bytes of the trace ID), when `ShouldSample()` is called, it uses the expression `R >= T` to decide whether to return `RECORD_AND_SAMPLE` or `DROP`.
532
+
Given a `ProbabilitySampler` configured with a sampling threshold `T` and Context with randomness value `R` (typically, the 7 rightmost bytes of the trace ID), when `ShouldSample()` is called, it uses the expression `R >= T` to decide whether to return `RECORD_AND_SAMPLE` or `DROP`.
533
533
534
-
* If randomness value (R) is greater or equal to the rejection threshold (T), meaning when (R >= T), return `RECORD_AND_SAMPLE`, otherwise, return `DROP`.
534
+
* If randomness value (R) is greater than or equal to the rejection threshold (T), meaning when (R >= T), return `RECORD_AND_SAMPLE`, otherwise, return `DROP`.
535
535
* When (R >= T), the OpenTelemetry TraceState SHOULD be modified to include the key-value `th:T` for rejection threshold value (T), as specified for the [OpenTelemetry TraceState `th` sub-key][TRACESTATEHANDLING].
0 commit comments