RobertIndie commented on a change in pull request #9321:
URL: https://github.com/apache/pulsar/pull/9321#discussion_r565094843
##########
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:
Thanks. It seems unnecessary to record expired time here. Here I made
some changes: Remove the `expiredTime` label in `expiredTokenMetrics`, use
`Histogram` to record tokens that are about to expire and the corresponding
expiration time.
----------------------------------------------------------------
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]