Skip to content

Commit

Permalink
Add ServiceMonitor for Fleet metrics in rancher-monitoring chart
Browse files Browse the repository at this point in the history
  • Loading branch information
p-se committed Jun 6, 2024
1 parent 9d6136d commit 1c7478e
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if .Values.rancherMonitoring.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels: {{ include "kube-prometheus-stack.labels" . | nindent 4 }}
name: monitoring-fleet-controller
namespace: cattle-fleet-system
spec:
endpoints:
- port: metrics
metricRelabelings:
{{ if .Values.global.cattle.clusterId }}
- sourceLabels: [__address__]
targetLabel: cluster_id
replacement: {{ .Values.global.cattle.clusterId }}
{{- end }}
{{ if .Values.global.cattle.clusterName}}
- sourceLabels: [__address__]
targetLabel: cluster_name
replacement: {{ .Values.global.cattle.clusterName }}
{{- end }}
jobLabel: fleet
selector:
matchLabels:
app: fleet-controller
{{- end }}

0 comments on commit 1c7478e

Please sign in to comment.