# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 The HuggingFace Authors.

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