diff options
author | Christian Pointner <equinox@spreadspace.org> | 2022-12-07 19:16:39 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2022-12-07 19:33:32 +0100 |
commit | f294c367c70d04d3de1c10fa87c2be4ea6cc3012 (patch) | |
tree | e9accdbd8bb877f02543a3425fc394517cac4007 /roles/monitoring/prometheus/server/templates | |
parent | alerta: allow to force alerm severity for heartbeats (diff) |
prometheus/node-exporter: make certificate SANs configurable
promethues/server: add support for federation
Diffstat (limited to 'roles/monitoring/prometheus/server/templates')
-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 %} |