Skip to content

WIP feat(opentelemetry): Add SentryTraceProvider#21181

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

WIP feat(opentelemetry): Add SentryTraceProvider#21181
andreiborza wants to merge 5 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.27 kB - -
@sentry/browser - with treeshaking flags 25.69 kB - -
@sentry/browser (incl. Tracing) 45.51 kB +0.57% +257 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 47.74 kB +0.53% +251 B 🔺
@sentry/browser (incl. Tracing, Profiling) 50.49 kB +0.51% +255 B 🔺
@sentry/browser (incl. Tracing, Replay) 85.13 kB +0.33% +273 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 74.62 kB +0.36% +261 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 89.83 kB +0.3% +261 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 102.43 kB +0.25% +249 B 🔺
@sentry/browser (incl. Feedback) 44.46 kB - -
@sentry/browser (incl. sendFeedback) 32.09 kB - -
@sentry/browser (incl. FeedbackAsync) 37.21 kB - -
@sentry/browser (incl. Metrics) 28.37 kB - -
@sentry/browser (incl. Logs) 28.59 kB - -
@sentry/browser (incl. Metrics & Logs) 29.29 kB - -
@sentry/react 29.01 kB - -
@sentry/react (incl. Tracing) 47.72 kB +0.5% +236 B 🔺
@sentry/vue 32.47 kB +0.87% +277 B 🔺
@sentry/vue (incl. Tracing) 47.37 kB +0.55% +255 B 🔺
@sentry/svelte 27.3 kB - -
CDN Bundle 29.7 kB +0.07% +19 B 🔺
CDN Bundle (incl. Tracing) 48.03 kB +0.54% +255 B 🔺
CDN Bundle (incl. Logs, Metrics) 31.18 kB +0.05% +13 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 49.29 kB +0.53% +255 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 70.52 kB +0.05% +33 B 🔺
CDN Bundle (incl. Tracing, Replay) 85.52 kB +0.28% +237 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.69 kB +0.3% +258 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 91.39 kB +0.27% +242 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.54 kB +0.25% +228 B 🔺
CDN Bundle - uncompressed 87.77 kB +0.09% +75 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 145.09 kB +0.66% +944 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 92.26 kB +0.09% +75 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 148.85 kB +0.64% +944 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 216.98 kB +0.04% +75 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 263.87 kB +0.36% +944 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 267.61 kB +0.36% +944 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 277.57 kB +0.35% +944 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 281.3 kB +0.34% +944 B 🔺
@sentry/nextjs (client) 50.26 kB +0.58% +285 B 🔺
@sentry/sveltekit (client) 45.97 kB +0.53% +240 B 🔺
@sentry/core/server 76.57 kB +0.21% +153 B 🔺
@sentry/core/browser 63.31 kB +0.23% +141 B 🔺
@sentry/node-core 62.68 kB +0.69% +425 B 🔺
@sentry/node 132.37 kB +1.25% +1.63 kB 🔺
@sentry/node - without tracing 76.14 kB +1.93% +1.44 kB 🔺
@sentry/aws-serverless 88.54 kB +1.89% +1.63 kB 🔺
@sentry/cloudflare (withSentry) - minified 173.51 kB +0.64% +1.09 kB 🔺
@sentry/cloudflare (withSentry) 433.42 kB +0.64% +2.73 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
*/
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
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.

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 a44215e. Configure here.


if (typeof grpcCodeAttribute === 'string') {
return { code: SPAN_STATUS_ERROR, message: GRPC_STATUS_CODE_MAP[grpcCodeAttribute] || 'unknown_error' };
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

gRPC numeric status codes silently ignored in status inference

Medium Severity

inferOtelSpanStatusFromAttributes only checks typeof grpcCodeAttribute === 'string', but the OTel semantic convention defines rpc.grpc.status_code as an integer. Numeric gRPC error codes (the common case from instrumentation libraries) fall through to undefined, causing the caller to default to SPAN_STATUS_OK — even for actual gRPC errors like UNKNOWN (2) or INTERNAL (13). Additionally, a string '0' (gRPC OK) would incorrectly map to SPAN_STATUS_ERROR since GRPC_STATUS_CODE_MAP has no entry for '0', yielding 'unknown_error'. The HTTP code path correctly handles both number and string types; the gRPC path needs the same treatment plus a guard for code 0.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a44215e. Configure here.

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