Reputation: 118
I am planning to use Prometheus for monitoring JVM within the Docker Container. We achieved this with javaagent for JMX exporter. My question is how do I dynamically discover and update my prometheus.yml for scrape targets of JVM to be monitored when I bring up/down a docker container. I am running tomcat within the docker container. Any suggestions?
Thanks in advance and Appreciate your time. Karthik
Upvotes: 0
Views: 2886
Reputation: 113
You may want to take a look at SPM Client docker container. It has the agents for monitoring a number of different applications running in Docker - Elasticsearch, Solr, Tomcat, MySQL, and so on: https://github.com/sematext/docker-spm-client
Upvotes: 0
Reputation: 34172
This depends on how you do service discovery generally. For example if you're using Consul you can use Consul SD in Prometheus to find your exporter, possibly using something like Gliderlab's Registrator. http://www.slideshare.net/brianbrazil/prometheus-and-docker-docker-galway-november-2015 slides 18 and 20 should help point you in the right direction.
Other than Consul, in your situation the other main option would be to use Zookeeper Serverset or get your configuration management to write out yaml/json target files for use by Prometheus.
Upvotes: 1