Skip to content

feat(effect): Set code.function.name attribute for span description inference - #24261

Closed
Lms24 wants to merge 2 commits into
developfrom
lms/feat-effect-function-name-attr
Closed

feat(effect): Set code.function.name attribute for span description inference#24261
Lms24 wants to merge 2 commits into
developfrom
lms/feat-effect-function-name-attr

Conversation

@Lms24

@Lms24 Lms24 commented Sep 9, 2026

Copy link
Copy Markdown
Member

Effect spans fall back to op function when we don't detect spans that should be op http.server or http.client. I'm going to assume this is intended and moreover, assume that these spans are actual function spans. This is good because it means they're already low cardinality and adhere to the conventions span name spec. So the only thing left to do was setting the code.function.name attribute for span description inference.

ref #23954

@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 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 3eb1e36. Configure here.

Comment thread packages/effect/test/tracer.test.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 - -
@sentry/browser - with treeshaking flags 27.12 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.01 kB - -
@sentry/browser (incl. Tracing) 49.27 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 49.28 kB - -
@sentry/browser (incl. Tracing, Profiling) 52.21 kB - -
@sentry/browser (incl. Tracing, Replay) 88.81 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.99 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 93.49 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 106.44 kB - -
@sentry/browser (incl. Feedback) 46.3 kB - -
@sentry/browser (incl. sendFeedback) 33.87 kB - -
@sentry/browser (incl. FeedbackAsync) 38.99 kB - -
@sentry/browser (incl. Metrics) 29.84 kB - -
@sentry/browser (incl. Logs) 30.1 kB - -
@sentry/browser (incl. Metrics & Logs) 30.78 kB - -
@sentry/react 30.57 kB - -
@sentry/react (incl. Tracing) 51.64 kB - -
@sentry/vue 36.07 kB - -
@sentry/vue (incl. Tracing) 51.56 kB - -
@sentry/svelte 28.85 kB - -
CDN Bundle 30.56 kB - -
CDN Bundle (incl. Tracing) 49.81 kB - -
CDN Bundle (incl. Logs, Metrics) 32.83 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.77 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.48 kB - -
CDN Bundle (incl. Tracing, Replay) 87.35 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 89.26 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 93.28 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 95.27 kB - -
CDN Bundle - uncompressed 90.47 kB - -
CDN Bundle (incl. Tracing) - uncompressed 148.36 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.04 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 154.32 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.3 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.95 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 273.9 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.65 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 287.59 kB - -
@sentry/nextjs (client) 54.09 kB - -
@sentry/sveltekit (client) 49.73 kB - -
@sentry/core/server 36.99 kB - -
@sentry/core/browser 13.55 kB - -
@sentry/node 127.95 kB +0.02% +24 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.17 kB +0.02% +19 B 🔺
@sentry/aws-serverless 97.12 kB +0.03% +26 B 🔺
@sentry/cloudflare (withSentry) - minified 202.05 kB - -
@sentry/cloudflare (withSentry) 502.91 kB - -

View base workflow run

@Lms24

Lms24 commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

Ok so i think we should just remove the fallback op for function instead. we don't know at all what calls this helper so I'd rather not pretend these are sentry-created spans.

@Lms24

Lms24 commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

superseded by #24263

@Lms24 Lms24 closed this Sep 9, 2026
Lms24 added a commit that referenced this pull request Sep 11, 2026
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.
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