57 lines
1.7 KiB
Django/Jinja
57 lines
1.7 KiB
Django/Jinja
# {{ ansible_managed }}
|
|
|
|
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:
|
|
monitor: 'example'
|
|
|
|
# Alertmanager configuration
|
|
# Use prometheus alertmanager installed on the same machine
|
|
alerting:
|
|
alertmanagers:
|
|
- static_configs:
|
|
- targets: ['{{ prometheus_alertmanager }}']
|
|
|
|
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
|
|
rule_files:
|
|
- "alert.rules.yml" # Monitoring alerts, this is the file you may be searching!
|
|
- "django.rules.yml" # Custom rules specific for Django project monitoring
|
|
|
|
# A scrape configuration containing exactly one endpoint to scrape:
|
|
# Here it's Prometheus itself.
|
|
scrape_configs:
|
|
# The .json in file_sd_configs is dynamically reloaded
|
|
|
|
|
|
- job_name: federate
|
|
scrape_interval: 15s
|
|
metrics_path: '/federate'
|
|
honor_labels: true
|
|
file_sd_configs:
|
|
- files:
|
|
- '/etc/prometheus/targets.json'
|
|
relabel_configs:
|
|
# Do not put :9100 in instance name, rather here
|
|
- source_labels: [__address__]
|
|
target_label: __param_target
|
|
- source_labels: [__param_target]
|
|
target_label: federated_instance
|
|
- source_labels: [__param_target]
|
|
target_label: __address__
|
|
replacement: '$1:9090'
|
|
params:
|
|
'match[]':
|
|
- '{job="servers"}'
|
|
- '{job="prometheus"}'
|
|
- '{job="unifi_snmp"}'
|
|
- '{job="django"}'
|
|
- '{job="ups_snmp"}'
|
|
- '{job="django"}'
|
|
- '{job="docker"}'
|
|
- '{job="switch"}'
|
|
|