-
Notifications
You must be signed in to change notification settings - Fork 795
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: adding new metric: up down sum observer #1272
feat: adding new metric: up down sum observer #1272
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1272 +/- ##
==========================================
+ Coverage 93.03% 93.24% +0.20%
==========================================
Files 120 137 +17
Lines 2931 3878 +947
Branches 590 790 +200
==========================================
+ Hits 2727 3616 +889
- Misses 204 262 +58
|
What is the plan to export this new Metric type to Prometheus exporter? |
This is currently already exported as point has value which is number and this number will be exported |
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.
Code looks good to me, a few comments left in the docs.
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.
🎉 🦝
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.
Couple more things I noticed.
@@ -30,7 +30,7 @@ const NOOP_CALLBACK = () => {}; | |||
*/ | |||
export abstract class BaseObserverMetric extends Metric<BoundObserver> | |||
implements api.BaseObserver { | |||
protected _callback: (observerResult: api.ObserverResult) => void; | |||
protected _callback: (observerResult: api.ObserverResult) => unknown; |
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.
not sure why you changed the void to a unknown ?
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.
because this might or not return something
@open-telemetry/javascript-approvers ^^ |
}); | ||
} | ||
|
||
// sync callback in case you don't need to wait for value |
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.
👍
Great to provide both examples.
Co-authored-by: Mayur Kale <[email protected]>
Co-authored-by: Mayur Kale <[email protected]>
Which problem is this PR solving?
Short description of the changes