aerogear/keycloak-metrics-spi

No data for some metrics

noze-gnassipova opened this issue · 4 comments

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

  • Keycloak 23.0.6
  • SPI metrics 5.0.1

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

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.

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.

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

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.