From 2c4142b4a46c03572d4655a40197912d42dad53b Mon Sep 17 00:00:00 2001 From: Ben Banfield-Zanin Date: Fri, 29 May 2026 16:53:47 +0100 Subject: [PATCH] Synapse: add index label to metrics based on the Pod the suffix --- .../templates/synapse/synapse_service_monitor.yaml | 6 +++++- newsfragments/1364.changed.md | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 newsfragments/1364.changed.md diff --git a/charts/matrix-stack/templates/synapse/synapse_service_monitor.yaml b/charts/matrix-stack/templates/synapse/synapse_service_monitor.yaml index e8c0064b..42c594c4 100644 --- a/charts/matrix-stack/templates/synapse/synapse_service_monitor.yaml +++ b/charts/matrix-stack/templates/synapse/synapse_service_monitor.yaml @@ -1,6 +1,6 @@ {{- /* Copyright 2024 New Vector Ltd -Copyright 2025 Element Creations Ltd +Copyright 2025-2026 Element Creations Ltd SPDX-License-Identifier: AGPL-3.0-only */ -}} @@ -24,6 +24,10 @@ spec: - targetLabel: instance action: replace replacement: {{ tpl .ingress.host $ }} + - sourceLabels: [__meta_kubernetes_pod_name] + targetLabel: index + regex: '.*-([0-9]+)' + replacement: '$1' selector: matchLabels: app.kubernetes.io/part-of: matrix-stack diff --git a/newsfragments/1364.changed.md b/newsfragments/1364.changed.md new file mode 100644 index 00000000..fa8a64ba --- /dev/null +++ b/newsfragments/1364.changed.md @@ -0,0 +1 @@ +Synapse: add `index` label to metrics.