aerogear / keycloak-metrics-spi

Adds a Metrics Endpoint to Keycloak
Apache License 2.0
523 stars 151 forks source link

No data for some metrics #193

Open noze-gnassipova opened 4 months ago

noze-gnassipova commented 4 months ago

Description

There's no data for some metrics: Screenshot 2024-02-09 at 12 38 59 PM

Expected Behavior

Should show values for metrics

Environment

Dev

Steps to reproduce

jar file is present, metrics-listener was enabled for all realms, KC_METRICS_ENABLED: "true" Screenshot 2024-02-09 at 12 45 42 PM

tolleiv commented 1 month ago

This is normal behaviour when the Keycloak instance has not seen related events after the startup. Once a related event happens, this metric will jump from empty to 1.

noze-gnassipova commented 1 month ago

This is normal behaviour when the Keycloak instance has not seen related events after the startup. Once a related event happens, this metric will jump from empty to 1.

I don't think so. I tested with failed client login attempts, but I still don't see any metrics.

Mr-Folder commented 2 weeks ago

You probably didn't enabled the event listener

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.


$ /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```
noze-gnassipova commented 2 weeks ago

You probably didn't enabled the event listener

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.

$ /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```

It's enabled; the picture is attached. Thanks for the response though.