eole-prometheus/tmpl/prometheus.yml

63 lines
1.5 KiB
YAML

# my global config
global:
scrape_interval: %%prometheusScrapeInterval
evaluation_interval: %%prometheusEvaluationInterval
scrape_timeout: %%prometheusScrapeTimeout
rule_files:
- "/etc/prometheus/rules.d/*.yml"
scrape_configs:
- job_name: %%prometheusJobName
honor_labels: true
static_configs:
- targets: ['%%nom_domaine_machine:9090'%slurp
%if %%getVar('activerSndNodeExpoter','non') == 'oui'
, '%%nom_domaine_machine:9100'%slurp
%end if
]
- job_name: '%%job_name_node'
file_sd_configs:
- files: [ "%%job_file_config/*.yml" ]
%if %%getVar('addTargetPrometheus','non') == 'oui'
static_configs:
- targets: [ "%%adresse_ip_eth0:9100"%slurp
%for %%cliPr in %%getVar('prTarg',[])
%if %%cliPr.prTargSonde == 'Node Exporter'
, '%%cliPr.prTargIP:9100'%slurp
%end if
%end for
]
%end if
%for %%job in %%getVar('promJobs', [])
- job_name: '%%job'
%if %%job.honorLabels == 'oui'
honor_labels: true
%else
honor_labels: false
%end if
scrape_interval: %%{job.scrpInterval}s
scrape_timeout: %%{job.scrpTimeout}s
scheme: %%job.scrpScheme
%for %%target in %%getVar('prOpenTarg',[])
static_configs:
%if %%target.prOpenTargJob == %%job
- targets: [ "%%target.prOpenTargIP:%%target.prOpenTargPort" ]
%end if
%end for
%end for
%if %%getVar('activerAlertmanager','non') == 'oui'
alerting:
alertmanagers:
- scheme: http
static_configs:
- targets:
- "%%nom_domaine_machine:9093"
%end if