-
Notifications
You must be signed in to change notification settings - Fork 1.6k
GH-3741: Fix metric tag to show underlying exception type #3756
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
Conversation
Fixes: spring-projects#3741 Issue: spring-projects#3741 When exceptions occur in Kafka listeners, the metrics currently show `ListenerExecutionFailedException` in both the `error` tag (when using observation) and `exception` tag (when using micrometer without observation), rather than the actual underlying exception. * Modify ListenerContainer to pass actual exception to failure metrics * Update MessagingMessageListenerAdapter to report cause to observation * Add MicrometerMetricsTests to verify both observation and non-observation metrics * Fix ObservationTests to verify correct error reporting in metrics This ensures metrics show the actual underlying exception while maintaining existing span behavior. Signed-off-by: Soby Chacko <[email protected]> **Auto-cherry-pick to `3.3.x` & `3.2.x`**
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.
Just a couple remarks.
Thanks
|
||
/** | ||
* @author Soby Chacko | ||
* @since 3.3.3 |
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.
* @since 3.3.3 | |
* @since 3.2.7 |
static class Config { | ||
|
||
@Bean | ||
KafkaAdmin admin(EmbeddedKafkaBroker broker) { |
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.
I wonder why do we need this bean?
} | ||
|
||
@Bean | ||
SimpleTracer simpleTracer() { |
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.
Do we use this bean somewhere?
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.
sorry - copy error from the other test :)
Yeah... Let's see if we want to have this fix in |
Fixes: #3741
Issue: #3741
When exceptions occur in Kafka listeners, the metrics currently show
ListenerExecutionFailedException
in both theerror
tag (when using observation) andexception
tag (when using micrometer without observation), rather than the actual underlying exception.This ensures metrics show the actual underlying exception while maintaining existing span behavior.
Signed-off-by: Soby Chacko [email protected]
Auto-cherry-pick to
3.3.x
&3.2.x