eole-prometheus/tmpl/prometheus.yml

72 lines
1.7 KiB
YAML
Raw Permalink Normal View History

2018-04-16 12:54:20 +02:00
# my global config
global:
scrape_interval: %%prometheusScrapeInterval
evaluation_interval: %%prometheusEvaluationInterval
scrape_timeout: %%prometheusScrapeTimeout
rule_files:
2018-06-11 09:04:58 +02:00
- "/etc/prometheus/rules.d/*.yml"
2018-04-16 12:54:20 +02:00
scrape_configs:
2018-06-04 11:16:18 +02:00
- job_name: %%prometheusJobName
honor_labels: true
2018-04-16 12:54:20 +02:00
static_configs:
2018-06-04 11:16:18 +02:00
- targets: ['%%nom_domaine_machine:9090'%slurp
%if %%getVar('activerSndNodeExpoter','non') == 'oui'
2018-06-04 11:16:18 +02:00
, '%%nom_domaine_machine:9100'%slurp
%end if
2018-06-04 11:16:18 +02:00
]
- job_name: '%%job_name_node'
file_sd_configs:
# - files: [ "%%job_file_config/*.yml" ]
%if %%getVar('addTargetPrometheus','non') == 'oui'
static_configs:
2018-06-05 14:27:32 +02:00
- targets: [ "%%adresse_ip_eth0:9100"%slurp
%for %%cliPr in %%getVar('prTarg',[])
%if %%cliPr.prTargSonde == 'Node Exporter'
, '%%cliPr.prTargIP:9100'%slurp
2018-06-04 11:16:18 +02:00
%end if
%end for
]
%end if
2018-06-05 16:46:23 +02:00
%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
metrics_path: %%job.scrpMetricPath
2018-06-11 15:42:36 +02:00
%set first = True
static_configs:
2018-06-11 15:42:36 +02:00
- targets: [ %slurp
%for %%target in %%getVar('prOpenTarg',[])
%if %%target.prOpenTargJob == %%job
2018-06-11 15:42:36 +02:00
%if %%first
"%%target.prOpenTargIP:%%target.prOpenTargPort"%slurp
%set first = False
%else
, "%%target.prOpenTargIP:%%target.prOpenTargPort"%slurp
%end if
%end if
%end for
2018-06-11 15:42:36 +02:00
]
%end for
2018-06-06 09:05:55 +02:00
%if %%getVar('activerAlertmanager','non') == 'oui'
alerting:
alertmanagers:
- scheme: http
static_configs:
- targets:
- "%%nom_domaine_machine:9093"
%end if