@@ -51,7 +51,7 @@ Each sampled request executed by this controller method will be turned into a tr
51
51
Sentry 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:
52
52
53
53
``` java {tabTitle:Java (Spring 5)}
54
- import io.sentry.IHub ;
54
+ import io.sentry.IScopes ;
55
55
import io.sentry.spring.tracing.SentrySpanClientHttpRequestInterceptor ;
56
56
import java.util.Collections ;
57
57
import org.springframework.context.annotation.Bean ;
@@ -63,18 +63,18 @@ import org.springframework.web.util.UriTemplateHandler;
63
63
class AppConfig {
64
64
65
65
@Bean
66
- RestTemplate restTemplate (IHub hub ) {
66
+ RestTemplate restTemplate (IScopes scopes ) {
67
67
RestTemplate restTemplate = new RestTemplate ();
68
68
SentrySpanClientHttpRequestInterceptor sentryRestTemplateInterceptor =
69
- new SentrySpanClientHttpRequestInterceptor (hub );
69
+ new SentrySpanClientHttpRequestInterceptor (scopes );
70
70
restTemplate. setInterceptors(Collections . singletonList(sentryRestTemplateInterceptor));
71
71
return restTemplate;
72
72
}
73
73
}
74
74
```
75
75
76
76
``` java {tabTitle:Java (Spring 6)}
77
- import io.sentry.IHub ;
77
+ import io.sentry.IScopes ;
78
78
import io.sentry.spring.jakarta.tracing.SentrySpanClientHttpRequestInterceptor ;
79
79
import java.util.Collections ;
80
80
import org.springframework.context.annotation.Bean ;
@@ -86,18 +86,18 @@ import org.springframework.web.util.UriTemplateHandler;
86
86
class AppConfig {
87
87
88
88
@Bean
89
- RestTemplate restTemplate (IHub hub ) {
89
+ RestTemplate restTemplate (IScopes scopes ) {
90
90
RestTemplate restTemplate = new RestTemplate ();
91
91
SentrySpanClientHttpRequestInterceptor sentryRestTemplateInterceptor =
92
- new SentrySpanClientHttpRequestInterceptor (hub );
92
+ new SentrySpanClientHttpRequestInterceptor (scopes );
93
93
restTemplate. setInterceptors(Collections . singletonList(sentryRestTemplateInterceptor));
94
94
return restTemplate;
95
95
}
96
96
}
97
97
```
98
98
99
99
``` kotlin {tabTitle:Kotlin (Spring 5)}
100
- import io.sentry.IHub
100
+ import io.sentry.IScopes
101
101
import io.sentry.spring.tracing.SentrySpanClientHttpRequestInterceptor
102
102
import org.springframework.context.annotation.Bean
103
103
import org.springframework.context.annotation.Configuration
@@ -108,8 +108,8 @@ import org.springframework.web.util.UriTemplateHandler
108
108
class AppConfig {
109
109
110
110
@Bean
111
- fun restTemplate (hub : IHub ): RestTemplate {
112
- val sentryRestTemplateInterceptor = SentrySpanClientHttpRequestInterceptor (hub )
111
+ fun restTemplate (scopes : IScopes ): RestTemplate {
112
+ val sentryRestTemplateInterceptor = SentrySpanClientHttpRequestInterceptor (scopes )
113
113
114
114
return RestTemplate ().apply {
115
115
interceptors = listOf (sentryRestTemplateInterceptor)
@@ -119,7 +119,7 @@ class AppConfig {
119
119
```
120
120
121
121
``` kotlin {tabTitle:Kotlin (Spring 6)}
122
- import io.sentry.IHub
122
+ import io.sentry.IScopes
123
123
import io.sentry.spring.jakarta.tracing.SentrySpanClientHttpRequestInterceptor
124
124
import org.springframework.context.annotation.Bean
125
125
import org.springframework.context.annotation.Configuration
@@ -130,8 +130,8 @@ import org.springframework.web.util.UriTemplateHandler
130
130
class AppConfig {
131
131
132
132
@Bean
133
- fun restTemplate (hub : IHub ): RestTemplate {
134
- val sentryRestTemplateInterceptor = SentrySpanClientHttpRequestInterceptor (hub )
133
+ fun restTemplate (scopes : IScopes ): RestTemplate {
134
+ val sentryRestTemplateInterceptor = SentrySpanClientHttpRequestInterceptor (scopes )
135
135
136
136
return RestTemplate ().apply {
137
137
interceptors = listOf (sentryRestTemplateInterceptor)
0 commit comments