Closed thomasdarimont closed 2 years ago
thanks @thomasdarimont , much appreciated. Will this retain compatibility with non X / older Keycloak versions?
@pb82 you're welcome :) I tested this with Keycloak.X 15.0.2 and Keycloak 15.0.2. A wildfly / JBoss EAP based Keycloak server will ignore the annotated MetricsFilterProvider.
:+1: I'll try it with an older version, then it should be good to go
When will fixes be merged?
Looks like I faced with the same problem on Keycloak 15.0.0
@pb82 : The extension currently prevents KeyCloak 16.0.0 from starting, is it possible to merge it quickly please ?
Some unit tests are failing, i'm looking into this now. Will merge once I have them passing or updated.
@thomasdarimont failing tests are caused by the upgrade of prometheus client. This causes some of the metric names to change. I'll merge this, but keep the Prometheus version at 0.9.0 as this would be a breaking change otherwise. We can upgrade that in a separate release.
Motivation
Currently the keycloak-metrics-spi does not work with Keycloak.X because the
MetricsEndpointFactory
explicitly registers aMetricsFilter
instance via theResteasyProviderFactory
, that uses Resteasy 3 API, which is not available in Keycloak.X.What
Add a workaround to be able to use keycloak-metrics-spi with Keycloak and Keycloak.X.
Why
keycloak-metrics-spi did not work with Keycloak.X,
How
This PR adds a guard around the
MetricsFilter
registration in theMetricsEndpointFactory
, which uses the Resteasy 3 API only if available.To register the
MetricsFilter
in Keycloak.X environments, we use the JAX-RS providers support of of the Quarkus platform, which dynamically discovers and registers theMetricsFilterProvider
, which delegates filter invocations to theMetricsFilter
instance.Verification Steps
Add the steps required to check this change. Following an example.
Checklist
[x] Code has been tested locally by PR requester [] Changes have been successfully verified by another team member
Progress
[x] Finished task
Additional Notes
Updated the keycloak version to 15.0.2 Updated the prometheus client version to 0.12.0 Fixed broken references in readme
Fixes https://github.com/aerogear/keycloak-metrics-spi/issues/107