Skip to content

Commit

Permalink
Add missing event metrics from aerogear/keycloak-metrics-spi to a key…
Browse files Browse the repository at this point in the history
  • Loading branch information
bohmber committed Oct 9, 2024
1 parent d743e34 commit 7faa01b
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public class MicrometerMetricsEventListener implements GlobalEventListenerProvid
private static final String ERROR_TAG = "error";
private static final String EVENT_TAG = "event";
private static final String DESCRIPTION_OF_EVENT_METER = "Keycloak user events";
private static final String KEYCLOAK_METER_NAME_PREFIX = "keycloak_";
// Micrometer naming convention that separates lowercase words with a . (dot) character.
private static final String KEYCLOAK_METER_NAME_PREFIX = "keycloak.";
private static final String USER_EVENTS_METER_NAME = KEYCLOAK_METER_NAME_PREFIX + "user";

private final boolean withIdp, withRealm, withClientId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@

import org.bouncycastle.util.Strings;
import org.keycloak.Config;
import org.keycloak.events.EventType;
import org.keycloak.events.GlobalEventListenerProvider;
import org.keycloak.events.GlobalEventListenerProviderFactory;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.KeycloakSessionFactory;
import org.keycloak.provider.EnvironmentDependentProviderFactory;

import java.util.Locale;

public class MicrometerMetricsEventListenerFactory implements GlobalEventListenerProviderFactory, EnvironmentDependentProviderFactory {

private static final String ID = "micrometer-metrics";
Expand Down
Loading

0 comments on commit 7faa01b

Please sign in to comment.