![](/img/trans.png)
[英]How can I expose metrics of my NodeJS service using opencensus / prometheus library?
[英]Prometheus not expose all collected metrics
我已將 Prometheus 配置為抓取一些來源的指標。
問題是。
在 Prometheus UI 中,我可以看到所有目標,在圖表中我可以查詢所有指標,包括與 nodejs 相關的指標。 但是,如果我確實curl http://localhost:9090/metrics
我只會看到與 prometheus 和 node-exporter 相關的指標。 沒有任何與 nodejs 應用程序或 hazelcast 相關的內容。
對 nodejs 應用程序的直接請求curl http://localhost:8080/metrics
返回所有這些值,沒有任何問題。
什么會導致這樣的問題?
這個 url : localhost:9090/metrics
只是在這里公開 Prometheus 指標。 它是 Prometheus 用來刮擦自身的那個。 它與 Prometheus 抓取的應用程序無關。
此外,您在此處看到的節點相關指標不是由 node_exporter 公開的指標(可能存在一些相似之處)。 如果要查看 node_exporter 指標,則需要轉到localhost:9100/metrics
(如果您沒有更改默認配置)。
現在要查看 Prometheus 抓取的指標,您有以下選項:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.