Skip to content

Commit 4e3cff3

Browse files
committed
move OkHttp auto-config into SentryAutoConfiguration
1 parent 18717d0 commit 4e3cff3

4 files changed

Lines changed: 22 additions & 39 deletions

File tree

‎sentry-spring-boot-4/api/sentry-spring-boot-4.api‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ public class io/sentry/spring/boot4/SentryLogbackInitializer : org/springframewo
3535
public fun supportsEventType (Lorg/springframework/core/ResolvableType;)Z
3636
}
3737

38-
public class io/sentry/spring/boot4/SentryOkHttpAutoConfiguration {
39-
public fun <init> ()V
40-
}
41-
4238
public class io/sentry/spring/boot4/SentryProfilerAutoConfiguration {
4339
public fun <init> ()V
4440
}

‎sentry-spring-boot-4/src/main/java/io/sentry/spring/boot4/SentryAutoConfiguration.java‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,28 @@ static class SentryKafkaQueueConfiguration {
274274
}
275275
}
276276

277+
@Configuration(proxyBeanMethods = false)
278+
@ConditionalOnClass(
279+
name = {
280+
"okhttp3.OkHttpClient",
281+
"io.sentry.okhttp.SentryOkHttpInterceptor",
282+
"io.sentry.okhttp.SentryOkHttpEventListener"
283+
})
284+
@ConditionalOnProperty(name = "sentry.clients.ok-http-enabled", havingValue = "true")
285+
@ConditionalOnMissingClass({
286+
"io.sentry.opentelemetry.SentryAutoConfigurationCustomizerProvider",
287+
"io.sentry.opentelemetry.agent.AgentMarker"
288+
})
289+
@Open
290+
static class SentryOkHttpConfiguration {
291+
292+
@Bean
293+
public static @NotNull SentryOkHttpClientBeanPostProcessor
294+
sentryOkHttpClientBeanPostProcessor() {
295+
return new SentryOkHttpClientBeanPostProcessor();
296+
}
297+
}
298+
277299
@Configuration(proxyBeanMethods = false)
278300
@ConditionalOnClass(ProceedingJoinPoint.class)
279301
@ConditionalOnProperty(

‎sentry-spring-boot-4/src/main/java/io/sentry/spring/boot4/SentryOkHttpAutoConfiguration.java‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

‎sentry-spring-boot-4/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ io.sentry.spring.boot4.SentryAutoConfiguration
22
io.sentry.spring.boot4.SentryProfilerAutoConfiguration
33
io.sentry.spring.boot4.SentryLogbackAppenderAutoConfiguration
44
io.sentry.spring.boot4.SentryLog4j2AppenderAutoConfiguration
5-
io.sentry.spring.boot4.SentryOkHttpAutoConfiguration
65
io.sentry.spring.boot4.SentryWebfluxAutoConfiguration

0 commit comments

Comments
 (0)