Count users in keycloak_count_users metric#83
Open
jermarchand wants to merge 1 commit into
Open
Conversation
Contributor
|
Thanks for the contribution @jermarchand , this looks reasonable to me |
Contributor
|
@jermarchand this works as long as users are created or register through the UI. When using the API to create users (like e.g. the keycloak operator does) no register or create event is fired and the users are not counted. One solution would be to count the users on every regular and admin event. Not sure if this could lead to excessive database queries when scraping metrics often? |
Author
|
I don't know how operator work :/ |
|
@jermarchand Is this PR still relevant? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Add a new metric which is a gauge of the total number of users on the Keycloak instance. #81
What
Add 1 Gauge :
Why
Show the number of users
How
On REGISTER or CREATE/DELETE User events, count the users of the realm.
Verification Steps
Add the steps required to check this change. Following an example.
Checklist:
Progress
Additional Notes
I'm a newby with Prometheus metrics, so fell free to comment and propose better implementation.
Until first REGISTER or CREATE/DELETE User events, the metric is not set.