Keycloak Grafana dashboards

Learn how to import Keycloak provided Grafana dashboards to your Grafana instance

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.

Prerequisites

  • Keycloak metrics are enabled. Follow Enabling Keycloak Metrics guide for more details.

  • Grafana instance is running and Keycloak metrics are collected into a Prometheus instance.

Keycloak Grafana dashboards

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.

  1. Identify the branch from keycloak-grafana-dashboards to use from the following table.

    Keycloak version keycloak-grafana-dashboards branch

    >= 26.1

    main

  2. Clone the GitHub repository

    git clone -b BRANCH_FROM_STEP_1 https://github.com/keycloak/keycloak-grafana-dashboard.git
  3. The dashboards are available in the directory keycloak-grafana-dashboard/dashboards.

The following sections describe the purpose of each dashboard.

Keycloak troubleshooting 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 Keycloak service level indicators (SLIs). This dashboard can be also used while troubleshooting a Keycloak deployment following the Metrics for troubleshooting Keycloak deployment guide, for example, when SLI graphs do not show expected results.

Troubleshooting dashboard
Figure 1. Troubleshooting dashboard

Keycloak capacity planning dashboard

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 Keycloak self-provided metrics.

Keycloak event metrics must be enabled for this dashboard to work correctly. To enable them, see the guide Enabling Keycloak Event Metrics.
Capacity planning dashboard
Figure 2. Capacity planning dashboard

Import a dashboard

  1. Open the dashboard page from the left Grafana menu.

  2. Click New and Import.

  3. Click Upload dashboard JSON file and select the JSON file of the dashboard you want to import.

  4. Pick your Prometheus datasource.

  5. Click Import.

Export a dashboard

Exporting a dashboard to JSON format may be useful. For example, you may want to suggest a change in our dashboard repository.

  1. Open a dashboard you would like to export.

  2. Click share (Grafana share icon) in the top left corner next to the dashboard name.

  3. Click the Export tab.

  4. Enable Export for sharing externally.

  5. Click either Save to file or View JSON and Copy to Clipboard according to where you want to store the resulting JSON.

On this page