From 772d806ca24bfa1a29bdc037f3546abe163a9856 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 17 Apr 2025 17:53:35 +0200 Subject: [PATCH 01/10] first iteration --- .../Integrations/SessionIntegration.cs | 2 - .../TraceGenerationIntegration.cs | 34 ++++++++ src/Sentry.Unity/SentryMonoBehaviour.cs | 7 +- src/Sentry.Unity/SentryUnityOptions.cs | 1 + src/Sentry.Unity/SentryUnitySDK.cs | 5 -- .../TraceGenerationIntegrationTests.cs | 80 +++++++++++++++++++ 6 files changed, 121 insertions(+), 8 deletions(-) create mode 100644 src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs create mode 100644 test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs diff --git a/src/Sentry.Unity/Integrations/SessionIntegration.cs b/src/Sentry.Unity/Integrations/SessionIntegration.cs index d02d2c0c2..c966d2227 100644 --- a/src/Sentry.Unity/Integrations/SessionIntegration.cs +++ b/src/Sentry.Unity/Integrations/SessionIntegration.cs @@ -19,8 +19,6 @@ public void Register(IHub hub, SentryOptions options) return; } - options.DiagnosticLogger?.LogDebug("Registering Session integration."); - _sentryMonoBehaviour.ApplicationResuming += () => { options.DiagnosticLogger?.LogDebug("Resuming session."); diff --git a/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs b/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs new file mode 100644 index 000000000..dbd662d93 --- /dev/null +++ b/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs @@ -0,0 +1,34 @@ +using Sentry.Extensibility; +using Sentry.Integrations; + +namespace Sentry.Unity.Integrations; + +internal class TraceGenerationIntegration : ISdkIntegration +{ + private readonly ISceneManager _sceneManager; + private readonly ISentryMonoBehaviour _sentryMonoBehaviour; + + public TraceGenerationIntegration(SentryMonoBehaviour sentryMonoBehaviour) : this(sentryMonoBehaviour, SceneManagerAdapter.Instance) + {} + + internal TraceGenerationIntegration(ISentryMonoBehaviour sentryMonoBehaviour, ISceneManager sceneManager) + { + _sceneManager = sceneManager; + _sentryMonoBehaviour = sentryMonoBehaviour; + } + + public void Register(IHub hub, SentryOptions options) + { + _sentryMonoBehaviour.ApplicationResuming += () => + { + options.DiagnosticLogger?.LogDebug("Application resumed. Creating new Trace."); + SentrySdk.SetTrace(SentryId.Create(), SpanId.Create()); + }; + + _sceneManager.ActiveSceneChanged += (_, _) => + { + options.DiagnosticLogger?.LogDebug("Active Scene changed. Creating new Trace."); + SentrySdk.SetTrace(SentryId.Create(), SpanId.Create()); + }; + } +} diff --git a/src/Sentry.Unity/SentryMonoBehaviour.cs b/src/Sentry.Unity/SentryMonoBehaviour.cs index f2ba0adf6..0945d3e72 100644 --- a/src/Sentry.Unity/SentryMonoBehaviour.cs +++ b/src/Sentry.Unity/SentryMonoBehaviour.cs @@ -4,11 +4,16 @@ namespace Sentry.Unity; +internal interface ISentryMonoBehaviour +{ + event Action? ApplicationResuming; +} + /// /// Singleton and DontDestroyOnLoad setup. /// [AddComponentMenu("")] // Hides it from being added as a component in the inspector -public partial class SentryMonoBehaviour : MonoBehaviour +public partial class SentryMonoBehaviour : MonoBehaviour, ISentryMonoBehaviour { private static SentryMonoBehaviour? _instance; public static SentryMonoBehaviour Instance diff --git a/src/Sentry.Unity/SentryUnityOptions.cs b/src/Sentry.Unity/SentryUnityOptions.cs index 7cc9773f5..7be25356c 100644 --- a/src/Sentry.Unity/SentryUnityOptions.cs +++ b/src/Sentry.Unity/SentryUnityOptions.cs @@ -319,6 +319,7 @@ internal SentryUnityOptions(SentryMonoBehaviour behaviour, IApplication applicat this.AddIntegration(new UnityBeforeSceneLoadIntegration()); this.AddIntegration(new SceneManagerIntegration()); this.AddIntegration(new SessionIntegration(behaviour)); + this.AddIntegration(new TraceGenerationIntegration(behaviour)); this.AddExceptionFilter(new UnityBadGatewayExceptionFilter()); this.AddExceptionFilter(new UnityWebExceptionFilter()); diff --git a/src/Sentry.Unity/SentryUnitySDK.cs b/src/Sentry.Unity/SentryUnitySDK.cs index c32ae428d..029e34194 100644 --- a/src/Sentry.Unity/SentryUnitySDK.cs +++ b/src/Sentry.Unity/SentryUnitySDK.cs @@ -51,11 +51,6 @@ private SentryUnitySdk(SentryUnityOptions options) unitySdk._dotnetSdk = SentrySdk.Init(options); - // For now, we're creating a new trace after initializing to be able to tie errors and crashes together on all - // layers. To be able to regenerate new traces based on some mechanism, this will move into some sort of - // integration i.e. scene manager. - SentrySdk.SetTrace(SentryId.Create(), SpanId.Create()); - if (options.NativeContextWriter is { } contextWriter) { SentrySdk.ConfigureScope((scope) => diff --git a/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs b/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs new file mode 100644 index 000000000..6f2ebe2d0 --- /dev/null +++ b/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs @@ -0,0 +1,80 @@ +using System; +using System.Linq; +using NUnit.Framework; +using Sentry.Extensibility; +using Sentry.Unity.Integrations; +using Sentry.Unity.Tests.SharedClasses; +using Sentry.Unity.Tests.Stubs; +using static Sentry.Unity.Tests.SceneManagerIntegrationTests; + +namespace Sentry.Unity.Tests; + +public class TraceGenerationIntegrationTests +{ + private class Fixture + { + public FakeSceneManager SceneManager { get; set; } = new(); + public TestSentryMonoBehaviour SentryMonoBehaviour { get; set; } = new(); + public TestHub TestHub { get; set; } = new(); + public TestLogger Logger { get; set; } = new(); + public SentryOptions SentryOptions { get; set; } + + public Fixture() => SentryOptions = new SentryOptions { DiagnosticLogger = Logger }; + + public TraceGenerationIntegration GetSut() => new(SentryMonoBehaviour, SceneManager); + } + + private readonly Fixture _fixture = new(); + + [SetUp] + public void SetUp() + { + _fixture.TestHub = new TestHub(); + SentrySdk.UseHub(_fixture.TestHub); + } + + [Test] + public void TraceGeneration_OnApplicationResume_GeneratesNewTrace() + { + // Arrange + var sut = _fixture.GetSut(); + sut.Register(_fixture.TestHub, _fixture.SentryOptions); + + // Act + _fixture.SentryMonoBehaviour.ResumeApplication(); + + // Assert + var configureScope = _fixture.TestHub.ConfigureScopeCalls.Single(); + var scope = new Scope(_fixture.SentryOptions); + var initialPropagationContext = scope.PropagationContext; + configureScope(scope); + + Assert.AreNotEqual(initialPropagationContext, scope.PropagationContext); + } + + [Test] + public void TraceGeneration_OnActiveSceneChange_GeneratesNewTrace() + { + // Arrange + var sut = _fixture.GetSut(); + sut.Register(_fixture.TestHub, _fixture.SentryOptions); + + // Act + _fixture.SceneManager.OnActiveSceneChanged(new SceneAdapter("from scene name"), new SceneAdapter("to scene name")); + + // Assert + var configureScope = _fixture.TestHub.ConfigureScopeCalls.Single(); + var scope = new Scope(_fixture.SentryOptions); + var initialPropagationContext = scope.PropagationContext; + configureScope(scope); + + Assert.AreNotEqual(initialPropagationContext, scope.PropagationContext); + } + + internal class TestSentryMonoBehaviour : ISentryMonoBehaviour + { + public event Action? ApplicationResuming; + + public void ResumeApplication() => ApplicationResuming?.Invoke(); + } +} From 578aed52a927964f8b6c2d57f120f2f66c968d34 Mon Sep 17 00:00:00 2001 From: Sentry Github Bot Date: Thu, 17 Apr 2025 15:56:11 +0000 Subject: [PATCH 02/10] Format code --- modules/sentry-native | 2 +- src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/sentry-native b/modules/sentry-native index 69f006a72..19d50848f 160000 --- a/modules/sentry-native +++ b/modules/sentry-native @@ -1 +1 @@ -Subproject commit 69f006a722ac1688ff3373acf0f7dcf0b067b56f +Subproject commit 19d50848fb80a7f56f98fe30fef6731b1eedb8b3 diff --git a/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs b/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs index dbd662d93..9b4dc75c5 100644 --- a/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs +++ b/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs @@ -9,7 +9,7 @@ internal class TraceGenerationIntegration : ISdkIntegration private readonly ISentryMonoBehaviour _sentryMonoBehaviour; public TraceGenerationIntegration(SentryMonoBehaviour sentryMonoBehaviour) : this(sentryMonoBehaviour, SceneManagerAdapter.Instance) - {} + { } internal TraceGenerationIntegration(ISentryMonoBehaviour sentryMonoBehaviour, ISceneManager sceneManager) { From 1d17bef52c0716cd54e0a05b5a612ed6176e138b Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Tue, 22 Apr 2025 14:26:35 +0200 Subject: [PATCH 03/10] finalized --- src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs | 6 ++++-- src/sentry-dotnet | 2 +- test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs b/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs index dbd662d93..48c6655cb 100644 --- a/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs +++ b/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs @@ -22,13 +22,15 @@ public void Register(IHub hub, SentryOptions options) _sentryMonoBehaviour.ApplicationResuming += () => { options.DiagnosticLogger?.LogDebug("Application resumed. Creating new Trace."); - SentrySdk.SetTrace(SentryId.Create(), SpanId.Create()); + hub.ConfigureScope(scope => + scope.SetPropagationContext(new SentryPropagationContext(SentryId.Create(), SpanId.Create()))); }; _sceneManager.ActiveSceneChanged += (_, _) => { options.DiagnosticLogger?.LogDebug("Active Scene changed. Creating new Trace."); - SentrySdk.SetTrace(SentryId.Create(), SpanId.Create()); + hub.ConfigureScope(scope => + scope.SetPropagationContext(new SentryPropagationContext(SentryId.Create(), SpanId.Create()))); }; } } diff --git a/src/sentry-dotnet b/src/sentry-dotnet index 47719fbe4..5ae3d67cc 160000 --- a/src/sentry-dotnet +++ b/src/sentry-dotnet @@ -1 +1 @@ -Subproject commit 47719fbe4fce9f86725c1e27c4644a59b9594446 +Subproject commit 5ae3d67cc20757661c61e6ae7af0feac928ea99d diff --git a/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs b/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs index 6f2ebe2d0..1f696dda9 100644 --- a/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs +++ b/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs @@ -1,7 +1,6 @@ using System; using System.Linq; using NUnit.Framework; -using Sentry.Extensibility; using Sentry.Unity.Integrations; using Sentry.Unity.Tests.SharedClasses; using Sentry.Unity.Tests.Stubs; From d9e1831d347e3ea09331482ac998a816898360ff Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Tue, 22 Apr 2025 14:38:15 +0200 Subject: [PATCH 04/10] Updated CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac18d06d0..37cfd2efc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Features +- The SDK now recreates a new trace based on app focus and active scene changes. ([#2123](https://github.com/getsentry/sentry-unity/pull/2123)) - Drastically improved performance of scope sync when targeting Android ([#2107](https://github.com/getsentry/sentry-unity/pull/2107)) - When running on Android, Windows or Linux, the SDK now links errors and events originating on different layers (managed, native errors) via `trace ID` ([#1997](https://github.com/getsentry/sentry-unity/pull/1997), [#2089](https://github.com/getsentry/sentry-unity/pull/2089)) - The SDK now reports the game's name as part of the app context ([2083](https://github.com/getsentry/sentry-unity/pull/2083)) From 06f1f4520f428922ed46374c753ae9d93760a1a8 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Wed, 23 Apr 2025 16:26:04 +0200 Subject: [PATCH 05/10] additional creation --- .../Integrations/TraceGenerationIntegration.cs | 3 +++ .../TraceGenerationIntegrationTests.cs | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs b/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs index 97df9594d..5ad9c101e 100644 --- a/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs +++ b/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs @@ -19,6 +19,9 @@ internal TraceGenerationIntegration(ISentryMonoBehaviour sentryMonoBehaviour, IS public void Register(IHub hub, SentryOptions options) { + hub.ConfigureScope(scope => + scope.SetPropagationContext(new SentryPropagationContext(SentryId.Create(), SpanId.Create()))); + _sentryMonoBehaviour.ApplicationResuming += () => { options.DiagnosticLogger?.LogDebug("Application resumed. Creating new Trace."); diff --git a/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs b/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs index 1f696dda9..73636ee41 100644 --- a/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs +++ b/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs @@ -32,6 +32,24 @@ public void SetUp() SentrySdk.UseHub(_fixture.TestHub); } + [Test] + public void TraceGeneration_OnRegister_GeneratesInitialTrace() + { + // Arrange + var sut = _fixture.GetSut(); + + // Act + sut.Register(_fixture.TestHub, _fixture.SentryOptions); + + // Assert + var configureScope = _fixture.TestHub.ConfigureScopeCalls.Single(); + var scope = new Scope(_fixture.SentryOptions); + var initialPropagationContext = scope.PropagationContext; + configureScope(scope); + + Assert.AreNotEqual(initialPropagationContext, scope.PropagationContext); + } + [Test] public void TraceGeneration_OnApplicationResume_GeneratesNewTrace() { From 89d82c880abd983b67761bb87aa6a445ba3156f3 Mon Sep 17 00:00:00 2001 From: Sentry Github Bot Date: Wed, 23 Apr 2025 14:28:22 +0000 Subject: [PATCH 06/10] Format code --- test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs b/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs index 73636ee41..c795b7a59 100644 --- a/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs +++ b/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs @@ -37,16 +37,16 @@ public void TraceGeneration_OnRegister_GeneratesInitialTrace() { // Arrange var sut = _fixture.GetSut(); - + // Act sut.Register(_fixture.TestHub, _fixture.SentryOptions); - + // Assert var configureScope = _fixture.TestHub.ConfigureScopeCalls.Single(); var scope = new Scope(_fixture.SentryOptions); var initialPropagationContext = scope.PropagationContext; configureScope(scope); - + Assert.AreNotEqual(initialPropagationContext, scope.PropagationContext); } From 7e529db08f556cb3e18bf37d2534b82e95fe3fec Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Wed, 23 Apr 2025 16:39:56 +0200 Subject: [PATCH 07/10] fixed tests --- .../TraceGenerationIntegrationTests.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs b/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs index 73636ee41..b81b1e3d9 100644 --- a/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs +++ b/test/Sentry.Unity.Tests/TraceGenerationIntegrationTests.cs @@ -56,12 +56,15 @@ public void TraceGeneration_OnApplicationResume_GeneratesNewTrace() // Arrange var sut = _fixture.GetSut(); sut.Register(_fixture.TestHub, _fixture.SentryOptions); + var initialCallsCount = _fixture.TestHub.ConfigureScopeCalls.Count; // Act _fixture.SentryMonoBehaviour.ResumeApplication(); // Assert - var configureScope = _fixture.TestHub.ConfigureScopeCalls.Single(); + // Calling 'Register' already generated a trace, so we expect 1+1 calls to ConfigureScope + Assert.AreEqual(initialCallsCount + 1, _fixture.TestHub.ConfigureScopeCalls.Count); + var configureScope = _fixture.TestHub.ConfigureScopeCalls.Last(); var scope = new Scope(_fixture.SentryOptions); var initialPropagationContext = scope.PropagationContext; configureScope(scope); @@ -75,12 +78,15 @@ public void TraceGeneration_OnActiveSceneChange_GeneratesNewTrace() // Arrange var sut = _fixture.GetSut(); sut.Register(_fixture.TestHub, _fixture.SentryOptions); + var initialCallsCount = _fixture.TestHub.ConfigureScopeCalls.Count; // Act _fixture.SceneManager.OnActiveSceneChanged(new SceneAdapter("from scene name"), new SceneAdapter("to scene name")); // Assert - var configureScope = _fixture.TestHub.ConfigureScopeCalls.Single(); + // Calling 'Register' already generated a trace, so we expect 1+1 calls to ConfigureScope + Assert.AreEqual(initialCallsCount + 1, _fixture.TestHub.ConfigureScopeCalls.Count); + var configureScope = _fixture.TestHub.ConfigureScopeCalls.Last(); var scope = new Scope(_fixture.SentryOptions); var initialPropagationContext = scope.PropagationContext; configureScope(scope); From fd0d2022f9a531b14dbe85969bbd8112125debf4 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Wed, 23 Apr 2025 16:51:29 +0200 Subject: [PATCH 08/10] Updated CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9c7db08a..7af398830 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ ### Features -- The trace used to connect errors on different layers of your game now gets regenerated every time the aspp gains focus again, or the active scene changes ([#2123](https://github.com/getsentry/sentry-unity/pull/2123)) +- The trace used to connect errors on different layers of your game now gets regenerated every time the app gains focus again, or the active scene changes ([#2123](https://github.com/getsentry/sentry-unity/pull/2123)) - The SDK now links errors and events (managed and native errors) via `trace ID`. This allows you to correlate events captured from different layers of your game ([#1997](https://github.com/getsentry/sentry-unity/pull/1997), [#2089](https://github.com/getsentry/sentry-unity/pull/2089), [#2106](https://github.com/getsentry/sentry-unity/pull/2106)) - Drastically improved performance of scope sync when targeting Android ([#2107](https://github.com/getsentry/sentry-unity/pull/2107)) - The SDK now reports the game's name as part of the app context ([2083](https://github.com/getsentry/sentry-unity/pull/2083)) From f61f93183dfdbb886477879feabc2b53c2d6ccaf Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Wed, 23 Apr 2025 16:52:01 +0200 Subject: [PATCH 09/10] seal --- src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs b/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs index 5ad9c101e..8f01ecb28 100644 --- a/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs +++ b/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs @@ -3,7 +3,7 @@ namespace Sentry.Unity.Integrations; -internal class TraceGenerationIntegration : ISdkIntegration +internal sealed class TraceGenerationIntegration : ISdkIntegration { private readonly ISceneManager _sceneManager; private readonly ISentryMonoBehaviour _sentryMonoBehaviour; From acbcda85f58356eead58bef84de9c55e39cda6c3 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 24 Apr 2025 10:33:15 +0200 Subject: [PATCH 10/10] cleanup --- .../Integrations/TraceGenerationIntegration.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs b/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs index 8f01ecb28..89a98c768 100644 --- a/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs +++ b/src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs @@ -19,21 +19,21 @@ internal TraceGenerationIntegration(ISentryMonoBehaviour sentryMonoBehaviour, IS public void Register(IHub hub, SentryOptions options) { - hub.ConfigureScope(scope => - scope.SetPropagationContext(new SentryPropagationContext(SentryId.Create(), SpanId.Create()))); + hub.ConfigureScope(UpdatePropagationContext); _sentryMonoBehaviour.ApplicationResuming += () => { options.DiagnosticLogger?.LogDebug("Application resumed. Creating new Trace."); - hub.ConfigureScope(scope => - scope.SetPropagationContext(new SentryPropagationContext(SentryId.Create(), SpanId.Create()))); + hub.ConfigureScope(UpdatePropagationContext); }; _sceneManager.ActiveSceneChanged += (_, _) => { options.DiagnosticLogger?.LogDebug("Active Scene changed. Creating new Trace."); - hub.ConfigureScope(scope => - scope.SetPropagationContext(new SentryPropagationContext(SentryId.Create(), SpanId.Create()))); + hub.ConfigureScope(UpdatePropagationContext); }; } + + private static void UpdatePropagationContext(Scope scope) => + scope.SetPropagationContext(new SentryPropagationContext()); }