Skip to content
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

Exceptions thrown by custom error handlers are not recorded in RestTemplate observations #32063

Closed
github-actions bot opened this issue Jan 19, 2024 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) theme: observability An issue related to observability and tracing type: backport An issue that is a backport of another issue to a maintenance branch type: bug A general bug
Milestone

Comments

@github-actions
Copy link

Backport of gh-32060

@github-actions github-actions bot added in: web Issues in web modules (web, webmvc, webflux, websocket) theme: observability An issue related to observability and tracing type: backport An issue that is a backport of another issue to a maintenance branch type: bug A general bug labels Jan 19, 2024
@github-actions github-actions bot added this to the 6.0.17 milestone Jan 19, 2024
bclozel added a commit that referenced this issue Jan 22, 2024
Prior to this commit, the `RestTemplate` observation instrumentation
would only record `RestClientException` and `IOException` as errors in
the observation. Other types of errors can be thrown by custom
components, such as `ResponseErrorHandler` and in this case they aren't
recorded with the observation.
Also, the current instrumentation does not create any observation scope
around the execution. While this would have a limited benefit as no
application code is executed there, developers could set up custom
components (such as, again, `ResponseErrorHandler`) that could use
contextual logging with trace ids.

This commit ensures that all `Throwable` are recorded as errors with the
observations and that an observation `Scope` is created around the
execution of the client exchange.

Fixes gh-32063
@bclozel bclozel self-assigned this Jan 22, 2024
Copy link
Author

Fixed via b484ab1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) theme: observability An issue related to observability and tracing type: backport An issue that is a backport of another issue to a maintenance branch type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant