{{- if .Values.serviceMonitor.enabled }} --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ template "sidekiq-prometheus-exporter.fullname" . }} namespace: {{ .Release.Namespace | quote }} labels: {{- include "sidekiq-prometheus-exporter.labels" . | nindent 4 }} {{- with .Values.serviceMonitor.labels }} {{- toYaml . | nindent 4 }} {{- end }} spec: jobLabel: {{ template "sidekiq-prometheus-exporter.fullname" . }} selector: matchLabels: {{- include "sidekiq-prometheus-exporter.labels" . | nindent 6 }} namespaceSelector: matchNames: - {{ .Release.Namespace | quote }} endpoints: - port: metrics path: {{ .Values.serviceMonitor.path }} interval: {{ .Values.serviceMonitor.interval }} scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }} {{- end }}