From 2d123afcd076d3a90579f7054bf520c95f1dc090 Mon Sep 17 00:00:00 2001 From: Finn Date: Wed, 10 Jul 2024 15:34:51 -0700 Subject: [PATCH] add prom scrape annotations to matrix pods --- k8s/matrix/bridge-meta.yaml | 1 - k8s/matrix/bridge-signal.yaml | 7 +++---- k8s/matrix/bridge-telegram.yaml | 3 +++ k8s/matrix/config-janky.bot/homeserver.yaml | 5 +++++ k8s/matrix/janky.bot-homeserver.yaml | 4 ++++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/k8s/matrix/bridge-meta.yaml b/k8s/matrix/bridge-meta.yaml index 4acb3da..9328b78 100644 --- a/k8s/matrix/bridge-meta.yaml +++ b/k8s/matrix/bridge-meta.yaml @@ -410,7 +410,6 @@ data: m.audio: "{{ .Sender.Displayname }} sent an audio file" m.video: "{{ .Sender.Displayname }} sent a video" m.location: "{{ .Sender.Displayname }} sent a location" - # Logging config. See https://github.com/tulir/zeroconfig for details. logging: min_level: info diff --git a/k8s/matrix/bridge-signal.yaml b/k8s/matrix/bridge-signal.yaml index b7379f0..476198d 100644 --- a/k8s/matrix/bridge-signal.yaml +++ b/k8s/matrix/bridge-signal.yaml @@ -2,7 +2,6 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: bridge-signal - namespace: matrix spec: rules: - host: bridge-signal.matrix.k8s @@ -20,7 +19,6 @@ apiVersion: v1 kind: Service metadata: name: bridge-signal - namespace: matrix spec: publishNotReadyAddresses: true ports: @@ -33,7 +31,6 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: bridge-signal - namespace: matrix spec: selector: matchLabels: @@ -44,6 +41,9 @@ spec: metadata: labels: app: bridge-signal + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "8000" spec: initContainers: - name: template-config @@ -91,7 +91,6 @@ apiVersion: v1 kind: ConfigMap metadata: name: bridge-signal - namespace: matrix data: config.yaml: | # Homeserver details. diff --git a/k8s/matrix/bridge-telegram.yaml b/k8s/matrix/bridge-telegram.yaml index debf1e3..51a3090 100644 --- a/k8s/matrix/bridge-telegram.yaml +++ b/k8s/matrix/bridge-telegram.yaml @@ -62,6 +62,9 @@ spec: metadata: labels: app: bridge-telegram + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "8000" spec: initContainers: - name: template-config diff --git a/k8s/matrix/config-janky.bot/homeserver.yaml b/k8s/matrix/config-janky.bot/homeserver.yaml index c4ffb75..4bae07d 100644 --- a/k8s/matrix/config-janky.bot/homeserver.yaml +++ b/k8s/matrix/config-janky.bot/homeserver.yaml @@ -8,6 +8,11 @@ listeners: resources: - names: [client, federation] compress: false + - port: 8000 + type: http + bind_addresses: ['0.0.0.0'] + resources: + - names: [metrics] database: name: sqlite3 args: diff --git a/k8s/matrix/janky.bot-homeserver.yaml b/k8s/matrix/janky.bot-homeserver.yaml index 96900cc..2ed2286 100644 --- a/k8s/matrix/janky.bot-homeserver.yaml +++ b/k8s/matrix/janky.bot-homeserver.yaml @@ -14,6 +14,10 @@ spec: labels: app: synapse instance: janky.bot + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "8000" + prometheus.io/path: /_synapse/metrics spec: securityContext: fsGroup: 991