首页 > 其他 > 详细

odyssey prometheus 监控

时间:2020-08-22 18:36:10      阅读:67      评论:0      收藏:0      [点我收藏+]

因为odyssey 兼容pgbouncer,我们可以直接使用pgbouncer的exporter

环境准备

  • docker-compose 文件
version: "3"
services:
  postgres:
    image: postgres:12
    ports:
      - "5432:5432"
    environment:
      - "POSTGRES_PASSWORD=dalong"
  pgbouncer:
    image: brainsam/pgbouncer
    ports:
      - "6543:6543"
    volumes:
      - "./pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini"
      - "./users.txt:/opt/auth/users.txt"
  app:
    image: kksudo/odyssey-docker:1.1
    ports:
      - "6432:6432"
    volumes:
      - "./odyssey-dev.conf:/etc/odyssey/odyssey.conf"
  prom1:
    image: dalongrong/pgbouncer_exporter:v0.4.1
    ports:
    - "9127:9127"
    command: --pgBouncer.connectionString="postgres://postgres:dalong@pgbouncer:6543/pgbouncer?sslmode=disable"
  prom2:
    image: dalongrong/pgbouncer_exporter:v0.4.1
    ports:
    - "9128:9127"
    command: --pgBouncer.connectionString="postgres://postgres:dalong@app:6432/console?sslmode=disable"
  • 效果

技术分享图片

 

 

说明

pgbouncer的exporter 目前新版本的比较少,我基于源码构建提供了一个版本的容器镜像
操作方法

 
git clone https://github.com/prometheus-community/pgbouncer_exporter.git
make build

Dockerfile

FROM debian:stretch-slim
COPY pgbouncer_exporter  /bin/pgbouncer_exporter
ENTRYPOINT [ "/bin/pgbouncer_exporter" ]

参考资料

https://github.com/prometheus-community/pgbouncer_exporter
https://github.com/yandex/odyssey
https://github.com/rongfengliang/postgres-connect-pool-tools-learning

odyssey prometheus 监控

原文:https://www.cnblogs.com/rongfengliang/p/13546419.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!