Skip to content

Commit ec30e19

Browse files
authored
Hubs/Scopes Merge 13 - Replace IHub with IScopes in samples (#3310)
* Introduce `IScopes` interface. * Replace `IHub` with `IScopes` in core * Replace `IHub` with `IScopes` in android core * Replace `IHub` with `IScopes` in android integrations * Replace `IHub` with `IScopes` in apollo integrations * Replace `IHub` with `IScopes` in okhttp integration * Replace `IHub` with `IScopes` in graphql integration * Replace `IHub` with `IScopes` in logging integrations * Replace `IHub` with `IScopes` in more integrations * Replace `IHub` with `IScopes` in OTel integration * Replace `IHub` with `IScopes` in Spring 5 / Spring Boot 2 integrations * Replace `IHub` with `IScopes` in Spring 6 / Spring Boot 3 integrations * Replace `IHub` with `IScopes` in samples
1 parent e11f8b1 commit ec30e19

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

sentry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/ProfilingActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class ProfilingActivity : AppCompatActivity() {
100100
val traceData = ProfilingTraceData(profile, t)
101101
// Create envelope item from copied profile
102102
val item =
103-
SentryEnvelopeItem.fromProfilingTrace(traceData, Long.MAX_VALUE, Sentry.getCurrentHub().options.serializer)
103+
SentryEnvelopeItem.fromProfilingTrace(traceData, Long.MAX_VALUE, Sentry.getCurrentScopes().options.serializer)
104104
val itemData = item.data
105105

106106
// Compress the envelope item using Gzip

sentry-samples/sentry-samples-spring-jakarta/src/main/java/io/sentry/samples/spring/jakarta/AppConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.sentry.samples.spring.jakarta;
22

3-
import io.sentry.IHub;
3+
import io.sentry.IScopes;
44
import io.sentry.spring.jakarta.SentryUserFilter;
55
import io.sentry.spring.jakarta.SentryUserProvider;
66
import java.util.List;
@@ -14,7 +14,7 @@ public class AppConfig {
1414

1515
@Bean
1616
SentryUserFilter sentryUserFilter(
17-
final IHub hub, final List<SentryUserProvider> sentryUserProviders) {
18-
return new SentryUserFilter(hub, sentryUserProviders);
17+
final IScopes scopes, final List<SentryUserProvider> sentryUserProviders) {
18+
return new SentryUserFilter(scopes, sentryUserProviders);
1919
}
2020
}

sentry-samples/sentry-samples-spring-jakarta/src/main/java/io/sentry/samples/spring/jakarta/WebConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.sentry.samples.spring.jakarta;
22

3-
import io.sentry.IHub;
3+
import io.sentry.IScopes;
44
import io.sentry.spring.jakarta.tracing.SentrySpanClientHttpRequestInterceptor;
55
import java.util.Collections;
66
import org.springframework.context.annotation.Bean;
@@ -20,14 +20,14 @@ public class WebConfig {
2020
* Creates a {@link RestTemplate} which calls are intercepted with {@link
2121
* SentrySpanClientHttpRequestInterceptor} to create spans around HTTP calls.
2222
*
23-
* @param hub - sentry hub
23+
* @param scopes - sentry scopes
2424
* @return RestTemplate
2525
*/
2626
@Bean
27-
RestTemplate restTemplate(IHub hub) {
27+
RestTemplate restTemplate(IScopes scopes) {
2828
RestTemplate restTemplate = new RestTemplate();
2929
SentrySpanClientHttpRequestInterceptor sentryRestTemplateInterceptor =
30-
new SentrySpanClientHttpRequestInterceptor(hub);
30+
new SentrySpanClientHttpRequestInterceptor(scopes);
3131
restTemplate.setInterceptors(Collections.singletonList(sentryRestTemplateInterceptor));
3232
return restTemplate;
3333
}

sentry-samples/sentry-samples-spring/src/main/java/io/sentry/samples/spring/AppConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.sentry.samples.spring;
22

3-
import io.sentry.IHub;
3+
import io.sentry.IScopes;
44
import io.sentry.spring.SentryUserFilter;
55
import io.sentry.spring.SentryUserProvider;
66
import java.util.List;
@@ -14,7 +14,7 @@ public class AppConfig {
1414

1515
@Bean
1616
SentryUserFilter sentryUserFilter(
17-
final IHub hub, final List<SentryUserProvider> sentryUserProviders) {
18-
return new SentryUserFilter(hub, sentryUserProviders);
17+
final IScopes scopes, final List<SentryUserProvider> sentryUserProviders) {
18+
return new SentryUserFilter(scopes, sentryUserProviders);
1919
}
2020
}

sentry-samples/sentry-samples-spring/src/main/java/io/sentry/samples/spring/WebConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.sentry.samples.spring;
22

3-
import io.sentry.IHub;
3+
import io.sentry.IScopes;
44
import io.sentry.spring.tracing.SentrySpanClientHttpRequestInterceptor;
55
import java.util.Collections;
66
import org.springframework.context.annotation.Bean;
@@ -20,14 +20,14 @@ public class WebConfig {
2020
* Creates a {@link RestTemplate} which calls are intercepted with {@link
2121
* SentrySpanClientHttpRequestInterceptor} to create spans around HTTP calls.
2222
*
23-
* @param hub - sentry hub
23+
* @param scopes - sentry scopes
2424
* @return RestTemplate
2525
*/
2626
@Bean
27-
RestTemplate restTemplate(IHub hub) {
27+
RestTemplate restTemplate(IScopes scopes) {
2828
RestTemplate restTemplate = new RestTemplate();
2929
SentrySpanClientHttpRequestInterceptor sentryRestTemplateInterceptor =
30-
new SentrySpanClientHttpRequestInterceptor(hub);
30+
new SentrySpanClientHttpRequestInterceptor(scopes);
3131
restTemplate.setInterceptors(Collections.singletonList(sentryRestTemplateInterceptor));
3232
return restTemplate;
3333
}

0 commit comments

Comments
 (0)