Skip to content

Commit

Permalink
Add requirements for probability sampler
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu committed May 18, 2020
1 parent f9aabe2 commit a712040
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions specification/trace/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ TODO: Add details about how the probability sampler is implemented as a function
of the `TraceID`.
TODO: Split out the parent handling.

##### Requirements for `Probability` sampler algorithm

* Ensures that sampling algorithm is deterministic. A trace identified by a given `TraceId` is sampled or not independent of language, time, etc. To achieve this implementations MUST use the random part of the `TraceId` when applying probability sampling.
* By ensuring this, even if the user configures the `Probability` sampler to run for all the `Spans` the same number of traces will be sampled.
* Systems should be able to implement inflationary probability rate. To achieve this a `Probability` sampler with a given sampling rate should sample all traces that any `Probability` sampler with a lower sampling rate would sample.
* This is important when a backend System may want to run with a higher sampling rate than the frontend System, this way all frontend traces will still be sampled and extra traces will be sampled on the backend only.

#### ParentOrElse

* This is a composite sampler. `ParentOrElse(delegateSampler)` either respects the parent span's sampling decision or delegates to `delegateSampler` for root spans.
Expand Down

0 comments on commit a712040

Please sign in to comment.