Skip to content

Commit

Permalink
Update Span End method documentation (open-telemetry#1310)
Browse files Browse the repository at this point in the history
* Update Span End method documentation

Updates to the Span after End is called result it potentially
inconsistent views of the Span between the code defining it and the
ultimate receiver of the Span data. This corrects the documented
language of the API to prevent this from happening.

* Add changes to changelog
  • Loading branch information
MrAlias committed Nov 9, 2020
1 parent a354c02 commit 757030d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Fix `Code.UnmarshalJSON` to work with valid json only. (#1276)
- The `resource.New()` method changes signature to support builtin attributes and functional options, including `telemetry.sdk.*` and
`host.name` semantic conventions; the former method is renamed `resource.NewWithAttributes`. (#1235)
- Correct the `Span.End` method documentation in the `otel` API to state updates are not allowed on a span after it has ended. (#1310)

### Removed

Expand Down
6 changes: 4 additions & 2 deletions trace/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,10 @@ type Span interface {
// nil.
Tracer() Tracer

// End completes the Span. Updates are not allowed the Span after End is
// called other than setting the status.
// End completes the Span. The Span is considered complete and ready to be
// delivered through the rest of the telemetry pipeline after this method
// is called. Therefore, updates to the Span are not allowed after this
// method has been called.
End(options ...SpanOption)

// AddEvent adds an event with the provided name and options.
Expand Down

0 comments on commit 757030d

Please sign in to comment.