diff --git a/Explorer/Assets/DCL/Infrastructure/Global/Dynamic/InitializationFlowContainer.cs b/Explorer/Assets/DCL/Infrastructure/Global/Dynamic/InitializationFlowContainer.cs index e4c79ba31ca..7c81d310ee9 100644 --- a/Explorer/Assets/DCL/Infrastructure/Global/Dynamic/InitializationFlowContainer.cs +++ b/Explorer/Assets/DCL/Infrastructure/Global/Dynamic/InitializationFlowContainer.cs @@ -50,8 +50,6 @@ public static InitializationFlowContainer Create( var checkOnboardingStartupOperation = new CheckOnboardingStartupOperation(loadingStatus, selfProfile, staticContainer.FeatureFlagsCache, decentralandUrlsSource, appArgs, realmNavigationContainer.RealmNavigator); var teleportStartupOperation = new TeleportStartupOperation(loadingStatus, realmContainer.RealmController, staticContainer.ExposedGlobalDataContainer.ExposedCameraData.CameraEntityProxy, realmContainer.TeleportController, staticContainer.ExposedGlobalDataContainer.CameraSamplingData, dynamicWorldParams.StartParcel); - var sentryDiagnostics = new SentryDiagnosticStartupOperation(realmContainer.RealmController, bootstrapContainer.DiagnosticsContainer); - var loadingOperations = new List() { blocklistCheckStartupOperation, @@ -61,7 +59,6 @@ public static InitializationFlowContainer Create( checkOnboardingStartupOperation, teleportStartupOperation, ensureLivekitConnectionStartupOperation, // GateKeeperRoom is dependent on player position so it must be after teleport - sentryDiagnostics }; // The Global PX operation is the 3rd most time-consuming loading stage and it's currently not needed in Local Scene Development diff --git a/Explorer/Assets/DCL/Infrastructure/Global/StaticContainer.cs b/Explorer/Assets/DCL/Infrastructure/Global/StaticContainer.cs index d8a87520e08..b9a981e6468 100644 --- a/Explorer/Assets/DCL/Infrastructure/Global/StaticContainer.cs +++ b/Explorer/Assets/DCL/Infrastructure/Global/StaticContainer.cs @@ -238,6 +238,14 @@ await UniTask.WhenAll( diagnosticsContainer.Sentry!.AddCurrentSceneToScope(scope, container.ScenesCache.CurrentScene.Info); }); + diagnosticsContainer.AddSentryScopeConfigurator(scope => + { + diagnosticsContainer.Sentry?.AddRealmInfoToScope(scope, + container.RealmData.Ipfs.CatalystBaseUrl.Value, + container.RealmData.Ipfs.ContentBaseUrl.Value, + container.RealmData.Ipfs.LambdasBaseUrl.Value); + }); + var renderFeature = container.QualityContainer.RendererFeaturesCache.GetRendererFeature(); if (enableGPUInstancing && renderFeature != null && renderFeature.Settings != null && renderFeature.Settings.FrustumCullingAndLODGenComputeShader != null) { diff --git a/Explorer/Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Handlers/ReportHandlerBase.cs b/Explorer/Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Handlers/ReportHandlerBase.cs index 222c377b296..0828e0c685c 100644 --- a/Explorer/Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Handlers/ReportHandlerBase.cs +++ b/Explorer/Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Handlers/ReportHandlerBase.cs @@ -40,6 +40,8 @@ public void LogException(T ecsSystemException) where T: Exception, IDecentral { if (IsLogMessageAllowed(ecsSystemException, in ecsSystemException.ReportData, LogType.Exception)) LogExceptionInternal(ecsSystemException); + else + HandleSupressedException(ecsSystemException, ecsSystemException.ReportData); } [HideInCallstack] @@ -47,6 +49,8 @@ public void LogException(Exception exception, ReportData reportData, Object cont { if (IsLogMessageAllowed(exception, reportData, LogType.Exception)) LogExceptionInternal(exception, reportData, context); + else + HandleSupressedException(exception, reportData); } internal abstract void LogInternal(LogType logType, ReportData category, Object context, object message); @@ -57,6 +61,8 @@ public void LogException(Exception exception, ReportData reportData, Object cont internal abstract void LogExceptionInternal(Exception exception, ReportData reportData, Object context); + internal virtual void HandleSupressedException(Exception exception, ReportData reportData) { } + [MethodImpl(MethodImplOptions.AggressiveInlining)] private bool IsLogMessageAllowed(in object message, in ReportData reportData, LogType logType) => matrix.IsEnabled(reportData.Category, logType) && !Debounce(in message, in reportData, logType); diff --git a/Explorer/Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Sentry/SentryReportHandler.cs b/Explorer/Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Sentry/SentryReportHandler.cs index 9e9d7e92d23..0dfca47bded 100644 --- a/Explorer/Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Sentry/SentryReportHandler.cs +++ b/Explorer/Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Sentry/SentryReportHandler.cs @@ -86,6 +86,16 @@ internal override void LogExceptionInternal(Exception exception, ReportData repo SentrySdk.CaptureException(exception, reportScope.Value.ExecuteCached); } + internal override void HandleSupressedException(Exception exception, ReportData reportData) + { + //Add breadcrumb for non AB categories. AB categories will flood our Sentry without meaningfull information + if (reportData.Category.Equals(ReportCategory.ASSET_BUNDLES)) + return; + + SentrySdk.AddBreadcrumb( + $"Suppressed exception {reportData.Category}: {exception.Message}"); + } + private void CaptureMessage(string message, ReportData reportData, LogType logType) { // Avoid reporting non-errors to sentry as separate issues (even if they are enabled in the matrix) diff --git a/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs b/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs deleted file mode 100644 index 1612fcc14ae..00000000000 --- a/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Cysharp.Threading.Tasks; -using DCL.Diagnostics; -using ECS.SceneLifeCycle.Realm; -using System; -using System.Threading; -using Utility.Types; - -namespace DCL.UserInAppInitializationFlow.StartupOperations -{ - public class SentryDiagnosticStartupOperation : IStartupOperation - { - private readonly IRealmController realmController; - private readonly DiagnosticsContainer diagnosticsContainer; - - public SentryDiagnosticStartupOperation( - IRealmController realmController, DiagnosticsContainer diagnosticsContainer) - { - this.realmController = realmController; - this.diagnosticsContainer = diagnosticsContainer; - } - - public UniTask> ExecuteAsync(IStartupOperation.Params report, CancellationToken ct) - { - diagnosticsContainer.AddSentryScopeConfigurator((scope) => - { - diagnosticsContainer.Sentry?.AddRealmInfoToScope(scope, - realmController.RealmData.Ipfs.CatalystBaseUrl.Value, - realmController.RealmData.Ipfs.ContentBaseUrl.Value, - realmController.RealmData.Ipfs.LambdasBaseUrl.Value); - }); - - return UniTask.FromResult(EnumResult.SuccessResult()); - } - } -} diff --git a/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs.meta b/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs.meta deleted file mode 100644 index 371328b615d..00000000000 --- a/Explorer/Assets/DCL/UserInAppInitializationFlow/StartupOperations/SentryDiagnosticStartupOperation.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fec913ca7d32401f87374a978275eed5 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Explorer/Assets/DCL/WebRequests/WebRequestController.cs b/Explorer/Assets/DCL/WebRequests/WebRequestController.cs index 652961958fb..c0c7c1ea767 100644 --- a/Explorer/Assets/DCL/WebRequests/WebRequestController.cs +++ b/Explorer/Assets/DCL/WebRequests/WebRequestController.cs @@ -3,6 +3,7 @@ using DCL.Web3.Identities; using DCL.WebRequests.Analytics; using DCL.WebRequests.RequestsHub; +using Sentry; using System; using UnityEngine.Networking; using Utility.Multithreading; @@ -77,8 +78,12 @@ public WebRequestController(IWebRequestsAnalyticsContainer analyticsContainer, I if (envelope.CommonArguments.AttemptsDelayInMilliseconds() > 0) await UniTask.Delay(TimeSpan.FromMilliseconds(envelope.CommonArguments.AttemptsDelayInMilliseconds())); + if (exception.IsIrrecoverableError(attemptsLeft) && !envelope.IgnoreIrrecoverableErrors) + { + SentrySdk.AddBreadcrumb($"Irrecoverable exception occured on loading {typeof(TWebRequest).Name} from {envelope.CommonArguments.URL} with {envelope}\n", level: BreadcrumbLevel.Info); throw; + } } }