Skip to content

Commit a5a59bd

Browse files
authored
feat(helm): add API and heavy worker ServiceMonitors (onyx-dot-app#10025)
1 parent 32d2e79 commit a5a59bd

4 files changed

Lines changed: 50 additions & 2 deletions

File tree

deployment/helm/charts/onyx/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ home: https://www.onyx.app/
55
sources:
66
- "https://github.com/onyx-dot-app/onyx"
77
type: application
8-
version: 0.4.40
8+
version: 0.4.41
99
appVersion: latest
1010
annotations:
1111
category: Productivity
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{{- if .Values.monitoring.serviceMonitors.enabled }}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: ServiceMonitor
4+
metadata:
5+
name: {{ include "onyx.fullname" . }}-api
6+
labels:
7+
{{- include "onyx.labels" . | nindent 4 }}
8+
{{- with .Values.monitoring.serviceMonitors.labels }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
11+
spec:
12+
namespaceSelector:
13+
matchNames:
14+
- {{ .Release.Namespace }}
15+
selector:
16+
matchLabels:
17+
app: {{ .Values.api.deploymentLabels.app }}
18+
endpoints:
19+
- port: api-server-port
20+
path: /metrics
21+
interval: 30s
22+
scrapeTimeout: 10s
23+
{{- end }}

deployment/helm/charts/onyx/templates/celery-worker-servicemonitors.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,29 @@ spec:
7474
interval: 30s
7575
scrapeTimeout: 10s
7676
{{- end }}
77+
{{- if gt (int .Values.celery_worker_heavy.replicaCount) 0 }}
78+
---
79+
apiVersion: monitoring.coreos.com/v1
80+
kind: ServiceMonitor
81+
metadata:
82+
name: {{ include "onyx.fullname" . }}-celery-worker-heavy
83+
labels:
84+
{{- include "onyx.labels" . | nindent 4 }}
85+
{{- with .Values.monitoring.serviceMonitors.labels }}
86+
{{- toYaml . | nindent 4 }}
87+
{{- end }}
88+
spec:
89+
namespaceSelector:
90+
matchNames:
91+
- {{ .Release.Namespace }}
92+
selector:
93+
matchLabels:
94+
app: {{ .Values.celery_worker_heavy.deploymentLabels.app }}
95+
metrics: "true"
96+
endpoints:
97+
- port: metrics
98+
path: /metrics
99+
interval: 30s
100+
scrapeTimeout: 10s
101+
{{- end }}
77102
{{- end }}

deployment/helm/charts/onyx/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ monitoring:
264264
# The sidecar must be configured with label selector: grafana_dashboard=1
265265
enabled: false
266266
serviceMonitors:
267-
# -- Set to true to deploy ServiceMonitor resources for Celery worker metrics endpoints.
267+
# -- Set to true to deploy ServiceMonitor resources for API server and Celery worker metrics endpoints.
268268
# Requires the Prometheus Operator CRDs (included in kube-prometheus-stack).
269269
# Use `labels` to match your Prometheus CR's serviceMonitorSelector (e.g. release: onyx-monitoring).
270270
enabled: false

0 commit comments

Comments
 (0)