{{- if .Values.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: {{ include "nifi.fullname" . }}
  labels:
    {{- include "nifi.labels" . | nindent 4 }}
spec:
  endpoints:
    - interval: {{ .Values.metrics.serviceMonitor.interval }}
      port: metrics
      path: /metrics
  namespaceSelector:
    matchNames:
      - {{ .Release.Namespace }}
  selector:
    matchLabels:
      {{- include "nifi.selectorLabels" . | nindent 6 }}
{{- end }}