简体   繁体   English

使用 Prometheus 监控 Spring Boot 应用程序

[英]Spring Boot application monitoring with Prometheus

We are working on the Monitoring and Alerting mechanism for Spring boot application hosted on the physical server.我们正在研究托管在物理服务器上的 Spring 启动应用程序的监控和警报机制。 After some research, decided to go with经过一番研究,决定去

Actuators - To monitor application in every aspects执行器 - 在各个方面监控应用程序

Prometheus - Metric store Prometheus - 公制存储

Grafana - For Dashboard visualization and alerting Grafana - 用于仪表板可视化和警报

Everything going well until Prometheus comes in to the picture.一切顺利,直到普罗米修斯出现。 Am facing an issue in feeding the metrics to metric store.在将指标提供给指标存储时遇到问题。

prometheus.yml普罗米修斯.yml

scrape_configs: - job_name: 'spring-actuator' metrics_path: '/actuator/prometheus' scrape_interval: 5s static_configs: - targets: ['localhost:8080']

Prometheus server logs Prometheus 服务器日志

level=info ts=2020-02-05T15:05:20.873Z caller=main.go:762 msg="Completed loading of configuration file" filename=prometheus.yml level=info ts=2020-02-05T15:05:20.873Z caller=main.go:617 msg="Server is ready to receive web requests." level=info ts=2020-02-05T15:05:20.873Z caller=main.go:762 msg="配置文件加载完成" filename=prometheus.yml level=info ts=2020-02-05T15:05:20.873 " Z caller=main.go:617 msg="服务器已准备好接收 Web 请求。

Prometheus Dashboard showing no data to display .普罗米修斯仪表板显示没有要显示的数据

Side Note, Spring Boot Services are up and it returning data when localhost:8080/actuator/prometheus is being hit.旁注,当 localhost:8080/actuator/prometheus 被点击时,Spring Boot 服务已启动并返回数据。 Disabled the sensitivity of Actuator endpoints.禁用执行器端点的灵敏度。

actuator/prometheus endpoint result:执行器/普罗米修斯端点结果:

Spring Boot 千分尺响应

There is too little info to be able to answer this question, but whenever I saw the no data to display it had to do with metrics inconsistency, incorrectly set up gauges or bad queries.信息太少,无法回答这个问题,但每当我看到没有数据显示时,它都与指标不一致、错误设置仪表或错误查询有关。

You need to look for error/potential problems in your actuator/prometheus endpoint, there might be some information about this.您需要在执行器/普罗米修斯端点中查找错误/潜在问题,可能有一些关于此的信息。

I will be glad to help if you submit the endpoint output.如果您提交端点输出,我将很乐意提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用性能监控工具 Spring 启动 - Application Performance Monitoring Tool Spring Boot Spring Boot生产监控 - Spring Boot production monitoring NewRelic 监控 Spring 引导应用程序未正确跟踪端点 - NewRelic monitoring for Spring Boot application not tracking endpoints correctly 如何在 Spring Boot 应用程序中设置用于 azure 监控的变量 instrumentationKey - How to set the variable instrumentationKey for azure monitoring in a spring boot application 您如何配置prometheus.yml文件以在Spring-Boot应用程序中收集Prometheus指标? - How do you configure prometheus.yml file to collect Prometheus metrics in a Spring-Boot application? 将应用程序迁移到Spring Boot 2之后,无法将hystrix指标公开给/ actuator / prometheus - Can't expose hystrix metrics to /actuator/prometheus after migrating application to Spring boot 2 使用 Sidecar/适配器模式在 Kubernestes 中为 Spring Boot 应用程序导出 Prometheus 指标 - Export Prometheus Metrics for Spring Boot Application in Kubernestes using Sidecar/ Adapter Pattern 在 spring 应用程序内启动 prometheus - Start prometheus within spring application 弹簧启动Prometheus,千分尺无法发布数据 - Spring boot Prometheus , micrometer not able to publish data 保护 Spring Boot 2 Actuator Prometheus 端点 - Securing Spring Boot 2 Actuator Prometheus End Points
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM