不能在spring 2(Version2.0.0.M7)项目中包含Prometheus度量。
根据spring-boot-starter-actuator,千分尺文档添加了依赖项,在application.yaml中添加了management.endpoints.web.expose:,prometheus,,但是在调用/执行器/普罗米修斯时
{ "timestamp": 1518159066052, "path": "/actuator/prometheus", "message": "Response status 404 with reason \"No matching handler\"", "status": 404, "error": "Not Found" }
请告诉我,为什么我没有得到普罗米修斯的指标?
发布于 2018-02-09 12:48:54
你把micrometer-registry-prometheus加到你的受抚养人身上了吗?
微米有一个可插拔的体系结构,您需要定义(通过插入依赖项)您想要使用的监视系统。(您甚至可以添加多个,而不仅仅是一个。)
顺便说一句,您应该切换到Spring 2.0.0.RC1。这是目前这篇文章的内容。
发布于 2018-07-31 15:17:20
我很难用SpringBoot2.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')发布于 2018-02-13 12:17:44
编辑:自从我给出这个答案以来,很多事情都变了。RC1为2.0.0.RC1。请阅读文档https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-metrics.html
如果上面的解决方案不适用于其他人,请尝试这样做:我在SpringBoot2.0.0.RC1,Spring starter,当然还有弹簧-启动-启动-执行器方面也有同样的问题。
我的application.properties文件如下:
management.endpoints.web.expose=prometheus,metrics,info,health在我的pom文件中,我还有:
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient</artifactId>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>0.12.0.RELEASE</version>
</dependency>Prometheus指标在/驱动器/prometheus下,只有在我切换到最新版本的微米-注册表-prometheus之后才显示出来:
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>1.0.0-rc.9</version>
</dependency>https://stackoverflow.com/questions/48700449
复制相似问题