Skip to content
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

[API/SDK] Provider cleanup #2664

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

marcalff
Copy link
Member

@marcalff marcalff commented May 9, 2024

Fixes #2506

Changes

Please provide a brief description of the changes here.

  • Removed methods related to Flush() and Close() from the API class opentelemetry::trace::Tracer, starting with ABI version 2.
    • These methods are not intended for the API, and got exposed as an oversight
    • These methods belong to the SDK instead
  • Changed all XXXProviderFactory::Create() methods to return an SDK object instead of an API object.
    • Returning an SDK object is necessary for the application code to perform a proper initialisation, and proper shutdown of the SDK
    • In particular, returning an SDK object is required for the caller to invoke Flush() and Shutdown().
  • Removed static_cast<SDK*>(API object) from examples, and use cleaner code, to initialize SDK providers.

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

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 87.53%. Comparing base (497eaf4) to head (f201ba1).
Report is 64 commits behind head on main.

Current head f201ba1 differs from pull request most recent head 17ae54d

Please upload reports for the commit 17ae54d to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2664      +/-   ##
==========================================
+ Coverage   87.12%   87.53%   +0.41%     
==========================================
  Files         200      188      -12     
  Lines        6109     5842     -267     
==========================================
- Hits         5322     5113     -209     
+ Misses        787      729      -58     
Files Coverage Δ
api/include/opentelemetry/trace/noop.h 93.34% <ø> (ø)
api/include/opentelemetry/trace/tracer.h 100.00% <ø> (ø)
sdk/include/opentelemetry/sdk/trace/tracer.h 100.00% <ø> (ø)
sdk/src/logs/event_logger_provider_factory.cc 100.00% <100.00%> (ø)
sdk/src/trace/tracer_provider_factory.cc 44.83% <42.86%> (+0.39%) ⬆️

... and 55 files with indirect coverage changes

@marcalff marcalff changed the title [SDK] Provider cleanup [API/SDK] Provider cleanup May 9, 2024
@lalitb
Copy link
Member

lalitb commented May 9, 2024

Good catch :)

@marcalff
Copy link
Member Author

marcalff commented May 9, 2024

Waiting for the build to finish to make sure DLL links, then this will be ready for review.

@marcalff marcalff added the help wanted Good for taking. Extra help will be provided by maintainers label May 10, 2024
@marcalff
Copy link
Member Author

Add help-wanted label:

The windows DLL build fails with undefined symbols, and I can not figure out why (I don't have windows locally to investigate).

@marcalff marcalff added pr:please-review This PR is ready for review and removed help wanted Good for taking. Extra help will be provided by maintainers labels May 13, 2024
@marcalff marcalff marked this pull request as ready for review May 13, 2024 20:34
@marcalff marcalff requested a review from a team as a code owner May 13, 2024 20:34
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.

[EXAMPLES] Improve ForceFlush call to also work with NoopTracerProvider
2 participants