在春季启动2(版本2.0.0.M7)中不能包含Prometheus指标 [英] Cannot include Prometheus metrics in spring boot 2 (version 2.0.0.M7)

查看:194
本文介绍了在春季启动2(版本2.0.0.M7)中不能包含Prometheus指标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不能在春季启动2(版本2.0.0.M7)项目中包含Prometheus指标.

Cannot include Prometheus metrics in spring boot 2 (version 2.0.0.M7) project.

根据千分尺文档添加了 spring-boot-starter-致动器依赖项,并在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" }

According micrometer docs added spring-boot-starter-actuator dependency and in application.yaml added management.endpoints.web.expose: prometheus but when calling /actuator/prometheus get
{ "timestamp": 1518159066052, "path": "/actuator/prometheus", "message": "Response status 404 with reason \"No matching handler\"", "status": 404, "error": "Not Found" }

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

Tell me please why I wasn't getting prometheus metrics?

推荐答案

您是否已将micrometer-registry-prometheus添加到您的亲戚中?

Did you add micrometer-registry-prometheus to your dependecies?

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

Micrometer has a pluggable architecture where you need to define (by plugging dependencies) what monitoring system you'd like to work with. (You can even add multiple, not just one.)

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

Btw, you should be switching to Spring Boot 2.0.0.RC1. That's the current one as of this writing.

这篇关于在春季启动2(版本2.0.0.M7)中不能包含Prometheus指标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆