aerogear / keycloak-metrics-spi

Adds a Metrics Endpoint to Keycloak
Apache License 2.0
530 stars 152 forks source link

Add counter metrics for client_login, refresh_token and code_to_token #85

Closed tlereste closed 3 years ago

tlereste commented 3 years ago

Motivation

To improve Keycloak observability @ Cdiscount (e-commerce platform), we need to add new gauge metrics with client_id and error informations.

This PR will also close the issue https://github.com/aerogear/keycloak-metrics-spi/issues/59

What

Adding new gauge metrics :

Why

We need to have the client_id and error informations for theses metrics.

How

I added theses metrics based on the events :

Verification Steps

  1. Build the SPI from this branch and start Keycloak with it.
  2. Login with client (grant_type = "client_credential")
  3. Refresh a token (grant_type = "refresh_token")
  4. Do a authorization (grant_type = "authorization_code")
  5. Open the metrics endpoint in a browser.

Checklist:

Progress

Additional Notes

NA

clementcur commented 3 years ago

Hi @pb82, any chance you can take a look?

pb82 commented 3 years ago

Hey @clementcur , yep sorry. I was planning to make some time for the pull requests in this repo. I'll see if I can get through them today.