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 Suppress Tracing context key #1653

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ release.

- Added `OTEL_EXPORTER_JAEGER_TIMEOUT` environment variable. ([#1612](https://github.com/open-telemetry/opentelemetry-specification/pull/1612))
- Added `OTEL_EXPORTER_ZIPKIN_TIMEOUT` environment variable. ([#1636](https://github.com/open-telemetry/opentelemetry-specification/pull/1636))
- Added Suppress Instrumentation context key. ([#1653](https://github.com/open-telemetry/opentelemetry-specification/pull/1653))

### Traces

Expand Down
25 changes: 25 additions & 0 deletions specification/context/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Table of Contents
- [Get current Context](#get-current-context)
- [Attach Context](#attach-context)
- [Detach Context](#detach-context)
- [Predefined Keys](#predefined-keys)
- [Suppress Instrumentation](#suppress-instrumentation)

</details>

Expand Down Expand Up @@ -125,3 +127,26 @@ The API MUST accept the following parameters:

The API MAY return a value used to check whether the operation
was successful or not.

## Predefined Keys
dyladan marked this conversation as resolved.
Show resolved Hide resolved

The following are predefined keys that may modify the behavior of multiple signals.
For each key, there MUST be corresponding methods to set and get its value.
The key itself MUST NOT be exposed publicly.

### Suppress Instrumentation

In some cases it may be useful to temporarily disable instrumentation.
For example, this may be used to prevent span exports from being traced and exported,
or by an instrumentation which wraps a lower-level package which may also be
instrumented in order to prevent duplicate spans.
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved

If this key is set to `true`, the following behavior is changed:

- Any `Span` created by `StartSpan` MUST be a non-recording `Span`.
- `Propagator#Inject` MUST NOT modify the carrier.
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved
dyladan marked this conversation as resolved.
Show resolved Hide resolved
- `Propagator#Extract` MUST return the `Context` passed to it as an argument unchanged.
- `Metrics` MUST NOT be recorded.

If this key is not set it is assumed to be `false`.
The `get` method for this key MAY return `false` if the key is unset.
dyladan marked this conversation as resolved.
Show resolved Hide resolved