-
Notifications
You must be signed in to change notification settings - Fork 918
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
Add Metrics to Bootnode #5460
Add Metrics to Bootnode #5460
Conversation
Name: "bootstrap_node_kaddht_peers", | ||
Help: "The current number of kaddht peers of the bootstrap node", | ||
}) | ||
discv5PeersCount = promauto.NewGauge(prometheus.GaugeOpts{ |
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.
Want to use NewGaugeFunc?
https://godoc.org/github.com/prometheus/client_golang/prometheus#NewGaugeFunc
With that, you could remove that RunEvery routine and prometheus would simply run the function when the metrics page is scraped
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.
It would end up being more code added cause I would have to call update metrics twice for each of them in the callback, also I wouldn't be able to initialize it at the top as a package var
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.
Yeah, i was afraid of that
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, I had one comment, but I don't feel very strongly about it.
this is failing build @rauljordan . You need to update your docker deps too |
c242f5e
build still fails @rauljordan
|
Build fails |
Codecov Report
@@ Coverage Diff @@
## master #5460 +/- ##
=======================================
Coverage 14.88% 14.88%
=======================================
Files 8 8
Lines 430 430
=======================================
Hits 64 64
Misses 351 351
Partials 15 15 |
Resolves #4217
Description
Write a summary of the changes you are making
Adds kaddht peer count + discv5 peer count to the prometheus metrics of a bootnode.