From 18aaae4922e909465189e962fa1682912b5f4e3d Mon Sep 17 00:00:00 2001 From: smartbit Date: Tue, 5 Apr 2022 17:38:16 +0200 Subject: [PATCH 1/3] in serviceMonitor add metricRelabelings & relabelings, fix labels Signed-off-by: smartbit --- charts/dex/Chart.yaml | 2 +- charts/dex/templates/servicemonitor.yaml | 10 +++++++++- charts/dex/values.yaml | 10 ++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/charts/dex/Chart.yaml b/charts/dex/Chart.yaml index 225df6bc..d05d911b 100644 --- a/charts/dex/Chart.yaml +++ b/charts/dex/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 type: application name: dex -version: 0.8.0 +version: 0.8.1 appVersion: "2.31.1" kubeVersion: ">=1.14.0-0" description: OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors. diff --git a/charts/dex/templates/servicemonitor.yaml b/charts/dex/templates/servicemonitor.yaml index 314b06b8..040e6a24 100644 --- a/charts/dex/templates/servicemonitor.yaml +++ b/charts/dex/templates/servicemonitor.yaml @@ -9,7 +9,7 @@ metadata: labels: {{- include "dex.labels" . | nindent 4 }} {{- with .Values.serviceMonitor.labels }} - {{ toYaml . | indent 4}} + {{- toYaml . | nindent 4}} {{- end }} spec: endpoints: @@ -20,6 +20,14 @@ spec: {{- with .Values.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ . }} {{- end }} + {{- with .Values.serviceMonitor.metricRelabelings }} + metricRelabelings: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.serviceMonitor.relabelings }} + relabelings: + {{- toYaml . | nindent 8 }} + {{- end }} jobLabel: {{ include "dex.fullname" . }} selector: matchLabels: diff --git a/charts/dex/values.yaml b/charts/dex/values.yaml index 4f84d0d7..4b42902c 100644 --- a/charts/dex/values.yaml +++ b/charts/dex/values.yaml @@ -195,6 +195,16 @@ serviceMonitor: # See the [documentation](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/design.md#servicemonitor) and the [API reference](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor) for details. enabled: false + # -- MetricRelabelConfigs to apply to samples before ingestion. + # Relabel the metrics to be able to recognize them + metricRelabelings: + - replacement: dex_$1 + sourceLabels: [__name__] + targetLabel: __name__ + + # -- RelabelConfigs to apply to samples before scraping. + relabelings: [] + # -- Namespace where the ServiceMonitor resource should be deployed. # @default -- Release namespace. namespace: "" From dcc8ae455218047e420ca8b37d7eb5e96af4a16d Mon Sep 17 00:00:00 2001 From: smartbit Date: Wed, 6 Apr 2022 15:34:18 +0200 Subject: [PATCH 2/3] remove default metricRelabelings Signed-off-by: smartbit --- charts/dex/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/dex/values.yaml b/charts/dex/values.yaml index 4b42902c..1c8bb063 100644 --- a/charts/dex/values.yaml +++ b/charts/dex/values.yaml @@ -197,10 +197,10 @@ serviceMonitor: # -- MetricRelabelConfigs to apply to samples before ingestion. # Relabel the metrics to be able to recognize them - metricRelabelings: - - replacement: dex_$1 - sourceLabels: [__name__] - targetLabel: __name__ + metricRelabelings: [] + # - replacement: dex_$1 + # sourceLabels: [__name__] + # targetLabel: __name__ # -- RelabelConfigs to apply to samples before scraping. relabelings: [] From 3f7562b4b133434b8c8cde913e0d10f3c12e7c30 Mon Sep 17 00:00:00 2001 From: smartbit Date: Wed, 6 Apr 2022 15:38:04 +0200 Subject: [PATCH 3/3] update chart to 0.8.2 Signed-off-by: smartbit --- charts/dex/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/dex/Chart.yaml b/charts/dex/Chart.yaml index d05d911b..cde96aa9 100644 --- a/charts/dex/Chart.yaml +++ b/charts/dex/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 type: application name: dex -version: 0.8.1 +version: 0.8.2 appVersion: "2.31.1" kubeVersion: ">=1.14.0-0" description: OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors.