【问题标题】:Spring Boot application monitoring with Prometheus使用 Prometheus 监控 Spring Boot 应用程序
【发布时间】:2020-05-21 13:57:04
【问题描述】:

我们正在研究托管在物理服务器上的 Spring Boot 应用程序的监控和警报机制。经过一番研究,决定去

Actuators - 全方位监控应用程序

Prometheus - 度量存储

Grafana - 用于仪表板可视化和警报

在普罗米修斯出现之前一切顺利。在将指标提供给指标存储时遇到问题。

prometheus.yml

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

Prometheus 服务器日志

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.873Z caller=main.go:617 msg="服务器已准备好接收网络请求。"

Prometheus 仪表板显示没有要显示的数据

旁注,Spring Boot 服务已启动,并在 localhost:8080/actuator/prometheus 被命中时返回数据。禁用了 Actuator 端点的敏感性。

actuator/prometheus 端点结果:

【问题讨论】:

  • grafana 是否真的在同一台主机上运行?在 docker 中运行不计入 docker 镜像中的 localhost 会将请求保留在实例中。
  • Spring boot 应用、Prometheus、Grafana 都在我的本地机器上运行。这里不涉及码头工人
  • 您可以将整个输出添加到 txt 中吗?第二个问题 - 您实际上是否在仪表板中查询任何 Prometheus 指标?

标签: java spring-boot prometheus health-monitoring prometheus-alertmanager


【解决方案1】:

信息太少,无法回答这个问题,但每当我看到没有可显示的数据时,这与指标不一致、仪表设置错误或查询错误有关。

您需要在执行器/prometheus 端点中查找错误/潜在问题,可能有一些关于此的信息。

如果您提交端点输出,我很乐意提供帮助。

【讨论】:

  • 谢谢,已附加执行器/prometheus 端点。请检查
猜你喜欢
  • 2020-05-06
  • 1970-01-01
  • 2019-10-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多