Skip to content

feat(ops)!: Drop category prefix and SPAN_OP suffix from op constants - #565

Merged
Lms24 merged 2 commits into
mainfrom
feat/rename-span-op-constants
Aug 11, 2026
Merged

Lms24 merged 2 commits into
mainfrom
feat/rename-span-op-constants

Conversation

@Lms24

@Lms24 Lms24 commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Span op constants were named <CATEGORY>_<OP>_SPAN_OP, where the category only groups the model files and carries no meaning. This cause sub-optimal export names like GEN_AI_GEN_AI_INVOKE_AGENT_SPAN_OP or BROWSER_PAGELOAD_SPAN_OP. Names are now generated just from the op string: GEN_AI_INVOKE_AGENT, PAGELOAD. Op values are unchanged, and no model files were harmed during the creation of this PR. This is a breaking change though but I checked and the JS SDK is the only consumer of ops. We're fine with the breakage and can easily handle it.

  • Renames apply to the op constants exported from the JS package and the Rust crate.
  • Op files are read in sorted order now, so the collision fallback can't differ between Linux and Windows CI.

Fixes #546
Refs #546

@linear-code

linear-code Bot commented Aug 10, 2026

Copy link
Copy Markdown

CON-101

@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Semver Impact of This PR

🔴 Major (breaking changes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Breaking Changes 🛠

  • (ops) Drop category prefix and SPAN_OP suffix from op constants by Lms24 in #565

New Features ✨

Attributes

  • Add sentry.event.serialized_meta by mjq in #566
  • Change sentry.description scrubbing policy to manual by Lms24 in #555

Op

  • Add handler op by msonnb in #554
  • Add router span operation by msonnb in #551

Bug Fixes 🐛

  • (ops) Add http.client.stream to http.client name and description rules by msonnb in #553

Internal Changes 🔧

Deps

  • Bump dompurify from 3.4.12 to 3.4.13 by dependabot in #559
  • Bump js-yaml from 4.3.0 to 4.3.1 by dependabot in #560

Other

  • (docs) Add Sentry Astro SDK by Lms24 in #563
  • Unstale yarn.lock by Lms24 in #561

🤖 This preview updates automatically when you update the PR.

Span op constants were named `<CATEGORY>_<OP>_SPAN_OP`. The category carries no
meaning beyond grouping the model files, so it only produced stutter like
`GEN_AI_GEN_AI_INVOKE_AGENT_SPAN_OP`. Derive the name from the op string alone
and drop the redundant suffix, leaving `GEN_AI_INVOKE_AGENT` and `PAGELOAD`.

Without the category, eight ops defined in more than one category (`http`, `ui`,
`navigation`, `grpc`, `function`, `app`, `file`, `serialize`) collide. They share
the same op value, so emit each exactly once, in the category that documents it,
falling back to the first category alphabetically. Op files are now read in
sorted order so that fallback cannot differ between platforms.

Downstream impact is minimal: Relay does not use the generated Rust ops, no ops
are generated for Python, and the Sentry frontend does not consume ops from the
JS package. The JS SDK uses a handful and needs a rename.

BREAKING CHANGE: Generated span op constants are renamed in the JS package and
the Rust crate. `BROWSER_PAGELOAD_SPAN_OP` is now `PAGELOAD`,
`GEN_AI_GEN_AI_INVOKE_AGENT_SPAN_OP` is now `GEN_AI_INVOKE_AGENT`. Op values are
unchanged.

Fixes #546
Refs CON-101
Co-Authored-By: Claude <[email protected]>
@Lms24
Lms24 force-pushed the feat/rename-span-op-constants branch from 80a3daf to e79466b Compare August 10, 2026 15:55
@Lms24 Lms24 changed the title feat(ops)!: Drop category prefix and SPAN_OP suffix from constants feat(ops)!: Drop category prefix and SPAN_OP suffix from op constants Aug 10, 2026
@Lms24
Lms24 marked this pull request as ready for review August 11, 2026 08:42
@Lms24
Lms24 requested review from a team, cleptric, mjq and nsdeschenes as code owners August 11, 2026 08:42
@Lms24 Lms24 self-assigned this Aug 11, 2026
@Lms24
Lms24 merged commit 8fce9c2 into main Aug 11, 2026
16 checks passed
@Lms24
Lms24 deleted the feat/rename-span-op-constants branch August 11, 2026 11:56
logaretm pushed a commit to getsentry/sentry-javascript that referenced this pull request Aug 24, 2026
0.20.0 drops the category prefix and `_SPAN_OP` suffix from the `op`
constants (getsentry/sentry-conventions#565), which removes every
`*_SPAN_OP` export the SDK imported.

Old names were mapped to new ones by their string value rather than by
guessing the name transformation, so collapsed constants resolve
correctly — `GENERAL_FUNCTION_SPAN_OP` and `WEB_SERVER_FUNCTION_SPAN_OP`
both became `FUNCTION`, and the three `*_HTTP_SPAN_OP` variants all
became `HTTP`. All 124 old values still exist in 0.20.0 with no
ambiguity, so the rename is value-preserving.

These constants are internal only — nothing re-exports them from a
public entry point — so this is not a breaking change for SDK users.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
alwx added a commit that referenced this pull request Sep 22, 2026
Resolve the generated python/src/sentry_conventions/attributes.py conflict and
re-run `yarn generate`. The op constant is now emitted as `TURBO_MODULE` after
#565 dropped the category prefix and `SPAN_OP` suffix from op constants.
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.

Rename exported span op constants.

2 participants