-
Notifications
You must be signed in to change notification settings - Fork 575
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
Update metric use the new API #3170
Update metric use the new API #3170
Conversation
For reference: #2589 Something like |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3170 +/- ##
=======================================
+ Coverage 69.3% 72.5% +3.2%
=======================================
Files 147 149 +2
Lines 6885 6905 +20
=======================================
+ Hits 4775 5013 +238
+ Misses 1995 1763 -232
- Partials 115 129 +14
|
@@ -120,7 +118,7 @@ func Start(opts ...Option) error { | |||
|
|||
func (r *runtime) register() error { | |||
startTime := time.Now() | |||
uptime, err := r.meter.AsyncInt64().UpDownCounter( | |||
uptime, err := r.meter.Int64ObservableUpDownCounter( |
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.
I don't think it's worth opening a separate PR, but I noticed this should be just an async counter since it's monotonic. Potentially worth changing as part of switching to new API:
uptime, err := r.meter.Int64ObservableUpDownCounter( | |
uptime, err := r.meter.Int64ObservableCounter( |
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.
I would suggest fixing this in a follow-up PR.
With the landing of the new metric API uses of the old api need to be adjusted.
This PR can't be considered until there is a release of the metric API, but will be needed when these versions are updated to that release.
If you would like to test it you can use this go.work: https://gist.githubusercontent.com/MadVikingGod/0045dd54a9fba8f8104459f79454e4ad/raw/50da79ebea42f3d176e7ecb00cc3b34aa4741187/go.work