Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to monitor a spring-boot application via JMX?

I'm trying to set up a JMX monitoring for a comand line app build with spring-boot.

According to https://github.com/spring-projects/spring-boot/tree/master/spring-boot-actuator I just have to add the dependency:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

Now I start my app, open VisualVM and I already see my application PID. But how can I now access the metrics like /health etc that are mentioned on the actuator page? As this is a comand line app, I don't have any HTTP path that I can execute.

How can I see those metrics via JXM?

like image 785
membersound Avatar asked Sep 10 '14 10:09

membersound


People also ask

How do I monitor my spring boot application?

The first part of monitoring Spring Boot applications is choosing a metrics database. By default, Spring Boot will configure a Micrometer metrics registry in every application. This default implementation collects a pre-defined set of application metrics such as memory and CPU usage, HTTP requests, and a few others.

What is the use of JMX spring boot?

Java Management Extensions (JMX) provide a standard mechanism to monitor and manage applications. By default, Spring Boot exposes management endpoints as JMX MBeans under the org. springframework. boot domain.


1 Answers

If you want to access JMX beans with JVisualVM, you need to install the VisualVM-MBeans plugin (go to Tools -> Plugins -> Available Plugins). You can also use JConsole, which can access JMX beans by default.

like image 78
dunni Avatar answered Oct 06 '22 23:10

dunni