From 2e0bd1784979cdf65369c522b087ec14458c3e13 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Wed, 2 Sep 2026 10:31:12 +0200 Subject: [PATCH 1/2] docs: Highlight that scope tags are not applied to streamed spans The v11 migration guide only mentioned this in a trailing note inside the `beforeSendTransaction` section, where users who never used that option would not look. Give it its own subsection with before/after examples, since it silently affects every app that enriches transactions with tags. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Hyk7rMtFEFUgLnS5YYekxJ --- MIGRATION.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/MIGRATION.md b/MIGRATION.md index 44f29afe32c4..a5164fb651aa 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -333,8 +333,40 @@ This means spans are no longer bound by the 1000-span per transaction limit and The new model comes with some changes to Sentry hooks such as `beforeSendSpan` or options like `ignoreSpans` and requires manual migration. The `beforeSendTransaction` and `ignoreTransactions` options will **no-op**. +Scope `tags` and `extra` are no longer applied to spans, since streamed spans only carry attributes. If you cannot migrate to span streaming yet, you can opt into the previous transaction-based static model. +#### Scope `tags` and `extra` are not applied to spans + +Streamed spans only carry attributes, so scope `tags` and `extra` (set via `Sentry.setTag(s)`, `Sentry.setExtra(s)` or the equivalent scope methods) are no longer applied to spans. +This affects every span, including the segment span that replaced the transaction, and the SDK does not warn about it: the data is simply missing from your spans. + +Tags and extra still apply to errors, so you don't have to remove them. +Set attributes for everything that should also be searchable on spans (attributes additionally apply to logs and metrics): + +```js +// Before: applied to the transaction +Sentry.setTag('order_id', order.id); +Sentry.setTags({ user_tier: user.tier }); + +// After: applied to spans, logs and metrics +Sentry.setAttribute('order_id', order.id); +Sentry.setAttributes({ user_tier: user.tier }); +``` + +Attributes accept `string`, `number`, `boolean` and arrays of those, so numbers and booleans no longer have to be stringified. +Just like tags, they can be set on a specific scope: + +```js +// Applied to all spans, logs and metrics of the application +Sentry.getGlobalScope().setAttributes({ 'app.version': '2.1.0' }); + +// Applied to a single operation +Sentry.withScope(scope => { + scope.setAttribute('checkout.step', 'payment'); +}); +``` + #### `beforeSendSpan` receives the streamed span format Your `beforeSendSpan` callback now receives a `StreamedSpanJSON` object and is invoked as each span finishes, rather than for all spans of a transaction right before that transaction is sent. As in v10, it is invoked for the root span as well as for child spans. @@ -436,7 +468,7 @@ Sentry.init({ }); ``` -Note that scope `tags` and `extra` are not carried over to streamed spans, since spans only have attributes. Use `Sentry.setAttribute()` / `Sentry.setAttributes()` instead. +Note that scope `tags` and `extra` [are not carried over to streamed spans](#scope-tags-and-extra-are-not-applied-to-spans). Use `Sentry.setAttribute()` / `Sentry.setAttributes()` instead. #### Replacing `ignoreTransactions` with `ignoreSpans` From d127395dc55714cd5b4f1de76468da0649eb6e87 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Wed, 2 Sep 2026 14:36:02 +0200 Subject: [PATCH 2/2] Update MIGRATION.md Co-authored-by: Andrei <168741329+andreiborza@users.noreply.github.com> --- MIGRATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MIGRATION.md b/MIGRATION.md index a5164fb651aa..e84eb032fd54 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -339,7 +339,7 @@ If you cannot migrate to span streaming yet, you can opt into the previous trans #### Scope `tags` and `extra` are not applied to spans Streamed spans only carry attributes, so scope `tags` and `extra` (set via `Sentry.setTag(s)`, `Sentry.setExtra(s)` or the equivalent scope methods) are no longer applied to spans. -This affects every span, including the segment span that replaced the transaction, and the SDK does not warn about it: the data is simply missing from your spans. +This affects every span, including the segment span that replaced the transaction. Tags and extra still apply to errors, so you don't have to remove them. Set attributes for everything that should also be searchable on spans (attributes additionally apply to logs and metrics):