Skip to content

WIP feat(opentelemetry): Add SentryTraceProvider#21181

Draft
andreiborza wants to merge 12 commits into
developfrom
ab/sentry-tracer-provider
Draft

WIP feat(opentelemetry): Add SentryTraceProvider#21181
andreiborza wants to merge 12 commits into
developfrom
ab/sentry-tracer-provider

Conversation

@andreiborza
Copy link
Copy Markdown
Member

WIP

Comment thread packages/opentelemetry/src/sentryTraceProvider.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.21 kB +0.01% +1 B 🔺
@sentry/browser - with treeshaking flags 25.65 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing) 45.72 kB +0.46% +209 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 47.95 kB +0.46% +218 B 🔺
@sentry/browser (incl. Tracing, Profiling) 50.49 kB +0.41% +202 B 🔺
@sentry/browser (incl. Tracing, Replay) 84.91 kB +0.24% +201 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 74.52 kB +0.25% +182 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 89.61 kB +0.24% +206 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 102.31 kB +0.2% +202 B 🔺
@sentry/browser (incl. Feedback) 44.37 kB - -
@sentry/browser (incl. sendFeedback) 32.03 kB - -
@sentry/browser (incl. FeedbackAsync) 37.12 kB +0.02% +4 B 🔺
@sentry/browser (incl. Metrics) 28.28 kB +0.01% +2 B 🔺
@sentry/browser (incl. Logs) 28.53 kB +0.02% +3 B 🔺
@sentry/browser (incl. Metrics & Logs) 29.22 kB +0.01% +1 B 🔺
@sentry/react 29.02 kB +0.02% +3 B 🔺
@sentry/react (incl. Tracing) 47.97 kB +0.42% +196 B 🔺
@sentry/vue 32.4 kB +0.55% +177 B 🔺
@sentry/vue (incl. Tracing) 47.6 kB +0.42% +197 B 🔺
@sentry/svelte 27.23 kB +0.01% +1 B 🔺
CDN Bundle 29.61 kB +0.11% +32 B 🔺
CDN Bundle (incl. Tracing) 48.2 kB +0.52% +245 B 🔺
CDN Bundle (incl. Logs, Metrics) 31.12 kB +0.11% +32 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 49.45 kB +0.52% +253 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 70.4 kB +0.05% +30 B 🔺
CDN Bundle (incl. Tracing, Replay) 85.55 kB +0.25% +212 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.75 kB +0.28% +235 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 91.42 kB +0.28% +255 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.58 kB +0.27% +241 B 🔺
CDN Bundle - uncompressed 87.86 kB +0.1% +80 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 145.77 kB +0.55% +791 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 92.34 kB +0.09% +80 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 149.53 kB +0.54% +791 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 217.16 kB +0.04% +80 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 264.65 kB +0.31% +799 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 268.39 kB +0.3% +799 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.35 kB +0.29% +799 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.08 kB +0.29% +799 B 🔺
@sentry/nextjs (client) 50.42 kB +0.34% +167 B 🔺
@sentry/sveltekit (client) 46.12 kB +0.44% +198 B 🔺
@sentry/core/server 76.06 kB +0.14% +101 B 🔺
@sentry/core/browser 63.21 kB +0.19% +114 B 🔺
@sentry/node-core 62.03 kB +0.5% +305 B 🔺
@sentry/node 131.72 kB +1% +1.3 kB 🔺
@sentry/node - without tracing 75.3 kB +1.61% +1.19 kB 🔺
@sentry/aws-serverless 87.59 kB +1.52% +1.31 kB 🔺
@sentry/cloudflare (withSentry) - minified 174.65 kB +0.56% +969 B 🔺
@sentry/cloudflare (withSentry) 436.32 kB +0.59% +2.53 kB 🔺

View base workflow run

@andreiborza andreiborza force-pushed the ab/sentry-tracer-provider branch from 0f2020a to 71e7c69 Compare May 27, 2026 05:27
Comment thread packages/core/src/tracing/sentrySpan.ts Outdated
*/
public recordException(_exception: unknown, _time?: number | undefined): void {
// noop
public recordException(exception: unknown, time?: SpanTimeInput | undefined): void {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can leave this as noop, we do not care about this and do not really support it, doing nothing with events etc.

@andreiborza andreiborza force-pushed the ab/sentry-tracer-provider branch from 71e7c69 to a44215e Compare May 28, 2026 04:15
Comment thread packages/opentelemetry/src/sentryTraceProvider.ts
Comment thread packages/node/src/sdk/initOtel.ts
Comment thread packages/opentelemetry/src/sentryTraceProvider.ts
@andreiborza andreiborza force-pushed the ab/sentry-tracer-provider branch from cf369b6 to 749e7e7 Compare June 6, 2026 22:56
Comment thread packages/node/src/sdk/initOtel.ts
Comment thread packages/core/src/tracing/trace.ts
@andreiborza andreiborza force-pushed the ab/sentry-tracer-provider branch 5 times, most recently from f79c234 to 8ebaf6b Compare June 8, 2026 08:54
andreiborza and others added 8 commits June 8, 2026 12:53
# Conflicts:
#	dev-packages/e2e-tests/test-applications/nextjs-13/instrumentation.ts
#	dev-packages/e2e-tests/test-applications/nextjs-14/instrumentation.ts
#	dev-packages/e2e-tests/test-applications/nextjs-15-basepath/sentry.server.config.ts
#	dev-packages/e2e-tests/test-applications/nextjs-15-intl/sentry.server.config.ts
#	dev-packages/e2e-tests/test-applications/nextjs-15/sentry.server.config.ts
#	dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/sentry.server.config.ts
#	dev-packages/e2e-tests/test-applications/nextjs-16-streaming/sentry.server.config.ts
#	dev-packages/e2e-tests/test-applications/nextjs-16-trailing-slash/sentry.server.config.ts
#	dev-packages/e2e-tests/test-applications/nextjs-16-tunnel/sentry.server.config.ts
#	dev-packages/e2e-tests/test-applications/nextjs-16-userfeedback/sentry.server.config.ts
#	dev-packages/e2e-tests/test-applications/nextjs-16/sentry.server.config.ts
#	dev-packages/e2e-tests/test-applications/nextjs-app-dir/instrumentation.ts
#	dev-packages/e2e-tests/test-applications/nextjs-pages-dir/instrumentation.ts
#	dev-packages/e2e-tests/test-applications/supabase-nextjs/sentry.server.config.ts
SentryNonRecordingSpan can now store a `sampled` flag that distinguishes
"sampled negative" from "no sampling decision yet" in TwP mode. Trace
header generation uses the new `spanToTraceSamplingDecision` helper to
propagate this decision instead of always inferring from traceFlags.

Also aligns `recordException` signature to use `SpanTimeInput` on both
the Span interface and its implementations.

Co-Authored-By: Claude <noreply@anthropic.com>
@andreiborza andreiborza force-pushed the ab/sentry-tracer-provider branch from 8ebaf6b to 2b70730 Compare June 8, 2026 10:54
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.

There are 2 total unresolved issues (including 1 from previous review).

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 2bb6a3c. Configure here.

Comment thread packages/core/src/utils/spanUtils.ts
@andreiborza andreiborza force-pushed the ab/sentry-tracer-provider branch from 959483b to 87ed1f0 Compare June 8, 2026 14:05
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