Skip to content

Commit ff09dc4

Browse files
authored
Report missing integrations (#4229)
* Report missing integrations * fix name * spotless
1 parent 66c895b commit ff09dc4

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

sentry-android-core/src/main/java/io/sentry/android/core/CurrentActivityIntegration.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
package io.sentry.android.core;
22

3+
import static io.sentry.util.IntegrationUtils.addIntegrationToSdkVersion;
4+
35
import android.app.Activity;
46
import android.app.Application;
57
import android.os.Bundle;
68
import androidx.annotation.NonNull;
79
import io.sentry.IScopes;
810
import io.sentry.Integration;
11+
import io.sentry.SentryLevel;
912
import io.sentry.SentryOptions;
1013
import io.sentry.util.Objects;
1114
import java.io.Closeable;
@@ -27,6 +30,8 @@ public CurrentActivityIntegration(final @NotNull Application application) {
2730
@Override
2831
public void register(@NotNull IScopes scopes, @NotNull SentryOptions options) {
2932
application.registerActivityLifecycleCallbacks(this);
33+
options.getLogger().log(SentryLevel.DEBUG, "CurrentActivityIntegration installed.");
34+
addIntegrationToSdkVersion("CurrentActivity");
3035
}
3136

3237
@Override

sentry-android-core/src/main/java/io/sentry/android/core/EnvelopeFileObserverIntegration.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.sentry.android.core;
22

3+
import static io.sentry.util.IntegrationUtils.addIntegrationToSdkVersion;
4+
35
import io.sentry.ILogger;
46
import io.sentry.IScopes;
57
import io.sentry.ISentryLifecycleToken;
@@ -80,6 +82,7 @@ private void startOutboxSender(
8082
try {
8183
observer.startWatching();
8284
options.getLogger().log(SentryLevel.DEBUG, "EnvelopeFileObserverIntegration installed.");
85+
addIntegrationToSdkVersion("EnvelopeFileObserver");
8386
} catch (Throwable e) {
8487
// it could throw eg NoSuchFileException or NullPointerException
8588
options

sentry-openfeign/src/main/java/io/sentry/openfeign/SentryFeignClient.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22

33
import static io.sentry.TypeCheckHint.OPEN_FEIGN_REQUEST;
44
import static io.sentry.TypeCheckHint.OPEN_FEIGN_RESPONSE;
5+
import static io.sentry.util.IntegrationUtils.addIntegrationToSdkVersion;
56

67
import feign.Client;
78
import feign.Request;
89
import feign.Response;
910
import io.sentry.BaggageHeader;
1011
import io.sentry.Breadcrumb;
12+
import io.sentry.BuildConfig;
1113
import io.sentry.Hint;
1214
import io.sentry.IScopes;
1315
import io.sentry.ISpan;
16+
import io.sentry.SentryIntegrationPackageStorage;
1417
import io.sentry.SpanDataConvention;
1518
import io.sentry.SpanOptions;
1619
import io.sentry.SpanStatus;
@@ -42,6 +45,13 @@ public SentryFeignClient(
4245
this.delegate = Objects.requireNonNull(delegate, "delegate is required");
4346
this.scopes = Objects.requireNonNull(scopes, "scopes are required");
4447
this.beforeSpan = beforeSpan;
48+
addPackageAndIntegrationInfo();
49+
}
50+
51+
private void addPackageAndIntegrationInfo() {
52+
SentryIntegrationPackageStorage.getInstance()
53+
.addPackage("maven:io.sentry:sentry-openfeign", BuildConfig.VERSION_NAME);
54+
addIntegrationToSdkVersion("OpenFeign");
4555
}
4656

4757
@Override

sentry/src/main/java/io/sentry/SpotlightIntegration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static io.sentry.SentryLevel.DEBUG;
44
import static io.sentry.SentryLevel.ERROR;
55
import static io.sentry.SentryLevel.WARNING;
6+
import static io.sentry.util.IntegrationUtils.addIntegrationToSdkVersion;
67

78
import io.sentry.util.Platform;
89
import java.io.Closeable;
@@ -34,6 +35,7 @@ public void register(@NotNull IScopes scopes, @NotNull SentryOptions options) {
3435
executorService = new SentryExecutorService();
3536
options.setBeforeEnvelopeCallback(this);
3637
logger.log(DEBUG, "SpotlightIntegration enabled.");
38+
addIntegrationToSdkVersion("Spotlight");
3739
} else {
3840
logger.log(
3941
DEBUG,

0 commit comments

Comments
 (0)