application(JMX) monitoring running inside kubernetes cluster using prometheus

4/10/2017

I have multiple java application running inside the container and all of them is managed by kubernetes.

I am using prometheus to monitor cotainer level metrics i.e cpu, mem, etc.

Now I want to do applciation level monitoring using jmx_exporter. but with every deploy container IP keep changing.

  1. can I some how use kuberentes service-ip(cluster-ip) which don't change.

    I cannot just directly put kube-service ip as it load-balance it among containers. and every time i will get only one contaienr metrics insted of all.

  2. or is there a way to dynamically discover cotainer with service_name or replication_controller name in prometheus.

-- Deepak
containers
docker
kubernetes
prometheus

1 Answer

4/10/2017

Yes, you can scrape pods in kubernetes.

You can find an example of how to do that here

-- jaxxstorm
Source: StackOverflow