Skip to content

feat(cloudflare): Emit low cardinality function span names and preserve span descriptions - #24246

Draft
Lms24 wants to merge 2 commits into
developfrom
lms/feat-cloudflare-adjust-span-names
Draft

feat(cloudflare): Emit low cardinality function span names and preserve span descriptions#24246
Lms24 wants to merge 2 commits into
developfrom
lms/feat-cloudflare-adjust-span-names

Conversation

@Lms24

@Lms24 Lms24 commented Sep 9, 2026

Copy link
Copy Markdown
Member

This PR makes a few adjustments to cloudflare sentry.op: "function" spans:

  • Email hander: This span included an email address in the span name/description, which I'd argue is sub-optimal, given neither name nor description get auto-scrubbed. I therefore opted to just call it name for both, streaming and transaction mode.
  • Scheduled/Cron handler: This span had a string and the cron string in its description. For span streaming, we now just call it scheduled (like the handled function name). Because we can't map the static string via span inference for function spans in Relay, I added the old name as a sentry.description override to avoid span description inference for streamed spans. For transactions, nothing changes
  • wrapMethodWithSentry - wrapped spans: Any spans that were previously of op function are already named after their function name (🎉). Therefore we only need to add the code.function.name attribute for description inference and we're good.

Adjusted tests and added note in migration guide.

@Lms24 Lms24 changed the title feat(cloudflare): Emit low cardinality span names and preserve span descriptions feat(cloudflare): Emit low cardinality function span names and preserve span descriptions Sep 9, 2026

@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 2 potential issues.

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 1e6561f. Configure here.

Comment thread packages/cloudflare/src/instrumentations/worker/instrumentEmail.ts
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.81 kB +0.04% +11 B 🔺
@sentry/browser - with treeshaking flags 27.12 kB +0.04% +10 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 27.01 kB +0.03% +7 B 🔺
@sentry/browser (incl. Tracing) 49.27 kB +0.12% +57 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 49.28 kB +0.12% +57 B 🔺
@sentry/browser (incl. Tracing, Profiling) 52.21 kB +0.17% +84 B 🔺
@sentry/browser (incl. Tracing, Replay) 88.81 kB +0.05% +44 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.99 kB +0.05% +33 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 93.49 kB +0.06% +51 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 106.44 kB +0.07% +67 B 🔺
@sentry/browser (incl. Feedback) 46.3 kB +0.02% +5 B 🔺
@sentry/browser (incl. sendFeedback) 33.87 kB +0.02% +6 B 🔺
@sentry/browser (incl. FeedbackAsync) 38.99 kB +0.04% +13 B 🔺
@sentry/browser (incl. Metrics) 29.84 kB +0.08% +23 B 🔺
@sentry/browser (incl. Logs) 30.1 kB +0.06% +18 B 🔺
@sentry/browser (incl. Metrics & Logs) 30.78 kB +0.11% +31 B 🔺
@sentry/react 30.57 kB +0.05% +14 B 🔺
@sentry/react (incl. Tracing) 51.64 kB +0.16% +78 B 🔺
@sentry/vue 36.07 kB +0.05% +17 B 🔺
@sentry/vue (incl. Tracing) 51.56 kB +0.16% +82 B 🔺
@sentry/svelte 28.85 kB +0.06% +15 B 🔺
CDN Bundle 30.56 kB +0.05% +15 B 🔺
CDN Bundle (incl. Tracing) 49.81 kB +0.15% +73 B 🔺
CDN Bundle (incl. Logs, Metrics) 32.83 kB +0.03% +9 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 51.77 kB +0.14% +71 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 73.48 kB -0.01% -4 B 🔽
CDN Bundle (incl. Tracing, Replay) 87.35 kB +0.08% +63 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 89.26 kB +0.1% +82 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 93.28 kB +0.07% +59 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 95.27 kB +0.07% +65 B 🔺
CDN Bundle - uncompressed 90.47 kB +0.01% +8 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 148.36 kB +0.13% +189 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.04 kB +0.01% +8 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 154.32 kB +0.13% +189 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.3 kB +0.01% +8 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.95 kB +0.08% +189 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 273.9 kB +0.07% +189 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.65 kB +0.07% +189 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 287.59 kB +0.07% +189 B 🔺
@sentry/nextjs (client) 54.09 kB +0.16% +84 B 🔺
@sentry/sveltekit (client) 49.73 kB +0.15% +71 B 🔺
@sentry/core/server 36.99 kB - -
@sentry/core/browser 13.55 kB - -
@sentry/node 127.95 kB +0.13% +158 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.61 kB - -
@sentry/node - without tracing 88.73 kB +0.03% +21 B 🔺
@sentry/node - without channel injection 107.17 kB +0.13% +137 B 🔺
@sentry/aws-serverless 97.12 kB +0.03% +27 B 🔺
@sentry/cloudflare (withSentry) - minified 202.2 kB +0.12% +223 B 🔺
@sentry/cloudflare (withSentry) 503.45 kB +0.16% +771 B 🔺

View base workflow run

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