2022-06-07 17:41:19 +00:00
|
|
|
{{- define "tc.promtail.servicemonitor" -}}
|
2021-11-24 16:40:43 +00:00
|
|
|
{{- if .Values.serviceMonitor.enabled }}
|
2022-06-07 17:41:19 +00:00
|
|
|
---
|
2021-11-24 16:40:43 +00:00
|
|
|
apiVersion: monitoring.coreos.com/v1
|
|
|
|
kind: ServiceMonitor
|
|
|
|
metadata:
|
|
|
|
name: {{ include "common.names.fullname" . -}}
|
|
|
|
{{- with .Values.serviceMonitor.annotations }}
|
|
|
|
annotations:
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
labels:
|
|
|
|
{{- include "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 "common.labels.selectorLabels" . | nindent 6 }}
|
|
|
|
endpoints:
|
|
|
|
- port: http-metrics
|
|
|
|
{{- with .Values.serviceMonitor.interval }}
|
|
|
|
interval: {{ . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.serviceMonitor.scrapeTimeout }}
|
|
|
|
scrapeTimeout: {{ . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2022-06-07 17:41:19 +00:00
|
|
|
{{- end -}}
|