strimzi / strimzi-kafka-oauth

OAuth2 support for Apache Kafka® to work with many OAuth2 authorization servers
Apache License 2.0
145 stars 90 forks source link

Validation request metric reported incorrectly #203

Open nkostoulas opened 1 year ago

nkostoulas commented 1 year ago

I have enabled OAuth metrics on my strimzi broker cluster and I am exporting these to Prometheus using JMX.

I noticed that the strimzi_oauth_validation_requests_count seems to be incorrectly reported, as when I'm using a Kafka client to request Topic Metadata from the brokers and authenticating with OAuth, the counter metric seems to be incremented as both a success and a failure for each request.

strimzi_oauth_validation_requests_count{kind="jwks", error_type="other", outcome="error", ...} | 14

strimzi_oauth_validation_requests_count{kind="jwks", outcome="success", ...}  | 14

Am I missing something or is this a know issue? I assume this metric is incremented every time there is a client request to Kafka and an error should only be reported if the jwt token is invalid.

nkostoulas commented 1 year ago

Oh this https://github.com/strimzi/strimzi-kafka-oauth/pull/177 might have fixed it. Why would an unsupported callback be called though when using Strimzi?

mstruk commented 1 year ago

Sounds like the same issue, yes.