@@ -55,14 +55,27 @@ public final class AuthorizationFramework extends PluginFramework<IAuthorization
55
55
56
56
private static final Logger LOGGER = LoggerFactory .getLogger (AuthorizationFramework .class );
57
57
58
- private final Counter authStackReloadCounter = Metrics .getRegistry ().counter ("authorization_stack_reload" );
59
- private final Counter authCacheHits = Metrics .getRegistry ().counter ("authorization_cache_hits" );
60
- private final Counter authCacheMisses = Metrics .getRegistry ().counter ("authorization_cache_misses" );
61
- private final Counter authSessionsInvalidated = Metrics .getRegistry ().counter ("authorization_sessions_invalidated" );
62
-
63
- private final Timer authTimer = Metrics .getRegistry ().timer ("authorization" );
64
- private final Timer authPositiveTimer = Metrics .getRegistry ().timer ("authorization_positive" );
65
- private final Timer authNegativeTimer = Metrics .getRegistry ().timer ("authorization_negative" );
58
+ private final Counter authStackReloadCounter = Metrics .getRegistry ().
59
+ counter ("authorization.stack.reload" );
60
+ private final Counter authCacheHits = Counter .builder ("authorization.cache" ).
61
+ description ("authorization cache hits" ).
62
+ tag ("what" , "hits" ).
63
+ register (Metrics .getRegistry ());
64
+ private final Counter authCacheMisses = Counter .builder ("authorization.cache" ).
65
+ description ("authorization cache misses" ).
66
+ tag ("what" , "misses" ).
67
+ register (Metrics .getRegistry ());
68
+ private final Counter authSessionsInvalidated = Metrics .getRegistry ().
69
+ counter ("authorization.sessions.invalidated" );
70
+
71
+ private final Timer authTimerPositive = Timer .builder ("authorization.latency" ).
72
+ description ("authorization latency" ).
73
+ tag ("outcome" , "positive" ).
74
+ register (Metrics .getRegistry ());
75
+ private final Timer authTimerNegative = Timer .builder ("authorization.latency" ).
76
+ description ("authorization latency" ).
77
+ tag ("outcome" , "negative" ).
78
+ register (Metrics .getRegistry ());
66
79
67
80
/**
68
81
* Stack of available plugins/stacks in the order of the execution.
@@ -537,11 +550,10 @@ private boolean checkAll(HttpServletRequest request, String cache, Nameable enti
537
550
}
538
551
539
552
// Update the timers.
540
- authTimer .record (duration );
541
553
if (overallDecision ) {
542
- authPositiveTimer .record (duration );
554
+ authTimerPositive .record (duration );
543
555
} else {
544
- authNegativeTimer .record (duration );
556
+ authTimerNegative .record (duration );
545
557
}
546
558
547
559
m .put (entity .getName (), overallDecision );
0 commit comments