Replace internal model id with model name #3

Closed
opened 2023-03-04 15:14:38 +01:00 by sschnabe · 0 comments
sschnabe commented 2023-03-04 15:14:38 +01:00 (Migrated from github.com)

At the moment Event (and AdminEvent) provides only internal database ids. In Grafana/Prometheus/... this must be mapped later to a human readable name. There should be an option to replace this database ids with names.

Todo:

@wistefan any comments?

At the moment [Event](https://github.com/keycloak/keycloak/blob/main/server-spi-private/src/main/java/org/keycloak/events/Event.java#L28) (and [AdminEvent](https://github.com/keycloak/keycloak/blob/main/server-spi-private/src/main/java/org/keycloak/events/admin/AdminEvent.java#L25)) provides only internal database ids. In Grafana/Prometheus/... this must be mapped later to a human readable name. There should be an option to replace this database ids with names. Todo: - replace id with name: - [Event.getRealmId()](https://github.com/keycloak/keycloak/blob/main/server-spi-private/src/main/java/org/keycloak/events/Event.java#L84) with [RealmModel.getName()](https://github.com/keycloak/keycloak/blob/main/server-spi/src/main/java/org/keycloak/models/RealmModel.java#L84) - [Event.getClientId()](https://github.com/keycloak/keycloak/blob/main/server-spi-private/src/main/java/org/keycloak/events/Event.java#L92) with [ClientModel.getClientId()](https://github.com/keycloak/keycloak/blob/main/server-spi/src/main/java/org/keycloak/models/ClientModel.java#L112) - [AdminEvent.getRealmId()](https://github.com/keycloak/keycloak/blob/main/server-spi-private/src/main/java/org/keycloak/events/admin/AdminEvent.java#L105) with [RealmModel.getName()](https://github.com/keycloak/keycloak/blob/main/server-spi/src/main/java/org/keycloak/models/RealmModel.java#L84) - add option `KC_METRICS_EVENT_REPLACE_IDS` with default `true` - add option `KC_METRICS_EVENT_REPLACE_IDS_CACHE_REALMS` with default `true`, will cache realm names locally - add option `KC_METRICS_EVENT_REPLACE_IDS_CACHE_CLIENTS` with default `true`, will cache clientIds locally @wistefan any comments?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: kokuwaio/keycloak-event-metrics#3
No description provided.