prometheus / jmx_exporter

A process for exposing JMX Beans via HTTP for Prometheus consumption
Apache License 2.0
3.03k stars 1.2k forks source link

JMX metrics -> push gateway? #21

Closed curtisallen closed 9 years ago

curtisallen commented 9 years ago

We've been using prometheus for a while and love it. Great work!

Wondering if you've considered allowing JMX metrics to be exported to a push gateway? We'd prefer not to run web servers on our kafka, zookeeper nodes, or connect via a java agent remotely. A lot of our infrastructure components are ephemeral so managing config is a chore.

Instead we'd like to have metrics pushed to our push gateway from these components. I'm willing to put together a pull request. If you see value in doing so.

brian-brazil commented 9 years ago

Have you looked into the service discovery that was added in Prometheus 0.14.0? It'll let you dynamically configure what to monitor, and will produce overall better results than indirecting via a push gateway.

beorn7 commented 9 years ago

In general, to do Prometheus monitoring "right", you want to have an HTTP server on the targets to monitor. Everything else is band aid at best. Or in other words: If you cannot have that HTTP server on most of your targets, I would simply not recommend Prometheus.

The JMX exporter will easily create a whole lot of metrics, and the Pushgateway is not meant to scale to a lot of metrics pushed from many different targets. For one, the one big scrape the Prometheus server has to perform, gets really big then. Also, you are creating another management chore: If one of your monitoring targets dies, what to do with the metrics it has pushed to the Pushgateway? They will just stick around forever, or you have to create another job that deletes metrics from dead targets...

curtisallen commented 9 years ago

@brian-brazil yeah I noticed consul was added with the release last week. May end up going that route. @beorn7 thanks for the comments, didn't consider push gateway metrics clutter before. Thanks!