aerogear / keycloak-metrics-spi

Adds a Metrics Endpoint to Keycloak
Apache License 2.0
530 stars 152 forks source link

Provider not working on redhat-sso 7.3.6 #61

Closed onnder closed 3 years ago

onnder commented 4 years ago

Description

Provider is not working on RHEL branded implementation of keycloak 7.3.6.

Expected Behavior

Metrics such as keycloak_failed_login_attempts should record failed/error logins etc.

Actual Behavior

Environment

Steps to reproduce

Deploy redhat-sso 7.3.6, observe keycloak metrics such as logins and failed logins no longer reflected in metrics endpoint. We have tried to build/ deploy Your SPI with different versions of keycloakVersion in gredel.properties file with no sucess.

As mentioned in related issue https://github.com/aerogear/keycloak-metrics-spi/issues/23, this is most likely due to a divergence from keycloak standards by redhat.

Thank You

pb82 commented 4 years ago

@onnder The path where the extension is expected differs between RHSSO and Keycloak.

In RHSSO it is: https://github.com/keycloak/keycloak-operator/blob/master/pkg/model/constants.go#L43 In Keycloak it is: https://github.com/keycloak/keycloak-operator/blob/master/pkg/model/constants.go#L41

onnder commented 4 years ago

@pb82 thanks for reply. Actually, also as mentioned in issue https://github.com/aerogear/keycloak-metrics-spi/issues/27, in reply https://github.com/aerogear/keycloak-metrics-spi/issues/27#issuecomment-463388254, our folder path to SPI deployments differs from path you mention in readme and https://github.com/aerogear/keycloak-metrics-spi/issues/61#issuecomment-587055698.

We use RPM based installation of RedHAt SSO 7.3.6. Path of folder fol SPI deployments is: /opt/rh/rh-sso7/root/usr/share/keycloak/standalone/deployments. When we put your jar into this folder, by info in server log, it is properly deployed without errors:

15:29:46,850 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "keycloak-metrics-spi-1.0.5-SNAPSHOT.jar" (runtime-name: "keycloak-metrics-spi-1.0.5-SNAPSHOT.jar")
15:29:47,567 INFO  [org.keycloak.subsystem.server.extension.KeycloakProviderDeploymentProcessor] (MSC service thread 1-2) Deploying Keycloak provider: keycloak-metrics-spi-1.0.5-SNAPSHOT.jar
15:29:52,141 WARN  [org.keycloak.services] (ServerService Thread Pool -- 58) KC-SERVICES0047: metrics (org.jboss.aerogear.keycloak.metrics.MetricsEndpointFactory) is implementing the internal SPI realm-restapi-extension. This SPI is internal and may change without notice
15:30:00,868 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 31) WFLYSRV0010: Deployed "keycloak-metrics-spi-1.0.5-SNAPSHOT.jar" (runtime-name : "keycloak-metrics-spi-1.0.5-SNAPSHOT.jar")

After that the behavior is same as I have described in Issue description (Actual Behavior part).

Of course, as we expect, and we are aware of it, test/proof of concept scenario with this keycloak (not rhsso) image : https://hub.docker.com/layers/jboss/keycloak/4.8.1.Final/images/sha256-81d15b4500eb21dd0b328557cf739e806b2e700bbcbb402f41a392dacf797503?context=explore went ok and SPI was properly installed from /deployments folder with metrics-listener registered and functional /metrics outputs containing all data.

But for one particular project, we have to use RHSSO release of Keycloak, best when using your metrics SPI.

We will appreciate any hint how to properly install it in our RHSSO RPM based environment, or also any idea of what to change your SPI source code to be able to use it in our situation. Thanks Ondrej Kovacik

ghost commented 4 years ago

@onnder I'm running the SPI on patch-7.3.7 and have no issues. Let me know if you have any questions and I can try to help.

pb82 commented 3 years ago

closing as outdated