diff --git a/CHANGELOG.md b/CHANGELOG.md index 03c6e8ba08..8d462307d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased * Feat: Refactor OkHttp and Apollo to Kotlin functional interfaces (#1797) +* Feat: Add secondary constructor to SentryInstrumentation (#1804) ## 5.4.0 diff --git a/sentry-graphql/api/sentry-graphql.api b/sentry-graphql/api/sentry-graphql.api index f84711f876..851ea57019 100644 --- a/sentry-graphql/api/sentry-graphql.api +++ b/sentry-graphql/api/sentry-graphql.api @@ -8,6 +8,7 @@ public final class io/sentry/graphql/SentryInstrumentation : graphql/execution/i public fun ()V public fun (Lio/sentry/IHub;)V public fun (Lio/sentry/IHub;Lio/sentry/graphql/SentryInstrumentation$BeforeSpanCallback;)V + public fun (Lio/sentry/graphql/SentryInstrumentation$BeforeSpanCallback;)V public fun beginExecution (Lgraphql/execution/instrumentation/parameters/InstrumentationExecutionParameters;)Lgraphql/execution/instrumentation/InstrumentationContext; public fun createState ()Lgraphql/execution/instrumentation/InstrumentationState; public fun instrumentDataFetcher (Lgraphql/schema/DataFetcher;Lgraphql/execution/instrumentation/parameters/InstrumentationFieldFetchParameters;)Lgraphql/schema/DataFetcher; diff --git a/sentry-graphql/src/main/java/io/sentry/graphql/SentryInstrumentation.java b/sentry-graphql/src/main/java/io/sentry/graphql/SentryInstrumentation.java index fbf2b0ab6b..ace8581ebf 100644 --- a/sentry-graphql/src/main/java/io/sentry/graphql/SentryInstrumentation.java +++ b/sentry-graphql/src/main/java/io/sentry/graphql/SentryInstrumentation.java @@ -30,6 +30,10 @@ public SentryInstrumentation( this.beforeSpan = beforeSpan; } + public SentryInstrumentation(final @Nullable BeforeSpanCallback beforeSpan) { + this(HubAdapter.getInstance(), beforeSpan); + } + public SentryInstrumentation(final @NotNull IHub hub) { this(hub, null); }