Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/micrometer-metrics/micrometer-keycloak
Adds Micrometer support to Keycloak.
https://github.com/micrometer-metrics/micrometer-keycloak
keycloak metrics micrometer prometheus
Last synced: about 1 month ago
JSON representation
Adds Micrometer support to Keycloak.
- Host: GitHub
- URL: https://github.com/micrometer-metrics/micrometer-keycloak
- Owner: micrometer-metrics
- License: apache-2.0
- Archived: true
- Created: 2020-01-07T17:00:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-08T22:20:39.000Z (over 2 years ago)
- Last Synced: 2024-02-10T10:11:03.838Z (5 months ago)
- Topics: keycloak, metrics, micrometer, prometheus
- Language: Java
- Homepage:
- Size: 72.3 KB
- Stars: 6
- Watchers: 7
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-keycloak - Micrometer Keycloak extension
README
# micrometer-keycloak is no longer actively maintained by VMware, Inc.
# Micrometer Keycloak SPI
Inspired by @aerogear's [Keycloak Metrics SPI](https://github.com/aerogear/keycloak-metrics-spi).
A [Service Provider](https://www.keycloak.org/docs/4.8/server_development/index.html#_providers) that adds a metrics endpoint to Keycloak. The endpoint returns metrics data ready to be scraped by [Prometheus](https://prometheus.io/).
Two distinct providers are defined:
* `MetricsEventListener` to record the internal Keycloak events
* `MetricsEndpoint` to expose the data through a custom endpointThe endpoint lives under `/auth/realms//metrics`. It will return data for all realms, no matter which realm
you use in the URL (you can just default to `/auth/realms/master/metrics`).## Usage
Add the jar into the _providers_ subdirectory of your Keycloak installation.
To enable the event listener via the GUI interface, go to _Manage -> Events -> Config_. The _Event Listeners_ configuration should have an entry named `metrics-listener`.
To enable the event listener via the Keycloak CLI, such as when building a Docker container, use these commands. (These commands assume /opt/jboss is the Keycloak home directory, which is used on the _jboss/keycloak_ reference container on Docker Hub.)
/opt/jboss/keycloak/bin/kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user $KEYCLOAK_USER --password $KEYCLOAK_PASSWORD
/opt/jboss/keycloak/bin/kcadm.sh update events/config -s "eventsEnabled=true" -s "adminEventsEnabled=true" -s "eventsListeners+=metrics-listener"
/usr/bin/rm -f /opt/jboss/.keycloak/kcadm.config