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

Obtaining Login Request Counts at Different Time Intervals #186

Open
Toami79 opened this issue Jan 15, 2024 · 2 comments
Open

Obtaining Login Request Counts at Different Time Intervals #186

Toami79 opened this issue Jan 15, 2024 · 2 comments

Comments

@Toami79
Copy link

Toami79 commented Jan 15, 2024

Description

Hello, I would like to obtain the count of login requests per 1 minute, 1 hour, and 1 day individually, instead of aggregating them in the totalLogins parameter. Does anyone have any suggestions on how I can achieve this in my metrics?

Expected Behavior

keycloak_login_attempts_per_minute{realm="myrealm",provider="keycloak",client_id="myclient",} 2.0
keycloak_login_attempts_per_hour{realm="myrealm",provider="keycloak",client_id="myclient",} 2.0
keycloak_login_attempts_per_day{realm="myrealm",provider="keycloak",client_id="myclient",} 2.0
keycloak_logins_per_minute{realm="myrealm",provider="keycloak",client_id="myclient",} 2.0
keycloak_logins_per_hour{realm="myrealm",provider="keycloak",client_id="myclient",} 2.0
keycloak_logins_per_day{realm="myrealm",provider="keycloak",client_id="myclient",} 2.0

Actual Behavior

keycloak_login_attempts_total{realm="myrealm",provider="keycloak",client_id="myclient",} 2.0
keycloak_logins_total{realm="myrealm",provider="keycloak",client_id="myclient",} 2.0

Environment

  • Operating system: all
  • Project Versions: keycloak 21.0.2
@mmadoo
Copy link

mmadoo commented Jan 24, 2024

Why don't you use prometheus query like increase(keycloak_logins_total[24h]) increase(keycloak_logins_total[1h]) ...

@Toami79
Copy link
Author

Toami79 commented Feb 7, 2024

@mmadoo I want to get these parameters using java code not by prometheus query directly

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

2 participants