#Pushgateway使用###简介prometheus只能主动向targe抓取数据, pushgateway添加一层网关,能让client端主动推送数据到prometheus 。###使用运行pu
#Pushgateway使用###简介prometheus只能主动向targe抓取数据, pushgateway添加一层网关,能让client端主动推送数据到prometheus 。
###使用运行pushgateway
docker run --rm -p 9091:9091 prom/pushgateway
配置prometheus添加target抓取pushgateway
target: "http://172.17.42.1:9091/metrics"
prometheus重新载入配置:
curl -s -XPOST localhost:9090/-/reload
推送数据到gateway
echo "some_metric 3.14" | curl --data-binary @- http://pushgateway.:9091/metrics/job/some_job
####参考https://pypi.python.org/pypi/prometheushttps://github.com/prometheus/pushgateway/blob/master/README.md