【问题标题】:Grafana couldn't get metrics from python prometheus (‘no metrics found’)Grafana 无法从 python prometheus 获取指标(“未找到指标”)
【发布时间】:2021-08-04 15:04:02
【问题描述】:

我有一个运行 Prometheus 服务器的 python 程序,我正在尝试从 grafana 获取它的指标。 成功添加 Prometheus 数据源并将其设置为默认值后,当我进入探索页面时,我在指标下拉列表中收到“未找到指标”消息。 从 grafana 容器:

  • 我可以 curl Prometheus 服务并获取正确的指标列表
  • 根据对其他主题的推荐,我确定日期是 UTC 格式

我尝试通过 chrome 网络选项卡对其进行调试,我可以通过预览看到它确实在 4 条消息中收到了正确的指标列表:规则、标签、值和元数据

【问题讨论】:

    标签: prometheus grafana


    【解决方案1】:

    你的问题会从展示你的作品中受益;即包括curl 命令和响应;解释你是如何运行服务|容器等的。

    你说的是“容器”。

    Grafana 容器可能无法访问 Python 代码的 host:port。如果 Prometheus 服务器绑定到主机端口,Grafana 容器将无法访问它除非 Grafana 容器要么运行--net=host 您可以为容器提供可解析的(非localhost)主机名。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-04
      • 1970-01-01
      • 1970-01-01
      • 2018-12-24
      • 1970-01-01
      • 1970-01-01
      • 2019-08-28
      • 2020-06-25
      相关资源
      最近更新 更多