{{- if and .Values.config.metrics .Values.prometheus.servicemonitor.enabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ include "jellyfin.fullname" . }} labels: {{- include "jellyfin.labels" . | nindent 4 }} {{- with .Values.prometheus.servicemonitor.labels }} {{- toYaml . | nindent 4 }} {{- end }} spec: selector: matchLabels: {{- include "jellyfin.selectorLabels" . | nindent 6 }} endpoints: - port: http path: "/metrics" {{- end }}