Skip to content

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

r-dimitrov
Copy link

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

@velo velo enabled auto-merge (squash) November 22, 2024 12:19
github-actions[bot]

This comment was marked as off-topic.

@r-dimitrov r-dimitrov disabled auto-merge November 22, 2024 12:48
@r-dimitrov
Copy link
Author

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.

@velo velo enabled auto-merge (squash) December 9, 2024 01:11
github-actions[bot]

This comment was marked as off-topic.

Copy link
Member

@kdavisk6 kdavisk6 left a 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?

auto-merge was automatically disabled January 10, 2025 17:01

Head branch was pushed to by a user without write access

@r-dimitrov r-dimitrov requested a review from kdavisk6 January 20, 2025 08:37
Copy link
Member

@kdavisk6 kdavisk6 left a 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

@r-dimitrov r-dimitrov requested a review from kdavisk6 January 28, 2025 14:03
@velo velo closed this Feb 10, 2025
@r-dimitrov
Copy link
Author

Hello, @velo. Why did you close the PR :( Lets find a solution and make it work..

@velo
Copy link
Member

velo commented Feb 11, 2025

Ops, closed by mistake, my bad

@velo velo reopened this Feb 11, 2025
@r-dimitrov
Copy link
Author

@velo @kdavisk6 Hello, guys! Could we proceed with merging the PR? It's in good shape, and it's truly a must-have feature when it comes to distributed tracing. Thank you so much for all the great work you do — it's truly appreciated!

@diniodinev
Copy link

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.
So we need that also in our organization. Any updates when it will be ready?

@velo velo enabled auto-merge (squash) April 22, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] MicrometerObservationCapability not reporting timeouts
4 participants