Skip to content

Commit decb070

Browse files
new performance API wording fixes (#7738)
1 parent 5f54a72 commit decb070

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/platform-includes/performance/add-active-span/javascript.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
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.
1+
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.
22

33
```javascript
44
const result = Sentry.startActiveSpan({ name: "Important Function" }, () => {
@@ -19,12 +19,12 @@ const result = await Sentry.startActiveSpan(
1919
const result = Sentry.startActiveSpan(
2020
{ name: "Important Function" },
2121
(span) => {
22-
// Can access the span to add data or set specific status.
23-
// The span can be undefined if the span was not sampled or if performance monitoring is disabled.
22+
// You can access the span to add data or set specific status.
23+
// The span may be undefined if the span was not sampled or if performance monitoring is disabled.
2424
span?.setData("foo", "bar");
2525
return expensiveFunction();
2626
}
2727
);
2828
```
2929
30-
The span named `Important Function` will become the active span for the duration of the callback.
30+
In this example, the span named `Important Function` will become the active span for the duration of the callback.

src/platform-includes/performance/add-active-span/node.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
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.
1+
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.
22

33
```javascript
44
const result = Sentry.startActiveSpan({ name: "Important Function" }, () => {
@@ -19,8 +19,8 @@ const result = await Sentry.startActiveSpan(
1919
const result = Sentry.startActiveSpan(
2020
{ name: "Important Function" },
2121
(span) => {
22-
// Can access the span to add data or set specific status.
23-
// The span can be undefined if the span was not sampled or if performance monitoring is disabled.
22+
// You can access the span to add data or set specific status.
23+
// The span may be undefined if the span was not sampled or if performance monitoring is disabled.
2424
span?.setData("foo", "bar");
2525
return expensiveFunction();
2626
}

src/platforms/common/performance/instrumentation/custom-instrumentation.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,35 +47,35 @@ To capture transactions and spans customized to your organization's needs, you m
4747

4848
<PlatformSection supported={["javascript", "node"]}>
4949

50-
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.
50+
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.
5151

52-
To start measuring timing data, you first need to import the SDK.
52+
To get started, import the SDK.
5353

5454
<PlatformContent includePath="enriching-events/import" />
5555

5656
<PlatformContent includePath="performance/span-api-version" />
5757

5858
## Create Active Span
5959

60-
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.
60+
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.
6161

6262
<PlatformContent includePath="performance/add-active-span" />
6363

6464
## Get Active Span
6565

66-
You can also get the current active span, which is useful for when you need to add new child spans.
66+
You can also get the current active span, which is useful to add new child spans.
6767

6868
<PlatformContent includePath="performance/get-span" />
6969

7070
## Start Independent Spans
7171

72-
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.
72+
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.
7373

7474
<PlatformContent includePath="performance/add-independent-span" />
7575

7676
## Start Transaction
7777

78-
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.
78+
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.
7979

8080
<PlatformContent includePath="performance/enable-manual-instrumentation" />
8181

0 commit comments

Comments
 (0)