Monitoring
Alauda Build of Keycloak exposes built-in metrics compatible with Prometheus. Enabling metrics allows you to monitor Keycloak's health, performance, and usage in your observability stack.
TOC
Enable MetricsKey MetricsConfigure Prometheus ScrapingLiveness and Readiness ProbesHealth EndpointsEnable Metrics
Metrics are enabled by setting the metrics-enabled option in the Keycloak CR:
Once enabled, Keycloak exposes a metrics endpoint at:
The metrics endpoint is served on the management port (default: 9000) via the spec.httpManagement.port field, separate from the main HTTP/HTTPS port.
Key Metrics
The following categories of metrics are available:
Configure Prometheus Scraping
Add the following scrape configuration to your Prometheus instance to collect Keycloak metrics:
If you are using the Prometheus Operator, create a ServiceMonitor:
Liveness and Readiness Probes
The Keycloak Operator configures liveness and readiness probes automatically. You can customize the probe parameters in the Keycloak CR:
The probes use the management endpoint at http://<pod>:9000/health/live and http://<pod>:9000/health/ready.
Health Endpoints
Keycloak exposes three health endpoints on the management port: