日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

prometheus 基于文件的目标发现

發(fā)布時間:2025/5/22 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 prometheus 基于文件的目标发现 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

prometheus 基于文件的目標發(fā)現(xiàn)

1、創(chuàng)建目錄

cd /usr/local/prometheus/conf mkdir -pv targets/{nodes,docker}

2、修改prometheus.yml文件

scrape_configs:- job_name: 'prometheus'static_configs:- targets: ['localhost:9090']- job_name: 'node_exporter'file_sd_configs:- files:- targets/nodes/*.jsonrefresh_interval: 1m- job_name: 'docker'file_sd_configs:- files:- targets/docker/*.jsonrefresh_interval: 1m

3、新增targets/nodes/nodes.json文件

[{"targets": ["192.168.31.151:9100","192.168.31.82:9100","192.168.31.144:9100"] }]

4、新增targets/docker/docker.json文件

[{"targets": ["192.168.31.151:8080","192.168.31.144:8080","192.168.31.82:8080"],"labels": {"datacenter":"sh"} }]

5、重載

ps -ef|grep prom |grep -v grep|awk '{print $2}'|xargs kill -HUP

轉載于:https://www.cnblogs.com/shhnwangjian/p/10665697.html

總結

以上是生活随笔為你收集整理的prometheus 基于文件的目标发现的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。