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

Moving active span interaction To Trace Context Utilities #923

Merged
Show file tree
Hide file tree
Changes from 11 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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Updates:
([#911](https://github.com/open-telemetry/opentelemetry-specification/pull/911))
- Explicitly specify the SpanContext APIs IsValid and IsRemote as required
([#914](https://github.com/open-telemetry/opentelemetry-specification/pull/914))
- Move active span interaction in the Trace API to a separate class
([#923](https://github.com/open-telemetry/opentelemetry-specification/pull/923))

## v0.6.0 (07-01-2020)

Expand Down
3 changes: 3 additions & 0 deletions spec-compliance-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ status of the feature is not known.
|Create TracerProvider | + | + | + | + | + | + | + | + | + | + |
|Get a Tracer | + | + | + | + | + | + | + | + | + | + |
|Safe for concurrent calls | + | + | + | | + | + | + | + | + | + |
|[Tracing Context Utilities](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#tracing-context-utilities)|
|Get active Span | | | | + | | | | | | |
|Set active Span | | | | + | | | | | | |
|[Tracer](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#tracer-operations)|
|Create a new Span | + | + | + | + | + | + | + | + | + | + |
|Get active Span | + | + | + | + | + | + | + | + | + | + |
Expand Down
30 changes: 21 additions & 9 deletions specification/trace/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Table of Contents
* [Duration](#duration)
* [TracerProvider](#tracerprovider)
* [TracerProvider operations](#tracerprovider-operations)
* [Tracing Context Utilities](#tracing-context-utilities)
* [Tracer](#tracer)
* [Tracer operations](#tracer-operations)
* [SpanContext](#spancontext)
Expand Down Expand Up @@ -129,6 +130,22 @@ the tracer could, for example, do a look-up with its name+version in a map in
the `TracerProvider`, or the `TracerProvider` could maintain a registry of all
returned `Tracer`s and actively update their configuration if it changes.

## Tracing Context Utilities

`Tracing Context Utilities` contains all operations within tracing that
modify the [`Context`](../context/context.md).

As these utilities operate solely on the context API, they MAY be exposed
as static methods on the trace module instead of a class.

The `Tracing Context Utilities` MUST provide the following functions:

- Get the currently active span
- Set the currently active span

The above methods MUST be equivalent to a single parameterized method call of
the [`Context`](../context/context.md) management system.

## Tracer

The tracer is responsible for creating `Span`s.
Expand All @@ -142,17 +159,12 @@ The `Tracer` MUST provide functions to:

- [Create a new `Span`](#span-creation) (see the section on `Span`)

The `Tracer` SHOULD provide methods to:
The `Tracer` MAY provide functions to:

- Get the currently active `Span`
- Mark a given `Span` as active
- Get the currently active span
- Set the currently active span

The `Tracer` MUST delegate to the [`Context`](../context/context.md) to perform
these tasks, i.e. the above methods MUST do the same as a single equivalent
method of the Context management system.
In particular, this implies that the active span MUST not depend on the `Tracer`
that it is queried from/was set to, as long as the tracers were obtained from
the same `TracerProvider`.
These functions MUST delegate to the `Tracing Context Utilities`.

## SpanContext

Expand Down