-
Notifications
You must be signed in to change notification settings - Fork 106
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 blockdiff and blocknumber gauges for Prometheus #2770
Conversation
@joaquincasares just so i understand correctly what's happening here is
|
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.
Looks cool! I am still gathering context here but added a comment/q.
# unsure if overloading is supported. | ||
if gauge: | ||
if name not in PrometheusMetric.gauges: | ||
PrometheusMetric.gauges[name] = Gauge( |
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.
Maybe we abstract these out into addPrometheusMetric('gauges')
, addPrometheusMetric('histograms')
?
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.
Phew! Thanks! I knew I didn't like the gauge=false
bit since I would only extend to two types, but figured to punt that design choice until later.
I'll implement your suggestion, thanks!
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.
Heh, I misread your suggestion, but hopefully the latest change is what you had in mind?
|
* implement and use gauges for prometheus metrics * use Callable, not func * invert 0/1 * update interface for choosing gauges
Description
Implement Prometheus Gauges and add blockdiff and blocknumber metrics for the exporter using a collector function. Collector functions allow us to leave business logic next to related business logic within the same file, while exposing a group of gauges that should only be inspected at export/scrape time.
Tests
How will this change be monitored? Are there sufficient logs?