Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[API] Add Enabled method to Tracer #3357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 22, 2025
Merged

Conversation

psx95
Copy link
Contributor

@psx95 psx95 commented Apr 9, 2025

Fixes #3149

Changes

Adds a method to Tracer (ABI version >= 2) that allows the user to check if the tracer is enabled or not. A disabled tracer does not produce spans.

This change enhances tracer spec-compatibility.

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

Copy link

netlify bot commented Apr 9, 2025

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
🔨 Latest commit 48a2fe3
🔍 Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/680712ca5bf31a0008510510

Copy link

codecov bot commented Apr 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.57%. Comparing base (674cc9e) to head (48a2fe3).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3357      +/-   ##
==========================================
+ Coverage   89.56%   89.57%   +0.01%     
==========================================
  Files         210      210              
  Lines        6502     6505       +3     
==========================================
+ Hits         5823     5826       +3     
  Misses        679      679              
Files with missing lines Coverage Δ
api/include/opentelemetry/trace/noop.h 93.94% <100.00%> (+0.61%) ⬆️
api/include/opentelemetry/trace/tracer.h 100.00% <ø> (ø)
sdk/src/trace/tracer.cc 83.61% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@psx95 psx95 marked this pull request as ready for review April 16, 2025 19:41
@psx95 psx95 requested a review from a team as a code owner April 16, 2025 19:41
Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

Copy link
Contributor

@dbarker dbarker left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks

@ThomsonTan ThomsonTan merged commit d976876 into open-telemetry:main Apr 22, 2025
66 checks passed
@psx95 psx95 deleted the tracer-enabled branch April 22, 2025 15:35
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.

[API] Add functionality in Tracer to report if it is enabled
5 participants