2026-06-24 20:17:46 -04:00
|
|
|
# Gere par Set-OPS (role serveur_prometheus). Ne pas editer a la main.
|
|
|
|
|
global:
|
|
|
|
|
scrape_interval: {{ serveur_prometheus_intervalle }}
|
|
|
|
|
|
|
|
|
|
scrape_configs:
|
|
|
|
|
- job_name: prometheus
|
|
|
|
|
static_configs:
|
|
|
|
|
- targets: ['localhost:9090']
|
|
|
|
|
|
|
|
|
|
- job_name: node
|
2026-07-04 21:04:40 -04:00
|
|
|
{% if serveur_prometheus_metriques_tls | default(false) %}
|
|
|
|
|
scheme: https
|
|
|
|
|
tls_config:
|
|
|
|
|
ca_file: {{ serveur_prometheus_metriques_ca }}
|
|
|
|
|
{% endif %}
|
2026-06-24 20:17:46 -04:00
|
|
|
static_configs:
|
2026-08-09 14:44:03 -04:00
|
|
|
{# `intersect` rend un ENSEMBLE : son ordre d'iteration n'est pas stable d'un
|
|
|
|
|
processus Python a l'autre. Sans `sort`, ce fichier se rendait differemment a
|
|
|
|
|
chaque passage — memes quatorze cibles, ordre different — et Prometheus etait
|
|
|
|
|
redemarre pour rien. Trouve par le passage d'idempotence du 2026-08-09.
|
|
|
|
|
On trie sur les HOTES : ordre deterministe et lisible par un humain. #}
|
|
|
|
|
- targets: {{ (groups.get(serveur_prometheus_groupe_metriques, []) | intersect(groups.get('hotes_actifs', [])) | sort)
|
2026-06-24 20:17:46 -04:00
|
|
|
| map('extract', hostvars)
|
|
|
|
|
| selectattr('ansible_host', 'defined')
|
|
|
|
|
| map(attribute='ansible_host')
|
|
|
|
|
| map('regex_replace', '$', ':' ~ serveur_prometheus_port_node)
|
|
|
|
|
| list | to_json }}
|
|
|
|
|
{% for job in serveur_prometheus_cibles_supplementaires %}
|
|
|
|
|
|
|
|
|
|
- job_name: {{ job.job }}
|
|
|
|
|
static_configs:
|
|
|
|
|
- targets: {{ job.cibles | to_json }}
|
|
|
|
|
{% endfor %}
|