-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keycloak won't pick up metrics-listener #87
Comments
We fixed this in our case by updating realm file imported by Docker:
|
I'm not sure how that would help, as the metrics-listener provider is never registered in the first place. |
After adding these 2 files in Docker image, when it initializes
We turn it on by using our modified realm file, also provided in docker image |
I tried adding this to my Dockerfile:
Logs state this:
But still, there is no provider for metrics-listener defined when I check the admin gui. Logs also states this when trying to use the provider:
|
I think this is actually a bug in the keycloak deployment code. The provider is supposed to be populated in KeycloakProviderDependencyProcessor. getKeycloakProviderDeploymentInfo(), but it just ... doesn't. |
Gah, spoke too soon. Its slightly more complicated. By the docs, metrics-spi is missing a required file "META-INF/services/org.keycloak.provider.Spi" as described in the keycloak server docs. However, that still doesn't work. Near as I can tell, the solution is in this discourse thread I don't fully understand how this is supposed to work, but at least some fault is on this provider. |
@leesplk or @torbjornsk: Did you find a solution to this problem? I'm experiencing the same thing. The jar is picked up and deployed, and the endpoint is working, but I get the |
yes, sort of. Its complicated to describe the underlying problem (ie, i'm not sure my diagnosis is 100% correct) but my discovery was that enabling the builtin jboss-logging SPI prevented the registration of any subsequent event listener. My solution was:
The advantage to stealing the jboss-logging id is that keycloak will automatically attach that specific EventListener to new realms (i don't think this is documented, but i've verified its true by code inspection and practical experience). |
I'm running into what I think is the same issue with Keycloak 16.1.0 and Keycloak-Metrics-SPI 2.5.3. I get the metrics page, but nothing except JVM metrics. In the logs I see the same message as @NCrustand , We also do have Am I to understand that we can have logging, or we can have metrics, but we can't have both? |
I think I've managed to figure out the issue. When we enabled From that post:
We copy/pasted that, and it had been working fine. However today while debugging this issue I was reading up on SPI and read that:
Thus it seemed plausible that defining I updated our pre-start script to the following and now everything seems to be happy:
We now get both events written to logs, and metrics. |
Description
I'm trying to deploy the metrics spi to Keycloak 10.0.1 using Docker. I have tried multiple ways of deploying (copy file to standalone/deployments, deploy-command from cli, module add from cli), but it doesn't seem to work as expected. The logs state that the jar is deployed and everything is fine, but still metrics-listener does not appear in the provider list. To make things even more strange, the "metrics" provider appears, along with the metrics endpoint. So it seems only parts of the content of the jar is deployed, with the logs giving no indication of anything being wrong while deploying.
I'm quite stuck at this point, and close to giving up on the whole thing. Any points as to where/how to debug this?
The text was updated successfully, but these errors were encountered: