Skip to content

Commit acbcda8

Browse files
committed
cleanup
1 parent 535fe05 commit acbcda8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Sentry.Unity/Integrations/TraceGenerationIntegration.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ internal TraceGenerationIntegration(ISentryMonoBehaviour sentryMonoBehaviour, IS
1919

2020
public void Register(IHub hub, SentryOptions options)
2121
{
22-
hub.ConfigureScope(scope =>
23-
scope.SetPropagationContext(new SentryPropagationContext(SentryId.Create(), SpanId.Create())));
22+
hub.ConfigureScope(UpdatePropagationContext);
2423

2524
_sentryMonoBehaviour.ApplicationResuming += () =>
2625
{
2726
options.DiagnosticLogger?.LogDebug("Application resumed. Creating new Trace.");
28-
hub.ConfigureScope(scope =>
29-
scope.SetPropagationContext(new SentryPropagationContext(SentryId.Create(), SpanId.Create())));
27+
hub.ConfigureScope(UpdatePropagationContext);
3028
};
3129

3230
_sceneManager.ActiveSceneChanged += (_, _) =>
3331
{
3432
options.DiagnosticLogger?.LogDebug("Active Scene changed. Creating new Trace.");
35-
hub.ConfigureScope(scope =>
36-
scope.SetPropagationContext(new SentryPropagationContext(SentryId.Create(), SpanId.Create())));
33+
hub.ConfigureScope(UpdatePropagationContext);
3734
};
3835
}
36+
37+
private static void UpdatePropagationContext(Scope scope) =>
38+
scope.SetPropagationContext(new SentryPropagationContext());
3939
}

0 commit comments

Comments
 (0)