【问题标题】:Grafana not showing metrics shown by springboot prometheus endpointGrafana 未显示 springboot prometheus 端点显示的指标
【发布时间】:2020-07-02 16:33:18
【问题描述】:

我已经为我的 Spring Boot 应用程序配置了 micrometer 和 prometheus,我可以在端点 /actuator/prometheus 看到以下指标(使用 Timer 生成):

# HELP timer_test_seconds Time spent serving test requests
# TYPE timer_test_seconds summary
timer_test_seconds_count{class="com.test.MyController",exception="none",method="testTimer",} 2.0
timer_test_seconds_sum{class="com.test.MyController",exception="none",method="testTimer",} 8.6461705
# HELP timer_test_seconds_max Time spent serving test requests
# TYPE timer_test_seconds_max gauge
timer_test_seconds_max{class="com.test.MyController",exception="none",method="testTimer",} 4.5578234

但是当我在 Grafana 中运行此查询之一(针对 prometheus 实例配置)时,我看不到任何结果。

这需要任何配置吗?

【问题讨论】:

    标签: spring-boot prometheus grafana


    【解决方案1】:

    这些是您的服务公开的指标。 Grafana 不会直接与您的服务交互。

    1. Prometheus 是否已启动并抓取此目标?你可以在 localhost:port/graph 中检查 Prometheus 是否有任何数据。
    2. Grafana 是否正确指向您的 Prometheus 端点?

    很可能,Prometheus 没有正确抓取您的目标。请记住,Grafana 根本不知道您的服务,因此您应该首先检查 Prometheus 中是否有任何数据。

    【讨论】:

      猜你喜欢
      • 2018-05-02
      • 1970-01-01
      • 2021-07-04
      • 1970-01-01
      • 1970-01-01
      • 2022-01-27
      • 1970-01-01
      • 2021-11-12
      • 2019-07-14
      相关资源
      最近更新 更多