Monitoring spring boot -Java applications in Kubernetes

151 views
Skip to first unread message

sujad...@gmail.com

unread,
May 17, 2019, 3:14:10 AM5/17/19
to Prometheus Users
Hi Team,

I have installed Prometheus in our Kubernetes environment and its happily getting the Nodes & Pods logs to Grafana and Visualizing, however all our applications are built using Spingboot framework in Java, Is there a way that I can monitor the apps without changing the Code.

Screen Shot 2019-05-17 at 2.12.56 PM.png

Screen Shot 2019-05-17 at 2.10.13 PM.png


Sujad Syed

unread,
May 18, 2019, 11:55:54 AM5/18/19
to Prometheus Users
Hi cany any one help me here

--
You received this message because you are subscribed to a topic in the Google Groups "Prometheus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prometheus-users/XqykaYebDlk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/0d3221c2-95b6-4669-841a-46fd102e6da5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Harald Koch

unread,
May 18, 2019, 12:14:11 PM5/18/19
to Prometheus Users

On Fri 17 May, 2019, 12:44 PM , <sujad...@gmail.com> wrote:
Hi Team,

I have installed Prometheus in our Kubernetes environment and its happily getting the Nodes & Pods logs to Grafana and Visualizing, however all our applications are built using Spingboot framework in Java, Is there a way that I can monitor the apps without changing the Code.

Look into the Prometheus jmx_exporter (https://github.com/prometheus/jmx_exporter). You may still need to change your code to add new MBeans if the metrics you are interested in are not available by default; Spring makes this easy.

The jmx_exporter can be bundled with your application as part of your k8s deployment, or can be loaded in via a sidecar (see, for example, https://github.com/chuyeow/prometheus-jmx-exporter-kubernetes). In either case, you would need to add an option to the java command line to start the jmx_exporter agent with your application.

It's possible there's a simpler mechanism with Spring boot, but I haven't looked for one (we currently run applications in Apache Karaf). (We also use the Java client, but you mentioned that you do not want to modify your code.)

--
Harald Koch

frank....@interface-projects.de

unread,
May 20, 2019, 6:39:13 AM5/20/19
to Prometheus Users
As far as i know spring uses the micrometer library. Prometheus is one the supported output formats of the micrometer library. So the chances are good that you don't have to change your code, maybe some config ...

nullop

unread,
Apr 22, 2021, 9:05:00 AM4/22/21
to Prometheus Users
Sorry to bump an unrelated post. Were you running this in the same jvm as karaf? I am trying to do that and running into issues.
Reply all
Reply to author
Forward
0 new messages