Prometheus+Pushgateway

  1. 安装pushgateway

下载 pushgateway-1.2.0.linux-amd64.tar.gz 解压缩到指定目录
下载地址 https://github.com/prometheus/pushgateway/releases

tar xzvf pushgateway-1.2.0.linux-amd64.tar.gz
mv pushgateway-1.2.0.linux-amd64 /usr/local/pushgateway
  1. 后台运行 pushgateway
nohup ./pushgateway > run.log 2>&1 &
  1. 查看
curl localhost:9091/metrics   #访问 pushgateway-server:9091/metrics可以看到指标
  1. 配置prometheus.yml 后重载prometheus
- job_name: pushgateway
    honor_labels: true
    static_configs:
    - targets: ['192.168.x.xxx:9091']
      labels:
        instance: pushgateway
        service: pushgatewayservice

pushgateway默认端口9091

  1. 查看是否成功连接 Prometheus

可以通过Prometheus Web端查看 http://192.168.x.xxx:9090/targets 中是否有设置的 pushgateway 的metrics。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容