Cleanup prometheus_federate's prometheus.yml.j2
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

pull/28/head
jeltz 3 years ago
parent 7d527be1c0
commit 52124d2cad

@ -1,51 +1,35 @@
# {{ ansible_managed }}
---
{{ ansible_managed | comment }}
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'
monitor: '{{ ansible_fqdn }}'
# Alertmanager configuration
# Use prometheus alertmanager installed on the same machine
alerting:
alertmanagers:
- static_configs:
- targets: ['{{ prometheus_alertmanager }}']
- 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
- 'alert.rules.yml'
# 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
scrape_interval: 30s
metrics_path: '/federate'
honor_labels: true
honor_timestamps: 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[]':
match[]:
- '{job="servers"}'
- '{job="prometheus"}'
- '{job="unifi_snmp"}'
@ -54,4 +38,4 @@ scrape_configs:
- '{job="django"}'
- '{job="docker"}'
- '{job="switch"}'
...

Loading…
Cancel
Save