Skip to content

Commit eb41b12

Browse files
committed
further suggestions
1 parent d1eedb7 commit eb41b12

File tree

1 file changed

+6
-9
lines changed
  • docs/platforms/javascript/common/enriching-events/transaction-name

1 file changed

+6
-9
lines changed

docs/platforms/javascript/common/enriching-events/transaction-name/index.mdx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ notSupported:
88
- javascript.nextjs
99
---
1010

11-
The Sentry SDK sets a "transaction name" which is used to annotate error events with their point of failure.
12-
Furthermore, if you use <PlatformLink to="/tracing/">Tracing</PlatformLink>, Sentry refers to the root spans of your application as a "transaction" and groups traces based on the root span's "transaction" name.
11+
The Sentry SDK uses an _error transaction name_ to mark where something went wrong in an error event. If you use <PlatformLink to="/tracing/">Tracing</PlatformLink>, Sentry uses the name of your root span as the _root span transaction name_, which will group traces around that name.
1312

1413
This means that there are in fact two transaction names:
1514

@@ -20,11 +19,11 @@ Both are used to annotate and group error and trace events respectively and are
2019

2120
<PlatformCategorySection supported={['browser']}>
2221

23-
You need to add `browserTracingIntegration` when initializing the SDK to automatically set a transaction name.
22+
To automatically set transaction names, add `browserTracingIntegration` when initializing the SDK.
2423

2524
</PlatformCategorySection>
2625

27-
Because automatically-determined names are a good grouping mechanism, unless you have a special use-case, **you won't need to set or override transaction names manually.**
26+
Because automatically-determined names are a good grouping mechanism, unless you have a special use-case, **you won't need to set or override transaction names manually.**
2827

2928
## What's a "Good" Transaction Name?
3029

@@ -35,7 +34,7 @@ For example:
3534
- `UserListView`
3635
- `myapp.tasks.renew_all_subscriptions`
3736

38-
A good transaction name shouldn't have too many variables (such as user IDs), but should still be unique enough to help you easily identify the piece of code you care about.
37+
A good transaction name shouldn't have too many variables (such as user IDs), but should still be unique enough to help you easily identify the piece of code you care about.
3938
For example, instead of naming a transaction`'GET /api/users/123/details'`, name it `'GET /api/users/:id/details'`.
4039
This will group all errors and traces for requests to the same route.
4140

@@ -50,7 +49,7 @@ In a web app, you can set it when navigating to a new route, like in an SPA rout
5049

5150
## Setting the Error Transaction Name
5251

53-
There are several ways to set the transaction name for error events sent to Sentry.
52+
There are several ways to set the transaction name for error events sent to Sentry. This name will show up as the location of the issue next to the issue title.
5453

5554
### Setting the Name on the Scope
5655

@@ -117,15 +116,13 @@ Sentry.init({
117116
```
118117

119118
<Note>
120-
Only do this if you can't set the root span name earlier using other options.
119+
Only do this if you can't set the root span name earlier using other options.
121120
</Note>
122121

123122
## Further Information
124123

125-
126124
You might wonder why there are two separate transaction names and why they're set independently. This is mainly due to Sentry's history and evolution. The error transaction name existed before Sentry offered tracing, and it was used solely to group error events. When tracing was introduced, the root span in a span tree was also called a "transaction," with its own name.
127125

128126
In later iterations, Sentry shifted focus in the UI from "transactions" to "spans" and "traces," but the older concepts remain in parts of the UI. The SDKs adapted their APIs, moving away from transaction-based designs. For example, the `setTransactionName` API on the `Scope` refers to error transaction names, not spans. Similarly, a span name doesn’t automatically apply to error events, keeping the two concepts [separate](https://github.com/getsentry/sentry-javascript/issues/10846).
129127

130-
131128
As Sentry continues to evolve, the ambiguity between these terms is expected to decrease as the product moves away from associating "transactions" with tracing and spans.

0 commit comments

Comments
 (0)