From 865a445d080f388e6aa11ba653b11137871d1145 Mon Sep 17 00:00:00 2001 From: lcian Date: Wed, 5 Mar 2025 10:44:32 +0100 Subject: [PATCH 1/3] Report missing integrations --- .../android/core/CurrentActivityIntegration.java | 4 ++++ .../android/core/EnvelopeFileObserverIntegration.java | 3 +++ .../java/io/sentry/openfeign/SentryFeignClient.java | 10 ++++++++++ .../src/main/java/io/sentry/SpotlightIntegration.java | 2 ++ 4 files changed, 19 insertions(+) diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/CurrentActivityIntegration.java b/sentry-android-core/src/main/java/io/sentry/android/core/CurrentActivityIntegration.java index 0b618636d32..be62bbce979 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/CurrentActivityIntegration.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/CurrentActivityIntegration.java @@ -1,5 +1,7 @@ package io.sentry.android.core; +import static io.sentry.util.IntegrationUtils.addIntegrationToSdkVersion; + import android.app.Activity; import android.app.Application; import android.os.Bundle; @@ -27,6 +29,8 @@ public CurrentActivityIntegration(final @NotNull Application application) { @Override public void register(@NotNull IScopes scopes, @NotNull SentryOptions options) { application.registerActivityLifecycleCallbacks(this); + options.getLogger().log(SentryLevel.DEBUG, "CurrentActivityIntegration installed."); + addIntegrationToSdkVersion("CurrentActivity"); } @Override diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/EnvelopeFileObserverIntegration.java b/sentry-android-core/src/main/java/io/sentry/android/core/EnvelopeFileObserverIntegration.java index a921f794588..638353d7a69 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/EnvelopeFileObserverIntegration.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/EnvelopeFileObserverIntegration.java @@ -1,5 +1,7 @@ package io.sentry.android.core; +import static io.sentry.util.IntegrationUtils.addIntegrationToSdkVersion; + import io.sentry.ILogger; import io.sentry.IScopes; import io.sentry.ISentryLifecycleToken; @@ -80,6 +82,7 @@ private void startOutboxSender( try { observer.startWatching(); options.getLogger().log(SentryLevel.DEBUG, "EnvelopeFileObserverIntegration installed."); + addIntegrationToSdkVersion("UserInteraction"); } catch (Throwable e) { // it could throw eg NoSuchFileException or NullPointerException options diff --git a/sentry-openfeign/src/main/java/io/sentry/openfeign/SentryFeignClient.java b/sentry-openfeign/src/main/java/io/sentry/openfeign/SentryFeignClient.java index 935c4229ab1..37a52af1646 100644 --- a/sentry-openfeign/src/main/java/io/sentry/openfeign/SentryFeignClient.java +++ b/sentry-openfeign/src/main/java/io/sentry/openfeign/SentryFeignClient.java @@ -2,15 +2,18 @@ import static io.sentry.TypeCheckHint.OPEN_FEIGN_REQUEST; import static io.sentry.TypeCheckHint.OPEN_FEIGN_RESPONSE; +import static io.sentry.util.IntegrationUtils.addIntegrationToSdkVersion; import feign.Client; import feign.Request; import feign.Response; import io.sentry.BaggageHeader; import io.sentry.Breadcrumb; +import io.sentry.BuildConfig; import io.sentry.Hint; import io.sentry.IScopes; import io.sentry.ISpan; +import io.sentry.SentryIntegrationPackageStorage; import io.sentry.SpanDataConvention; import io.sentry.SpanOptions; import io.sentry.SpanStatus; @@ -42,6 +45,13 @@ public SentryFeignClient( this.delegate = Objects.requireNonNull(delegate, "delegate is required"); this.scopes = Objects.requireNonNull(scopes, "scopes are required"); this.beforeSpan = beforeSpan; + addPackageAndIntegrationInfo(); + } + + private void addPackageAndIntegrationInfo() { + SentryIntegrationPackageStorage.getInstance() + .addPackage("maven:io.sentry:sentry-openfeign", BuildConfig.VERSION_NAME); + addIntegrationToSdkVersion("OpenFeign"); } @Override diff --git a/sentry/src/main/java/io/sentry/SpotlightIntegration.java b/sentry/src/main/java/io/sentry/SpotlightIntegration.java index 0b69ae79be7..910259ad131 100644 --- a/sentry/src/main/java/io/sentry/SpotlightIntegration.java +++ b/sentry/src/main/java/io/sentry/SpotlightIntegration.java @@ -3,6 +3,7 @@ import static io.sentry.SentryLevel.DEBUG; import static io.sentry.SentryLevel.ERROR; import static io.sentry.SentryLevel.WARNING; +import static io.sentry.util.IntegrationUtils.addIntegrationToSdkVersion; import io.sentry.util.Platform; import java.io.Closeable; @@ -34,6 +35,7 @@ public void register(@NotNull IScopes scopes, @NotNull SentryOptions options) { executorService = new SentryExecutorService(); options.setBeforeEnvelopeCallback(this); logger.log(DEBUG, "SpotlightIntegration enabled."); + addIntegrationToSdkVersion("Spotlight"); } else { logger.log( DEBUG, From 231f0d693c88bbfa9d95e975af371a91f1e0c083 Mon Sep 17 00:00:00 2001 From: lcian Date: Wed, 5 Mar 2025 10:49:21 +0100 Subject: [PATCH 2/3] fix name --- .../io/sentry/android/core/EnvelopeFileObserverIntegration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/EnvelopeFileObserverIntegration.java b/sentry-android-core/src/main/java/io/sentry/android/core/EnvelopeFileObserverIntegration.java index 638353d7a69..482d90c6e6c 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/EnvelopeFileObserverIntegration.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/EnvelopeFileObserverIntegration.java @@ -82,7 +82,7 @@ private void startOutboxSender( try { observer.startWatching(); options.getLogger().log(SentryLevel.DEBUG, "EnvelopeFileObserverIntegration installed."); - addIntegrationToSdkVersion("UserInteraction"); + addIntegrationToSdkVersion("EnvelopeFileObserver"); } catch (Throwable e) { // it could throw eg NoSuchFileException or NullPointerException options From db7a215db283fe234757cad3f5bce5af64c186e6 Mon Sep 17 00:00:00 2001 From: lcian Date: Wed, 5 Mar 2025 11:00:06 +0100 Subject: [PATCH 3/3] spotless --- .../java/io/sentry/android/core/CurrentActivityIntegration.java | 1 + 1 file changed, 1 insertion(+) diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/CurrentActivityIntegration.java b/sentry-android-core/src/main/java/io/sentry/android/core/CurrentActivityIntegration.java index be62bbce979..3ce358efbc5 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/CurrentActivityIntegration.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/CurrentActivityIntegration.java @@ -8,6 +8,7 @@ import androidx.annotation.NonNull; import io.sentry.IScopes; import io.sentry.Integration; +import io.sentry.SentryLevel; import io.sentry.SentryOptions; import io.sentry.util.Objects; import java.io.Closeable;