diff --git a/dart/lib/src/http_client/failed_request_client.dart b/dart/lib/src/http_client/failed_request_client.dart index 13ef3ca691..0990d285f5 100644 --- a/dart/lib/src/http_client/failed_request_client.dart +++ b/dart/lib/src/http_client/failed_request_client.dart @@ -72,7 +72,11 @@ class FailedRequestClient extends BaseClient { Client? client, Hub? hub, }) : _hub = hub ?? HubAdapter(), - _client = client ?? Client(); + _client = client ?? Client() { + if (captureFailedRequests) { + _hub.options.sdk.addIntegration('HTTPClientError'); + } + } final Client _client; final Hub _hub; diff --git a/dart/lib/src/http_client/sentry_http_client.dart b/dart/lib/src/http_client/sentry_http_client.dart index c767dc1999..ce5befbbbf 100644 --- a/dart/lib/src/http_client/sentry_http_client.dart +++ b/dart/lib/src/http_client/sentry_http_client.dart @@ -101,6 +101,7 @@ class SentryHttpClient extends BaseClient { if (networkTracing) { innerClient = TracingClient(client: innerClient, hub: _hub); + _hub.options.sdk.addIntegration('HTTPNetworkTracing'); } // The ordering here matters. diff --git a/dart/lib/src/protocol/sdk_version.dart b/dart/lib/src/protocol/sdk_version.dart index 37c68fe700..2180c4f3c5 100644 --- a/dart/lib/src/protocol/sdk_version.dart +++ b/dart/lib/src/protocol/sdk_version.dart @@ -94,8 +94,11 @@ class SdkVersion { _packages.add(package); } - // Adds an integration + // Adds an integration if not already added void addIntegration(String integration) { + if (_integrations.contains(integration)) { + return; + } _integrations.add(integration); } diff --git a/dio/lib/src/sentry_dio_client_adapter.dart b/dio/lib/src/sentry_dio_client_adapter.dart index cade887276..08c112dc56 100644 --- a/dio/lib/src/sentry_dio_client_adapter.dart +++ b/dio/lib/src/sentry_dio_client_adapter.dart @@ -34,6 +34,8 @@ class SentryDioClientAdapter extends HttpClientAdapter { if (networkTracing) { innerClient = TracingClientAdapter(client: innerClient, hub: _hub); + // ignore: invalid_use_of_internal_member + _hub.options.sdk.addIntegration('DioNetworkTracing'); } // The ordering here matters. diff --git a/dio/lib/src/sentry_dio_extension.dart b/dio/lib/src/sentry_dio_extension.dart index d9168211de..38675e1125 100644 --- a/dio/lib/src/sentry_dio_extension.dart +++ b/dio/lib/src/sentry_dio_extension.dart @@ -40,6 +40,8 @@ extension SentryDioExtension on Dio { // Add FailedRequestInterceptor at index 0, so it's the first interceptor. // This ensures that it is called and not skipped by any previous interceptor. interceptors.insert(0, FailedRequestInterceptor()); + // ignore: invalid_use_of_internal_member + hub.options.sdk.addIntegration('DioHTTPClientError'); } // intercept http requests diff --git a/flutter/lib/src/integrations/load_contexts_integration.dart b/flutter/lib/src/integrations/load_contexts_integration.dart index 36c42212dc..cd4cbf23f6 100644 --- a/flutter/lib/src/integrations/load_contexts_integration.dart +++ b/flutter/lib/src/integrations/load_contexts_integration.dart @@ -159,9 +159,7 @@ class _LoadContextsIntegrationEventProcessor extends EventProcessor { final sdk = event.sdk ?? _options.sdk; for (final integration in integrations) { - if (!sdk.integrations.contains(integration)) { - sdk.addIntegration(integration); - } + sdk.addIntegration(integration); } event = event.copyWith(sdk: sdk); diff --git a/flutter/lib/src/navigation/sentry_navigator_observer.dart b/flutter/lib/src/navigation/sentry_navigator_observer.dart index 51fbb44f65..de5b51c52e 100644 --- a/flutter/lib/src/navigation/sentry_navigator_observer.dart +++ b/flutter/lib/src/navigation/sentry_navigator_observer.dart @@ -68,7 +68,12 @@ class SentryNavigatorObserver extends RouteObserver> { _setRouteNameAsTransaction = setRouteNameAsTransaction, _routeNameExtractor = routeNameExtractor, _additionalInfoProvider = additionalInfoProvider, - _native = SentryNative(); + _native = SentryNative() { + if (enableAutoTransactions) { + // ignore: invalid_use_of_internal_member + _hub.options.sdk.addIntegration('UINavigationTracing'); + } + } final Hub _hub; final bool _enableAutoTransactions; diff --git a/flutter/lib/src/sentry_asset_bundle.dart b/flutter/lib/src/sentry_asset_bundle.dart index fd1e62c595..0f5b66dd98 100644 --- a/flutter/lib/src/sentry_asset_bundle.dart +++ b/flutter/lib/src/sentry_asset_bundle.dart @@ -41,7 +41,14 @@ class SentryAssetBundle implements AssetBundle { bool enableStructuredDataTracing = false, }) : _hub = hub ?? HubAdapter(), _bundle = bundle ?? rootBundle, - _enableStructuredDataTracing = enableStructuredDataTracing; + _enableStructuredDataTracing = enableStructuredDataTracing { + // ignore: invalid_use_of_internal_member + _hub.options.sdk.addIntegration('AssetBundleTracing'); + if (_enableStructuredDataTracing) { + // ignore: invalid_use_of_internal_member + _hub.options.sdk.addIntegration('StructuredDataTracing'); + } + } final Hub _hub; final AssetBundle _bundle;