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 these spans were 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

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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 28.92 kB - -
@sentry/browser - with treeshaking flags 27.21 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.11 kB - -
@sentry/browser (incl. Tracing) 50.28 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 50.29 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.27 kB - -
@sentry/browser (incl. Tracing, Replay) 89.77 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 78.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 94.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 107.47 kB - -
@sentry/browser (incl. Feedback) 46.41 kB - -
@sentry/browser (incl. sendFeedback) 33.97 kB - -
@sentry/browser (incl. FeedbackAsync) 39.08 kB - -
@sentry/browser (incl. Metrics) 29.93 kB - -
@sentry/browser (incl. Logs) 30.2 kB - -
@sentry/browser (incl. Metrics & Logs) 30.87 kB - -
@sentry/react 30.67 kB - -
@sentry/react (incl. Tracing) 52.6 kB - -
@sentry/vue 36.16 kB - -
@sentry/vue (incl. Tracing) 52.53 kB - -
@sentry/svelte 28.93 kB - -
CDN Bundle 30.66 kB - -
CDN Bundle (incl. Tracing) 50.78 kB - -
CDN Bundle (incl. Logs, Metrics) 32.93 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 52.74 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.62 kB - -
CDN Bundle (incl. Tracing, Replay) 88.33 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.29 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 94.37 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.38 kB - -
CDN Bundle - uncompressed 90.73 kB - -
CDN Bundle (incl. Tracing) - uncompressed 151.69 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.31 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 157.66 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.72 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 271.26 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 277.21 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 284.96 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 290.9 kB - -
@sentry/nextjs (client) 54.92 kB - -
@sentry/sveltekit (client) 50.7 kB - -
@sentry/core/server 37.08 kB - -
@sentry/core/browser 13.66 kB - -
@sentry/node 128.59 kB +0.01% +12 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.82 kB - -
@sentry/node - without tracing 89.55 kB +0.04% +28 B 🔺
@sentry/node - without channel injection 107.53 kB +0.02% +20 B 🔺
@sentry/aws-serverless 97.77 kB +0.03% +20 B 🔺
@sentry/cloudflare (withSentry) - minified 203.01 kB - -
@sentry/cloudflare (withSentry) 505.44 kB - -

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
@Lms24 Lms24 self-assigned this Sep 10, 2026
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>
@Lms24
Lms24 force-pushed the lms/fix-effect-remove-op-fallback branch from b38c566 to 378c519 Compare September 10, 2026 15:22
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