-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: expose JMX metric that classifies an error state #5374
Conversation
e494636
to
f5b48da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. How would we implement more complex classifiers? Is the idea to add more ways of combining classifiers (for example, add an or
method)?
config/ksql-server.properties
Outdated
@@ -56,7 +56,7 @@ ksql.logging.processing.stream.auto.create=true | |||
#------ External service config ------- | |||
|
|||
# The set of Kafka brokers to bootstrap Kafka cluster information from: | |||
bootstrap.servers=localhost:9092 | |||
bootstrap.servers=localhost:29092 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meant to omit this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops I thought I removed that! thanks
* @param other the other classifier to chain | ||
* @return a {@code QueryErrorClassifier} that chains both | ||
*/ | ||
default QueryErrorClassifier and(QueryErrorClassifier other) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is currently not used right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it's not used yet - I'm planning on introducing a regex classifier so that you can chain them (e.g. use MissingTopic.and(SomeRegexClassifier).and(AnotherRegexClassifier)
) this isn't really a boolean "and" but rather a "andThen" - I can rename it
Description
This PR introduces JMX metrics that drill query errors down into more specific categories:
UNKNOWN
,USER
andSYSTEM
(open to better names) when an uncaught error is raised from KafkaStreams.Review Guide
There's a lot in this PR, I can split it up if it helps the review but it's not that many lines of code so I figured it's digestible with a little guide:
QueryError
a throwable paired with a classification of that error (see above)ErrorStateListener
extendsStateListener
to add an additional method that reacts toQueryError
when its raisedQueryErrorClassifier
classifies exceptions; it also supports chaining so we can easily introduce other onesMissingTopicClassifier
will check if any required topics are missing, and if so classifies the error asUSER
QueryMetadata
where I have more information than in theKafkaStreamsBuilder
Testing done
Caused a failure by deleting a necessary topic (
foo
) and then deleting the kafka streams local dir to trigger a faster error. In the logs:I used
jconsole
to make sure that the JMX MBean metrics were properly set. Here's a picture of it below:Reviewer checklist