aerogear / keycloak-metrics-spi

Adds a Metrics Endpoint to Keycloak
Apache License 2.0
549 stars 156 forks source link

No data to point #139

Open nidhin077 opened 2 years ago

nidhin077 commented 2 years ago

Description

Some of my Keycloak metrics are not displaying values.

Actual Behavior

The keycloak is connected to both Prometheus and Grafana. However, certain metrics indicate "No data to point." Screenshot 2022-06-23 160008

Environment

Keycloak versions: 16.1.1

abyssmemes commented 2 years ago

The same issue, maybe it depends on Prometheus version?

rdavyd commented 2 years ago

I have the same issue with quay.io/keycloak/keycloak:17.0.1-legacy. Description of metrics exists, but these metrics are not published.

$ curl -k  https://10.10.163.139:8443/auth/realms/myrealm/metrics 2>/dev/null | head -n 10
# HELP keycloak_user_event_GRANT_CONSENT_ERROR Generic KeyCloak User event
# TYPE keycloak_user_event_GRANT_CONSENT_ERROR counter
# HELP keycloak_user_event_PERMISSION_TOKEN_ERROR Generic KeyCloak User event
# TYPE keycloak_user_event_PERMISSION_TOKEN_ERROR counter
# HELP keycloak_refresh_tokens_errors Total number of failed token refreshes
# TYPE keycloak_refresh_tokens_errors counter
# HELP keycloak_request_duration Request duration
# TYPE keycloak_request_duration histogram
# HELP keycloak_user_event_REGISTER_NODE_ERROR Generic KeyCloak User event
# TYPE keycloak_user_event_REGISTER_NODE_ERROR counter
$
dj-wasabi commented 2 years ago

Same with the 18.0.2 version.

# HELP keycloak_user_event_SEND_RESET_PASSWORD_total Generic KeyCloak User event
# TYPE keycloak_user_event_SEND_RESET_PASSWORD_total counter
# HELP keycloak_registrations_total Total registered users
# TYPE keycloak_registrations_total counter
# HELP keycloak_registrations_errors_total Total errors on registrations
# TYPE keycloak_registrations_errors_total counter
# HELP keycloak_user_event_REMOVE_FEDERATED_IDENTITY_ERROR_total Generic KeyCloak User event
# TYPE keycloak_user_event_REMOVE_FEDERATED_IDENTITY_ERROR_total counter
# HELP keycloak_user_event_UNREGISTER_NODE_ERROR_total Generic KeyCloak User event
# TYPE keycloak_user_event_UNREGISTER_NODE_ERROR_total counter
# HELP keycloak_user_event_VALIDATE_ACCESS_TOKEN_ERROR_total Generic KeyCloak User event
# TYPE keycloak_user_event_VALIDATE_ACCESS_TOKEN_ERROR_total counter
# HELP keycloak_user_event_LOGOUT_ERROR_total Generic KeyCloak User event
# TYPE keycloak_user_event_LOGOUT_ERROR_total counter
# HELP keycloak_user_event_REFRESH_TOKEN_total Generic KeyCloak User event
# TYPE keycloak_user_event_REFRESH_TOKEN_total counter
# HELP keycloak_user_event_UPDATE_EMAIL_ERROR_total Generic KeyCloak User event
# TYPE keycloak_user_event_UPDATE_EMAIL_ERROR_total counter
# HELP keycloak_user_event_UPDATE_CONSENT_total Generic KeyCloak User event
# TYPE keycloak_user_event_UPDATE_CONSENT_total counter
# HELP keycloak_login_attempts_total Total number of login attempts
# TYPE keycloak_login_attempts_total counter
# HELP keycloak_admin_event_ACTION_total Generic KeyCloak Admin event
# TYPE keycloak_admin_event_ACTION_total counter
# HELP keycloak_user_event_CLIENT_UPDATE_ERROR_total Generic KeyCloak User event
# TYPE keycloak_user_event_CLIENT_UPDATE_ERROR_total counter
# HELP keycloak_user_event_REMOVE_TOTP_total Generic KeyCloak User event
# TYPE keycloak_user_event_REMOVE_TOTP_total counter
# HELP keycloak_user_event_CLIENT_DELETE_ERROR_total Generic KeyCloak User event
# TYPE keycloak_user_event_CLIENT_DELETE_ERROR_total counter
# HELP keycloak_user_event_CLIENT_INITIATED_ACCOUNT_LINKING_ERROR_total Generic KeyCloak User event
# TYPE keycloak_user_event_CLIENT_INITIATED_ACCOUNT_LINKING_ERROR_total counter
# HELP keycloak_user_event_SEND_IDENTITY_PROVIDER_LINK_ERROR_total Generic KeyCloak User event
# TYPE keycloak_user_event_SEND_IDENTITY_PROVIDER_LINK_ERROR_total counter
# HELP keycloak_user_event_IDENTITY_PROVIDER_RETRIEVE_TOKEN_total Generic KeyCloak User event
# TYPE keycloak_user_event_IDENTITY_PROVIDER_RETRIEVE_TOKEN_total counter
# HELP keycloak_user_event_CLIENT_INFO_total Generic KeyCloak User event
# TYPE keycloak_user_event_CLIENT_INFO_total counter
# HELP keycloak_user_event_IDENTITY_PROVIDER_LOGIN_total Generic KeyCloak User event
# TYPE keycloak_user_event_IDENTITY_PROVIDER_LOGIN_total counter

Especially the keycloak_logins doesn't provide any, so lots things that actually don't work for me now in the Dashboard.

ddl-olsonJD commented 1 year ago

Any update on this? I am having similar issues as well, where the keycloak metrics are not working for keycloak 18.0.2.

2tvenom commented 1 year ago

same in 20.0.3

# HELP keycloak_user_event_REMOVE_TOTP Generic KeyCloak User event
# TYPE keycloak_user_event_REMOVE_TOTP counter
# HELP keycloak_user_event_VALIDATE_ACCESS_TOKEN_ERROR Generic KeyCloak User event
# TYPE keycloak_user_event_VALIDATE_ACCESS_TOKEN_ERROR counter
# HELP keycloak_user_event_IDENTITY_PROVIDER_LOGIN Generic KeyCloak User event
# TYPE keycloak_user_event_IDENTITY_PROVIDER_LOGIN counter
# HELP keycloak_user_event_CLIENT_DELETE Generic KeyCloak User event
# TYPE keycloak_user_event_CLIENT_DELETE counter
# HELP keycloak_user_event_FEDERATED_IDENTITY_LINK Generic KeyCloak User event
# TYPE keycloak_user_event_FEDERATED_IDENTITY_LINK counter
# HELP keycloak_user_event_INTROSPECT_TOKEN_ERROR Generic KeyCloak User event
# TYPE keycloak_user_event_INTROSPECT_TOKEN_ERROR counter
# HELP keycloak_user_event_IMPERSONATE_ERROR Generic KeyCloak User event
# TYPE keycloak_user_event_IMPERSONATE_ERROR counter
# HELP keycloak_logins Total successful logins
# TYPE keycloak_logins counter
# HELP keycloak_user_event_UPDATE_EMAIL_ERROR Generic KeyCloak User event
# TYPE keycloak_user_event_UPDATE_EMAIL_ERROR counter
# HELP keycloak_user_event_REMOVE_FEDERATED_IDENTITY_ERROR Generic KeyCloak User event
# TYPE keycloak_user_event_REMOVE_FEDERATED_IDENTITY_ERROR counter
# HELP keycloak_user_event_USER_INFO_REQUEST Generic KeyCloak User event
# TYPE keycloak_user_event_USER_INFO_REQUEST counter
# HELP keycloak_user_event_CLIENT_INITIATED_ACCOUNT_LINKING_ERROR Generic KeyCloak User event
# TYPE keycloak_user_event_CLIENT_INITIATED_ACCOUNT_LINKING_ERROR counter
# HELP keycloak_admin_event_DELETE Generic KeyCloak Admin event
# TYPE keycloak_admin_event_DELETE counter
# HELP keycloak_user_event_OAUTH2_DEVICE_AUTH Generic KeyCloak User event
# TYPE keycloak_user_event_OAUTH2_DEVICE_AUTH counter
# HELP keycloak_user_event_REGISTER_NODE Generic KeyCloak User event
# TYPE keycloak_user_event_REGISTER_NODE counter
# HELP keycloak_user_event_DELETE_ACCOUNT Generic KeyCloak User event
# TYPE keycloak_user_event_DELETE_ACCOUNT counter
# HELP keycloak_user_event_UPDATE_PASSWORD Generic KeyCloak User event
# TYPE keycloak_user_event_UPDATE_PASSWORD counter
# HELP jvm_memory_pool_allocated_bytes_total Total bytes allocated in a given JVM memory pool. Only updated after GC, not continuously.
# TYPE jvm_memory_pool_allocated_bytes_total counter
2tvenom commented 1 year ago

@ddl-olsonJD @dj-wasabi @nidhin077

it start work after add event listener

image

ddl-olsonJD commented 1 year ago

Yes, agreed. It starts to work upon adding event metrics-listener Ensure that metrics listener does not get removed. I had the case where it would be added, but not saved.

Additionally, though some metrics now work with updating Event Listeners, not all of them work. Though I have not tested 20.0 yet.