Remove TracerProvider.Tracer documentation about concurrent safety#7872
Remove TracerProvider.Tracer documentation about concurrent safety#7872MrAlias wants to merge 2 commits intoopen-telemetry:mainfrom
TracerProvider.Tracer documentation about concurrent safety#7872Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7872 +/- ##
=====================================
Coverage 81.7% 81.7%
=====================================
Files 304 304
Lines 23245 23245
=====================================
Hits 19001 19001
Misses 3860 3860
Partials 384 384 🚀 New features to boost your workflow:
|
dc7938e to
a47745a
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes the documentation stating that TracerProvider.Tracer is safe to call concurrently from the trace API interface. The reasoning is sound: the API interface does not constrain implementation details like thread safety, so documenting that all implementations must be concurrent-safe is misleading. Individual SDK implementations (like go.opentelemetry.io/otel/sdk/trace.TracerProvider) can and do document their own concurrency guarantees.
Changes:
- Removed two lines of documentation claiming concurrent safety from the
TracerProvider.Tracermethod in the trace API - Added a changelog entry explaining the rationale and noting that the SDK implementation remains concurrent-safe
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| trace/provider.go | Removed concurrent safety documentation from the Tracer method of the TracerProvider interface |
| CHANGELOG.md | Added changelog entry documenting this API documentation change |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dashpole
left a comment
There was a problem hiding this comment.
Lets wait for resolution of the spec issue before making changes here.
For context: open-telemetry/opentelemetry-specification#4867
The API does not contain, nor constrain, the implementation of the SDK. It is unfounded, and dangerous, to tell users of the trace API they can always call
Tracerconcurrently given it is SDK dependent.