-
Notifications
You must be signed in to change notification settings - Fork 821
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
fix(sdk-metrics): deprecate instrument type in InstrumentDescriptor
#3520
fix(sdk-metrics): deprecate instrument type in InstrumentDescriptor
#3520
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3520 +/- ##
==========================================
+ Coverage 93.30% 93.69% +0.39%
==========================================
Files 235 277 +42
Lines 5986 8449 +2463
Branches 1154 1753 +599
==========================================
+ Hits 5585 7916 +2331
- Misses 401 533 +132
|
182ae6d
to
83c8a26
Compare
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.
Will this cause deprecation warnings (depending on linter/ts setup) for anyone importing InstrumentDescriptor
e.g. in an exporter? If so, is there a way to fix the deprecation warnings by using a different type/field in exposition format?
…MetricDescriptor'
4d587c0
to
014c7f1
Compare
It should be possible to just use the newly introduced base type |
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.
Overall LGTM % nits.
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.
LGTM but there are conflicts. This can be merged when they're fixed
Failing tests are unrelated to this PR, see #3700 |
@pichlermarc tests are still failing and the linked PR is merged |
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
Which problem is this PR solving?
InstrumentDescriptor
currently accidentally passes the original instrument type through to the exporter. In #3439 we agreed to deprecate it and renameInstrumentDescriptor
toDescriptor
.This PR
InstrumentDescriptor
and it'stype
fieldDescriptor
base interface as replacement, which has notype
field.InstrumentDescriptor
extendDescriptor
InstrumentDescriptor
is still passed to Exporters viaMetricData
as the interface needs to stay stableMetricDescriptor
to replaceInstrumentDescriptor
internally. This type:Descriptor
type
->originalInstrumentType
originalInstrumentType
around for internal use, as it is necessary tosum
should be included when creating aHistogramDataPoint
InstrumentDescriptor
before export.I'm not aiming to change any of the exporter packages that use the
InstrumentDescriptor
type in this PR, but keep the changes local to thesdk-metrics
package. Changing the exporter packages would blow up the diff significantly and make it hard to determine if the changes are truly non-breaking.I would be very happy about some feedback regarding the JavaScript/TypeScript-iness of the PR as well as naming of the types, as I'm not entirely confident about those points at the moment. 🙂
Fixes #3439
Type of change
How Has This Been Tested?
Checklist: