spring-boot - 不能在 Spring Boot 2(版本 2.0.0.M7)中包含 Prometheus 指标

标签 spring-boot metrics prometheus

不能在 spring boot 2(版本 2.0.0.M7)项目中包含 Prometheus 指标。

根据 micrometer docs已添加 spring-boot-starter-actuator 在 application.yaml 中添加了依赖项 management.endpoints.web.expose:普罗米修斯但是当调用/actuator/prometheus 时得到{ "timestamp": 1518159066052, "path": "/actuator/prometheus", "message": "Response status 404 with reason \"No matching handler\"", "status": 404, "error": "Not Found" }
请告诉我为什么我没有获得普罗米修斯指标?

最佳答案

我在使用 Springboot 2.x 启动千分尺时遇到了麻烦。

我项目中的这些更改帮助我在 actuator/prometheus 公开了指标。端点

这些是我的的变化application.properties 文件

management.endpoints.web.exposure.include=*
management.endpoint.metrics.enabled=true

我的 build.gradle 包含文件
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('io.micrometer:micrometer-registry-prometheus')

关于spring-boot - 不能在 Spring Boot 2(版本 2.0.0.M7)中包含 Prometheus 指标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48700449/

相关文章:

prometheus - 为什么crement()返回普罗米修斯的1.33值?

java - 更改spring security中的登录服务URL

spring - 哪个版本的spring boot包含了@WebIntegrationTest,添加时在Intellij中显示为红色

html - 在 Thymeleaf 中的 For-Each 循环下有一个表单

c# - RavenDB.Database 和 Metrics.Net 冲突

Azure 指标图图例

metrics - 在一个 12 因素的应用程序中,指标应该如何发送到指标监控服务器?

java - spring boot standalone 在本地运行良好但无法在远程服务器上访问

prometheus - 普罗米修斯中的刮取间隔和评估间隔

docker - 如何将每个 docker swarm 服务的运行实例数作为普罗米修斯指标?