【问题标题】:Prometheus not expose all collected metricsPrometheus 不会公开所有收集的指标
【发布时间】:2021-06-22 09:32:46
【问题描述】:

我已将 Prometheus 配置为抓取一些来源的指标。

  • 导师
  • 节点导出器
  • 普罗米修斯
  • 2 个 nodejs 应用程序。
  • hazelcast 服务器

问题是。

在 Prometheus UI 中我可以看到所有目标,在图表中我可以查询所有指标,包括与 nodejs 相关的。 但如果我这样做 curl http://localhost:9090/metrics 我只会看到与 prometheus 和 node-exporter 相关的指标。与 nodejs 应用程序或 hazelcast 无关。

直接请求 nodejs 应用程序curl http://localhost:8080/metrics 毫无问题地返回所有这些值。

什么会导致这样的问题?

【问题讨论】:

    标签: node.js prometheus metrics


    【解决方案1】:

    此网址:localhost:9090/metrics 仅用于公开 Prometheus 指标。它是普罗米修斯用来刮自己的。与普罗米修斯抓取的应用无关。

    此外,您在此处看到的与节点相关的指标并不是由 node_exporter 公开的指标(可能有一些相似之处)。如果您想查看 node_exporter 指标,您需要转到localhost:9100/metrics(如果您没有更改默认配置)。

    现在要查看 Prometheus 抓取的指标,您有以下选择:

    1. 使用 Prometheus 查询浏览器
    2. 使用其他工具(例如 Grafana)
    3. 使用 Prometheus API。 Documentation here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-06-20
      • 1970-01-01
      • 1970-01-01
      • 2022-08-11
      • 1970-01-01
      • 1970-01-01
      • 2020-10-02
      相关资源
      最近更新 更多