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

105 lines
2.9 KiB
Plaintext
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:
2019-11-01 14:16:32 +01:00
- "alert.rules.yml" # Monitoring alerts, this is the file you may be searching!
- "django.rules.yml" # Custom rules specific for Django project monitoring
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'
2021-04-01 05:21:08 +02:00
...