prometheus服務發現 + Prometheus 查詢說明 + 正則模糊查詢


0.數據抓取的生命周期

1.通過文件發現

- job_name: node

  file_sd_configs:

  - targets/nodes/*.json

  reflesh_interval: 5m

 

2.添加標簽

cat ./node/node.json
[{"targets":["10.0.0.111:9100"], "labels":{"instance":"node_111"}}, {"targets":["10.0.0.134:9100"], "labels":{"datacenter":"node_134"}} ]

 3.正則模糊查詢

up{myjob=~"node119.*"}

rate(node_network_receive_bytes_total{myjob=~"node119.*",device="eth0"}[1m])

參考:https://www.cnblogs.com/zhoujinyi/p/11951779.html   Prometheus學習系列(六)之Prometheus 查詢說明


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM