Skip to content

Comments

Remove TracerProvider.Tracer documentation about concurrent safety#7872

Open
MrAlias wants to merge 2 commits intoopen-telemetry:mainfrom
MrAlias:rm-doc-tp-concurrent-safe
Open

Remove TracerProvider.Tracer documentation about concurrent safety#7872
MrAlias wants to merge 2 commits intoopen-telemetry:mainfrom
MrAlias:rm-doc-tp-concurrent-safe

Conversation

@MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Feb 3, 2026

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 Tracer concurrently given it is SDK dependent.

@MrAlias MrAlias added this to the v1.41.0 milestone Feb 3, 2026
@MrAlias MrAlias added the documentation Provides helpful information label Feb 3, 2026
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.7%. Comparing base (90c75c4) to head (a47745a).

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #7872   +/-   ##
=====================================
  Coverage   81.7%   81.7%           
=====================================
  Files        304     304           
  Lines      23245   23245           
=====================================
  Hits       19001   19001           
  Misses      3860    3860           
  Partials     384     384           

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MrAlias MrAlias force-pushed the rm-doc-tp-concurrent-safe branch from dc7938e to a47745a Compare February 3, 2026 22:01
@MrAlias MrAlias marked this pull request as ready for review February 3, 2026 22:02
Copilot AI review requested due to automatic review settings February 3, 2026 22:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Tracer method 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.

Copy link
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets wait for resolution of the spec issue before making changes here.

For context: open-telemetry/opentelemetry-specification#4867

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Provides helpful information

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants