Custom Metrics in SPI in Keycloak 13+

110 views
Skip to first unread message

Simon.L...@eventim.de

unread,
Sep 30, 2021, 3:50:55 AM9/30/21
to keyclo...@googlegroups.com
Hello,

We are currently in the process of migrating from Keycloak 11 to 15. In some of our custom SPIs, we are measuring performance with a few metrics. While migrating one of the SPIs, we noticed that the microprofile/smallrye modules are missing from the underlying Wildfly distribution (https://issues.redhat.com/browse/KEYCLOAK-18033), and as such, our metrics can no longer be measured.

Is there a *new* way to get custom metrics in SPIs, or should we manually re-enable those modules as shown in https://github.com/thomasdarimont/keycloak-13.0.1-docker-microprofile-workaround in order to get our metrics to work again?

Best wishes
--
Simon Levermann
Software Development Expert Cross Product Services

simon.l...@eventim.de | www.eventim.de <http://www.eventim.de>
CTS EVENTIM Solutions GmbH | Contrescarpe 75A | D- 28195 Bremen

Verwaltungsanschrift: Contrescarpe 75A– D- 28195 Bremen // Geschäftsführer: Alexander Ruoff, Christoph Bodi
Sitz: Bremen, HRB 19598 – Ust.-ID Nr.: DE 211161916


Thomas Darimont

unread,
Sep 30, 2021, 4:28:59 AM9/30/21
to Simon.L...@eventim.de, Keycloak User
Hello Simon,

I'm afraid there is currently no other way to get smallrye metrics back other than adding the missing modules / extension yourself as shown in my example.

Alternatively you could implement your own metrics collection on top of https://github.com/aerogear/keycloak-metrics-spi or https://github.com/micrometer-metrics/micrometer-keycloak 

In my keycloak-project-example I have an example setup for Keycloak 15.0.2: https://github.com/thomasdarimont/keycloak-project-example 
Here I use the trick from my example and create a custom Dockerimage with the required smallrye components: https://github.com/thomasdarimont/keycloak-project-example/blob/main/deployments/local/dev/keycloak/Dockerfile


Btw. we are working on a dedicated metrics support for Keycloak.X:

Cheers,
Thomas

--
You received this message because you are subscribed to the Google Groups "Keycloak User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keycloak-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keycloak-user/010A351F-DF30-44B6-856A-95645A8DF3D8%40eventim.de.

Simon.L...@eventim.de

unread,
Sep 30, 2021, 10:52:31 AM9/30/21
to thomas....@googlemail.com, keyclo...@googlegroups.com

Hi Thomas,

 

thanks for the quick reply! We’ll go the route of adding the smallrye metrics components to our deployment, that way we assume the existing code for collecting metrics will simply continue to work. The Keycloak.X metrics support looks promising for future developments of our adapters, we’ll keep an eye on that.

 

Cheers,

Simon

 

From: Thomas Darimont <thomas....@googlemail.com>
Date: Thursday, 30. September 2021 at 10:29
To: "Levermann, Simon" <Simon.L...@eventim.de>
Cc: Keycloak User <keyclo...@googlegroups.com>
Subject: [SPAM] Re: [keycloak-user] Custom Metrics in SPI in Keycloak 13+

 

EXTERNAL                                                                                                                         

Reply all
Reply to author
Forward
0 new messages