Spring Boot 2.2.2 - Prometheus 在 Actuator 中不起作用

OCPi

我已将 Spring Boot 应用程序升级到最新的 2.2.2 Boot 版本。从那以后,我只有一个指标端点,但没有 Prometheus。

我的build.gradle.kts文件具有org.springframework.boot:spring-boot-starter-actuator依赖项,我还添加io.micrometer:micrometer-registry-prometheus了参考建议(Prometheus 端点)。

我的application.yml如下所示:

management:
  server:
    port: 9000
  endpoints:
    web:
      exposure:
        include: health, shutdown, prometheus
  endpoint:
    shutdown:
      enabled: true

有人可以指导我走向正确的方向吗?

编辑:它在 Spring Boot 2.2.0 中工作。这是下载相同项目的链接链接

编辑 2:我可以验证它也适用于 2.2.1。

乔纳森·乔克斯

我按照你的设置,我从这个加载了 Spring Boot 2.2.2.RELEASE的项目创建了一个项目,我添加了以下依赖项Prometheus

implementation("io.micrometer:micrometer-registry-prometheus")

我还添加了以下配置 application.yml

management:
  server:
    port: 9000
  endpoints:
    web:
      exposure:
        include: health, shutdown, prometheus
  endpoint:
    shutdown:
      enabled: true

当应用程序启动时,您将看到以下信息,其中显示 3 个端点已暴露(健康、关机和普罗米修斯)

2020-01-05 23:48:19.489  INFO 7700 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 3 endpoint(s) beneath base path '/actuator'

并用于此端点的Postman方法,它运行良好。我按照这里的这些步骤创建了一个存储库所以请让我知道显示了什么错误,或者当你没有得到预期的结果时会发生什么,以便我可以帮助和编辑这个答案。GEThttp://localhost:9000/actuator/prometheus

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

在Spring-boot 2中如何使用Actuator修改Prometheus公开的度量标准名称

RestController在oauth2 Spring Boot中不起作用

Spring Boot 2 Actuator不会发布JVM指标

Spring Boot 2 和 QueryDSL 集成不起作用?

Spring Boot 2 Actuator端点在GET请求中返回405

验证在Spring Boot 1.5.2和Oauth2中不起作用

必需的参数异常在Spring Boot 2.x中不起作用

Spring Boot 2中针对Actuator和自定义API端点的单独身份验证提供程序

使用上下文路径的 POST 调用在 spring boot 2.x 中不起作用

Log4j2 JSP Taglib在Spring-boot嵌入式Servlet容器中不起作用

带有Camel 2.25的Spring Boot 2.x:特定于Spring的端点不起作用

Spring Boot Actuator 2.x @WriteOperation 以对象作为参数

Spring Boot Kafka - Kafka 指标在 /actuator/prometheus 中不可用

升级到Spring Boot 2.x后请求映射不起作用

Spring Boot OAuth2单一登录概念不起作用

将Spring Boot 1.5升级到2 <sec:authorize>不起作用

Spring Boot和Swagger 2:UnsatisfiedDependencyException-存储库测试不起作用

运行状况端点在spring-boot-actuator服务中不起作用

升级到Spring Boot 2后,如何将缓存指标公开给Prometheus?

http 在离子 2 中不起作用

EventEmitter在Angular 2中不起作用

appendComponentToBody在角度2中不起作用

jquery 在 Angular 2 中不起作用?

FileReader 在 Angular 2 中不起作用

* ngFor在角度2中不起作用

zendframework 2中的路由不起作用

Spring Injection在Jersey筛选器中不起作用-jersey2中的@InjectParam等效项

Spring Boot 2 / GraphQL扩展标量不起作用:异常“无法构造实例”“无法反序列化”

将Spring Boot版本从1.3.5升级到1.4.2后,DB2ZOS方言不起作用