Skip to content

feat: Make span origins spec compliant - #25602

Open
mydea wants to merge 3 commits into
developfrom
ref/span-origin-spec-violations
Open

mydea wants to merge 3 commits into
developfrom
ref/span-origin-spec-violations

Conversation

@mydea

@mydea mydea commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Several span origins didn't follow the trace origin spec (<type>.<category>.<integration_name>.<integration_part>, where category is a span op category). Most put the library in the category slot, which makes it impossible to group origins by category the way ops are grouped. v11 is already renaming origins (#22722, #23627), so this is the window to fix them.

Before After
auto.amqplib.{publisher,consumer} auto.queue.amqplib.{publisher,consumer}
auto.kafkajs.{producer,consumer} auto.queue.kafkajs.{producer,consumer}
auto.vercelai.channel auto.ai.vercelai (matches the other auto.ai.<provider> origins)
auto.firebase.firestore auto.db.firebase.firestore
auto.firebase.functions auto.function.firebase
auto.aws.aws_sdk auto.{rpc,db,queue,ai}.aws_sdk (category follows the span op: DynamoDB db, SQS/SNS queue, Bedrock ai, otherwise rpc)
auto.aws_lambda auto.function.aws_serverless (matches the existing auto.function.aws_serverless.* mechanism types)
auto.mcp.notification auto.function.mcp_server.notification (sits next to auto.function.mcp_server)
auto.db.cloudflare.durable_object.sql auto.db.cloudflare.durable_object_sql (was five parts)
auto.http.browser.{lcp,cls,inp} auto.ui.browser.{lcp,cls,inp} (web vital spans, op ui.webvital.*)

The Vercel AI exception mechanism type moves along with its origin. AGENTS.md and BUGBOT.md now spell out the category and four-part rules so new origins are checked against them.

🤖 Generated with Claude Code

@mydea mydea changed the title ref!: Make span origins spec compliant ref: Make span origins spec compliant Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 42ba635 (PR test merge using develop at 6df508e)

Against: 6df508e (develop) · base run #63271

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 29.98 kB - -
@sentry/browser - with treeshaking flags 28.12 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.02 kB - -
@sentry/browser (incl. Tracing) 52.16 kB -0.01% -1 B 🔽
@sentry/browser (incl. Tracing + Span Streaming) 52.16 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.11 kB -0.01% -4 B 🔽
@sentry/browser (incl. Tracing, Replay) 91.95 kB -0.01% -1 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.84 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 96.69 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 109.62 kB -0.01% -1 B 🔽
@sentry/browser (incl. Feedback) 47.5 kB - -
@sentry/browser (incl. sendFeedback) 35.04 kB - -
@sentry/browser (incl. FeedbackAsync) 40.15 kB - -
@sentry/browser (incl. Metrics) 31 kB - -
@sentry/browser (incl. Logs) 31.27 kB - -
@sentry/browser (incl. Metrics & Logs) 31.93 kB - -
@sentry/react 31.8 kB - -
@sentry/react (incl. Tracing) 54.49 kB - -
@sentry/vue 38.13 kB - -
@sentry/vue (incl. Tracing) 55.1 kB -0.01% -1 B 🔽
@sentry/svelte 30 kB - -
@sentry/remix (Remix 3 client bundle) 57.18 kB -0.01% -1 B 🔽
CDN Bundle 31.74 kB - -
CDN Bundle (incl. Tracing) 52.7 kB -0.01% -3 B 🔽
CDN Bundle (incl. Logs, Metrics) 33.94 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 54.64 kB -0.01% -4 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) 74.92 kB - -
CDN Bundle (incl. Tracing, Replay) 90.39 kB -0.01% -4 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.32 kB -0.01% -6 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 96.54 kB -0.01% -4 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.48 kB -0.01% -3 B 🔽
CDN Bundle - uncompressed 93.49 kB - -
CDN Bundle (incl. Tracing) - uncompressed 156.34 kB -0.01% -6 B 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.04 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 162.31 kB -0.01% -6 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 230.25 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 276.68 kB -0.01% -6 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 282.63 kB -0.01% -6 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 290.38 kB -0.01% -6 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 296.33 kB -0.01% -6 B 🔽
@sentry/nextjs (client) 57.38 kB -0.01% -1 B 🔽
@sentry/sveltekit (client) 52.54 kB -0.01% -1 B 🔽
@sentry/core/server 41.85 kB +0.01% +1 B 🔺
@sentry/core/browser 13.81 kB - -
@sentry/node 153.01 kB +0.04% +51 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.58 kB - -
@sentry/node - without tracing 94.57 kB - -
@sentry/node - without channel injection 133.64 kB +0.04% +43 B 🔺
@sentry/aws-serverless 102.78 kB +0.04% +33 B 🔺
@sentry/cloudflare (withSentry) - minified 193.71 kB - -
@sentry/cloudflare (withSentry) 481.82 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 214.62 kB - -

View base workflow run

@mydea
mydea marked this pull request as ready for review October 21, 2026 11:35
@mydea
mydea requested review from a team as code owners October 21, 2026 11:35
@mydea
mydea requested review from Lms24, andreiborza, isaacs and logaretm and removed request for a team October 21, 2026 11:35
mydea added a commit that referenced this pull request Oct 22, 2026
The `.diagnostic_channel` suffix on span origins was left over from v10,
where it distinguished these spans from the OTel-based ones. The rest of
the v11 origins already dropped mechanism parts like `.otel` and
`.orchestrion`.

- `auto.graphql.diagnostic_channel` → `auto.graphql.graphql`: graphql
has a single instrumentation path, so the suffix carried no information.
The integration name stays, as in every other
`auto.<category>.<integration>` origin.
- `auto.db.{redis,mysql2,mongoose}.diagnostic_channel` →
`auto.db.{redis,mysql2,mongoose}.native_channel`: these integrations
still have two paths, the library's own tracing channels (newer
versions) and orchestrion-injected channels (older versions, plain
`auto.db.<lib>`). `native_channel` says what the distinction actually
is.

While at it, two origins that were inconsistent with their siblings:

- `auto.http.wintercg_fetch` → `auto.http.fetch`: Bun, Deno and
Cloudflare already use `auto.http.fetch` for the same instrumentation.
- `auto.grpc.serverless` → `auto.grpc.google_cloud`: `serverless` didn't
name the integration.

Spec violations (category, part count) are handled separately in #25602.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@mydea
mydea force-pushed the ref/span-origin-spec-violations branch from 79f052c to 6945fb7 Compare October 22, 2026 07:11
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 5 not successful, 59 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry (latest) Test (optional) Failing after 13s Details
❌ CI: Optional E2E Tests / E2E node-openai-decisions-send-to-sentry Test (optional) Failing after 3m Details
❌ CI: Optional E2E Tests / E2E node-openai-decisions-send-to-sentry (latest) Test (optional) Failing after 4m Details
❌ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Failing after 4m Details
❌ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Failing after 1m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E angular (canary) Test (optional) Successful in 57s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 20s Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 57s Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 29s Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 32s Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 20s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (canary, turbopack) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 31s Details
✅ CI: Optional E2E Tests / E2E astro-7-static Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 46s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 23s Details
✅ CI: Optional E2E Tests / E2E angular (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) Successful in 43s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (canary, webpack) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E node-openai-send-to-sentry (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 24s Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 57s Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E nuxt-4 (canary) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry Test (optional) Successful in 50s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) Successful in 20s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 22s Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 26s Details
✅ CI: Optional E2E Tests / E2E nextjs-16-standalone (canary, turbopack) Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 30s Details
✅ CI: Optional E2E Tests / E2E nuxt-3 (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 56s Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 19s Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-4-static (canary) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-openai-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 19s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 23s Details
✅ CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 24s Details
✅ CI: Optional E2E Tests / E2E vue-3 (canary) Test (optional) Successful in 54s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) Successful in 42s Details

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice cleanup, thanks! One open question regarding ai vs. gen_ai but otherwise LGTM!

Comment thread .cursor/BUGBOT.md
- `SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN` (`'sentry.origin'`) with a proper span origin
- a proper origin must only contain [a-z], [A-Z], [0-9], `_` and `.` characters.
- a proper origin has at most four parts, `<type>.<category>.<integration_name>.<integration_part>`, and must not skip a part. `type` is `auto` or `manual`.
- `category` must be a span op category (e.g. `http`, `db`, `queue`, `function`, `ai`, `ui`, `rpc`), matching the span's op. Flag origins that put a library or vendor in the category slot (e.g. `auto.kafkajs.producer` instead of `auto.queue.kafkajs.producer`).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- `category` must be a span op category (e.g. `http`, `db`, `queue`, `function`, `ai`, `ui`, `rpc`), matching the span's op. Flag origins that put a library or vendor in the category slot (e.g. `auto.kafkajs.producer` instead of `auto.queue.kafkajs.producer`).
- `category` must be a span op category (e.g. `http`, `db`, `queue`, `function`, `gen_ai`, `ui`, `rpc`), matching the span's op. Flag origins that put a library or vendor in the category slot (e.g. `auto.kafkajs.producer` instead of `auto.queue.kafkajs.producer`).

attributes: expect.objectContaining({
'sentry.op': { type: 'string', value: 'gen_ai.invoke_agent' },
'sentry.origin': { type: 'string', value: 'auto.vercelai.channel' },
'sentry.origin': { type: 'string', value: 'auto.ai.vercelai' },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

l/m: if we want to double down on the "the second part must be a span op category", this should be

Suggested change
'sentry.origin': { type: 'string', value: 'auto.ai.vercelai' },
'sentry.origin': { type: 'string', value: 'auto.gen_ai.vercelai' },

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is a good point, but we use auto.ai.* a lot right now 😬 maybe something for a follow up, but likely this should be aligned across all ai things then!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yup totally fine with a follow up or fwiw with leaving these slightly unaligned to the op all together. My suspicion is, we added the origin back when those ops were still called ai.* and when we changed the ops to gen_ai we didn't change the origin.

logaretm
logaretm previously approved these changes Oct 22, 2026
@logaretm
logaretm self-requested a review October 22, 2026 18:01

@logaretm logaretm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got a couple of things here


/** The span origin every aws-sdk channel span carries. */
export const AWS_SDK_ORIGIN = 'auto.aws.aws_sdk';
export const AWS_SDK_ORIGIN = 'auto.rpc.aws_sdk';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A DynamoDB span gets op db but origin auto.rpc.aws_sdk. If the origin category should match the op, that span should be auto.db.aws_sdk, SQS/SNS auto.queue.aws_sdk, and Bedrock auto.ai.aws_sdk.

attributes: {
[SENTRY_OP]: FUNCTION_AWS,
[SENTRY_ORIGIN]: 'auto.aws_lambda',
[SENTRY_ORIGIN]: 'auto.function.aws_lambda',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be auto.function.aws_serverless? The errors from this same handler already use aws_serverless as the name.

@logaretm
logaretm dismissed their stale review October 22, 2026 18:12

too premature

@mydea
mydea force-pushed the ref/span-origin-spec-violations branch from 6945fb7 to 555944a Compare October 23, 2026 06:41
mydea and others added 3 commits October 23, 2026 11:15
Use a span op category as the second origin part, keep origins at most
four parts, and stop encoding the instrumentation mechanism:

- auto.amqplib.* -> auto.queue.amqplib.*
- auto.kafkajs.* -> auto.queue.kafkajs.*
- auto.vercelai.channel -> auto.ai.vercelai
- auto.firebase.firestore -> auto.db.firebase.firestore
- auto.firebase.functions -> auto.function.firebase
- auto.aws.aws_sdk -> auto.rpc.aws_sdk
- auto.aws_lambda -> auto.function.aws_lambda
- auto.mcp.notification -> auto.function.mcp_server.notification
- auto.db.cloudflare.durable_object.sql -> auto.db.cloudflare.durable_object_sql
- auto.http.browser.{lcp,cls,inp} -> auto.ui.browser.{lcp,cls,inp}

Also spell out the origin rules in AGENTS.md and BUGBOT.md so new
origins follow them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nism types

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mydea
mydea force-pushed the ref/span-origin-spec-violations branch from b740dfb to cb9535a Compare October 23, 2026 09:15
@mydea mydea changed the title ref: Make span origins spec compliant feat: Make span origins spec compliant Oct 23, 2026

This branch has not been deployed

No deployments
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.

3 participants