| Giorgi Lekveishvili | 193b7c0 | 2025-05-22 16:21:37 +0400 | [diff] [blame^] | 1 | {{- if .Values.metrics.serviceMonitor.enabled -}} |
| 2 | apiVersion: monitoring.coreos.com/v1 |
| 3 | kind: ServiceMonitor |
| 4 | metadata: |
| 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 }} |
| 17 | spec: |
| 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 }} |