Skip to content

Commit

Permalink
Make clear that context is not mutable when setting a span (open-tele…
Browse files Browse the repository at this point in the history
…metry#2637)

* Make clear that context is not mutable when setting a span
* Avoid making the copy seem mutable
* Update the summary line to also not sound like Context is mutable
  • Loading branch information
Grunet authored Jul 6, 2022
1 parent 819c0c0 commit 3d0825d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ release.

- Clarify the return of `Export(batch)` in the Batch Span Processor and exporter
concurrency ([#2452](https://github.com/open-telemetry/opentelemetry-specification/pull/2452))
- Clarify that Context should not be mutable when setting a span ([#2637](https://github.com/open-telemetry/opentelemetry-specification/pull/2637))

### Metrics

Expand Down
4 changes: 2 additions & 2 deletions specification/trace/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ The API MUST provide the following functionality to interact with a `Context`
instance:

- Extract the `Span` from a `Context` instance
- Insert the `Span` to a `Context` instance
- Combine the `Span` with a `Context` instance, creating a new `Context` instance

The functionality listed above is necessary because API users SHOULD NOT have
access to the [Context Key](../context/README.md#create-a-key) used by the Tracing API implementation.
Expand All @@ -173,7 +173,7 @@ If the language has support for implicitly propagated `Context` (see
the following functionality:

- Get the currently active span from the implicit context. This is equivalent to getting the implicit context, then extracting the `Span` from the context.
- Set the currently active span to the implicit context. This is equivalent to getting the implicit context, then inserting the `Span` to the context.
- Set the currently active span into a new context, and make that the implicit context. This is equivalent to combining the current implicit context's values with the `Span` to create a new context, which is then made the current implicit context.

All the above functionalities operate solely on the context API, and they MAY be
exposed as either static methods on the trace module, or as static methods on a class
Expand Down

0 comments on commit 3d0825d

Please sign in to comment.