From b07fd768300ff39054d8204024d3ad01dce36e9c Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 15 Sep 2022 12:46:41 +0300 Subject: [PATCH] Fix prometheus.yml.j2 indentation and worker ids for stream writers Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/2105 --- roles/matrix-prometheus/templates/prometheus.yml.j2 | 10 +++++----- roles/matrix-synapse/tasks/synapse/workers/init.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/matrix-prometheus/templates/prometheus.yml.j2 b/roles/matrix-prometheus/templates/prometheus.yml.j2 index 628f4f4f..83ae8a9a 100644 --- a/roles/matrix-prometheus/templates/prometheus.yml.j2 +++ b/roles/matrix-prometheus/templates/prometheus.yml.j2 @@ -32,17 +32,17 @@ scrape_configs: static_configs: - targets: {{ matrix_prometheus_scraper_synapse_targets|to_json }} labels: - instance: {{ matrix_domain }} + instance: {{ matrix_domain | to_json }} job: master index: 0 {% for worker in matrix_prometheus_scraper_synapse_workers_enabled_list %} {% if worker.metrics_port != 0 %} - targets: ['{{ worker.name }}:{{ worker.metrics_port }}'] labels: - instance: {{ matrix_domain }} - worker_id: {{ worker.id }} - job: {{ worker.type }} - app: {{ worker.app }} + instance: {{ matrix_domain | to_json }} + worker_id: {{ worker.id | to_json }} + job: {{ worker.type | to_json }} + app: {{ worker.app | to_json }} {% endif %} {% endfor %} {% endif %} diff --git a/roles/matrix-synapse/tasks/synapse/workers/init.yml b/roles/matrix-synapse/tasks/synapse/workers/init.yml index 0c2b8a79..43e44b63 100644 --- a/roles/matrix-synapse/tasks/synapse/workers/init.yml +++ b/roles/matrix-synapse/tasks/synapse/workers/init.yml @@ -20,7 +20,7 @@ - name: Build stream writer workers ansible.builtin.set_fact: worker: - id: "stream-writer-{{ item }}-{{ item.stream }}" + id: "stream-writer-{{ idx }}-{{ item.stream }}" # Names must not include understores. Certain stream writer streams (to_device, account_data, ..) do, so we fix them up. name: "matrix-synapse-worker-stream-writer-{{ idx }}-{{ item.stream | replace('_', '-') }}" type: 'stream_writer'