Skip to content

[CODE HEALTH] Fix bugprone-exception-escape in NoopTracer::StartSpan() - #4673

Merged
marcalff merged 10 commits into
open-telemetry:mainfrom
marcalff:fix_noexcept_2
Oct 11, 2026
Merged

marcalff merged 10 commits into
open-telemetry:mainfrom
marcalff:fix_noexcept_2

Conversation

@marcalff

@marcalff marcalff commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Contributes to #2053

Changes

Please provide a brief description of the changes here.

  • Remove NoopSpan::tracer_, this property is unused
  • Remove the tracer parameter from the NoopSpan constructor
  • Adjusted all callers accordingly
  • Add a NoopTracer::noop_span_ property
  • Return the pre allocated NoopTracer::noop_span_ from NoopTracer::StartSpan(), fixing the issue.
  • Added a CHANGELOG breaking change entry
  • Added details in CHANGELOG for other PRs causing breaking changes

Please note:

  • File api/include/opentelemetry/trace/noop.h is located under api.
  • However, file noop.h is not part of the opentelemetry abi, as instrumented applications never see noop objects directly.
  • Changing classes NoopSpan, NoopTracer and NoopTracerProvider is not a breaking change for instrumentation. It only affects custom exporters.

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

@marcalff
marcalff requested a review from a team as a code owner October 4, 2026 19:40
@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.78%. Comparing base (cdb5e44) to head (7aa44c0).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4673      +/-   ##
==========================================
+ Coverage   86.77%   86.78%   +0.01%     
==========================================
  Files         525      525              
  Lines       20747    20742       -5     
==========================================
- Hits        18002    17998       -4     
+ Misses       2745     2744       -1     
Files with missing lines Coverage Δ
api/include/opentelemetry/trace/noop.h 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

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

@marcalff marcalff added the pr:please-review This PR is ready for review label Oct 5, 2026

@dbarker dbarker 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.

Thanks. Please consider the optional changes below. Since this class may be instantiated by users and is in the public API, consider adding a breaking change entry to the CHANGELOG.

Comment thread api/include/opentelemetry/trace/noop.h
Comment thread api/include/opentelemetry/trace/noop.h
@marcalff
marcalff merged commit 29d358f into open-telemetry:main Oct 11, 2026
125 of 127 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:please-review This PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants