Skip to content

Commit

Permalink
Add Suppress Instrumentation context key
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan committed Apr 27, 2021
1 parent f8ff8c3 commit 4a162f3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ release.

New:

- Add Suppress Instrumentation context key
([#1653](https://github.com/open-telemetry/opentelemetry-specification/pull/1653))
- Add Metadata for Baggage entries, and clarify W3C Baggage Propagator implementation
([#1066](https://github.com/open-telemetry/opentelemetry-specification/pull/1066))
- Change Status to be consistent with Link and Event
Expand Down
25 changes: 25 additions & 0 deletions specification/context/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,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 @@ -123,3 +125,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

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.

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

0 comments on commit 4a162f3

Please sign in to comment.