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

Mark SdkMeter as pub(crate) #2113

Merged

Conversation

utpilla
Copy link
Contributor

@utpilla utpilla commented Sep 12, 2024

Changes

  • SdkMeter should not be public

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@utpilla utpilla requested a review from a team September 12, 2024 21:37
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.3%. Comparing base (8bd3294) to head (bc03ace).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2113     +/-   ##
=======================================
- Coverage   78.3%   78.3%   -0.1%     
=======================================
  Files        121     121             
  Lines      20815   20815             
=======================================
- Hits       16309   16308      -1     
- Misses      4506    4507      +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@TommyCpp TommyCpp left a comment

Choose a reason for hiding this comment

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

This is a breaking change so maybe a change note?

@cijothomas
Copy link
Member

This is a breaking change so maybe a change note?

+1. We also need to add one for #2085 too

@cijothomas cijothomas merged commit ff9d50b into open-telemetry:main Sep 12, 2024
25 checks passed
@cijothomas
Copy link
Member

Merging. Missing changelogs can be added in a follow up for both together.

@hdost
Copy link
Contributor

hdost commented Sep 13, 2024

Can i get a rational on this? Perhaps I am missing some context. Is it because users should use a builder and not the SdkMeter directly?

@cijothomas
Copy link
Member

Can i get a rational on this? Perhaps I am missing some context. Is it because users should use a builder and not the SdkMeter directly?

From the examples:

let meter = global::meter("mylibraryname");

// OR
// let meter = meter_provider.meter("mylibraryname");

// Create a Counter Instrument from above meter
let counter = meter.u64_counter("my_counter").init();

SdkMeter not required to do this, and OTel's expectation is also rely on API only, not SDK constructs like SdkMeter, as that would tie their instrumentation to a specific SDK implementation (negating one of the original goals of OTel).

I also look at this from another angle - some pub thing was removed, and still all examples continue to compile, indicating that this should not have been public in the first place. Should work most of the time to help clean up public APIs to the absolute minimum required.

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.

4 participants