blob: df98bd6ceaa762b34c5f74d0b9e20f46bf47ca0d [file] [log] [blame]
gio16bb6382025-05-21 18:42:40 +04001{{- if .Values.metrics.serviceMonitor.enabled -}}
2apiVersion: monitoring.coreos.com/v1
3kind: ServiceMonitor
4metadata:
5 name: longhorn-prometheus-servicemonitor
6 namespace: {{ include "release_namespace" . }}
7 labels:
8 {{- include "longhorn.labels" . | nindent 4 }}
9 name: longhorn-prometheus-servicemonitor
10 {{- with .Values.metrics.serviceMonitor.additionalLabels }}
11 {{- toYaml . | nindent 4 }}
12 {{- end }}
13 {{- with .Values.metrics.serviceMonitor.annotations }}
14 annotations:
15 {{- toYaml . | nindent 4 }}
16 {{- end }}
17spec:
gio3e1b96b2026-07-21 18:52:35 +040018 {{- with .Values.metrics.serviceMonitor.sampleLimit }}
19 sampleLimit: {{ . }}
20 {{- end }}
gio16bb6382025-05-21 18:42:40 +040021 selector:
22 matchLabels:
23 app: longhorn-manager
24 namespaceSelector:
25 matchNames:
26 - {{ include "release_namespace" . }}
27 endpoints:
28 - port: manager
29 {{- with .Values.metrics.serviceMonitor.interval }}
30 interval: {{ . }}
31 {{- end }}
32 {{- with .Values.metrics.serviceMonitor.scrapeTimeout }}
33 scrapeTimeout: {{ . }}
34 {{- end }}
35 {{- with .Values.metrics.serviceMonitor.relabelings }}
36 relabelings:
37 {{- toYaml . | nindent 8 }}
38 {{- end }}
39 {{- with .Values.metrics.serviceMonitor.metricRelabelings }}
40 metricRelabelings:
41 {{- toYaml . | nindent 8 }}
42 {{- end }}
43{{- end }}