Installation Prometheus-postgres-exporter #53

Merged
pz2891 merged 29 commits from prometheus_postgres_exporter into master 2021-04-14 20:19:59 +02:00
4 changed files with 28 additions and 1 deletions
Showing only changes of commit dd48302585 - Show all commits

View file

@ -99,6 +99,9 @@
prometheus_targets: prometheus_targets:
- targets: | - targets: |
{{ groups['aurore_pve'] + groups['aurore_vm'] | list | sort }} {{ groups['aurore_pve'] + groups['aurore_vm'] | list | sort }}
prometheus_postgres_targets:
- targets:
- bdd.adm.auro.re
prometheus_switch_snmp_targets: prometheus_switch_snmp_targets:
- targets: - targets:
- yggdrasil.switch.auro.re - yggdrasil.switch.auro.re
@ -128,6 +131,9 @@
prometheus_targets: prometheus_targets:
- targets: | - targets: |
{{ groups['ovh_pve'] + groups['ovh_vm'] | list | sort }} {{ groups['ovh_pve'] + groups['ovh_vm'] | list | sort }}
prometheus_postgres_targets:
- targets:
- bdd-ovh.adm.auro.re
prometheus_docker_targets: prometheus_docker_targets:
- docker-ovh.adm.auro.re:8087 - docker-ovh.adm.auro.re:8087
roles: roles:

View file

@ -75,6 +75,13 @@
mode: 0644 mode: 0644
when: prometheus_docker_targets is defined when: prometheus_docker_targets is defined
- name: Configure Prometheus postgres monitoring
copy:
content: "{{ prometheus_postgres_targets | to_nice_json }}\n"
dest: /etc/prometheus/targets_postgres.json
mode: 0644
when: prometheus_postgres_targets is defined
- name: Activate prometheus service - name: Activate prometheus service
systemd: systemd:
name: prometheus name: prometheus
@ -88,4 +95,3 @@
- key: 05-prometheus - key: 05-prometheus
message: >- message: >-
Prometheus est déployé sur cette machine (voir /etc/prometheus) Prometheus est déployé sur cette machine (voir /etc/prometheus)
...
pz2891 marked this conversation as resolved Outdated

Pourquoi avoir retirer ça ?
C'est la fin correct pour un fichier yaml.

Pourquoi avoir retirer ça ? C'est la fin correct pour un fichier yaml.

View file

@ -101,4 +101,18 @@ scrape_configs:
file_sd_configs: file_sd_configs:
- files: - files:
- '/etc/prometheus/targets_docker.json' - '/etc/prometheus/targets_docker.json'
- job_name: postgresql
file_sd_configs:
- files:
- '/etc/prometheus/targets_postgres.json'
relabel_configs:
# Do not put :9187 in instance name, rather here
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- source_labels: [__param_target]
target_label: __address__
replacement: '$1:9187'
... ...

View file

@ -31,6 +31,7 @@ scrape_configs:
params: params:
match[]: match[]:
- '{job="servers"}' - '{job="servers"}'
- '{job="postgresql"}'
- '{job="prometheus"}' - '{job="prometheus"}'
- '{job="unifi_snmp"}' - '{job="unifi_snmp"}'
- '{job="django"}' - '{job="django"}'