-
Couldn't load subscription status.
- Fork 2k
feat(metrics): add push gateway support for Prometheus metrics #19243
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
Conversation
…nfigurable interval
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 tested it locally like this :
docker run -d -p 9091:9091 prom/pushgateway
reth node --metrics=0.0.0.0:9001 --metrics.push.url=http://localhost:9091/metrics/job/test
curl http://localhost:9091/metrics
It seems to push correctly.
I'm wondering if it's relevant to add a test that spawns a HTTP server in order to inspect the PUT requests sent by the MetricServer. Wdyt ?
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.
only two comments, this is basically what we need, yeah!
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.
this lgtm
@Rjected likely has more context here
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.
This should work, although I think it would be good to figure out how to add config options to how we currently build our PrometheusRecorder, so we can use the builtin push-gateway support:
https://docs.rs/metrics-exporter-prometheus/latest/metrics_exporter_prometheus/struct.PrometheusBuilder.html#method.with_push_gateway
If we were to implement auth then I would prefer using the builtin support as well
While implementing it, I've seen also that there is http_listener, but I followed the existing http listener pattern for the push gateway. I would be happy to give a follow up to this very soon 👍 |
Closes #19229
This spawns a task to push metrics to prometheus following configurable interval (default 5sec).
Added CLI flags for push gateway url and push interval.