Spring Boot 指标在普罗米修斯中不可用

问题描述 投票:0回答:0

我想用 Prometheus 配置 Spring actuator。 Prometheus 部署在 Docker 容器中。我遵循了以下步骤: added dependencies in Spring Boot

enable all actuators (我可以在 localhost:8080/actuator/prometheus 看到 prometheus)

prometheus.yaml located at /etc/prometheus

我已经启动了 Spring boot 应用程序,监听 8080 端口。

我已经使用以下命令启动了 docker 容器:

sudo docker run -p 9090:9090 -v /etc/prometheus/ prom/prometheus --config.file=/etc/prometheus/prometheus.yml 
在 localhost:9090 我可以看到 prometheus UI,但 prometheus 不显示 Springboot 指标... Prometheus 没有将我的应用程序显示为目标: enter image description here 这是我的第一个问题,抱歉。 谁能帮帮我?

我尝试了很多教程,但没有任何帮助。 我希望理解并解决问题。

spring-boot docker prometheus spring-boot-actuator
© www.soinside.com 2019 - 2024. All rights reserved.