sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Support Spring's new RestClient with auto configuration

Open nandorholozsnyak opened this issue 1 year ago • 2 comments

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 SentrySpanRestClientCustomizer that extends the RestClientCustomizer
  • Update the SentryAutoConfiguration to register the customizer
  • Write the necessary tasks

nandorholozsnyak avatar Feb 08 '24 06:02 nandorholozsnyak

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.

markushi avatar Feb 13 '24 20:02 markushi

Hey @markushi I'll try to finalize the PR this week. Everything is looking good.

nandorholozsnyak avatar Feb 14 '24 05:02 nandorholozsnyak

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...

nandorholozsnyak avatar Mar 04 '24 10:03 nandorholozsnyak

Implemented in https://github.com/getsentry/sentry-java/pull/3199

adinauer avatar Mar 25 '24 13:03 adinauer