Skip to content

Commit

Permalink
Probability sampling in tracestate specification (open-telemetry#2047)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacd authored Jan 26, 2022
1 parent 42430e8 commit 3bb58f5
Show file tree
Hide file tree
Showing 3 changed files with 1,073 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ release.
- Clarify `StartSpan` returning the parent as a non-recording Span when no SDK
is in use
([#2121](https://github.com/open-telemetry/opentelemetry-specification/pull/2121))
- Add support for probability sampling in the OpenTelemetry `tracestate` entry and
add optional specification for consistent probability sampling.
([#2047](https://github.com/open-telemetry/opentelemetry-specification/pull/2047))

### Metrics

Expand Down
6 changes: 3 additions & 3 deletions specification/trace/tracestate-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ When setting [TraceState](api.md#tracestate) values that are part of the OTel ec
they MUST all be contained in a single entry using the `ot` key, with the value being
a semicolon separated list of key-value pairs such as:

* `ot=p:8;r:64`
* `ot=p:8;r:62`
* `ot=foo:bar;k1:13`

The [TraceContext](https://www.w3.org/TR/trace-context/) specification defines support for multiple "tenants" each to use their own `tracestate` entry by prefixing `tenant@` to tenant-specific values in a mixed tracing environment. OpenTelemetry recognizes this syntax but does not specify an interpretation for multi-tenant `tracestate`.
Expand Down Expand Up @@ -65,8 +65,8 @@ Set values MUST be either updated or added to the `ot` entry in `TraceState`,
in order to preserve existing values belonging to other OTel concerns. For example,
if a given concern K wants to set `k1:13`:

* `ot=p:8;r:64` will become `ot=p:8;r:64;k1:13`.
* `ot=p:8;k1:7;r:64` will become `ot=p8;r:64;k1:13`. Preserving the order is not required.
* `ot=p:8;r:62` will become `ot=p:8;r:62;k1:13`.
* `ot=p:8;k1:7;r:62` will become `ot=p8;r:62;k1:13`. Preserving the order is not required.

If setting a value ends up making the entire `ot` entry exceed the 256 characters limit,
SDKs are advised to abort the operation and signal the user about the error, e.g.
Expand Down
Loading

0 comments on commit 3bb58f5

Please sign in to comment.