From 6652ec23c4f90df9b60f555a00a1398d83343f40 Mon Sep 17 00:00:00 2001 From: Philipp Hofmann Date: Mon, 12 Dec 2022 09:41:29 +0100 Subject: [PATCH 1/3] feat: Docs for Sentry.span --- src/docs/sdk/performance/index.mdx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/docs/sdk/performance/index.mdx b/src/docs/sdk/performance/index.mdx index 3fc595fb7b..1ca08ebf40 100644 --- a/src/docs/sdk/performance/index.mdx +++ b/src/docs/sdk/performance/index.mdx @@ -219,11 +219,21 @@ Which in reality is useful for proxies to set it to `0` and opt out of tracing. ## Static API Changes 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). - It creates a `Transaction` bound to the current hub and returns the instance. Users interact with the instance for creating child spans and, thus, have to keep track of it themselves. +With `Sentry.span` users can attach spans to an already ongoing transaction. +This property returns a `SpanProtocol` if a running transaction is bound to +the scope; otherwise, it returns nil. Although we recommend users keep track +of their own transactions, the SDKs should offer a way to expose auto-generated +transactions. SDKs shall bind auto-generated transactions to the scope, making +them accessible with `Sentry.span`. +If the SDK has global mode enabled, which specifies whether to use global scope +management mode and should be `true` for client applications and `false` for server +applications, `Sentry.span` shall return the root span of the transaction. If the +user disables global mode, `Sentry.span` shall return the latest unfinished span. + ## `Hub` Changes - Introduce a method called `traceHeaders` From 2a212e865dc9c33751aad2af45062b921a3a8f6e Mon Sep 17 00:00:00 2001 From: Philipp Hofmann Date: Mon, 12 Dec 2022 13:36:57 +0100 Subject: [PATCH 2/3] Update src/docs/sdk/performance/index.mdx Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> --- src/docs/sdk/performance/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/sdk/performance/index.mdx b/src/docs/sdk/performance/index.mdx index 1ca08ebf40..2634171b15 100644 --- a/src/docs/sdk/performance/index.mdx +++ b/src/docs/sdk/performance/index.mdx @@ -231,7 +231,7 @@ transactions. SDKs shall bind auto-generated transactions to the scope, making them accessible with `Sentry.span`. If the SDK has global mode enabled, which specifies whether to use global scope management mode and should be `true` for client applications and `false` for server -applications, `Sentry.span` shall return the root span of the transaction. If the +applications, `Sentry.span` shall return the active transaction. If the user disables global mode, `Sentry.span` shall return the latest unfinished span. ## `Hub` Changes From d984786dd3132c3892c44ad1514688e7baac9d59 Mon Sep 17 00:00:00 2001 From: Philipp Hofmann Date: Mon, 12 Dec 2022 13:37:09 +0100 Subject: [PATCH 3/3] Update src/docs/sdk/performance/index.mdx Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> --- src/docs/sdk/performance/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/sdk/performance/index.mdx b/src/docs/sdk/performance/index.mdx index 2634171b15..5695924b67 100644 --- a/src/docs/sdk/performance/index.mdx +++ b/src/docs/sdk/performance/index.mdx @@ -232,7 +232,7 @@ them accessible with `Sentry.span`. If the SDK has global mode enabled, which specifies whether to use global scope management mode and should be `true` for client applications and `false` for server applications, `Sentry.span` shall return the active transaction. If the -user disables global mode, `Sentry.span` shall return the latest unfinished span. +user disables global mode, `Sentry.span` shall return the latest active (unfinished) span. ## `Hub` Changes