{{- define "tc.promtail.servicemonitor" -}} {{- if .Values.serviceMonitor.enabled }} --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ include "tc.common.names.fullname" . -}} {{- with .Values.serviceMonitor.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} labels: {{- include "tc.common.labels" . | nindent 4 }} {{- with .Values.serviceMonitor.labels }} {{- toYaml . | nindent 4 }} {{- end }} spec: {{- with .Values.serviceMonitor.namespaceSelector }} namespaceSelector: {{- toYaml . | nindent 4 }} {{- end }} selector: matchLabels: {{- include "tc.common.labels.selectorLabels" . | nindent 6 }} endpoints: - port: http-metrics {{- with .Values.serviceMonitor.interval }} interval: {{ . }} {{- end }} {{- with .Values.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ . }} {{- end }} {{- end }} {{- end -}}