From ceb38ddb4b41e1f61a95d203fc801cff70b35d1b Mon Sep 17 00:00:00 2001 From: wilmarguida Date: Wed, 5 Feb 2025 15:51:23 +0100 Subject: [PATCH] feat(keycloakx): make metricRelabelings possible on serviceMonitors Signed-off-by: wilmarguida --- charts/keycloakx/README.md | 2 ++ charts/keycloakx/templates/servicemonitor.yaml | 4 ++++ charts/keycloakx/values.yaml | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/charts/keycloakx/README.md b/charts/keycloakx/README.md index aabd530b..78bf9b79 100644 --- a/charts/keycloakx/README.md +++ b/charts/keycloakx/README.md @@ -192,6 +192,7 @@ The following table lists the configurable parameters of the Keycloak-X chart an | `serviceMonitor.interval` | Interval at which Prometheus scrapes metrics | `10s` | | `serviceMonitor.scrapeTimeout` | Timeout for scraping | `10s` | | `serviceMonitor.relabelings` | Relabelings for the Servicemonitor | `[]` | +| `serviceMonitor.metricRelabelings` | Relabelings for the Servicemonitor | `[]` | | `serviceMonitor.path` | The path at which metrics are served | `{{ tpl .Values.http.relativePath $ \| trimSuffix "/" }}/metrics` | | `serviceMonitor.port` | The Service port at which metrics are served | `http` | | `extraServiceMonitor.enabled` | If `true`, an additional ServiceMonitor resource for the prometheus-operator is created. Could be used for additional metrics via [Keycloak Metrics SPI](https://github.com/aerogear/keycloak-metrics-spi) | `false` | @@ -203,6 +204,7 @@ The following table lists the configurable parameters of the Keycloak-X chart an | `extraServiceMonitor.scrapeTimeout` | Timeout for scraping | `10s` | | `extraServiceMonitor.relabelings` | Relabelings for the Servicemonitor | `[]` | +| `serviceMonitor.metricRelabelings` | Relabelings for the Servicemonitor | `[]` | | `extraServiceMonitor.path` | The path at which metrics are served | `{{ tpl .Values.http.relativePath $ \| trimSuffix "/" }}/metrics` | | `extraServiceMonitor.port` | The Service port at which metrics are served | `http` | | `prometheusRule.enabled` | If `true`, a PrometheusRule resource for the prometheus-operator is created | `false` | diff --git a/charts/keycloakx/templates/servicemonitor.yaml b/charts/keycloakx/templates/servicemonitor.yaml index cc31c2c5..59cf73c2 100644 --- a/charts/keycloakx/templates/servicemonitor.yaml +++ b/charts/keycloakx/templates/servicemonitor.yaml @@ -41,6 +41,10 @@ spec: relabelings: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .metricRelabelings }} + metricRelabelings: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} {{- end }} {{- end }} diff --git a/charts/keycloakx/values.yaml b/charts/keycloakx/values.yaml index 10f1cbb1..40e5d588 100644 --- a/charts/keycloakx/values.yaml +++ b/charts/keycloakx/values.yaml @@ -442,6 +442,8 @@ serviceMonitor: scrapeTimeout: 10s # Relabelings for the Servicemonitor relabelings: [] + # metricRelabelings for the Servicemonitor + metricRelabelings: [] # The path at which metrics are served path: '{{ tpl .Values.http.relativePath $ | trimSuffix "/" }}/metrics' # The Service port at which metrics are served @@ -464,6 +466,8 @@ extraServiceMonitor: scrapeTimeout: 10s # Relabelings for the Servicemonitor relabelings: [] + # metricRelabelings for the Servicemonitor + metricRelabelings: [] # The path at which metrics are served path: '{{ tpl .Values.http.relativePath $ | trimSuffix "/" }}/metrics' # The Service port at which metrics are served