【发布时间】:2014-09-10 10:45:29
【问题描述】:
我正在尝试为使用 spring-boot 构建的命令行应用程序设置 JMX 监控。
根据https://github.com/spring-projects/spring-boot/tree/master/spring-boot-actuator我只需要添加依赖即可:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
现在我启动我的应用程序,打开 VisualVM,我已经看到了我的应用程序 PID。
但是我现在如何访问actuator 页面上提到的/health 等指标?由于这是一个命令行应用程序,我没有任何可以执行的 HTTP 路径。
如何通过 JXM 查看这些指标?
【问题讨论】:
-
你是否真的尝试过连接到那个 PID...
-
是的,当然我已经连接并且还看到了堆等,但不是 spring 的 jmx bean
-
您的链接已失效。
标签: java spring jmx spring-boot visualvm