Skip to content

fix(effect): Remove span op fallback to function - #24263

Open
Lms24 wants to merge 1 commit into
developfrom
lms/fix-effect-remove-op-fallback
Open

fix(effect): Remove span op fallback to function#24263
Lms24 wants to merge 1 commit into
developfrom
lms/fix-effect-remove-op-fallback

Conversation

@Lms24

@Lms24 Lms24 commented Sep 9, 2026

Copy link
Copy Markdown
Member

Initially, in #24261, I just wanted to enhance function spans in Effect but then realized when looking at the test changes that we likely shouldn't set a function op on these spans at all. IIUC, our wrapper can either be called by users or by other libraries that emit spans. From these spans, we try to infer an op (http.client and http.server at the moment). However, falling back to function for all other spans doesn't sound right to me because these could be any kinds of span.

Therefore, this PR

  • changes our op inference logic to just return no op
  • likewise, changes our origin inference logic to return manual for spans we don't know
  • => makes it seem like this span was user-emitted.
  • adjusts tests

My thinking is: We likely need to improve the inference logic if we know that certain libraries' spans go through our wrapper. Thinking of db, queue, request, etc. spans. But function likely isn't the fallback we want to use.

The side-effect: Spans with sentry.origin: "manual" double write span name and description, so no low card. span name stuff applies to them.

Would appreciate a thourough Effect-ive review, because I might be off here

ref (somewhat) #23954

The tracer derives op and origin from the span name, which is the only signal
Effect gives it. `@effect/platform` names its HTTP spans `http.server`/`http.client`,
but every other name comes from user code or a third-party library calling
`Effect.withSpan`. Those spans were labelled with op `function` and origin
`auto.function.effect`, which invents semantics the SDK cannot know and claims the
span was auto-instrumented when the user created it by hand.

Leave op and origin unset for names we cannot map, so the span keeps the core
defaults: no op, and a `manual` origin. More fine-grained ops can be mapped later
where a name actually identifies the operation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@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% +22 B 🔺
@sentry/node - without channel injection 107.16 kB +0.13% +135 B 🔺
@sentry/aws-serverless 97.12 kB +0.03% +27 B 🔺
@sentry/cloudflare (withSentry) - minified 202.05 kB +0.04% +74 B 🔺
@sentry/cloudflare (withSentry) 502.91 kB +0.05% +232 B 🔺

View base workflow run

@Lms24
Lms24 marked this pull request as ready for review September 9, 2026 17:50
@Lms24
Lms24 requested a review from a team as a code owner September 9, 2026 17:50
@Lms24
Lms24 requested review from JPeer264, nicohrubec and s1gr1d and removed request for a team September 9, 2026 17:50
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