From 7b52e6ad5ed8aece4d86ce0f3063fabeed544294 Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Wed, 30 Jun 2021 20:52:49 +0000 Subject: [PATCH] Add worker metrics to prometheus exporter --- roles/matrix-prometheus/templates/prometheus.yml.j2 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/roles/matrix-prometheus/templates/prometheus.yml.j2 b/roles/matrix-prometheus/templates/prometheus.yml.j2 index b3ee3b86..edfa476b 100644 --- a/roles/matrix-prometheus/templates/prometheus.yml.j2 +++ b/roles/matrix-prometheus/templates/prometheus.yml.j2 @@ -30,7 +30,15 @@ scrape_configs: - job_name: 'synapse' metrics_path: '/_synapse/metrics' static_configs: - - targets: {{ matrix_prometheus_scraper_synapse_targets|to_json }} + - targets: + {% for target in matrix_prometheus_scraper_synapse_targets %} + - {{ target }} + {% endfor %} + {% for worker in matrix_synapse_workers_enabled_list|d([]) %} + {% if worker.metrics_port != 0 %} + - 'matrix-synapse-worker-{{ worker.type }}-{{ worker.instanceId }}:{{ worker.metrics_port }}' + {% endif %} + {% endfor %} {% endif %} {% if matrix_prometheus_scraper_node_enabled %} @@ -43,4 +51,4 @@ scrape_configs: - job_name: postgres static_configs: - targets: {{ matrix_prometheus_scraper_postgres_targets|to_json }} - {% endif %} \ No newline at end of file + {% endif %}