diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d5c786256..7b59a421d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Feat: Set SDK version on Transactions (#1307) * Fix: Use logger set on SentryOptions in GsonSerializer (#1308) * Fix: Use the bindToScope correctly +* Feat: GraalVM Native Image Compatibility (#1329) * Fix: Allow 0.0 to be set on tracesSampleRate (#1328) * Fix: set "java" platform to transactions #1332 * Feat: Add OkHttp client application interceptor (#1330) diff --git a/sentry-spring-boot-starter/src/main/java/io/sentry/spring/boot/SentryAutoConfiguration.java b/sentry-spring-boot-starter/src/main/java/io/sentry/spring/boot/SentryAutoConfiguration.java index efb07cd221..93f4139cbc 100644 --- a/sentry-spring-boot-starter/src/main/java/io/sentry/spring/boot/SentryAutoConfiguration.java +++ b/sentry-spring-boot-starter/src/main/java/io/sentry/spring/boot/SentryAutoConfiguration.java @@ -41,13 +41,13 @@ import org.springframework.core.annotation.Order; import org.springframework.web.client.RestTemplate; -@Configuration +@Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = "sentry.dsn") @Open public class SentryAutoConfiguration { /** Registers general purpose Sentry related beans. */ - @Configuration + @Configuration(proxyBeanMethods = false) @EnableConfigurationProperties(SentryProperties.class) @Open static class HubConfiguration { @@ -108,7 +108,7 @@ static class HubConfiguration { } /** Registers beans specific to Spring MVC. */ - @Configuration + @Configuration(proxyBeanMethods = false) @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) @Import(SentryWebConfiguration.class) @Open @@ -144,27 +144,27 @@ public FilterRegistrationBean sentryTracingFilter( } } - @Configuration + @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = "sentry.enable-tracing", havingValue = "true") @ConditionalOnClass(ProceedingJoinPoint.class) @Import(SentryAdviceConfiguration.class) @Open static class SentryPerformanceAspectsConfiguration { - @Configuration + @Configuration(proxyBeanMethods = false) @ConditionalOnMissingBean(name = "sentryTransactionPointcut") @Import(SentryTransactionPointcutConfiguration.class) @Open static class SentryTransactionPointcutAutoConfiguration {} - @Configuration + @Configuration(proxyBeanMethods = false) @ConditionalOnMissingBean(name = "sentrySpanPointcut") @Import(SentrySpanPointcutConfiguration.class) @Open static class SentrySpanPointcutAutoConfiguration {} } - @Configuration + @Configuration(proxyBeanMethods = false) @AutoConfigureBefore(RestTemplateAutoConfiguration.class) @ConditionalOnClass(RestTemplate.class) @Open @@ -175,7 +175,7 @@ public SentrySpanRestTemplateCustomizer sentrySpanRestTemplateCustomizer(IHub hu } } - @Configuration + @Configuration(proxyBeanMethods = false) @ConditionalOnMissingBean(ITransportFactory.class) @ConditionalOnClass(ApacheHttpClientTransportFactory.class) @Open diff --git a/sentry-spring-boot-starter/src/main/java/io/sentry/spring/boot/SentryLogbackAppenderAutoConfiguration.java b/sentry-spring-boot-starter/src/main/java/io/sentry/spring/boot/SentryLogbackAppenderAutoConfiguration.java index 5152619c58..7f833e3133 100644 --- a/sentry-spring-boot-starter/src/main/java/io/sentry/spring/boot/SentryLogbackAppenderAutoConfiguration.java +++ b/sentry-spring-boot-starter/src/main/java/io/sentry/spring/boot/SentryLogbackAppenderAutoConfiguration.java @@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration; /** Auto-configures {@link SentryAppender}. */ -@Configuration +@Configuration(proxyBeanMethods = false) @Open @ConditionalOnClass({LoggerContext.class, SentryAppender.class}) @ConditionalOnProperty(name = "sentry.logging.enabled", havingValue = "true", matchIfMissing = true) diff --git a/sentry-spring-boot-starter/src/main/resources/META-INF/native-image/io.sentry/sentry/proxy-config.json b/sentry-spring-boot-starter/src/main/resources/META-INF/native-image/io.sentry/sentry/proxy-config.json new file mode 100644 index 0000000000..210c544e26 --- /dev/null +++ b/sentry-spring-boot-starter/src/main/resources/META-INF/native-image/io.sentry/sentry/proxy-config.json @@ -0,0 +1,10 @@ +[ + [ + "org.springframework.boot.autoconfigure.SpringBootApplication", + "org.springframework.core.annotation.SynthesizedAnnotation" + ], + [ + "org.springframework.boot.SpringBootConfiguration", + "org.springframework.core.annotation.SynthesizedAnnotation" + ] +] diff --git a/sentry-spring/api/sentry-spring.api b/sentry-spring/api/sentry-spring.api index db3ed577da..c503afd939 100644 --- a/sentry-spring/api/sentry-spring.api +++ b/sentry-spring/api/sentry-spring.api @@ -72,9 +72,9 @@ public class io/sentry/spring/SentryWebConfiguration { public class io/sentry/spring/tracing/SentryAdviceConfiguration { public fun ()V public fun sentrySpanAdvice (Lio/sentry/IHub;)Lorg/aopalliance/aop/Advice; - public fun sentrySpanAdvisor (Lio/sentry/IHub;Lorg/springframework/aop/Pointcut;)Lorg/springframework/aop/Advisor; + public fun sentrySpanAdvisor (Lorg/springframework/aop/Pointcut;Lorg/aopalliance/aop/Advice;)Lorg/springframework/aop/Advisor; public fun sentryTransactionAdvice (Lio/sentry/IHub;)Lorg/aopalliance/aop/Advice; - public fun sentryTransactionAdvisor (Lio/sentry/IHub;Lorg/springframework/aop/Pointcut;)Lorg/springframework/aop/Advisor; + public fun sentryTransactionAdvisor (Lorg/springframework/aop/Pointcut;Lorg/aopalliance/aop/Advice;)Lorg/springframework/aop/Advisor; } public abstract interface annotation class io/sentry/spring/tracing/SentrySpan : java/lang/annotation/Annotation { diff --git a/sentry-spring/src/main/java/io/sentry/spring/SentryWebConfiguration.java b/sentry-spring/src/main/java/io/sentry/spring/SentryWebConfiguration.java index ab98467a4b..99e46caa98 100644 --- a/sentry-spring/src/main/java/io/sentry/spring/SentryWebConfiguration.java +++ b/sentry-spring/src/main/java/io/sentry/spring/SentryWebConfiguration.java @@ -9,7 +9,7 @@ import org.springframework.core.annotation.Order; /** Registers Spring Web specific Sentry beans. */ -@Configuration +@Configuration(proxyBeanMethods = false) @Open public class SentryWebConfiguration { diff --git a/sentry-spring/src/main/java/io/sentry/spring/tracing/SentryAdviceConfiguration.java b/sentry-spring/src/main/java/io/sentry/spring/tracing/SentryAdviceConfiguration.java index 91cb42b0d6..58598cb78c 100644 --- a/sentry-spring/src/main/java/io/sentry/spring/tracing/SentryAdviceConfiguration.java +++ b/sentry-spring/src/main/java/io/sentry/spring/tracing/SentryAdviceConfiguration.java @@ -12,7 +12,7 @@ import org.springframework.context.annotation.Configuration; /** Creates advice infrastructure for {@link SentrySpan} and {@link SentryTransaction}. */ -@Configuration +@Configuration(proxyBeanMethods = false) @Open public class SentryAdviceConfiguration { @@ -23,9 +23,9 @@ public class SentryAdviceConfiguration { @Bean public @NotNull Advisor sentryTransactionAdvisor( - final @NotNull IHub hub, - final @NotNull @Qualifier("sentryTransactionPointcut") Pointcut sentryTransactionPointcut) { - return new DefaultPointcutAdvisor(sentryTransactionPointcut, sentryTransactionAdvice(hub)); + final @NotNull @Qualifier("sentryTransactionPointcut") Pointcut sentryTransactionPointcut, + final @NotNull @Qualifier("sentryTransactionAdvice") Advice sentryTransactionAdvice) { + return new DefaultPointcutAdvisor(sentryTransactionPointcut, sentryTransactionAdvice); } @Bean @@ -35,7 +35,8 @@ public class SentryAdviceConfiguration { @Bean public @NotNull Advisor sentrySpanAdvisor( - final IHub hub, final @NotNull @Qualifier("sentrySpanPointcut") Pointcut sentrySpanPointcut) { - return new DefaultPointcutAdvisor(sentrySpanPointcut, sentrySpanAdvice(hub)); + final @NotNull @Qualifier("sentrySpanPointcut") Pointcut sentrySpanPointcut, + final @NotNull @Qualifier("sentrySpanAdvice") Advice sentrySpanAdvice) { + return new DefaultPointcutAdvisor(sentrySpanPointcut, sentrySpanAdvice); } } diff --git a/sentry-spring/src/main/java/io/sentry/spring/tracing/SentrySpanPointcutConfiguration.java b/sentry-spring/src/main/java/io/sentry/spring/tracing/SentrySpanPointcutConfiguration.java index 2219424727..df71a21ea0 100644 --- a/sentry-spring/src/main/java/io/sentry/spring/tracing/SentrySpanPointcutConfiguration.java +++ b/sentry-spring/src/main/java/io/sentry/spring/tracing/SentrySpanPointcutConfiguration.java @@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration; /** AOP pointcut configuration for {@link SentrySpan}. */ -@Configuration +@Configuration(proxyBeanMethods = false) @Open public class SentrySpanPointcutConfiguration { diff --git a/sentry-spring/src/main/java/io/sentry/spring/tracing/SentryTransactionPointcutConfiguration.java b/sentry-spring/src/main/java/io/sentry/spring/tracing/SentryTransactionPointcutConfiguration.java index f5a2a37658..7417392c4e 100644 --- a/sentry-spring/src/main/java/io/sentry/spring/tracing/SentryTransactionPointcutConfiguration.java +++ b/sentry-spring/src/main/java/io/sentry/spring/tracing/SentryTransactionPointcutConfiguration.java @@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration; /** AOP pointcut configuration for {@link SentryTransaction}. */ -@Configuration +@Configuration(proxyBeanMethods = false) @Open public class SentryTransactionPointcutConfiguration { diff --git a/sentry/src/main/resources/META-INF/native-image/io.sentry/sentry/native-image.properties b/sentry/src/main/resources/META-INF/native-image/io.sentry/sentry/native-image.properties new file mode 100644 index 0000000000..14dab7de3e --- /dev/null +++ b/sentry/src/main/resources/META-INF/native-image/io.sentry/sentry/native-image.properties @@ -0,0 +1 @@ +Args = --enable-url-protocols=https diff --git a/sentry/src/main/resources/META-INF/native-image/io.sentry/sentry/reflect-config.json b/sentry/src/main/resources/META-INF/native-image/io.sentry/sentry/reflect-config.json new file mode 100644 index 0000000000..0796429691 --- /dev/null +++ b/sentry/src/main/resources/META-INF/native-image/io.sentry/sentry/reflect-config.json @@ -0,0 +1,163 @@ +[ + { + "name":"io.sentry.Breadcrumb", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.SentryBaseEvent", + "allDeclaredFields":true + }, + { + "name":"io.sentry.SentryEvent", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.SentryValues", + "allDeclaredFields":true + }, + { + "name":"io.sentry.SpanContext", + "allDeclaredFields":true + }, + { + "name":"io.sentry.SpanStatus", + "allDeclaredFields":true + }, + { + "name":"io.sentry.SpanId", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.App", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.Browser", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.Contexts", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.DebugImage", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.DebugMeta", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.Device", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.Gpu", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.Mechanism", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.Message", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.OperatingSystem", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.Request", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.SdkInfo", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.SdkVersion", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.SentryException", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.SentryId", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.SentryPackage", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.SentryRuntime", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.SentrySpan", + "allDeclaredFields":true + }, + { + "name":"io.sentry.protocol.SentryStackFrame", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.SentryStackTrace", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.SentryThread", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.protocol.SentryTransaction", + "allDeclaredFields":true + }, + { + "name":"io.sentry.protocol.User", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.SentryEnvelope", + "allDeclaredFields":true + }, + { + "name":"io.sentry.SentryEnvelopeHeader", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"io.sentry.SentryEnvelopeItem", + "allDeclaredFields":true + }, + { + "name":"io.sentry.SentryEnvelopeItemHeader", + "allDeclaredFields":true + } +]