Cleanup prometheus_federate's prometheus.yml.j2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
jeltz 2021-03-06 00:46:13 +01:00
parent 7d527be1c0
commit 52124d2cad

View file

@ -1,51 +1,35 @@
# {{ ansible_managed }} ---
{{ ansible_managed | comment }}
global: 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: external_labels:
monitor: 'example' monitor: '{{ ansible_fqdn }}'
# Alertmanager configuration
# Use prometheus alertmanager installed on the same machine
alerting: alerting:
alertmanagers: alertmanagers:
- static_configs: - static_configs:
- targets: ['{{ prometheus_alertmanager }}'] - targets: ['{{ prometheus_alertmanager }}']
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files: rule_files:
- "alert.rules.yml" # Monitoring alerts, this is the file you may be searching! - 'alert.rules.yml'
- "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: scrape_configs:
# The .json in file_sd_configs is dynamically reloaded
- job_name: federate - job_name: federate
scrape_interval: 15s scrape_interval: 30s
metrics_path: '/federate' metrics_path: '/federate'
honor_labels: true honor_labels: true
honor_timestamps: true
file_sd_configs: file_sd_configs:
- files: - files:
- '/etc/prometheus/targets.json' - '/etc/prometheus/targets.json'
relabel_configs: relabel_configs:
# Do not put :9100 in instance name, rather here
- source_labels: [__address__] - source_labels: [__address__]
target_label: __param_target target_label: __param_target
- source_labels: [__param_target]
target_label: federated_instance
- source_labels: [__param_target] - source_labels: [__param_target]
target_label: __address__ target_label: __address__
replacement: '$1:9090' replacement: '$1:9090'
params: params:
'match[]': match[]:
- '{job="servers"}' - '{job="servers"}'
- '{job="prometheus"}' - '{job="prometheus"}'
- '{job="unifi_snmp"}' - '{job="unifi_snmp"}'
@ -54,4 +38,4 @@ scrape_configs:
- '{job="django"}' - '{job="django"}'
- '{job="docker"}' - '{job="docker"}'
- '{job="switch"}' - '{job="switch"}'
...