0.pushgateway的安装和配置
tar -zxf pushgateway-1.2.0.linux-amd64.tar.gz
./pushgateway &
在Prometheus添加配置
- job_name: ‘node_111‘ static_configs: - targets: [‘10.0.0.111:9100‘]labels:instance: 111_9100- targets: [‘10.0.0.134:9100‘]labels:instance: 134_9100 - job_name: ‘pushgateway_test‘ #这个名称可以自定义,后面会用到 static_configs: - targets: [‘10.0.0.111:9091‘] #这里是pushgateway的地址
1.pushgateway发送数据的API格式
http://pustgatewayIP/metrices/job/job名/标签名/标签值 echo "metricname 120" | curl --data-binary @- http://10.0.0.111:9091/metrics/job/myjobname/labels/mylabelname
prometheus pushgateway-简单-脚本-自定义
原文:https://www.cnblogs.com/hixiaowei/p/13688036.html