blob: 3f3296133262289e2a4c5b2da8b18c367455a0b8 [file] [log] [blame]
gioc9b92b12025-05-22 08:57:18 +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:
18 selector:
19 matchLabels:
20 app: longhorn-manager
21 namespaceSelector:
22 matchNames:
23 - {{ include "release_namespace" . }}
24 endpoints:
25 - port: manager
26 {{- with .Values.metrics.serviceMonitor.interval }}
27 interval: {{ . }}
28 {{- end }}
29 {{- with .Values.metrics.serviceMonitor.scrapeTimeout }}
30 scrapeTimeout: {{ . }}
31 {{- end }}
32 {{- with .Values.metrics.serviceMonitor.relabelings }}
33 relabelings:
34 {{- toYaml . | nindent 8 }}
35 {{- end }}
36 {{- with .Values.metrics.serviceMonitor.metricRelabelings }}
37 metricRelabelings:
38 {{- toYaml . | nindent 8 }}
39 {{- end }}
40{{- end }}