Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics from multiple realms are not showing up #174

Open
TalhaNaeem101 opened this issue Jul 31, 2023 · 7 comments
Open

Metrics from multiple realms are not showing up #174

TalhaNaeem101 opened this issue Jul 31, 2023 · 7 comments

Comments

@TalhaNaeem101
Copy link

Description

The metrics are not showing up for all realms, it only shows for the master realm. While in the docs it is mentioned that It will return data for all realms, no matter which realm you use in the URL, But IT DOES NOT WORK FOR ME.

Expected Behavior

Metrics of all realms are to be exported in Prometheus and shown in grafana dashboard, the realm dashboard should be showing all the created realms.

Actual Behavior

I am seeing the metrcis of only one realm, i.e. master realm. While I have 4 more realms , but their metrics are not showing up. And the dropdown option for the realms does nott work in Grafana. Here is the screenshot for grafana dashboard, it only shows master realm, even if I use another realm name in endpoint:

image

And the endpoint I have used is: <url>/auth/realms/master/metrics

Environment

keycloak-metrics-spi version: 2.5.3
Keycoak version: 15.0.2 quay.io/keycloak/keycloak:15.0.2
Prometheus version: quay.io/prometheus-operator/prometheus-operator:v0.62.0
Grafana version: 6.48

Dockerfile for metrics-spi Setup:

# Build Stage
FROM maven:3.8.4-openjdk-17-slim AS build
COPY ./keycloak-metrics-spi /app
WORKDIR /app
RUN mvn clean package -DskipTests -Dkeycloak.version=15.0.2
# Final Stage
FROM quay.io/keycloak/keycloak:15.0.2
USER root
RUN mkdir -p /opt/jboss/keycloak/standalone/deployments/
COPY --from=build /app/target/keycloak-metrics-spi-2.5.3-SNAPSHOT.jar /opt/jboss/keycloak/standalone/deployments/
RUN touch /opt/jboss/keycloak/standalone/deployments/keycloak-metrics-spi-2.5.3.jar.dodeploy
RUN chown -R jboss: /opt/jboss/keycloak/standalone/deployments
EXPOSE 8080
USER jboss
CMD ["-b", "0.0.0.0", "-Dkeycloak.profile.feature.metrics=enabled"]

Please help/support in acheiving this milestone, I need to monitor all the realms which are being created programmatically.

@ShadaabSikandar
Copy link

Facing the same issue, need some help +1

@rafaelgomez-facephi
Copy link

Hi, can you confirm that you have added the "metrics listener" listener to realm events?. We had a similar problem and that was the solution.

image

@TalhaNaeem101
Copy link
Author

Thank you for your answer.

Yes, I have already tried with configuring this option, yet no luck.

image

@adrianof22
Copy link

@TalhaNaeem101 Had you setting up the listener in all of your realms? You need to setup each realm that you want to collect metric with the listener, at least was what I did.

@eneamarcantoni99
Copy link

I've the same issue with:
Keycloak: 21.1.2
Keycloak Metrics SPI: 3.0.0
Prometheus: 2.45.0
Grafana: 10.0.2

Someone has solved the issue?
I've already enabled "metrics-listener" for all of my realms.

@eneamarcantoni99
Copy link

I've tried with:
Keycloak: 22.0.1
Keycloak Metrics SPI: 4.0.0

But the issue persists.

@rafaelgomez-facephi
Copy link

It works for me with the following versions:
keycloak: 20.0.5
keycloak Metrics SPI: 3.0.0
Prometheus: 2.46.0
Grafana: 10.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants