From 2aa457efcc0a973d062d8240760e7095226199b4 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 2 Jul 2021 15:41:36 +0000 Subject: [PATCH] Use a prom variable and not a synapse role variable --- group_vars/matrix_servers | 1 + roles/matrix-prometheus/defaults/main.yml | 1 + roles/matrix-prometheus/templates/prometheus.yml.j2 | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 96b933f35..f52b4f104 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -1768,6 +1768,7 @@ matrix_prometheus_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_en matrix_prometheus_scraper_synapse_enabled: "{{ matrix_synapse_enabled and matrix_synapse_metrics_enabled }}" matrix_prometheus_scraper_synapse_targets: ['matrix-synapse:{{ matrix_synapse_metrics_port }}'] +matrix_prometheus_scraper_synapse_workers_enabled_list: "{{ matrix_synapse_workers_enabled_list }}" matrix_prometheus_scraper_synapse_rules_synapse_tag: "{{ matrix_synapse_docker_image_tag }}" matrix_prometheus_scraper_node_enabled: "{{ matrix_prometheus_node_exporter_enabled }}" diff --git a/roles/matrix-prometheus/defaults/main.yml b/roles/matrix-prometheus/defaults/main.yml index 3cd2599bb..79282f910 100644 --- a/roles/matrix-prometheus/defaults/main.yml +++ b/roles/matrix-prometheus/defaults/main.yml @@ -34,6 +34,7 @@ matrix_prometheus_scraper_synapse_rules_synapse_tag: "master" matrix_prometheus_scraper_synapse_rules_download_url: "https://raw.githubusercontent.com/matrix-org/synapse/{{ matrix_prometheus_scraper_synapse_rules_synapse_tag }}/contrib/prometheus/synapse-v2.rules" matrix_prometheus_scraper_synapse_targets: [] +matrix_prometheus_scraper_synapse_workers_enabled_list: [] # Tells whether the "node" scraper configuration is enabled. # This configuration aims to scrape the current node (this server). diff --git a/roles/matrix-prometheus/templates/prometheus.yml.j2 b/roles/matrix-prometheus/templates/prometheus.yml.j2 index 21a31ce17..869b2da8d 100644 --- a/roles/matrix-prometheus/templates/prometheus.yml.j2 +++ b/roles/matrix-prometheus/templates/prometheus.yml.j2 @@ -35,7 +35,7 @@ scrape_configs: instance: {{ matrix_domain }} job: master index: 0 - {% for worker in matrix_synapse_workers_enabled_list|d([]) %} + {% for worker in matrix_prometheus_scraper_synapse_workers_enabled_list %} {% if worker.metrics_port != 0 %} - targets: ['matrix-synapse-worker-{{ worker.type }}-{{ worker.instanceId }}:{{ worker.metrics_port }}'] labels: