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

Clarify that IsValid and IsRemote are APIs on SpanContext #771

Merged
merged 1 commit into from
Aug 11, 2020
Merged
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
12 changes: 9 additions & 3 deletions specification/trace/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Table of Contents
* [Tracer](#tracer)
* [Tracer operations](#tracer-operations)
* [SpanContext](#spancontext)
* [IsValid](#isvalid)
Copy link
Member

@Oberon00 Oberon00 Aug 11, 2020

Choose a reason for hiding this comment

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

I know I missed that we had IsValid (#753), but I think this was my mistake. It is actually clear enough in the spec already IMHO. If we add headings for IsValid and IsRemote, we should also add headings for SpanId, TraceId, TraceFlags, TraceState, and that would be a lot of headings.

Copy link
Member Author

Choose a reason for hiding this comment

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

They will come because there is an issue about format of trace id / span id formats that we expose. Tried to keep PRs small :)

* [IsRemote](#isremote)
* [Span](#span)
* [Span creation](#span-creation)
* [Determining the Parent Span from a Context](#determining-the-parent-span-from-a-context)
Expand Down Expand Up @@ -179,10 +181,14 @@ systems to participate in the same trace. Please review the [W3C
specification](https://www.w3.org/TR/trace-context/#tracestate-header) for
details on this field.

`IsValid` is a boolean flag which returns true if the SpanContext has a non-zero
TraceID and a non-zero SpanID.
### IsValid

`IsRemote` is a boolean which is true if the SpanContext was
An API that returns a boolean value, which is `true` if the SpanContext has a
non-zero TraceID and a non-zero SpanID.

### IsRemote

An API that returns a boolean value, which is `true` if the SpanContext was
propagated from a remote parent. When extracting a `SpanContext` through the
[Propagators API](../context/api-propagators.md#propagators-api), its `IsRemote`
flag MUST be set to true, whereas the SpanContext of any child spans MUST have
Expand Down