Skip to content

feat(core): Deprecate op option in StartSpanOptions - #23822

Closed
Lms24 wants to merge 1 commit into
feat/deprecate-force-transactionfrom
feat/deprecate-op
Closed

Lms24 wants to merge 1 commit into
feat/deprecate-force-transactionfrom
feat/deprecate-op

Conversation

@Lms24

@Lms24 Lms24 commented Sep 1, 2026

Copy link
Copy Markdown
Member

This PR deprecates the op StartSpanOptions property.

  • replacement is the sentry.op attribute which is straight forward
  • all remaining op usages were replaced

Split out of #23819. Stacked on top of #23821 (forceTransaction deprecation), so review that one first.

`op` duplicates the `sentry.op` span attribute, which is the canonical way to categorize a span. It
will be removed in a future version; the deprecation deliberately does not name a specific one.

All internal usages are rewritten to set `sentry.op` (via the `SENTRY_OP` constant from
`@sentry/conventions`) instead. Precedence is unchanged everywhere: an explicit `sentry.op` attribute
still wins over `op`. Call sites that already set both now only set the attribute.

`browserTracingIntegration` is the one exception that still touches `op`: `beforeStartSpan` is a
public hook that receives and may override it, so the option is kept in the options handed to the
hook and only folded into `sentry.op` afterwards.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit dbe044c. Configure here.

if (finalStartSpanOptions.op !== originalOp) {
// oxlint-disable-next-line typescript/no-deprecated
attributes[SENTRY_OP] = finalStartSpanOptions.op;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beforeStartSpan can drop span op

Medium Severity

The beforeStartSpan backfill writes finalStartSpanOptions.op onto sentry.op whenever it differs from the original attribute. Omitting the deprecated op field (or setting both, which the deprecation says should prefer the attribute) overwrites or deletes sentry.op, so pageload and navigation spans can lose their op.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit dbe044c. Configure here.

@Lms24

Lms24 commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Closing as for now, I think this is an unnecessary change given we can still support top-level op in span streaming. If we get strong feedback to deprecate it nevertheless, we can do so during the v11 cycle.

@Lms24 Lms24 closed this Sep 1, 2026
An error occurred while trying to automatically change base from feat/deprecate-force-transaction to develop September 1, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant