Skip to content

Commit c21921c

Browse files
tsloughterSergeyKanzhelev
authored andcommitted
add IsRemote field to SpanContext, set by propagators (open-telemetry#216)
1 parent 02d9663 commit c21921c

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

specification/api-propagators.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Propagators API consists of two main formats:
2424
- `HTTPTextFormat` is used to inject and extract a value as text into carriers that travel
2525
in-band across process boundaries.
2626

27+
Deserializing must set `IsRemote` to true on the returned `SpanContext`.
28+
2729
## Binary Format
2830

2931
`BinaryFormat` is a formatter to serialize and deserialize a value into a binary format.

specification/api-sampling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Returns the sampling Decision for a `Span` to be created.
3030
- `SpanContext` of a parent `Span`. Typically extracted from the wire. Can be
3131
`null`.
3232
- Boolean that indicates that `SpanContext` was extracted from the wire, i.e.
33-
parent `Span` is from the different process.
33+
parent `Span` is from the different process, meaning `IsRemote` is set to true.
3434
- `TraceId` of the `Span` to be created.
3535
- `SpanId` of the `Span` to be created.
3636
- Name of the `Span` to be created.

specification/api-tracing.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ the same trace.
166166
`IsValid` is a boolean flag which returns true if the SpanContext has a non-zero
167167
TraceID and a non-zero SpanID.
168168

169+
`IsRemote` is a boolean flag which returns true if the SpanContext was propagated
170+
from a remote parent.
171+
169172
Please review the W3C specification for details on the [Tracestate
170173
field](https://www.w3.org/TR/trace-context/#tracestate-field).
171174

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

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

236238
#### Add Links
237239

0 commit comments

Comments
 (0)