Ansible role for Prometheus PgBouncer exporter. Currently this works on Debian and RedHat based linux systems (only systemd support). Tested platforms are:
- Ubuntu 16.04
- CentOS 7
Requires Python3 and pip; recommended role for Python3 pip installation: geerlingguy.pip
The variables that can be passed to this role and a brief description about them are as follows. (For all variables, take a look at defaults/main.yml)
pgbouncer_exporter_version: 2.0.1
pgbouncer_exporter_host: 127.0.0.1
pgbouncer_exporter_port: 9127
pgbouncer_exporter_log_level: INFO
# list of environment variables
pgbouncer_exporter_env_variables:
- PGBOUNCER_PASS=passw0rd!
# pgbouncer supports environment variables replacement
# Ie. $(PGBOUNCER_PASS) is replaced with the content of "PGBOUNCER_PASS" environment variable
pgbouncer_exporter_pgbouncers:
- dsn: postgresql://pgbouncer:$(PGBOUNCER_PASS)@127.0.0.1:5432/pgbouncer
connect_timeout: 5
include_databases: []
exclude_databases:
- pgbouncer
None
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: prometheus-pgbouncer-exporter
roles:
- role: geerlingguy.repo-epel
when: ansible_os_family == 'RedHat'
- role: geerlingguy.pip
pip_package: python36-pip
when: ansible_os_family == 'RedHat'
- role: geerlingguy.pip
pip_package: python3-pip
when: ansible_os_family == 'Debian'
- role: mbaran0v.prometheus-pgbouncer-exporter
MIT / BSD
This role was created in 2019 by Maxim Baranov.