简体   繁体   English

Prometheus 不会公开所有收集的指标

[英]Prometheus not expose all collected metrics

I have configured Prometheus to scrape metrics for a few sources.我已将 Prometheus 配置为抓取一些来源的指标。

  • cadvisor管理员
  • node-exporter节点导出器
  • prometheus普罗米修斯
  • 2 nodejs applications. 2 nodejs 应用程序。
  • hazelcast servers榛播服务器

The problem is.问题是。

In Prometheus UI I can see all targets and in graph I can query all metrics include nodejs related.在 Prometheus UI 中,我可以看到所有目标,在图表中我可以查询所有指标,包括与 nodejs 相关的指标。 But if I do curl http://localhost:9090/metrics I see only metrics related to prometheus and node-exporter.但是,如果我确实curl http://localhost:9090/metrics我只会看到与 prometheus 和 node-exporter 相关的指标。 There is nothing related to nodejs applications or hazelcast.没有任何与 nodejs 应用程序或 hazelcast 相关的内容。

Direct request to nodejs applications curl http://localhost:8080/metrics return all of those values without any problems.对 nodejs 应用程序的直接请求curl http://localhost:8080/metrics返回所有这些值,没有任何问题。

What could cause such a problem?什么会导致这样的问题?

This url : localhost:9090/metrics is only here to expose the Prometheus metrics.这个 url : localhost:9090/metrics只是在这里公开 Prometheus 指标。 It is the one used by Prometheus to scrape itself.它是 Prometheus 用来刮擦自身的那个。 It has nothing to do with the application scraped by Prometheus.它与 Prometheus 抓取的应用程序无关。

Also, node related metrics that you see here, are not the one exposed by the node_exporter (there can be some similarities).此外,您在此处看到的节点相关指标不是由 node_exporter 公开的指标(可能存在一些相似之处)。 If you want to see the node_exporter metrics, you need to go to localhost:9100/metrics (if you didn't change the default configuration).如果要查看 node_exporter 指标,则需要转到localhost:9100/metrics (如果您没有更改默认配置)。

Now to see the metrics scraped by Prometheus, you have the following options :现在要查看 Prometheus 抓取的指标,您有以下选项:

  1. Use the Prometheus query explorer使用 Prometheus 查询浏览器
  2. Use another tool (Grafana for example)使用其他工具(例如 Grafana)
  3. Use the Prometheus API.使用普罗米修斯 API。 Documentation here 文档在这里

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

相关问题 如何使用opencensus / prometheus库公开NodeJS服务的指标? - How can I expose metrics of my NodeJS service using opencensus / prometheus library? 无法在Prometheus中推送指标 - Unable to push metrics in prometheus 未生成 Prometheus 指标 - Prometheus metrics not generated 如何使用路径参数为 url 提取 prometheus 指标 - How to extract prometheus metrics for urls with path params prometheus 无法从本地主机访问指标 - prometheus is not able to access metrics from localhost Prometheus 指标不适用于自定义 node.js 应用程序 - Prometheus metrics dont work on self defined node.js application 阅读 kafka 主题并通过 Rest API 公开数据,以便普罗米修斯刮(Nodejs) - Read a kafka topic and expose the data via Rest API for prometheus to scrape ( Nodejs) 如何通过Node中的index.js公开所有模块类 - How to expose all module classes through index.js in Node dotenv-webpack是否将所有环境变量从.env公开到前端? - Does dotenv-webpack expose all environment variables from .env to front end? Node.js:意外省略的var声明是否通过全局对象,错误或功能公开了所有变量? - Node.js: accidentally omitted var declaration expose all variables via global object, bug or feature?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM