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

sdk/metric: Add experimental Enabled method to synchronous instruments #6016

Merged
merged 9 commits into from
Dec 6, 2024

Conversation

codeboten
Copy link
Contributor

@codeboten codeboten commented Dec 4, 2024

Fixes #6002

Opening this to get feedback on whether or not I'm headed in the right direction
based on the details listed in open-telemetry#6002. This
is a replacement for open-telemetry#5768

Fixes open-telemetry#6002

There are still some tests I would add, but overall I'm mostly looking to reviewers to let me know
if this is the correct approach (defining an interface in `x` and using that interface in the SDK)

Signed-off-by: Alex Boten <[email protected]>
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.2%. Comparing base (3bb224b) to head (42b219a).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #6016   +/-   ##
=====================================
  Coverage   82.1%   82.2%           
=====================================
  Files        273     273           
  Lines      23643   23647    +4     
=====================================
+ Hits       19433   19448   +15     
+ Misses      3865    3852   -13     
- Partials     345     347    +2     

see 4 files with indirect coverage changes

Copy link
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

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

Nice work 👍 Overall, I think this is the direction we agreed on during the SIG meetings.

I think it would be good to also add an example in sdk/metric/example_test.go and add some benchmarks.

You can look at #5692 for reference.

sdk/metric/internal/x/x.go Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
sdk/metric/instrument.go Outdated Show resolved Hide resolved
sdk/metric/internal/x/README.md Outdated Show resolved Hide resolved
sdk/metric/internal/x/x.go Outdated Show resolved Hide resolved
sdk/metric/internal/x/x.go Outdated Show resolved Hide resolved
sdk/metric/meter_test.go Outdated Show resolved Hide resolved
sdk/metric/meter_test.go Outdated Show resolved Hide resolved
sdk/metric/instrument.go Outdated Show resolved Hide resolved
@pellared pellared changed the title add experimental Enabled interface sdk/metric: Add experimental Enabled method to synchronous instruments Dec 4, 2024
Copy link
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

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

Just one refactoring request from my side. The rest LGTM👍

sdk/metric/meter_test.go Outdated Show resolved Hide resolved
@pellared
Copy link
Member

pellared commented Dec 5, 2024

I think it would be good to also add an example in sdk/metric/example_test.go and add some benchmarks.

After a second thought, I do not think it is really necessary.

There are still some tests I would add, but overall I'm mostly looking to reviewers to let me know if this is the correct approach

Is the PR description up to date? Looks like a pretty complete PR unless I am missing something 😉

@codeboten
Copy link
Contributor Author

Updated the description, thanks for all the reviews/suggestions!

@pellared pellared added this to the v1.33.0 milestone Dec 5, 2024
@dmathieu dmathieu merged commit 0598dae into open-telemetry:main Dec 6, 2024
32 checks passed
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.

Add experimental Instrument.Enabled SDK method
4 participants