30 lines
896 B
YAML
30 lines
896 B
YAML
{{ if .Values.servicemonitor.enabled }}
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: {{ template "app.name" . }}
|
|
labels:
|
|
{{- include "app.labels" . | nindent 4 }}
|
|
{{- if .Values.servicemonitor.additionalLabels }}
|
|
{{- toYaml .Values.servicemonitor.additionalLabels | nindent 4 }}
|
|
{{- end -}}
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
{{- include "app.selectorLabels" . | nindent 6 }}
|
|
namespaceSelector:
|
|
matchNames:
|
|
- {{ .Release.Namespace }}
|
|
endpoints:
|
|
- path: /metrics
|
|
port: http
|
|
{{- if .Values.servicemonitor.relabelings }}
|
|
relabelings:
|
|
{{- toYaml .Values.servicemonitor.relabelings | nindent 8 }}
|
|
{{- end -}}
|
|
{{- if .Values.servicemonitor.metricRelabelings }}
|
|
metricRelabelings:
|
|
{{- toYaml .Values.servicemonitor.metricRelabelings | nindent 8 }}
|
|
{{- end -}}
|
|
{{- end -}}
|