diff options
Diffstat (limited to 'roles/monitoring/prometheus/server/templates/prometheus.yml.j2')
-rw-r--r-- | roles/monitoring/prometheus/server/templates/prometheus.yml.j2 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 index aed69de5..e9d83c1d 100644 --- a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 +++ b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 @@ -67,3 +67,30 @@ scrape_configs: {{ prometheus_server_jobs_extra | indent(2) }} {% endif %} +{% for source, config in (prometheus_server_federation | default({})).items() %} + + ## federation: {{ source }} +{% for job in config.jobs %} + + - job_name: 'federate/{{ source }}/{{ job }}' + scrape_interval: 15s + scrape_timeout: 15s + scheme: {{ config.scheme | default('https') }} + metrics_path: {{ config.path_prefix | default('') }}/federate +{% if 'basic_auth' in config %} + basic_auth: + username: '{{ config.basic_auth.username }}' + password_file: '/etc/prometheus/prometheus-federation-{{ source }}.password' +{% endif %} + honor_labels: true + metric_relabel_configs: + - source_labels: [id] + regex: '^static-agent$' + action: drop + params: + match[]: + - '{job="{{ job }}"}' + static_configs: + - targets: ['{{ config.url }}'] +{% endfor %} +{% endfor %} |