-
Notifications
You must be signed in to change notification settings - Fork 812
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
feat(api-metrics): remove bind/unbind and bound instruments #2559
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2559 +/- ##
=======================================
Coverage 93.07% 93.08%
=======================================
Files 140 140
Lines 5168 5145 -23
Branches 1101 1101
=======================================
- Hits 4810 4789 -21
+ Misses 358 356 -2
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in general looks fine, just wondering why do you need to cast instruments in all places now. This is perhaps something that could / should be fixed
@obecny because |
If bind is removed from the API then it should be removed from the SDK too. I don't see a reason to do the casting to retain a method that is being removed. Unless I misunderstood your comment. |
@dyladan The main goal of this PR is to remove bind/unbind from api-metrics. As stated in the OP, this PR didn't change the data flow or functionality of metric base SDK, as it would result in a large refactor. And spec for SDK is not frozen yet. |
Isn't the SDK freeze near, does it make sense to just wait for it to do everything in one PR ? |
If the SDK refactor is really that large then it's fine to do just the API for now. The casting in that case is only temporary until we can do a proper refactor of the SDK?
Yes the freeze is very near if it isn't already frozen. I would consider the SDK metrics spec to be essentially done aside from small tweaks based on the last few metrics and spec meetings. |
Even SDK is frozen, I would not put the SDK refactor with API change in a single PR. They can be changed separately. And even SDK is not refactored, it is compliant with the latest API (we just won't be able to access the bind/unbind from api-metrics). After api-metrics breaking changes settled down, users of api-metrics won't be affected when we land the SDK refactors. WDYT?
Yes, when we get rid of bind/unbind in SDK tests, we can remove these type casts. |
Not something blocking on my end, so lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, when we get rid of bind/unbind in SDK tests, we can remove these type casts.
Should we make an issue to track this before merging? Otherwise LGTM
I believe we need to create issues for feature-freeze SDK spec compliance. For now, we only have feature-freeze API spec tracking issues. |
@legendecas They is one conflict to fix before merging it |
# Conflicts: # experimental/packages/opentelemetry-sdk-metrics-base/test/Meter.test.ts
Which problem is this PR solving?
Removes
metric.bind/unbind
and bound instrument types from api-metrics. This PR didn't change the data flow or functionality of metric base SDK, as it would result in a large refactor, however, the SDK spec is not frozen yet.Fixes #2545
Short description of the changes
Metric.bind
,Metric.unbind
,Metric.clear
in api-metrics.BoundCounter
,BoundHistogram
,BoundObservableBase
) in api-metrics.metric-base-sdk
have not been changed, instead:CounterMetric
,BoundCounterMetric
both implementapi.Counter
interface.ObservableMetric
types implementsapi.ObservableBase
types.BoundObservableMetric
no longer implements any interface exposed by api-metrics.Type of change
How Has This Been Tested?
Checklist: