git clone -b BRANCH_FROM_STEP_1 https://github.com/keycloak/keycloak-grafana-dashboard.git
Keycloak provides metrics to observe what is happening inside the deployment. To understand how metrics evolve over time, it is helpful to collect them and visualize in graphs.
This guide provides instructions on how to visualize collected Keycloak metrics in a running Grafana instance.
Keycloak metrics are enabled. Follow Gaining insights with metrics guide for more details.
Grafana instance is running and Keycloak metrics are collected into a Prometheus instance.
For the HTTP request latency heatmaps to work, enable histograms for HTTP metrics by setting http-metrics-histograms-enabled
to true
.
Grafana dashboards are distributed in the form of a JSON file that is imported into a Grafana instance. JSON definitions of Keycloak Grafana dashboards are available in the keycloak/keycloak-grafana-dashboard GitHub repository.
Follow these steps to download JSON file definitions.
Identify the branch from keycloak-grafana-dashboards
to use from the following table.
Keycloak version | keycloak-grafana-dashboards branch |
---|---|
>= 26.1 |
|
Clone the GitHub repository
git clone -b BRANCH_FROM_STEP_1 https://github.com/keycloak/keycloak-grafana-dashboard.git
The dashboards are available in the directory keycloak-grafana-dashboard/dashboards
.
The following sections describe the purpose of each dashboard.
This dashboard is available in the JSON file: keycloak-troubleshooting-dashboard.json
.
On the top of the dashboard, graphs display the service level indicators as defined in Monitoring performance with Service Level Indicators. This dashboard can be also used while troubleshooting a Keycloak deployment following the Troubleshooting using metrics guide, for example, when SLI graphs do not show expected results.
This dashboard is available in the JSON file: keycloak-capacity-planning-dashboard.json
.
This dashboard shows metrics that are important when estimating the load handled by a Keycloak deployment. For example, it shows the number of password validations or login flows performed by Keycloak. For more detail on these metrics, see the guide Self-provided metrics.
Keycloak event metrics must be enabled for this dashboard to work correctly. To enable them, see the guide Monitoring user activities with event metrics. |
Open the dashboard page from the left Grafana menu.
Click New and Import.
Click Upload dashboard JSON file and select the JSON file of the dashboard you want to import.
Pick your Prometheus datasource.
Click Import.
Exporting a dashboard to JSON format may be useful. For example, you may want to suggest a change in our dashboard repository.
Continue reading on how to connect traces to dashboard in the Analyzing outliers and errors with exemplars guide.