Skip to content

Commit

Permalink
add IsRemote field to SpanContext, set by propagators (open-telemetry…
Browse files Browse the repository at this point in the history
  • Loading branch information
tsloughter authored and SergeyKanzhelev committed Oct 3, 2019
1 parent 02d9663 commit c21921c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions specification/api-propagators.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Propagators API consists of two main formats:
- `HTTPTextFormat` is used to inject and extract a value as text into carriers that travel
in-band across process boundaries.

Deserializing must set `IsRemote` to true on the returned `SpanContext`.

## Binary Format

`BinaryFormat` is a formatter to serialize and deserialize a value into a binary format.
Expand Down
2 changes: 1 addition & 1 deletion specification/api-sampling.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Returns the sampling Decision for a `Span` to be created.
- `SpanContext` of a parent `Span`. Typically extracted from the wire. Can be
`null`.
- Boolean that indicates that `SpanContext` was extracted from the wire, i.e.
parent `Span` is from the different process.
parent `Span` is from the different process, meaning `IsRemote` is set to true.
- `TraceId` of the `Span` to be created.
- `SpanId` of the `Span` to be created.
- Name of the `Span` to be created.
Expand Down
8 changes: 5 additions & 3 deletions specification/api-tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ the same trace.
`IsValid` is a boolean flag which returns true if the SpanContext has a non-zero
TraceID and a non-zero SpanID.

`IsRemote` is a boolean flag which returns true if the SpanContext was propagated
from a remote parent.

Please review the W3C specification for details on the [Tracestate
field](https://www.w3.org/TR/trace-context/#tracestate-field).

Expand Down Expand Up @@ -229,9 +232,8 @@ spans in the trace. Implementations MUST provide an option to create a `Span` as
a root span, and MUST generate a new `TraceId` for each root span created.

A `Span` is said to have a _remote parent_ if it is the child of a `Span`
created in another process. Since the `SpanContext` is the only component of a
`Span` that is propagated between processes, a `Span`'s parent SHOULD be a
`SpanContext` if it is remote. Otherwise, it may be a `Span` or `SpanContext`.
created in another process. Each propagators' deserialization must set
`IsRemote` to true so `Span` creation knows if the parent is remote.

#### Add Links

Expand Down

0 comments on commit c21921c

Please sign in to comment.