-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Metric collection for errors always report the same error "ListenerExecutionFailedException" regardless of what's thrown in the consumer method #3741
Comments
@renannprado I think this is how it works now and may not be a bug. With that said, this is an opportunity to correct it so that the error tag contains more information on the exception. We will look into it. Thanks for the report. |
Sounds reasonable, @renannprado . Please, consider contributing the fix: https://github.com/spring-projects/spring-kafka/blob/main/CONTRIBUTING.adoc! |
@artembilan if nobody works on it, I believe I should have some time before the end of the month. Thanks for quick replies! |
Thank you, @renannprado , for letting us know about your availability! Well, we may treat this as a breaking change since we are going to change the value of that For me, as this library developer, it is a bug and has to be fixed. So, tell me, please, @renannprado , how harmful it would be for your metrics collector that some timers are going to be different now? |
@artembilan the label Well I sadly can't stop what I'm doing now to come and fix this bug, so I wanted to report it at least. Please don't wait for me if you'd like to have a release including these changes by Tuesday. Would it be a breaking change though? you're not renaming the label (or are you?) but just making sure the right exception class appears in there. Sure, someone might have an implementation of alert or dashboard relying on exactly this value, but that would be misleading/wrong anyway. From my point of view, it's not going to be a breaking change, because I just started to integrate the metrics, so I don't have any alarms or dashboards using it, you could change it however it makes sense, but I'm only a single user 😁. |
Yeah... |
In what version(s) of Spring for Apache Kafka are you seeing this issue?
3.3.2
Describe the bug
I've followed this part of the documentation to integrate micrometer in the Kafka listener's container:
Then after throwing an exception from the consumer:
This is what I see in the metric:
Without configuring micrometer observation:
I tracked to this piece of code:
spring-kafka/spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/MessagingMessageListenerAdapter.java
Line 428 in f39f892
Though here I don't know if this exclusive to the micrometer version of the metric or not.
I've described as a bug because I find the metric not particular insightful when every error counts towards the same metric regardless of what happens in the consumer.
To Reproduce
Create a kafka consumer, configure micrometer observability (see above), throw a custom exception from within the consumer and check what metric was generated.
Expected behavior
If
MyException
is thrown during the consumption of the message, that's what I'd like to see in the metric.basically:
Maybe I'm oversimplifying and the actual solution is something else, but it makes very explicit what I mean.
And then that's what I would like to see in the metric:
Sample
I didn't prepare one, but if really needed, I can provide.
The text was updated successfully, but these errors were encountered: