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