Skip to content

Commit

Permalink
in serviceMonitor add metricRelabelings & relabelings, fix labels
Browse files Browse the repository at this point in the history
Signed-off-by: smartbit <[email protected]>
  • Loading branch information
smartbit committed Apr 5, 2022
1 parent c36a6e3 commit d6071bb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/dex/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 9 additions & 1 deletion charts/dex/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
labels:
{{- include "dex.labels" . | nindent 4 }}
{{- with .Values.serviceMonitor.labels }}
{{ toYaml . | indent 4}}
{{- toYaml . | nindent 4}}
{{- end }}
spec:
endpoints:
Expand All @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions charts/dex/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down

0 comments on commit d6071bb

Please sign in to comment.