Add configuration for Postgres Prom exporter

This commit is contained in:
Joshua Boniface 2023-12-10 02:53:11 -05:00
parent 258b5792da
commit c7d914696b
3 changed files with 21 additions and 0 deletions

View File

@ -21,6 +21,11 @@
state: restarted
ignore_errors: yes
- name: restart prometheus-postgres
service:
name: prometheus-postgres-exporter
state: restarted
- name: restart keydb
service:
name: keydb-server

View File

@ -46,6 +46,17 @@
until: apt_res is success
when: enable_prometheus_exporters is defined and enable_prometheus_exporters
- name: install Prometheus postgresql exporter config if enabled
template:
src: patroni/prometheus.env.j2
dest: /etc/default/prometheus-postgres-exporter
owner: prometheus
group: prometheus
mode: 0640
notify:
- restart prometheus-postgres
when: enable_prometheus_exporters is defined and enable_prometheus_exporters
- name: stop and disable postgresql
service:
name: "{{ item }}"

View File

@ -0,0 +1,5 @@
# Prometheus Postgres exporter configuration
# {{ ansible_managed }}
DATA_SURCE_NAME="host=/run/postgresql dbname=postgres"
ARGS=""