-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Record errors thrown by custom handler in RestTemplate observations
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-32060
- Loading branch information
Showing
2 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters