Skip to content

Commit 1377e84

Browse files
coolguyzoneAlex Krawiecjamescrosswelllizokm
authored
Turn repeated thread locality content into an include (#11554)
* Turn repeated thread locality content into an include * Update includes/platforms/configuration/options/thread-locality.mdx Co-authored-by: Liza Mock <[email protected]> --------- Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: James Crosswell <[email protected]> Co-authored-by: Liza Mock <[email protected]>
1 parent ead1a4f commit 1377e84

File tree

4 files changed

+19
-54
lines changed

4 files changed

+19
-54
lines changed

docs/platforms/dotnet/common/enriching-events/scopes/index.mdx

+1-18
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,7 @@ other hand are more user facing. You can call <PlatformIdentifier name="configur
3434
time to modify data stored on the scope. This is useful for doing things like
3535
[modifying the context](../context/).
3636

37-
<Alert>
38-
39-
If you are very curious about how thread locality works for scope data, in .NET there
40-
are two modes for managing "ambient data". Usuaully Sentry will automatically choose the
41-
most appropriate mode for your application type. However this can be overridden by
42-
setting [`SentryOptions.IsGlobalModeEnabled`](../../configuration/options/#is-global-mode-enabled) manually.
43-
44-
If global mode is disabled (appropriate for most server based applications), the
45-
ambient scope data is stored as an `AsyncLocal` and so it will flow with the execution
46-
context. Stephen Toub's blog post on [ExecutionContext vs SynchronizationContext](https://devblogs.microsoft.com/pfxteam/executioncontext-vs-synchronizationcontext/)
47-
explains that concept in more detail.
48-
49-
If global mode is enabled (appropriate for desktop applications), ambient scope data is
50-
stored as a Singleton and available globally. This means you can set context (such as
51-
the user logged into the application) once and it will be sent with all events, regardless
52-
of whether the event was captured on the UI thread or a background thread.
53-
54-
</Alert>
37+
<Include name="platforms/configuration/options/thread-locality.mdx" />
5538

5639
When you call a global function such as <PlatformIdentifier name="capture-event" /> internally Sentry
5740
discovers the current hub and asks it to capture an event. Internally the hub will

docs/platforms/powershell/enriching-events/scopes/index.mdx

+1-18
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,7 @@ other hand are more user facing. You can call <PlatformIdentifier name="configur
3434
time to modify data stored on the scope. This is useful for doing things like
3535
[modifying the context](../context/).
3636

37-
<Alert>
38-
39-
If you are very curious about how thread locality works for scope data, in .NET there
40-
are two modes for managing "ambient data". Usuaully Sentry will automatically choose the
41-
most appropriate mode for your application type. However this can be overridden by
42-
setting [`SentryOptions.IsGlobalModeEnabled`](../../configuration/options/#is-global-mode-enabled) manually.
43-
44-
If global mode is disabled (appropriate for most server based applications), the
45-
ambient scope data is stored as an `AsyncLocal` and so it will flow with the execution
46-
context. Stephen Toub's blog post on [ExecutionContext vs SynchronizationContext](https://devblogs.microsoft.com/pfxteam/executioncontext-vs-synchronizationcontext/)
47-
explains that concept in more detail.
48-
49-
If global mode is enabled (appropriate for desktop applications), ambient scope data is
50-
stored as a Singleton and available globally. This means you can set context (such as
51-
the user logged into the application) once and it will be sent with all events, regardless
52-
of whether the event was captured on the UI thread or a background thread.
53-
54-
</Alert>
37+
<Include name="platforms/configuration/options/thread-locality.mdx" />
5538

5639
When you call a global function such as <PlatformIdentifier name="capture-event" /> internally Sentry
5740
discovers the current hub and asks it to capture an event. Internally the hub will

docs/platforms/unity/enriching-events/scopes/index.mdx

+1-18
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,7 @@ other hand are more user facing. You can call <PlatformIdentifier name="configur
3434
time to modify data stored on the scope. This is useful for doing things like
3535
[modifying the context](../context/).
3636

37-
<Alert>
38-
39-
If you are very curious about how thread locality works for scope data, in .NET there
40-
are two modes for managing "ambient data". Usuaully Sentry will automatically choose the
41-
most appropriate mode for your application type. However this can be overridden by
42-
setting [`SentryOptions.IsGlobalModeEnabled`](../../configuration/options/#is-global-mode-enabled) manually.
43-
44-
If global mode is disabled (appropriate for most server based applications), the
45-
ambient scope data is stored as an `AsyncLocal` and so it will flow with the execution
46-
context. Stephen Toub's blog post on [ExecutionContext vs SynchronizationContext](https://devblogs.microsoft.com/pfxteam/executioncontext-vs-synchronizationcontext/)
47-
explains that concept in more detail.
48-
49-
If global mode is enabled (appropriate for desktop applications), ambient scope data is
50-
stored as a Singleton and available globally. This means you can set context (such as
51-
the user logged into the application) once and it will be sent with all events, regardless
52-
of whether the event was captured on the UI thread or a background thread.
53-
54-
</Alert>
37+
<Include name="platforms/configuration/options/thread-locality.mdx" />
5538

5639
When you call a global function such as <PlatformIdentifier name="capture-event" /> internally Sentry
5740
discovers the current hub and asks it to capture an event. Internally the hub will
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Alert>
2+
3+
Read on if you're curious to know how thread locality works for scope data. In .NET, there
4+
are two modes for managing ambient data (which is data that's available in different parts of an application and doesn't need to be passed explicitly through method arguments): a disabled global mode and an enabled global mode. Usually, Sentry will automatically choose the most appropriate mode for your application type. However, this can be overridden by setting [`SentryOptions.IsGlobalModeEnabled`](../../configuration/options/#is-global-mode-enabled) manually.
5+
6+
If global mode is disabled (appropriate for most server-based applications), the
7+
ambient scope data will be stored as an `AsyncLocal` and will flow with the execution
8+
context. Stephen Toub's blog post on [ExecutionContext vs SynchronizationContext](https://devblogs.microsoft.com/pfxteam/executioncontext-vs-synchronizationcontext/)
9+
explains that concept in more detail.
10+
11+
If global mode is enabled (appropriate for desktop applications), ambient scope data will be
12+
stored as a Singleton and available globally. This means you can set context (such as
13+
the user logged into the application) once and it will be sent with all events, regardless
14+
of whether the event was captured on the UI thread or a background thread.
15+
16+
</Alert>

0 commit comments

Comments
 (0)