-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixed feign-micrometer exception handling. #2644
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
base: master
Are you sure you want to change the base?
Conversation
I've just added some fixes, as there were exceptions when some clients had defined a custom ErrorDecoder. The input stream is consumed, and the decoder throws an exception. This way, we are copying the input stream so it can be used multiple times. |
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.
Can we discuss the need to read the request body into memory more?
micrometer/src/main/java/feign/micrometer/MicrometerObservationCapability.java
Outdated
Show resolved
Hide resolved
Head branch was pushed to by a user without write access
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.
See my other comments
Hello, @velo. Why did you close the PR :( Lets find a solution and make it work.. |
Ops, closed by mistake, my bad |
This PR addresses a gap in Micrometer tracing for Feign clients where exceptions such as 404, 400, 500 were not being marked with error=true in the Observation. As a result, these errors were not visible in distributed traces, making it harder to monitor and troubleshoot failed external calls. |
The current MR improves exception handling for feign-micrometer clients. Previously, exceptions such as 404, 400, 500, etc., were not marked with error=true in the Observation and thus were not reported in the trace as errors.
The exception declaration has been changed from (FeignException ex) to (Exception ex), as none of the supported clients (e.g., Apache HttpClient, OkHttp) throws FeignException, but rather client-specific exceptions.
The fix is currently in production in my organization, and it has been working effectively.
Fixes #2566