Problem with exposing prometheus metrics for jboss-keycloak

We are unable to expose the prometheus metrics for our jboss verion of keycloak (16.1.1) that we have deployed on our kubernetes cluster. We are currently using the following following helm chart for deploying keycloak:

We added env variables like tohe following:

  1. KC_METRICS_ENABLED
    value: “true”
  2. KEYCLOAK_METRICS_ENABLED
    value: “true”

We are able to view the metrics by logging inside the keycloak pod using the url http://localhost:9990/metrics but we are not able to view the same from outside of the pod.

Kindly advise. Thanks in advance.

Have you exposed the containerPort in your Kubernetes deployment manifest and added the corresponding port the the Service object?

Hi @twiden , yes we have exposed the container ports 9990 and 8080. We ahve added them in the service files as well. But its still the same.