Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraalVM Native Image Compatibility. #1329

Merged
merged 10 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -144,27 +144,27 @@ public FilterRegistrationBean<SentryTracingFilter> 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
Expand All @@ -175,7 +175,7 @@ public SentrySpanRestTemplateCustomizer sentrySpanRestTemplateCustomizer(IHub hu
}
}

@Configuration
@Configuration(proxyBeanMethods = false)
@ConditionalOnMissingBean(ITransportFactory.class)
@ConditionalOnClass(ApacheHttpClientTransportFactory.class)
@Open
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
[
"org.springframework.boot.autoconfigure.SpringBootApplication",
"org.springframework.core.annotation.SynthesizedAnnotation"
],
[
"org.springframework.boot.SpringBootConfiguration",
"org.springframework.core.annotation.SynthesizedAnnotation"
]
]
4 changes: 2 additions & 2 deletions sentry-spring/api/sentry-spring.api
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ public class io/sentry/spring/SentryWebConfiguration {
public class io/sentry/spring/tracing/SentryAdviceConfiguration {
public fun <init> ()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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.springframework.core.annotation.Order;

/** Registers Spring Web specific Sentry beans. */
@Configuration
@Configuration(proxyBeanMethods = false)
@Open
public class SentryWebConfiguration {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.springframework.context.annotation.Configuration;

/** AOP pointcut configuration for {@link SentrySpan}. */
@Configuration
@Configuration(proxyBeanMethods = false)
@Open
public class SentrySpanPointcutConfiguration {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.springframework.context.annotation.Configuration;

/** AOP pointcut configuration for {@link SentryTransaction}. */
@Configuration
@Configuration(proxyBeanMethods = false)
@Open
public class SentryTransactionPointcutConfiguration {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Args = --enable-url-protocols=https
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
[
maciejwalkowiak marked this conversation as resolved.
Show resolved Hide resolved
{
"name":"io.sentry.Breadcrumb",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.SentryBaseEvent",
"allDeclaredFields":true
},
{
"name":"io.sentry.SentryEvent",
"allDeclaredFields":true,
"methods":[{"name":"<init>","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":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.App",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.Browser",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.Contexts",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.DebugImage",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.DebugMeta",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.Device",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.Gpu",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.Mechanism",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.Message",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.OperatingSystem",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.Request",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.SdkInfo",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.SdkVersion",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.SentryException",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.SentryId",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.SentryPackage",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.SentryRuntime",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.SentrySpan",
"allDeclaredFields":true
},
{
"name":"io.sentry.protocol.SentryStackFrame",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.SentryStackTrace",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.SentryThread",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.protocol.SentryTransaction",
"allDeclaredFields":true
},
{
"name":"io.sentry.protocol.User",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.SentryEnvelope",
"allDeclaredFields":true
},
{
"name":"io.sentry.SentryEnvelopeHeader",
"allDeclaredFields":true,
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"io.sentry.SentryEnvelopeItem",
"allDeclaredFields":true
},
{
"name":"io.sentry.SentryEnvelopeItemHeader",
"allDeclaredFields":true
}
]