@@ -51,7 +51,7 @@ Each sampled request executed by this controller method will be turned into a tr
5151Sentry Spring integration provides ` SentrySpanClientHttpRequestInterceptor ` that creates a span for each outgoing HTTP request executed with a ` RestTemplate ` . To use instrumented ` RestTemplate ` make sure to set interceptor on the ` RestTemplate ` bean:
5252
5353``` java {tabTitle:Java (Spring 5)}
54- import io.sentry.IHub ;
54+ import io.sentry.IScopes ;
5555import io.sentry.spring.tracing.SentrySpanClientHttpRequestInterceptor ;
5656import java.util.Collections ;
5757import org.springframework.context.annotation.Bean ;
@@ -63,18 +63,18 @@ import org.springframework.web.util.UriTemplateHandler;
6363class AppConfig {
6464
6565 @Bean
66- RestTemplate restTemplate (IHub hub ) {
66+ RestTemplate restTemplate (IScopes scopes ) {
6767 RestTemplate restTemplate = new RestTemplate ();
6868 SentrySpanClientHttpRequestInterceptor sentryRestTemplateInterceptor =
69- new SentrySpanClientHttpRequestInterceptor (hub );
69+ new SentrySpanClientHttpRequestInterceptor (scopes );
7070 restTemplate. setInterceptors(Collections . singletonList(sentryRestTemplateInterceptor));
7171 return restTemplate;
7272 }
7373}
7474```
7575
7676``` java {tabTitle:Java (Spring 6)}
77- import io.sentry.IHub ;
77+ import io.sentry.IScopes ;
7878import io.sentry.spring.jakarta.tracing.SentrySpanClientHttpRequestInterceptor ;
7979import java.util.Collections ;
8080import org.springframework.context.annotation.Bean ;
@@ -86,18 +86,18 @@ import org.springframework.web.util.UriTemplateHandler;
8686class AppConfig {
8787
8888 @Bean
89- RestTemplate restTemplate (IHub hub ) {
89+ RestTemplate restTemplate (IScopes scopes ) {
9090 RestTemplate restTemplate = new RestTemplate ();
9191 SentrySpanClientHttpRequestInterceptor sentryRestTemplateInterceptor =
92- new SentrySpanClientHttpRequestInterceptor (hub );
92+ new SentrySpanClientHttpRequestInterceptor (scopes );
9393 restTemplate. setInterceptors(Collections . singletonList(sentryRestTemplateInterceptor));
9494 return restTemplate;
9595 }
9696}
9797```
9898
9999``` kotlin {tabTitle:Kotlin (Spring 5)}
100- import io.sentry.IHub
100+ import io.sentry.IScopes
101101import io.sentry.spring.tracing.SentrySpanClientHttpRequestInterceptor
102102import org.springframework.context.annotation.Bean
103103import org.springframework.context.annotation.Configuration
@@ -108,8 +108,8 @@ import org.springframework.web.util.UriTemplateHandler
108108class AppConfig {
109109
110110 @Bean
111- fun restTemplate (hub : IHub ): RestTemplate {
112- val sentryRestTemplateInterceptor = SentrySpanClientHttpRequestInterceptor (hub )
111+ fun restTemplate (scopes : IScopes ): RestTemplate {
112+ val sentryRestTemplateInterceptor = SentrySpanClientHttpRequestInterceptor (scopes )
113113
114114 return RestTemplate ().apply {
115115 interceptors = listOf (sentryRestTemplateInterceptor)
@@ -119,7 +119,7 @@ class AppConfig {
119119```
120120
121121``` kotlin {tabTitle:Kotlin (Spring 6)}
122- import io.sentry.IHub
122+ import io.sentry.IScopes
123123import io.sentry.spring.jakarta.tracing.SentrySpanClientHttpRequestInterceptor
124124import org.springframework.context.annotation.Bean
125125import org.springframework.context.annotation.Configuration
@@ -130,8 +130,8 @@ import org.springframework.web.util.UriTemplateHandler
130130class AppConfig {
131131
132132 @Bean
133- fun restTemplate (hub : IHub ): RestTemplate {
134- val sentryRestTemplateInterceptor = SentrySpanClientHttpRequestInterceptor (hub )
133+ fun restTemplate (scopes : IScopes ): RestTemplate {
134+ val sentryRestTemplateInterceptor = SentrySpanClientHttpRequestInterceptor (scopes )
135135
136136 return RestTemplate ().apply {
137137 interceptors = listOf (sentryRestTemplateInterceptor)
0 commit comments