You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 14, 2024. It is now read-only.
Add missing docs for this feature and clarify which span to return depending on global mode.
Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com>
Copy file name to clipboardExpand all lines: src/docs/sdk/performance/index.mdx
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -219,11 +219,21 @@ Which in reality is useful for proxies to set it to `0` and opt out of tracing.
219
219
## Static API Changes
220
220
221
221
The `Sentry.startTransaction` function should take two arguments - the `transactionContext` passed to the `Transaction` constructor and an optional `customSamplingContext` object containing data to be passed to `tracesSampler` (if defined).
222
-
223
222
It creates a `Transaction` bound to the current hub and returns the instance.
224
223
Users interact with the instance for creating child spans and, thus, have to
225
224
keep track of it themselves.
226
225
226
+
With `Sentry.span` users can attach spans to an already ongoing transaction.
227
+
This property returns a `SpanProtocol` if a running transaction is bound to
228
+
the scope; otherwise, it returns nil. Although we recommend users keep track
229
+
of their own transactions, the SDKs should offer a way to expose auto-generated
230
+
transactions. SDKs shall bind auto-generated transactions to the scope, making
231
+
them accessible with `Sentry.span`.
232
+
If the SDK has global mode enabled, which specifies whether to use global scope
233
+
management mode and should be `true` for client applications and `false` for server
234
+
applications, `Sentry.span` shall return the active transaction. If the
235
+
user disables global mode, `Sentry.span` shall return the latest active (unfinished) span.
0 commit comments