ansible/roles/prometheus/templates/prometheus.yml.j2

162 lines
4.5 KiB
Text
Raw Normal View History

2021-04-01 05:21:08 +02:00
---
{{ ansible_managed | comment }}
2019-05-05 14:07:04 +02:00
global:
# scrape_interval is set to the global default (60s)
# evaluation_interval is set to the global default (60s)
# scrape_timeout is set to the global default (10s).
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
federated_instance: '{{ inventory_hostname }}'
2019-05-05 14:07:04 +02:00
# Alertmanager configuration
2019-11-01 14:16:32 +01:00
# Use prometheus alertmanager installed on the same machine
2019-05-05 14:07:04 +02:00
alerting:
alertmanagers:
- static_configs:
2019-11-01 15:38:35 +01:00
- targets: ['{{ prometheus_alertmanager }}']
2019-05-05 14:07:04 +02:00
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
2021-04-11 15:58:35 +02:00
- "alerts/*.yml" # Monitoring alerts, this is the file you may be searching!
2019-05-05 14:07:04 +02:00
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
2019-11-01 14:16:32 +01:00
# The .json in file_sd_configs is dynamically reloaded
- job_name: prometheus
static_configs:
- targets:
- localhost:9090
- job_name: servers
2019-05-05 14:07:04 +02:00
file_sd_configs:
- files:
- '/etc/prometheus/targets.json'
2019-11-01 14:16:32 +01:00
relabel_configs:
# Do not put :9100 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:9100'
- job_name: unifi_snmp
file_sd_configs:
- files:
- '/etc/prometheus/targets_unifi_snmp.json'
metrics_path: /snmp
params:
module: [ubiquiti_unifi]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9116
- job_name: django
scheme: https
static_configs:
- targets: []
- job_name: ups_snmp
file_sd_configs:
- files:
- '/etc/prometheus/targets_ups_snmp.json'
metrics_path: /snmp
params:
module: [eatonups]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9116
2021-03-06 01:57:32 +01:00
- job_name: switch_snmp
file_sd_configs:
- files:
- "/etc/prometheus/targets_switch_snmp.json"
metrics_path: /snmp
params:
module: [procurve_switch]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9116
2021-02-10 19:06:28 +01:00
- job_name: docker
file_sd_configs:
- files:
- '/etc/prometheus/targets_docker.json'
relabel_configs:
# Do not put :8087 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:8087'
- 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'
2021-08-20 16:58:28 +02:00
- job_name: apc_pdu_snmp
file_sd_configs:
- files:
- '/etc/prometheus/targets_apc_pdu_snmp.json'
metrics_path: /snmp
params:
module:
- apc_pdu
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9116
2021-09-08 12:06:56 +02:00
- job_name: ipmi
file_sd_configs:
- files:
- '/etc/prometheus/targets_ipmi.json'
metrics_path: /metrics
params:
module: [default]
relabel_configs:
# Do not put :9290 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:9290'
2021-04-01 05:21:08 +02:00
...