【问题标题】:How to enable tomcat servlet metrics in Spring Boot 2.1.3如何在 Spring Boot 2.1.3 中启用 tomcat servlet 指标
【发布时间】: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


    【解决方案1】:

    这实际上是 micrometer API 中的一个错误。版本:micrometer-core-1.1.3

    来自 Github 的错误报告:https://github.com/micrometer-metrics/micrometer/issues/1754

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-06-17
      • 1970-01-01
      • 2023-03-05
      • 2017-09-20
      • 2019-03-20
      • 2017-03-23
      • 1970-01-01
      相关资源
      最近更新 更多