2021-11-23 20:36:27 +00:00
|
|
|
{{- if .Values.metrics.enabled }}
|
|
|
|
apiVersion: monitoring.coreos.com/v1
|
|
|
|
kind: ServiceMonitor
|
|
|
|
metadata:
|
2022-06-30 08:48:43 +00:00
|
|
|
name: {{ include "tc.common.names.fullname" . }}
|
2021-11-23 20:36:27 +00:00
|
|
|
labels:
|
2022-06-30 08:48:43 +00:00
|
|
|
{{- include "tc.common.labels" . | nindent 4 }}
|
2021-11-23 20:36:27 +00:00
|
|
|
{{- with .Values.metrics.serviceMonitor.labels }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2022-06-30 08:48:43 +00:00
|
|
|
{{- include "tc.common.labels.selectorLabels" . | nindent 6 }}
|
2021-11-23 20:36:27 +00:00
|
|
|
endpoints:
|
|
|
|
- port: metrics
|
|
|
|
{{- with .Values.metrics.serviceMonitor.interval }}
|
|
|
|
interval: {{ . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.metrics.serviceMonitor.scrapeTimeout }}
|
|
|
|
scrapeTimeout: {{ . }}
|
|
|
|
{{- end }}
|
|
|
|
path: /metrics
|
|
|
|
{{- end }}
|