Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
apply review feedback
  • Loading branch information
Lms24 committed Dec 11, 2024
commit c393c32f7c00d92d7fe1040bc44fe74cd3e8e1d8
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@ if (span) {
}
```

Prior to v8.39.0, you had to use `span.updateName('New Name')`, which had some limitations in `@sentry/node` and SDKs depending on it (e.g. `@sentry/nextjs`):
Prior to v8.39.0, you had to use `span.updateName('New Name')`, which had some limitations in `@sentry/node` and SDKs depending on it (for example, `@sentry/nextjs`):

- Spans with `http.method` or `http.request.method` attributes would automatically have their name set to the method + the URL path
- Spans with `db.system` attributes would automatically have their name set to the system + the statement
- Spans with `http.method` or `http.request.method` attributes would automatically have their name set to the method + the URL path.
- Spans with `db.system` attributes would automatically have their name set to the system + the statement.

Using `Sentry.updateSpanName()` instead of `span.updateName()` ensures that the name is updated correctly and no longer overwritten in these cases.
Using `Sentry.updateSpanName()` ensures that the name is updated correctly and no longer overwritten in these cases.

In browser environments (if you use `@sentry/browser`, `@sentry/react`, etc), `span.updateName()` and `Sentry.updateSpanName()` are identical and you can use either of them.
If you use `@sentry/browser`, `@sentry/react`, and so on in browser environments, `span.updateName()` and `Sentry.updateSpanName()` will function identically, so you can use either one of them.