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