# 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.api" . | nindent 4 }}
  name: "{{ include "name" . }}-api"
  namespace: {{ .Release.Namespace }}
spec:
  endpoints:
    - path: /metrics
      port: http
  namespaceSelector:
    matchNames:
      - {{ .Release.Namespace }}
  selector:
    matchLabels: {{ include "labels.api" . | nindent 6 }}
{{- end }}
