-
Notifications
You must be signed in to change notification settings - Fork 825
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(sdk-metrics)!: Drop deprecated InstrumentDescriptor
export
#5266
feat(sdk-metrics)!: Drop deprecated InstrumentDescriptor
export
#5266
Conversation
1e9b9c2
to
3d076ef
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5266 +/- ##
==========================================
- Coverage 94.64% 94.63% -0.02%
==========================================
Files 323 323
Lines 8084 8083 -1
Branches 1643 1643
==========================================
- Hits 7651 7649 -2
- Misses 433 434 +1
|
Note that this public `InstrumentDescriptor` has always been just an alias of `MetricDescriptor`, and does not actually point to the internal type with the same name. Separately: * Refactor the internal `InstrumentDescriptor` type to extend from the public `MetricDescriptor`, adding only the `advice` field * Move the `InstrumentType` enum into `./src/export/MetricData.ts` as it is a public export, plus to avoid a circular dependency after the refactor
3d076ef
to
befe9b5
Compare
rebased and retargeted |
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.
Thank you @chancancode for working on this.
In case you're interested in making some further changes, the next step after this PR would then be to move the deprecated type
property from MetricDescriptor
to the now internal InstrumentDescriptor
- this would solve #3439 (edit: the change seems very mechanical at first but there might be some challenges along the way to make it fit properly) 🙂
@pichlermarc Sure, happy to add that to my queue and give it a shot.
Ah, maybe I could have left it in the same file then, do you want it moved back or leave it? Additionally, to be clear, the enum itself is not deprecated and still remains a public export, and is still an independently useful concept/type/constants to have for other purposes, yea?
You are right that moving stuff around is the easy part, taking a quick look reveals that:
It is not immediately obvious to me what we expect them to do instead from the deprecation note. |
Yes, it's used for mapping
I think any usages for types that are not exported can be safely changed to
Yes - for Prometheus, it uses the type to map to enforce a naming convention. There you can replace that check for the InstrumentType to check if
That's the type that by default maps to So today, a re-mapped For the OpenCencus shim, the |
Which problem is this PR solving?
Drop the
@deprecated
InstrumentDescriptor
type exportShort description of the changes
Note that this public
InstrumentDescriptor
has always been just an alias ofMetricDescriptor
, and does not actually point to the internal type with the same name.Separately:
Refactor the internal
InstrumentDescriptor
type to extend from the publicMetricDescriptor
, adding only theadvice
fieldMove the
InstrumentType
enum into./src/export/MetricData.ts
as it is a public export, plus to avoid a circular dependency after the refactor (hence the big diff)Fixes #5254 (comment) (cc @pichlermarc)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
npm run compile
npm run lint
npm run test:*
Checklist:
Unit tests have been addedDocumentation has been updated