Skip to content

Commit

Permalink
Add ServiceMonitor for scraping gitops-controller in rancher-monitori…
Browse files Browse the repository at this point in the history
…ng chart (#4101)

Co-authored-by: Patrick Seidensal <pseidensal@suse.com>
  • Loading branch information
Tommy12789 and p-se authored Jun 25, 2024
1 parent 58a1f1f commit bc88dd8
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,30 @@ spec:
matchLabels:
app: fleet-controller
{{- end }}
---
{{- if .Values.rancherMonitoring.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels: {{ include "kube-prometheus-stack.labels" . | nindent 4 }}
name: monitoring-gitops-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: gitops
selector:
matchLabels:
app: gitjob
{{- end }}
4 changes: 2 additions & 2 deletions index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16369,7 +16369,7 @@ entries:
catalog.cattle.io/upstream-version: 45.31.1
apiVersion: v2
appVersion: v0.65.1
created: "2024-06-21T10:33:45.247640617+02:00"
created: "2024-06-21T16:08:14.887388097+02:00"
dependencies:
- condition: grafana.enabled
name: grafana
Expand Down Expand Up @@ -16463,7 +16463,7 @@ entries:
and Prometheus rules combined with documentation and scripts to provide easy
to operate end-to-end Kubernetes cluster monitoring with Prometheus using the
Prometheus Operator.
digest: c8647120ec147163717b16a83c4276bb8e3b81656e3067f25ef70e8b9b0fffd5
digest: b1c66287a0c5c15bc5212c897dfd28e354c6ca00d311c2fca639b7c8406ec6ef
home: https://github.com/prometheus-operator/kube-prometheus
icon: file://assets/logos/rancher-monitoring.png
keywords:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,30 @@ spec:
matchLabels:
app: fleet-controller
{{- end }}
---
{{- if .Values.rancherMonitoring.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels: {{ include "kube-prometheus-stack.labels" . | nindent 4 }}
name: monitoring-gitops-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: gitops
selector:
matchLabels:
app: gitjob
{{- end }}

0 comments on commit bc88dd8

Please sign in to comment.