If default is set for TOKEN_EXPIRY , the max_expiry or min_expiry won't appear
$ curl -sfS localhost:9793/metrics | grep 'token_expires_in_seconds'
# HELP token_expires_in_seconds Indicates remaining time until the token expires.
# TYPE token_expires_in_seconds gauge
token_expires_in_seconds{domain="domain1",role="role1",type="roletoken"} 14120.64295
token_expires_in_seconds{domain="domain1",role="role1",type="accesstoken"} 12754.642959
token_expires_in_seconds{domain="domain2",role="role2",type="roletoken"} 12754.642952
example 2
$ curl -sfS localhost:9793/metrics | grep 'token_expires_in_seconds'
# HELP token_expires_in_seconds Indicates remaining time until the token expires.
# TYPE token_expires_in_seconds gauge
token_expires_in_seconds{domain="domain",role="users",type="roletoken"} 13877.364748
token_expires_in_seconds{domain="domain",max_expiry="10000",role="role",type="roletoken"} 9510.364777
token_expires_in_seconds{domain="domain",min_expiry="10000",role="role",type="roletoken"} 13923.364768
token_expires_in_seconds{domain="domain",max_expiry="100000",role="role",type="roletoken"} 99486.364787
token_expires_in_seconds{domain="domain",max_expiry="10000",min_expiry="10000",role="role",type="roletoken"} 9560.364757
Example 3 (If number is big)
below example is 30 days long tokens
$ curl -sfS localhost:9793/metrics | grep 'token_expires_in_seconds'
# HELP token_expires_in_seconds Indicates remaining time until the token expires
# TYPE token_expires_in_seconds gauge
token_expires_in_seconds{domain="domain",min_expiry="10000",role="role",type="roletoken"} 2.591979418962684e+06
token_expires_in_seconds{domain="domain",min_expiry="10000",role="role",type="accesstoken"} 2.591979418947666e+06
Type of change
[ ] Bug fix
[x] New feature
[ ] Refactoring (no functional changes, no api changes)
Description
Add token_expires_in_seconds metrics
example 1
If default is set for
TOKEN_EXPIRY
, themax_expiry
ormin_expiry
won't appearexample 2
Example 3 (If number is big)
below example is 30 days long tokens
Type of change
Flags
Checklist
[skip ci]
/[ci skip]
/[no ci]
/[skip actions]
/[actions skip]
in the PR title if necessaryChecklist for maintainer
Squash and merge
[skip ci]
/[ci skip]
/[no ci]
/[skip actions]
/[actions skip]