【发布时间】:2021-12-20 18:24:33
【问题描述】:
我正在尝试使用嵌入式 tomcat 监控 Spring Boot 2.1.3 中的执行器指标,但指标不包括 tomcat.servlet.* 和 tomcat.cache.* 指标。
目前可用的指标如下
{"names":["logback.events","tomcat.sessions.expired","jvm.memory.committed","jvm.buffer.memory.used","jvm.memory.max"," jvm.threads.live","jvm.threads.peak","jvm.threads.states","jvm.memory.used","process.uptime","tomcat.global.sent","tomcat.sessions.拒绝","process.cpu.usage","tomcat.global.request.max","jdbc.connections.active","tomcat.global.request","jvm.classes.loaded","jvm.classes.卸载","tomcat.sessions.active.current","hikaricp.connections.idle","tomcat.global.received","tomcat.sessions.alive.max","jvm.gc.live.data.size" "jdbc.connections.max","jdbc.connections.min","hikaricp.connections.pending","method.timed","http.server.requests","hikaricp.connections","process.files.打开","hikaricp.connections.active","hikaricp.connections.creation","tomcat.threads.config.max","tomcat.sessions.active.max","tomcat.global.error","process. start.time","jvm.buffer.count","hikaricp.connections.max","hikaricp.connections.min","tomcat.threads.current","jvm.buffer.total.capacity","process. F iles.max","jvm.gc.memory.promoted","hikaricp.connections.usage","system.load.average.1m","jvm.gc.max.data.size","gauge.UserController. getUser.executionTime.seconds","hikaricp.connections.timeout","tomcat.threads.busy","system.cpu.count","hikaricp.connections.acquire","jvm.gc.pause","tomcat. session.created","jvm.threads.daemon","system.cpu.usage","jvm.gc.memory.allocated"]}
是否需要在 spring 中设置任何属性,以便公开所有 tomcat 指标。我已经尝试过 managemet.metrics.enable.tomcat=true 但它不起作用。
依赖项是:
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
【问题讨论】:
标签: prometheus grafana spring-micrometer embedded-tomcat