The events CLIENT_LOGIN and CLIENT_LOGIN_ERROR are currently exported as keycloak_user_event_CLIENT_LOGIN and keycloak_user_event_CLIENT_LOGIN_ERROR. With those metrics, only the realm is exposed, it's not possible to get the client_id. So we know only the number of CLIENT_LOGIN against a realm and not who connected through the metrics.
Expected Behavior
I would suggest to export those metrics using the same keycloak_logins and keycloak_failed_login_attempts or create keycloak_client_logins and keycloak_failed_client_login_attempts to easily track those login including the client_id information in the metrics.
For the moment, on my side I added both events in the switch case present in MetricsEventListener. That's the only change needed BTW.
Description
The events CLIENT_LOGIN and CLIENT_LOGIN_ERROR are currently exported as keycloak_user_event_CLIENT_LOGIN and keycloak_user_event_CLIENT_LOGIN_ERROR. With those metrics, only the realm is exposed, it's not possible to get the client_id. So we know only the number of CLIENT_LOGIN against a realm and not who connected through the metrics.
Expected Behavior
I would suggest to export those metrics using the same keycloak_logins and keycloak_failed_login_attempts or create keycloak_client_logins and keycloak_failed_client_login_attempts to easily track those login including the client_id information in the metrics.
For the moment, on my side I added both events in the switch case present in MetricsEventListener. That's the only change needed BTW.
Do you want me to create a PR with this change ?