Skip to content

Commit

Permalink
clarify handling b3 debug flag and parent span id propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
mwear committed Oct 1, 2020
1 parent 11d26b0 commit 58a972d
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions specification/context/api-propagators.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,23 @@ a community are:

### B3 Requirements

B3 has both single and multi-header encodings. To maximize compatibility between
implementations, the following guidelines have been established for B3
propagation in OpenTelemetry.
B3 has both single and multi-header encodings. It also has semantics that do not
map directly to OpenTelemetry such as a debug trace flag, and allowing spans
from both sides of request to share the same id. To maximize compatibility
between OpenTelemetry and Zipkin implementations, the following guidelines have
been established for B3 context propagation.

#### Extract

Propagators MUST attempt to extract B3 encoded using single and multi-header
formats. When extracting, the single-header variant takes precedence over
the multi-header version.
When extracting B3, propagators:

* MUST attempt to extract B3 encoded using single and multi-header
formats. When extracting, the single-header variant takes precedence over
the multi-header version.
* MUST preserve a debug trace flag, if received, and propagate
it with subsequent requests. Internally, an OpenTelemetry implementation
MUST convert this to a sampled trace flag.
* MUST not reuse `X-B3-SpanId` as the id for the server-side span.

#### Inject

Expand All @@ -349,3 +357,6 @@ When injecting B3, propagators:
* MUST default to injecting B3 using the single-header format
* MUST provide configuration to change the default injection format to B3
multi-header
* MUST omit propagating `X-B3-ParentSpanId` as OpenTelemetry does not support
reusing the same id for both sides of a request.

0 comments on commit 58a972d

Please sign in to comment.