sentry-java
sentry-java copied to clipboard
Support Spring's new RestClient with auto configuration
Problem Statement
As Spring 6.1 introduced the new RestClient approach for calling HTTP APIs, the Sentry SDK is not yet providing an auto configuration for it to set the SentrySpanClientHttpRequestInterceptor during the creation of a new client with the RestClient.Builder.
Solution Brainstorm
Change a few things:
- Create a new class named
SentrySpanRestClientCustomizerthat extends the RestClientCustomizer - Update the
SentryAutoConfigurationto register the customizer - Write the necessary tasks
Hey @nandorholozsnyak thanks for opening up this issue and contributing a PR: https://github.com/getsentry/sentry-java/pull/3199 If you need some help on the PR itself, kindly let us know in the comments.
Hey @markushi I'll try to finalize the PR this week. Everything is looking good.
Hey @nandorholozsnyak thanks for opening up this issue and contributing a PR: #3199 If you need some help on the PR itself, kindly let us know in the comments.
Hello there, code seems to be finalized for review. Please check the associated PR. I have a few concerns around the equality check, but I tried to use the same concept as in the RestTemplate one...
Implemented in https://github.com/getsentry/sentry-java/pull/3199