Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add IsRemote field to SpanContext, set by propagators #216

Merged
merged 5 commits into from
Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that boolean is contained in the SpanContext, I'd remove the extra argument altogether.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, probably can remove the boolean argument.

- `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