I’m running Keycloak in Azure Webapp. There’s a limitation of having to expose only one port (port forward a port). In my case, I’m doing a default forwarding of 8080. I want to enable metrics which is in port 9000. Is there a way to do this admin port in 8080 with like a switch https://keycloak.host/api/metrics ? Keycloak does this in a -start dev environment just wasn’t sure how I can do it (or if it’s even possible) in a production deployment.
Not 100% I understand the question, but Keycloak already exposes metrics (assuming you have set the --metrics-enabled flag) on port 8080 (or your default HTTP port). See the guide here Enabling Keycloak Metrics - Keycloak
@domv Which version of Keycloak do you run? The nightly build?
Yet (up to KC24), the metrics and health endpoints are available on default ports (http and/or https).
Starting with KC25 (which is the next upcoming major version) the metrics and health endpoints will be put on a separate management interface, which will be available on port 9000 by default. These settings are currently (only) available with the nightly build, but the nightly build is not recommended for production, only for testing new features before release.
Currently I don’t know if it’s possible to change this behavior.
Thanks for the reply dasniko. I’m running a nightly build. The behaviour of having the endpoints management ports in 8080 (like kc24) are available in start-dev. Just wondering if this behaviour can be replicated for production build.
Don’t know if and how this can be configured/changed.
I just tested it here with default settings and latest nightly as of today, and the metrics and health endpoints are only available on mgmt port, also with start-dev, NOT on default ports.
I currently don’t know where to find the documentation for the new management port.