39 lines
1.3 KiB
YAML
39 lines
1.3 KiB
YAML
{{- if and (.Values.agent.enabled) (.Values.agent.serviceMonitor.enabled)}}
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: {{ template "jaeger.agent.name" . }}
|
|
{{- if .Values.agent.serviceMonitor.namespace }}
|
|
namespace: {{ .Values.agent.serviceMonitor.namespace }}
|
|
{{- else }}
|
|
namespace: {{ .Release.Namespace }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "jaeger.labels" . | nindent 4 }}
|
|
app.kubernetes.io/component: agent
|
|
{{- if .Values.agent.serviceMonitor.additionalLabels }}
|
|
{{- toYaml .Values.agent.serviceMonitor.additionalLabels | nindent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.agent.serviceMonitor.annotations }}
|
|
annotations:
|
|
{{- toYaml .Values.agent.serviceMonitor.annotations | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
endpoints:
|
|
- port: admin
|
|
path: /metrics
|
|
{{- if .Values.agent.serviceMonitor.interval }}
|
|
interval: {{ .Values.agent.serviceMonitor.interval }}
|
|
{{- end }}
|
|
{{- if .Values.agent.serviceMonitor.scrapeTimeout }}
|
|
scrapeTimeout: {{ .Values.agent.serviceMonitor.scrapeTimeout }}
|
|
{{- end }}
|
|
namespaceSelector:
|
|
matchNames:
|
|
- {{ .Release.Namespace }}
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/component: agent
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
{{- end }}
|