From 42cd48d70c19da96cd904a67b60caa481311d989 Mon Sep 17 00:00:00 2001 From: ishuar Date: Thu, 3 Aug 2023 17:28:04 +0200 Subject: [PATCH] add the feature to allow relabeling in servicemonitor Signed-off-by: ishuar --- charts/velero/Chart.yaml | 2 +- charts/velero/templates/servicemonitor.yaml | 6 ++++++ charts/velero/values.yaml | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/charts/velero/Chart.yaml b/charts/velero/Chart.yaml index 7d721320..93b8d3ac 100644 --- a/charts/velero/Chart.yaml +++ b/charts/velero/Chart.yaml @@ -3,7 +3,7 @@ appVersion: 1.11.1 kubeVersion: ">=1.16.0-0" description: A Helm chart for velero name: velero -version: 4.2.0 +version: 4.3.0 home: https://github.com/vmware-tanzu/velero icon: https://cdn-images-1.medium.com/max/1600/1*-9mb3AKnKdcL_QD3CMnthQ.png sources: diff --git a/charts/velero/templates/servicemonitor.yaml b/charts/velero/templates/servicemonitor.yaml index e3ccfa40..777ff9f1 100644 --- a/charts/velero/templates/servicemonitor.yaml +++ b/charts/velero/templates/servicemonitor.yaml @@ -33,6 +33,12 @@ spec: {{- if .Values.metrics.serviceMonitor.scheme }} scheme: {{ .Values.metrics.serviceMonitor.scheme }} {{- end }} + {{- if .Values.metrics.serviceMonitor.metricRelabelings }} + metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.metricRelabelings | nindent 6 }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.relabelings }} + relabelings: {{ toYaml .Values.metrics.serviceMonitor.relabelings | nindent 6 }} + {{- end }} {{- if .Values.metrics.serviceMonitor.tlsConfig }} tlsConfig: {{- toYaml .Values.metrics.serviceMonitor.tlsConfig | nindent 6 }} diff --git a/charts/velero/values.yaml b/charts/velero/values.yaml index 604ae4cf..e1490935 100644 --- a/charts/velero/values.yaml +++ b/charts/velero/values.yaml @@ -182,6 +182,12 @@ metrics: enabled: false annotations: {} additionalLabels: {} + + # metrics.serviceMonitor.metricRelabelings Specify Metric Relabelings to add to the scrape endpoint + # ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig + # metricRelabelings: [] + # metrics.serviceMonitor.relabelings [array] Prometheus relabeling rules + # relabelings: [] # ServiceMonitor namespace. Default to Velero namespace. # namespace: # ServiceMonitor connection scheme. Defaults to HTTP.