blob: 82102c0ed3fa430c9bc64747c7db8a8795c5b176 [file] [log] [blame]
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +00001{{- if .Values.monitoring.serviceMonitor.enabled }}
2{{- with .Values.monitoring.serviceMonitor.metricsInstance }}
3{{- if and ($.Capabilities.APIVersions.Has "monitoring.grafana.com/v1alpha1/MetricsInstance") .enabled }}
4apiVersion: monitoring.grafana.com/v1alpha1
5kind: MetricsInstance
6metadata:
7 name: {{ include "loki.fullname" $ }}
8 {{- with .annotations }}
9 annotations:
10 {{- toYaml . | nindent 4 }}
11 {{- end }}
12 labels:
13 {{- include "loki.labels" $ | nindent 4 }}
14 {{- with .labels }}
15 {{- toYaml . | nindent 4 }}
16 {{- end }}
17spec:
18 {{- with .remoteWrite}}
19 remoteWrite:
20 {{- toYaml . | nindent 4 }}
21 {{- end }}
22
23 serviceMonitorNamespaceSelector: {}
24
25 serviceMonitorSelector:
26 matchLabels:
27 {{- include "loki.selectorLabels" $ | nindent 6 }}
28{{- end -}}
29{{- end -}}
30{{- end -}}