Fix prometheus.yml.j2 indentation and worker ids for stream writers

Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/2105
This commit is contained in:
Slavi Pantaleev 2022-09-15 12:46:41 +03:00
parent 800267b182
commit b07fd76830
2 changed files with 6 additions and 6 deletions

View file

@ -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 %}

View file

@ -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'