不能在 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/