{{- if .Values.monitoring.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: metering-reporting-operator
  labels:
    k8s-app: metering-reporting-operator
spec:
  jobLabel: component
  endpoints:
  - port: metrics
    scheme: "https"
    interval: 30s
    tlsConfig:
      caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
      serverName: reporting-operator.{{ .Release.Namespace }}.svc
    bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
  selector:
    matchLabels:
      app: reporting-operator
  namespaceSelector:
    matchNames:
    - {{ .Release.Namespace }}
{{- end }}
