Skip to content

Commit

Permalink
Clarify mutually exclusive options in span creation. (#131)
Browse files Browse the repository at this point in the history
* Clarify mutually exclusive options in span creation.

* Fix indentation.

* Add a note about parameters being language-specific.
  • Loading branch information
songy23 authored and SergeyKanzhelev committed Jun 17, 2019
1 parent 681c0f0 commit 7af04fa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions specification/tracing-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,16 @@ Optional parameters (or corresponding setters on `Builder` if using a `Builder`
- The option to become a root `Span` for a new trace.
If not set, the value of [Tracer.getCurrentSpan](#getcurrentspan) at `StartSpan`
time will be used as parent.

- **Note**: The three parameters above (parent `Span`, parent `SpanContext` and `root`) are
mutually exclusive. Based on language implementation, if multiple parameters are specified
or corresponding `Setter`s are called multiple times, only the last specified value will be used.
For example:
1. `builder.setParent(parentSpan).setNoParent().startSpan()` will generate a new root span
and `parentSpan` will be ignored;
2. `tracer.StartSpan(options.WithNoParent(), options.WithParentContext(parentCtx))`
will generate a new child span with remote parent `parentCtx`, and `WithNoParent` will be ignored.

- `Sampler` to the newly created `Span`. If not set, the implementation should provide a
default sampler used by Tracer.
- Collection of `Link`s that will be associated with the newly created Span
Expand Down

0 comments on commit 7af04fa

Please sign in to comment.