下载
https://github.com/prometheus/pushgateway/releases
curl https://github.com/prometheus/pushgateway/releases/download/v1.2.0/pushgateway-1.2.0.linux-amd64.tar.gz
启动Pushgateway
nohup ./pushgateway > run.log 2>&1 &
查看是否启动成功
curl "http://localhost:9091/metrics"
把Pushgateway信息添加到Prometheus配置文件prometheus.yml中
- job_name: pushgateway honor_labels: true static_configs: - targets: ['localhost:9091'] labels: instance: pushgateway service: pushgatewayservicet
推送数据
echo "mytest_metric 2022" | curl --data-binary @- http://localhost:9091/metrics/job/mytest_job
curl "http://localhost:9091/metrics"|grep mytest_metric
标签:http,9091,metrics,pushgateway,下载安装,curl,localhost From: https://www.cnblogs.com/boye169/p/17040657.html