Skip to content

Commit 4cd2925

Browse files
add optional prometheus ServiceMonitor for when synapse.metrics.enabled is set to true (#594)
* add optional prometheus serviceMonitor for when synapse.metric.enabled is set to true * helm-docs: automated action * fix label templating for servicemonitor --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 1bf9154 commit 4cd2925

4 files changed

Lines changed: 27 additions & 2 deletions

File tree

charts/matrix/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sources:
88

99
type: application
1010

11-
version: 13.0.2
11+
version: 13.1.0
1212

1313
# renovate: image=matrixdotorg/synapse
1414
appVersion: v1.109.0

charts/matrix/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# matrix
22

3-
![Version: 13.0.2](https://img.shields.io/badge/Version-13.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.109.0](https://img.shields.io/badge/AppVersion-v1.109.0-informational?style=flat-square)
3+
![Version: 13.1.0](https://img.shields.io/badge/Version-13.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.109.0](https://img.shields.io/badge/AppVersion-v1.109.0-informational?style=flat-square)
44

55
A Helm chart to deploy a Matrix homeserver stack on Kubernetes
66

@@ -796,6 +796,7 @@ A Helm chart to deploy a Matrix homeserver stack on Kubernetes
796796
| synapse.metrics.annotations | bool | `true` | |
797797
| synapse.metrics.enabled | bool | `true` | Whether Synapse should capture metrics on an additional endpoint |
798798
| synapse.metrics.port | int | `9092` | Port to listen on for metrics scraping |
799+
| synapse.metrics.serviceMonitor.enabled | bool | `false` | enable a prometheus ServiceMonitor to send metrics to prometheus |
799800
| synapse.podSecurityContext | object | `{"env":false,"fsGroup":1000,"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000}` | securityContext for the entire synapse pod, including the all containers Does not work by default in all cloud providers, disable by default |
800801
| synapse.podSecurityContext.env | bool | `false` | Enable if your k8s environment allows containers to chuser/setuid https://github.com/matrix-org/synapse/blob/96cf81e312407f0caba1b45ba9899906b1dcc098/docker/start.py#L196 |
801802
| synapse.podSecurityContext.fsGroup | int | `1000` | A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- If unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows. |
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- if and .Values.synapse.metrics.enabled .Values.synapse.metrics.serviceMonitor.enabled }}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: ServiceMonitor
4+
metadata:
5+
name: {{ include "matrix.fullname" . }}-synapse
6+
labels:
7+
{{- include "matrix.labels" . | nindent 4 }}
8+
{{- include "matrix.synapse.labels" . | nindent 4}}
9+
spec:
10+
endpoints:
11+
- interval: 30s
12+
targetPort: {{ .Values.synapse.metrics.port }}
13+
path: /_synapse/metrics
14+
namespaceSelector:
15+
matchNames:
16+
- {{ .Release.Namespace | quote }}
17+
selector:
18+
matchLabels:
19+
{{- include "matrix.labels" . | nindent 6 }}
20+
{{- include "matrix.synapse.labels" . | nindent 6 }}
21+
{{- end }}

charts/matrix/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,9 @@ synapse:
771771
# -- Port to listen on for metrics scraping
772772
port: 9092
773773
annotations: true
774+
serviceMonitor:
775+
# -- enable a prometheus ServiceMonitor to send metrics to prometheus
776+
enabled: false
774777

775778
# -- optiona: extra env variables to pass to the matrix synapse deployment
776779
extraEnv: []

0 commit comments

Comments
 (0)