Skip to content

Commit

Permalink
Hubs/Scopes Merge 13 - Replace IHub with IScopes in samples (#3310)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
adinauer authored Apr 16, 2024
1 parent e11f8b1 commit ec30e19
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ProfilingActivity : AppCompatActivity() {
val traceData = ProfilingTraceData(profile, t)
// Create envelope item from copied profile
val item =
SentryEnvelopeItem.fromProfilingTrace(traceData, Long.MAX_VALUE, Sentry.getCurrentHub().options.serializer)
SentryEnvelopeItem.fromProfilingTrace(traceData, Long.MAX_VALUE, Sentry.getCurrentScopes().options.serializer)
val itemData = item.data

// Compress the envelope item using Gzip
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.sentry.samples.spring.jakarta;

import io.sentry.IHub;
import io.sentry.IScopes;
import io.sentry.spring.jakarta.SentryUserFilter;
import io.sentry.spring.jakarta.SentryUserProvider;
import java.util.List;
Expand All @@ -14,7 +14,7 @@ public class AppConfig {

@Bean
SentryUserFilter sentryUserFilter(
final IHub hub, final List<SentryUserProvider> sentryUserProviders) {
return new SentryUserFilter(hub, sentryUserProviders);
final IScopes scopes, final List<SentryUserProvider> sentryUserProviders) {
return new SentryUserFilter(scopes, sentryUserProviders);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.sentry.samples.spring.jakarta;

import io.sentry.IHub;
import io.sentry.IScopes;
import io.sentry.spring.jakarta.tracing.SentrySpanClientHttpRequestInterceptor;
import java.util.Collections;
import org.springframework.context.annotation.Bean;
Expand All @@ -20,14 +20,14 @@ public class WebConfig {
* Creates a {@link RestTemplate} which calls are intercepted with {@link
* SentrySpanClientHttpRequestInterceptor} to create spans around HTTP calls.
*
* @param hub - sentry hub
* @param scopes - sentry scopes
* @return RestTemplate
*/
@Bean
RestTemplate restTemplate(IHub hub) {
RestTemplate restTemplate(IScopes scopes) {
RestTemplate restTemplate = new RestTemplate();
SentrySpanClientHttpRequestInterceptor sentryRestTemplateInterceptor =
new SentrySpanClientHttpRequestInterceptor(hub);
new SentrySpanClientHttpRequestInterceptor(scopes);
restTemplate.setInterceptors(Collections.singletonList(sentryRestTemplateInterceptor));
return restTemplate;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.sentry.samples.spring;

import io.sentry.IHub;
import io.sentry.IScopes;
import io.sentry.spring.SentryUserFilter;
import io.sentry.spring.SentryUserProvider;
import java.util.List;
Expand All @@ -14,7 +14,7 @@ public class AppConfig {

@Bean
SentryUserFilter sentryUserFilter(
final IHub hub, final List<SentryUserProvider> sentryUserProviders) {
return new SentryUserFilter(hub, sentryUserProviders);
final IScopes scopes, final List<SentryUserProvider> sentryUserProviders) {
return new SentryUserFilter(scopes, sentryUserProviders);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.sentry.samples.spring;

import io.sentry.IHub;
import io.sentry.IScopes;
import io.sentry.spring.tracing.SentrySpanClientHttpRequestInterceptor;
import java.util.Collections;
import org.springframework.context.annotation.Bean;
Expand All @@ -20,14 +20,14 @@ public class WebConfig {
* Creates a {@link RestTemplate} which calls are intercepted with {@link
* SentrySpanClientHttpRequestInterceptor} to create spans around HTTP calls.
*
* @param hub - sentry hub
* @param scopes - sentry scopes
* @return RestTemplate
*/
@Bean
RestTemplate restTemplate(IHub hub) {
RestTemplate restTemplate(IScopes scopes) {
RestTemplate restTemplate = new RestTemplate();
SentrySpanClientHttpRequestInterceptor sentryRestTemplateInterceptor =
new SentrySpanClientHttpRequestInterceptor(hub);
new SentrySpanClientHttpRequestInterceptor(scopes);
restTemplate.setInterceptors(Collections.singletonList(sentryRestTemplateInterceptor));
return restTemplate;
}
Expand Down

0 comments on commit ec30e19

Please sign in to comment.