feat(api-metrics): remove bind/unbind and bound instruments#2559
feat(api-metrics): remove bind/unbind and bound instruments#2559dyladan merged 5 commits intoopen-telemetry:mainfrom
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
|
obecny
left a comment
There was a problem hiding this comment.
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 |
aabmass
left a comment
There was a problem hiding this comment.
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/unbindand 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.clearin api-metrics.BoundCounter,BoundHistogram,BoundObservableBase) in api-metrics.metric-base-sdkhave not been changed, instead:CounterMetric,BoundCounterMetricboth implementapi.Counterinterface.ObservableMetrictypes implementsapi.ObservableBasetypes.BoundObservableMetricno longer implements any interface exposed by api-metrics.Type of change
How Has This Been Tested?
Checklist: