Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Commit 4e6c69a

Browse files
author
Joshua MacDonald
committed
add detail on SamplerResult
1 parent 02b06d0 commit 4e6c69a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

text/trace/0170-sampling-probability.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,28 @@ The following text will be added to the `Span` message in
661661
uint32 log_head_adjusted_count = <next_tag>;
662662
```
663663

664+
### Proposed `Sampler` interface changes
665+
666+
The Trace SDK specification of the `SamplingResult` will be extended
667+
with a new field to be returned by all Samplers.
668+
669+
```
670+
- The sampling probability of the span is encoded as one plus the
671+
inverse of head inclusion probability, known as "adjusted count",
672+
which is the effective count of the Span for use in Span-to-Metrics
673+
pipelines. The value 0 is used to represent unknown adjusted count,
674+
and the value 63 is used to represent known-zero adjusted count.
675+
For values >0 and <63, the adjusted count of the Span is
676+
2^(value-1), representing power-of-two probabilities between
677+
1 and 2^-61.
678+
679+
The corresonding `SamplerResult` field SHOULD be named
680+
`log_head_adjusted_count` to match the Span data model.
681+
```
682+
683+
See [OTEP 168](https://github.com/open-telemetry/oteps/pull/168) for
684+
details on how each of the built-in Samplers is expected to behave.
685+
664686
## Recommended reading
665687

666688
[Sampling, 3rd Edition, by Steven

0 commit comments

Comments
 (0)