Skip to content

Commit 8b20d1d

Browse files
jamescrosswellbitsandfoxes
authored andcommitted
Documented Scope.Span (#14101)
1 parent 3c89e2a commit 8b20d1d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/platforms/dotnet/common/configuration/options.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,17 @@ Broadly, the ExecutionContext passes to child tasks and threads, but not to pare
5555

5656
When Global Mode is **enabled**, a single scope stack is shared by the whole application.
5757

58+
<Alert title="💡 Note">
59+
5860
Since version 5.0.0 the transaction is always set on the current ExecutionContext, regardless of the Global Mode, so that spans from the UI don't get mixed up with transactions in background services.
5961

60-
See the <PlatformLink to="/enriching-events/scopes/">Scopes and Hubs documentation</PlatformLink> for more information.
62+
There may be situations in which this isn't what you want. For example, you could start a transaction and then run multiple tasks in parallel, each of which makes an HTTP Request. By default, Sentry's <PlatformLink to="/tracing/instrumentation/automatic-instrumentation/">Automatic Instrumentation</PlatformLink> will create spans as children of the transaction it finds stored in `Scope.Transaction` (which is now ExecutionContext specific, even in Global Mode).
63+
64+
You can override this behavior and force auto-instrumented spans to have a specific parent by setting `Scope.Span`. [An example of doing this](https://github.com/getsentry/symbol-collector/blob/8a0fdb2594c3028f63f180b9b56b1efea1cbce34/src/SymbolCollector.Core/Client.cs#L74-L83) can be found in the Symbol Collector.
6165

66+
</Alert>
67+
68+
See the <PlatformLink to="/enriching-events/scopes/">Scopes and Hubs documentation</PlatformLink> for more information.
6269

6370
</ConfigKey>
6471

0 commit comments

Comments
 (0)