From 8fc9269e8b0df435d2b4f64fad9650b49fb9d477 Mon Sep 17 00:00:00 2001 From: Shana Matthews Date: Tue, 5 Sep 2023 15:16:08 -0700 Subject: [PATCH] new performance API wording fixes --- .../performance/add-active-span/javascript.mdx | 8 ++++---- .../performance/add-active-span/node.mdx | 6 +++--- .../instrumentation/custom-instrumentation.mdx | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/platform-includes/performance/add-active-span/javascript.mdx b/src/platform-includes/performance/add-active-span/javascript.mdx index 2cf1455884eb7..fc06b19b12650 100644 --- a/src/platform-includes/performance/add-active-span/javascript.mdx +++ b/src/platform-includes/performance/add-active-span/javascript.mdx @@ -1,4 +1,4 @@ -You can use the `Sentry.startActiveSpan` method to wrap a callback in a span to measure how long it will take. The span is automatically finished when the callback is finished. This will work with both sync and async callbacks. +You can use the `Sentry.startActiveSpan` method to wrap a callback in a span to measure how long it will take. The span will automatically be finished when the callback finishes. This works with both synchronous and async callbacks. ```javascript const result = Sentry.startActiveSpan({ name: "Important Function" }, () => { @@ -19,12 +19,12 @@ const result = await Sentry.startActiveSpan( const result = Sentry.startActiveSpan( { name: "Important Function" }, (span) => { - // Can access the span to add data or set specific status. - // The span can be undefined if the span was not sampled or if performance monitoring is disabled. + // You can access the span to add data or set specific status. + // The span may be undefined if the span was not sampled or if performance monitoring is disabled. span?.setData("foo", "bar"); return expensiveFunction(); } ); ``` -The span named `Important Function` will become the active span for the duration of the callback. +In this example, the span named `Important Function` will become the active span for the duration of the callback. diff --git a/src/platform-includes/performance/add-active-span/node.mdx b/src/platform-includes/performance/add-active-span/node.mdx index 2cf1455884eb7..f79c2ee2e0ed1 100644 --- a/src/platform-includes/performance/add-active-span/node.mdx +++ b/src/platform-includes/performance/add-active-span/node.mdx @@ -1,4 +1,4 @@ -You can use the `Sentry.startActiveSpan` method to wrap a callback in a span to measure how long it will take. The span is automatically finished when the callback is finished. This will work with both sync and async callbacks. +You can use the `Sentry.startActiveSpan` method to wrap a callback in a span to measure how long it will take. The span will automatically be finished when the callback finishes. This works with both synchronous and async callbacks. ```javascript const result = Sentry.startActiveSpan({ name: "Important Function" }, () => { @@ -19,8 +19,8 @@ const result = await Sentry.startActiveSpan( const result = Sentry.startActiveSpan( { name: "Important Function" }, (span) => { - // Can access the span to add data or set specific status. - // The span can be undefined if the span was not sampled or if performance monitoring is disabled. + // You can access the span to add data or set specific status. + // The span may be undefined if the span was not sampled or if performance monitoring is disabled. span?.setData("foo", "bar"); return expensiveFunction(); } diff --git a/src/platforms/common/performance/instrumentation/custom-instrumentation.mdx b/src/platforms/common/performance/instrumentation/custom-instrumentation.mdx index 0bb0ed89edb47..a4daf22623ac9 100644 --- a/src/platforms/common/performance/instrumentation/custom-instrumentation.mdx +++ b/src/platforms/common/performance/instrumentation/custom-instrumentation.mdx @@ -47,9 +47,9 @@ To capture transactions and spans customized to your organization's needs, you m -To add custom performance data to your application, you need to create and use spans. Spans are a way to measure the time it takes for a specific action to occur. For example, you can create a span to measure the time it takes for a function to execute. +To add custom performance data to your application, you need to add custom instrumentation in the form of spans. Spans are a way to measure the time it takes for a specific action to occur. For example, you can create a span to measure the time it takes for a function to execute. -To start measuring timing data, you first need to import the SDK. +To get started, import the SDK. @@ -57,25 +57,25 @@ To start measuring timing data, you first need to import the SDK. ## Create Active Span -By default created spans are considered active, which means they are put on the Sentry scope. This allows child spans and Sentry errors to be associated with that span. This is the recommended way to create spans. +By default, spans you create are considered active, which means they are put on the Sentry scope. This allows child spans and Sentry errors to be associated with that span. This is the recommended way to create spans. ## Get Active Span -You can also get the current active span, which is useful for when you need to add new child spans. +You can also get the current active span, which is useful to add new child spans. ## Start Independent Spans -If you want to add a span that is not active, you can create a independent spans. This is useful for when you have work that is grouped together under a single parent span, but is independent from the current active span. In most cases you'll want to create and use active spans. +To add spans that aren't active, you can create independent spans. This is useful for when you have work that is grouped together under a single parent span, but is independent from the current active span. However, in most cases you'll want to create and use active spans instead. ## Start Transaction -The root span (the span that is the parent of all other spans) is known as a transaction in Sentry. This can be accessed and created separately if you need more control over the timing data or if you use a version of the SDK that does not support the top level span APIs. +The root span (the span that is the parent of all other spans) is known as a **transaction** in Sentry. Transactions can be accessed and created separately if you need more control over your timing data or if you use a version of the SDK that doesn't support the top-level span APIs.