aerogear / keycloak-metrics-spi

Adds a Metrics Endpoint to Keycloak
Apache License 2.0
526 stars 151 forks source link

Added feature: UUID obfuscation in URI label with URI_METRICS_DETAILED enabled #123

Open comemaryvallee opened 2 years ago

comemaryvallee commented 2 years ago

Motivation

Monitor metrics per realms without constraint of high cardinality due to the presence of UUIDs in the URI label.

What

Added the option to replace user's or client's UUID value in the URI label to a generic {id} value even when the _URI_METRICSDETAILED system variable is set to true.

Why

Needed to be able to monitor metrics with the realm name value present in the URI label but without UUIDs values, due to its high cardinality. The keycloak-metrics-spi evolution added the obfuscation of UUIDs only with the obfuscation of realm name value.

How

By adding a check for a _URI_METRICS_UUIDHIDED system variable set to true & by adding "users" value to the condition of UUID obfuscation.

Checklist:

Additional Notes

Modified the README.md to add the description of this feature.

pb82 commented 2 years ago

thanks @comemaryvallee, that seems very useful. It reduces cardinality but also avoids leaking UUIDs. Is this something you're also interested in @CathalOConnorRH ?

CathalOConnorRH commented 2 years ago

thanks @comemaryvallee, that seems very useful. It reduces cardinality but also avoids leaking UUIDs. Is this something you're also interested in @CathalOConnorRH ?

Hey @pb82 This might be something we could use alright, let me know if you would like me to test this change.

MaksymAtVgs commented 1 year ago

@CathalOConnorRH I'm interested in this changes too, any chances that this PR get merged to the master? And when is the next release expected?