Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(keycloakx): make relabelings possible on serviceMonitors #815

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion charts/keycloakx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ The following table lists the configurable parameters of the Keycloak-X chart an
| `serviceMonitor.labels` | Additional labels for the ServiceMonitor | `{}` |
| `serviceMonitor.interval` | Interval at which Prometheus scrapes metrics | `10s` |
| `serviceMonitor.scrapeTimeout` | Timeout for scraping | `10s` |
| `serviceMonitor.relabelings` | Relabelings for the Servicemonitor | `[]` |
| `serviceMonitor.metricRelabelings` | metricRelabelings 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` |
Expand All @@ -200,6 +202,9 @@ The following table lists the configurable parameters of the Keycloak-X chart an
| `extraServiceMonitor.labels` | Additional labels for the additional ServiceMonitor | `{}` |
| `extraServiceMonitor.interval` | Interval at which Prometheus scrapes metrics | `10s` |
| `extraServiceMonitor.scrapeTimeout` | Timeout for scraping | `10s` |

| `extraServiceMonitor.relabelings` | Relabelings for the Servicemonitor | `[]` |
| `serviceMonitor.metricRelabelings` | metricRelabelings 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` |
Expand Down Expand Up @@ -593,4 +598,3 @@ Keycloak 18.0.0 allows to enable the health endpoint independently of the metric
We reflect that via the new config option `health.enabled`.

Please read the additional notes about [Migrating to 18.0.0](https://www.keycloak.org/docs/latest/upgrading/index.html#migrating-to-18-0-0) in the Keycloak documentation.

8 changes: 8 additions & 0 deletions charts/keycloakx/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ spec:
scheme: {{ $.Values.http.internalScheme | lower }}
interval: {{ .interval }}
scrapeTimeout: {{ .scrapeTimeout }}
{{- with .relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/keycloakx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,10 @@ serviceMonitor:
interval: 10s
# Timeout for scraping
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
Expand All @@ -460,6 +464,10 @@ extraServiceMonitor:
interval: 10s
# Timeout for scraping
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
Expand Down