Skip to content

fix(deno): Avoid inferring invalid span op from Deno tracer#20128

Open
Lms24 wants to merge 2 commits intodevelopfrom
lms/fix-deno-invalid-span-op
Open

fix(deno): Avoid inferring invalid span op from Deno tracer#20128
Lms24 wants to merge 2 commits intodevelopfrom
lms/fix-deno-invalid-span-op

Conversation

@Lms24
Copy link
Copy Markdown
Member

@Lms24 Lms24 commented Apr 8, 2026

Looks like an invalid span op snuck into the Deno SDK when we pick up spans from Deno's tracer. We have a _mapSpanKindToOp helper in there which as a default value returned otel.span. This value does not align with our definition of span ops. Instead, if we can't infer a span op, we should just not set one in the first place.

(side-note: Long-term, we might need something more sophisticated here like inferSpanData in the Node SDK. But for now, I'd rather remove the invalid op and move on. Only came across this while working on #20127)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

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


New Features ✨

Core

  • Add enableTruncation option to OpenAI integration by andreiborza in #20167
  • Export a reusable function to add tracing headers by JPeer264 in #20076

Other

  • (deps) Bump defu from 6.1.4 to 6.1.6 by dependabot in #20104

Bug Fixes 🐛

  • (deno) Avoid inferring invalid span op from Deno tracer by Lms24 in #20128

Internal Changes 🔧

  • (bugbot) Add rules to flag test-flake-provoking patterns by Lms24 in #20192
  • (size-limit) Bump failing size limit scenario by Lms24 in #20186

🤖 This preview updates automatically when you update the PR.

@Lms24 Lms24 self-assigned this Apr 8, 2026
@Lms24 Lms24 requested review from chargome and sergical April 8, 2026 17:30
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 25.64 kB - -
@sentry/browser - with treeshaking flags 24.13 kB - -
@sentry/browser (incl. Tracing) 42.15 kB - -
@sentry/browser (incl. Tracing, Profiling) 46.77 kB - -
@sentry/browser (incl. Tracing, Replay) 80.94 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.56 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 85.65 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 97.91 kB - -
@sentry/browser (incl. Feedback) 42.42 kB - -
@sentry/browser (incl. sendFeedback) 30.31 kB - -
@sentry/browser (incl. FeedbackAsync) 35.3 kB - -
@sentry/browser (incl. Metrics) 26.95 kB - -
@sentry/browser (incl. Logs) 27.1 kB - -
@sentry/browser (incl. Metrics & Logs) 27.78 kB - -
@sentry/react 27.41 kB - -
@sentry/react (incl. Tracing) 44.48 kB - -
@sentry/vue 30.08 kB - -
@sentry/vue (incl. Tracing) 44.05 kB - -
@sentry/svelte 25.67 kB - -
CDN Bundle 28.32 kB - -
CDN Bundle (incl. Tracing) 43.12 kB - -
CDN Bundle (incl. Logs, Metrics) 29.69 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 44.17 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 68.49 kB - -
CDN Bundle (incl. Tracing, Replay) 80.01 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 81.06 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 85.55 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.59 kB - -
CDN Bundle - uncompressed 82.72 kB - -
CDN Bundle (incl. Tracing) - uncompressed 127.86 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 86.86 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 131.27 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 209.84 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 244.74 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 248.13 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 257.65 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 261.04 kB - -
@sentry/nextjs (client) 46.89 kB - -
@sentry/sveltekit (client) 42.62 kB - -
@sentry/node-core 55.76 kB +0.02% +8 B 🔺
@sentry/node 172.41 kB +0.01% +11 B 🔺
@sentry/node - without tracing 96.04 kB +0.01% +3 B 🔺
@sentry/aws-serverless 112.85 kB +0.01% +4 B 🔺

View base workflow run

@Lms24 Lms24 marked this pull request as ready for review April 9, 2026 09:06
@Lms24 Lms24 enabled auto-merge (squash) April 10, 2026 10:17
Copy link
Copy Markdown

@cursor cursor bot left a comment

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 c3468bf. Configure here.

...options?.attributes,
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'manual',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: op,
...(op ? { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 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.

Missing SEMANTIC_ATTRIBUTE_SENTRY_OP on startSpan calls

Low Severity

The project rules require that SEMANTIC_ATTRIBUTE_SENTRY_OP is always set when calling startInactiveSpan or startSpanManual (see https://develop.sentry.dev/sdk/telemetry/traces/span-operations/). After this change, when _mapSpanKindToOp returns undefined (for INTERNAL or unspecified span kinds), no sentry.op attribute is set at all. While the previous otel.span value was non-conforming, fully omitting the op still doesn't satisfy the rule. This is flagged because it was mentioned in the rules file — this may be an intentional and justified trade-off, but it warrants explicit acknowledgment.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit c3468bf. Configure here.

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.

2 participants