[keycloak-dev] Keycloak metrics with Prometheus

David Martin davmarti at redhat.com
Tue Dec 12 05:24:15 EST 2017


Hi,

We're working on an Ansible Playbook Bundle for Keycloak, for the Ansible
Service Broker [0].
As part of a cohesive Mobile backend solution on OpenShift, we're adding
prometheus metrics endpoints to our own (mobile specific) services, and
have had some success with adding a metrics endpoint to Keycloak.

However, we're not convinced the approach for adding the metrics endpoint
is the best approach.

The first approach used the jboss/keycloak-openshift image as a base image,
then added in the necessary parts (jar file & config), producing a new
image.
I'm not a fan of this approach as it means we'll have to maintain the new
image, keeping it up to date as the keycloak-openshift image gets updated.

The second approach (PR in [1]), also uses the jboss/keycloak-openshift
image, but copies the JAR file at APB provision time into a mounted
Persistent Volume in the keycloak-openshift running container.
This approach addresses the image maintenance issue, but feels a bit hacky.

A couple of questions:
* Do you have any thoughts on either of the appraoches so far
* Would it make sense for us to create a PR for keycloak upstream that adds
the necessary bits to expose a prometheus metrics endpoint. This would be
disabled by default, and enabled based on an env var.

Any thoughts or help are welcome.
Thanks

[0] https://github.com/feedhenry/keycloak-apb
[1] https://github.com/feedhenry/keycloak-apb/pull/35/files



-- 
David Martin
Red Hat Mobile
Twitter: @irldavem
IRC: @irldavem (feedhenry, mobile-internal)


More information about the keycloak-dev mailing list