温馨提示:本文翻译自stackoverflow.com,查看原文请点击:其他 - Cannot include Prometheus metrics in spring boot 2 (version 2.0.0.M7)
metrics prometheus spring-boot

其他 - 在 Spring 启动2(版本2.0.0.M7)中不能包含Prometheus指标

发布于 2020-04-17 14:53:23

无法在Spring Boot 2(版本2.0.0.M7)项目中包含Prometheus指标。

微米文档添加弹簧引导起动器的依赖,并在application.yaml加入management.endpoints.web.expose:普罗米修斯,但是打电话时/执行器/普罗米修斯 GET
{ "timestamp": 1518159066052, "path": "/actuator/prometheus", "message": "Response status 404 with reason \"No matching handler\"", "status": 404, "error": "Not Found" }

请告诉我为什么我没有获得普罗米修斯指标?

查看更多

提问者
makson
被浏览
55
mweirauch 2018-02-09 20:48

你增加micrometer-registry-prometheus了你的依赖吗?

千分尺具有可插拔的体系结构,您需要在其中定义(通过插入依赖项)您要使用的监视系统。(您甚至可以添加多个,而不仅仅是一个。)

顺便说一句,您应该切换到Spring Boot 2.0.0.RC1这是撰写本文时的最新内容。