Repository navigation
[Authentication]Add authentication metrics - #9244
Conversation
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
4 similar comments
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
Fix counters and labels name Co-authored-by: lipenghui <[email protected]>
f959cc8 to
7b29e67
Compare
|
/pulsarbot run-failure-checks |
1 similar comment
|
/pulsarbot run-failure-checks |
codelipenghui
left a comment
There was a problem hiding this comment.
BTW, could you please show me how the AuthenticationMetrics.java interact with the prometheus metrcis generator? Seems I can find it.
Whenever a successful authentication is triggered, the log is stored in the |
|
/pulsarbot run-failure-checks |
### Motivation Currently, if many clients are failing to authenticate, it might not be clear as to the reason why. For JWT auth for example, it could be because the JWT failed to validate, or that a token is expired. In a busy system, these messages are too noisy to log, so we should instead consider metrics that provide info on successful vs failed auths, as well as auth failure reasons ### Modifications * Implement `AuthenticationMetrics` API that allows for instrumenting auth success, and auth failures, with a Prometheus compatible attribute used to distinguish failure reasons. * Add auth metrics instrument to the `basic auth`, `jwt auth`, `tls auth`, `athenz auth` and `sasl auth`. (cherry picked from commit f89dbb6)
Master Issue: streamnative/platform-epics#217
Motivation
Currently, if many clients are failing to authenticate, it might not be clear as to the reason why. For JWT auth for example, it could be because the JWT failed to validate, or that a token is expired. In a busy system, these messages are too noisy to log, so we should instead consider metrics that provide info on successful vs failed auths, as well as auth failure reasons
Modifications
Implement
AuthenticationMetricsAPI that allows for instrumenting auth success, and auth failures, with a Prometheus compatible attribute used to distinguish failure reasons.Add auth metrics instrument to the
basic auth,jwt auth,tls auth,athenz authandsasl auth.Add metric
pulsar_authentication_success_countwith two labelsprovider_nameandauth_methodAdd metric
pulsar_authentication_failures_countwith 3 labelsprovider_name,auth_methodandreasonVerifying this change
This change is already covered by existing tests, such as testAuthMetrics.