merlimat commented on a change in pull request #9321:
URL: https://github.com/apache/pulsar/pull/9321#discussion_r564687640



##########
File path: 
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProviderToken.java
##########
@@ -202,6 +211,10 @@ private static String validateToken(final String token) 
throws AuthenticationExc
 
             return jwt;
         } catch (JwtException e) {
+            if (e instanceof ExpiredJwtException) {
+                String expiredTime = new Date(1000L * (Integer) 
((ExpiredJwtException) e).getClaims().get("exp")).toString();
+                expiredTokenMetrics.labels(expiredTime).inc();

Review comment:
       This will create an unbound cardinality in the labels values. What's the 
rational to include the absolute time in the metric? 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to