Skip to content

Commit 6f360e7

Browse files
lftglVeiko SchnabelDandyDeveloper
authored
[stable/redis-ha]: Enable relabeling and metricRelabeling on resources: ServiceMonitor (#201)
* Enable relabeling and metricRelabeling on resources kind: ServiceMonitor. Signed-off-by: lftgl <v.lftgl@gmail.com> * Increase Cart version Signed-off-by: lftgl <v.lftgl@gmail.com> * Fix merge conflict, change chart version. * chore: update Redis chart version to 4.34.9 and enhance ServiceMonitor configuration Signed-off-by: Aaron Layfield <aaron.layfield@gmail.com> * chore: bump Redis chart version to 4.34.10 Signed-off-by: Aaron Layfield <aaron.layfield@gmail.com> --------- Signed-off-by: lftgl <v.lftgl@gmail.com> Signed-off-by: Aaron Layfield <aaron.layfield@gmail.com> Co-authored-by: Veiko Schnabel <v.schnabel@syseleven.de> Co-authored-by: Aaron Layfield <aaron.layfield@gmail.com>
1 parent 952bbd4 commit 6f360e7

4 files changed

Lines changed: 27 additions & 1 deletion

File tree

charts/redis-ha/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ keywords:
55
- redis
66
- keyvalue
77
- database
8-
version: 4.34.9
8+
version: 4.34.10
99
appVersion: 8.2.1
1010
description: This Helm chart provides a highly available Redis implementation with a master/slave configuration and uses Sentinel sidecars for failover management
1111
icon: https://img.icons8.com/external-tal-revivo-shadow-tal-revivo/24/external-redis-an-in-memory-data-structure-project-implementing-a-distributed-logo-shadow-tal-revivo.png

charts/redis-ha/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ The following table lists the configurable parameters of the Redis chart and the
340340
| `exporter.serviceMonitor.endpointAdditionalProperties` | Set additional properties for the ServiceMonitor endpoints such as relabeling, scrapeTimeout, tlsConfig, and more. | object | `{}` |
341341
| `exporter.serviceMonitor.interval` | Set how frequently Prometheus should scrape (default is 30s) | string | `""` |
342342
| `exporter.serviceMonitor.labels` | Set labels for the ServiceMonitor, use this to define your scrape label for Prometheus Operator | object | `{}` |
343+
| `exporter.serviceMonitor.metricRelabelings` | | list | `[]` |
343344
| `exporter.serviceMonitor.namespace` | Set the namespace the ServiceMonitor should be deployed | string | `.Release.Namespace` |
345+
| `exporter.serviceMonitor.relabelings` | | list | `[]` |
344346
| `exporter.serviceMonitor.telemetryPath` | Set path to redis-exporter telemtery-path (default is /metrics) | string | `""` |
345347
| `exporter.serviceMonitor.timeout` | Set timeout for scrape (default is 10s) | string | `""` |
346348
| `exporter.tag` | Exporter image tag | string | `"v1.67.0"` |

charts/redis-ha/templates/redis-ha-servicemonitor.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ spec:
2626
{{- end }}
2727
{{- with .Values.exporter.serviceMonitor.endpointAdditionalProperties }}
2828
{{- toYaml . | nindent 4 }}
29+
{{- end }}
30+
{{- if .Values.exporter.serviceMonitor.metricRelabelings }}
31+
metricRelabelings:
32+
{{- toYaml .Values.exporter.serviceMonitor.metricRelabelings | nindent 6 }}
33+
{{- end }}
34+
{{- if .Values.exporter.serviceMonitor.relabelings }}
35+
relabelings:
36+
{{- toYaml .Values.exporter.serviceMonitor.relabelings | nindent 6 }}
2937
{{- end }}
3038
jobLabel: {{ template "redis-ha.fullname" . }}
3139
namespaceSelector:

charts/redis-ha/values.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,22 @@ exporter:
789789
# -- Disable API Check on ServiceMonitor
790790
disableAPICheck: false
791791

792+
# RelabelConfigs to apply to samples before scraping.
793+
relabelings: []
794+
# - sourceLabels: [__meta_kubernetes_pod_node_name]
795+
# separator: ;
796+
# regex: ^(.*)$
797+
# targetLabel: nodename
798+
# replacement: $1
799+
# action: replace
800+
801+
# MetricRelabelConfigs to apply to samples after scraping, but before ingestion.
802+
metricRelabelings: []
803+
# - action: keep
804+
# regex: 'kube_(daemonset|deployment|pod|namespace|node|statefulset).+'
805+
# sourceLabels: [__name__]
806+
807+
792808
# prometheus exporter SCANS redis db which can take some time
793809
# allow different probe settings to not let container crashloop
794810
livenessProbe:

0 commit comments

Comments
 (0)