Skip to content

[SDK] Remove TracerConfig copy from Tracer - #4712

Merged
marcalff merged 4 commits into
open-telemetry:mainfrom
dbarker:fix_dont_store_tracer_config
Oct 18, 2026
Merged

marcalff merged 4 commits into
open-telemetry:mainfrom
dbarker:fix_dont_store_tracer_config

Conversation

@dbarker

@dbarker dbarker commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Fixes # (issue)

The SDK Tracer maintains an unnecessary TracerConfig copy and related mutex. These can be removed to save resource usage.

Changes

  • Remove the TracerConfig and its mutex from SDK Tracer

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@dbarker
dbarker marked this pull request as ready for review October 17, 2026 19:29
@dbarker
dbarker requested a review from a team as a code owner October 17, 2026 19:29
@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.81%. Comparing base (2fc5227) to head (2278676).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4712      +/-   ##
==========================================
- Coverage   86.81%   86.81%   -0.00%     
==========================================
  Files         525      525              
  Lines       20741    20736       -5     
==========================================
- Hits        18005    18000       -5     
  Misses       2736     2736              
Files with missing lines Coverage Δ
sdk/include/opentelemetry/sdk/trace/tracer.h 100.00% <ø> (ø)
sdk/src/trace/tracer.cc 83.12% <100.00%> (-1.02%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dbarker dbarker changed the title [SDK] Tracer should not store the TracerConfig [SDK] Remove TracerConfig copy from Tracer Oct 17, 2026

@mateenali66 mateenali66 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the copy was write-only, and every write to it already happens under the provider's lock_. tsan is clean on UpdateTracerConfiguratorConcurrentStartSpan over 50 runs, and it merges cleanly with #4710.

small thing, sdk/include/opentelemetry/sdk/trace/tracer.h:9 still includes <mutex>, which nothing in the header uses now. everything builds with it removed.

@marcalff marcalff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@marcalff
marcalff merged commit 66ef33b into open-telemetry:main Oct 18, 2026
75 checks passed
malkia added a commit to malkia/opentelemetry-cpp that referenced this pull request Oct 18, 2026
[SDK] Remove TracerConfig copy from Tracer (open-telemetry#4712)
@dbarker
dbarker deleted the fix_dont_store_tracer_config branch October 18, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants