Skip to content

ref(opentelemetry): Replace @opentelemetry/resources with inline getSentryResource() - #20327

Merged
mydea merged 1 commit into
developfrom
fn/vendor-otel-resource
Apr 15, 2026
Merged

ref(opentelemetry): Replace @opentelemetry/resources with inline getSentryResource()#20327
mydea merged 1 commit into
developfrom
fn/vendor-otel-resource

Conversation

@mydea

Copy link
Copy Markdown
Member

Summary

  • Adds a minimal SentryResource class in @sentry/opentelemetry that structurally satisfies the OTel Resource interface (attributes, merge(), getRawAttributes())
  • Exports getSentryResource(serviceName) which produces the same 6-attribute resource previously built via defaultResource().merge(resourceFromAttributes({...}))
  • Removes direct @opentelemetry/resources imports from @sentry/node, @sentry/vercel-edge, and test helpers
  • Drops @opentelemetry/resources from @sentry/node dependencies and @sentry/node-core peer/dev dependencies

Test plan

  • yarn test passes for @sentry/opentelemetry, @sentry/node, @sentry/vercel-edge, @sentry/node-core
  • yarn build:dev succeeds for all affected packages
  • No lint or format errors introduced

🤖 Generated with Claude Code

@mydeamydea self-assigned this Apr 15, 2026

@cursorcursorBot 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 6c9d83d. Configure here.

Comment threadpackages/vercel-edge/src/sdk.ts
@github-actions

github-actionsBot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser25.78 kB--
@sentry/browser - with treeshaking flags24.27 kB--
@sentry/browser (incl. Tracing)42.77 kB--
@sentry/browser (incl. Tracing, Profiling)47.4 kB--
@sentry/browser (incl. Tracing, Replay)81.69 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags71.22 kB--
@sentry/browser (incl. Tracing, Replay with Canvas)86.39 kB--
@sentry/browser (incl. Tracing, Replay, Feedback)98.6 kB--
@sentry/browser (incl. Feedback)42.59 kB--
@sentry/browser (incl. sendFeedback)30.45 kB--
@sentry/browser (incl. FeedbackAsync)35.45 kB--
@sentry/browser (incl. Metrics)27.07 kB--
@sentry/browser (incl. Logs)27.2 kB--
@sentry/browser (incl. Metrics & Logs)27.89 kB--
@sentry/react27.53 kB--
@sentry/react (incl. Tracing)45.09 kB--
@sentry/vue30.61 kB--
@sentry/vue (incl. Tracing)44.63 kB--
@sentry/svelte25.8 kB--
CDN Bundle28.46 kB--
CDN Bundle (incl. Tracing)43.82 kB--
CDN Bundle (incl. Logs, Metrics)29.83 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)44.89 kB--
CDN Bundle (incl. Replay, Logs, Metrics)68.73 kB--
CDN Bundle (incl. Tracing, Replay)80.78 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)81.83 kB--
CDN Bundle (incl. Tracing, Replay, Feedback)86.31 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)87.34 kB--
CDN Bundle - uncompressed83.12 kB--
CDN Bundle (incl. Tracing) - uncompressed129.95 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed87.27 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed133.36 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed210.63 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed247.21 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed250.6 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed260.12 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed263.51 kB--
@sentry/nextjs (client)47.52 kB--
@sentry/sveltekit (client)43.24 kB--
@sentry/node-core57.94 kB+0.02%+8 B 🔺
@sentry/node174.8 kB+0.04%+54 B 🔺
@sentry/node - without tracing97.88 kB+0.09%+86 B 🔺
@sentry/aws-serverless115.13 kB+0.07%+80 B 🔺

View base workflow run

…etSentryResource()`
Add a minimal `SentryResource` class in `@sentry/opentelemetry` that satisfies the OTel `Resource` interface, and a `getSentryResource(serviceName)` helper that produces the exact same merged resource we previously built via `defaultResource().merge(resourceFromAttributes({...}))`.
This removes direct imports of `@opentelemetry/resources` from `@sentry/node`, `@sentry/vercel-edge`, and test helpers, and drops the package from `node`'s dependencies and `node-core`'s peer/dev dependencies.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mydea
mydeaforce-pushed the fn/vendor-otel-resource branch from 6c9d83d to ba69f1cCompareApril 15, 2026 12:14

@JPeer264JPeer264 left a comment

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.

LGTM. Also nice as this removes some repetition

@mydea
mydea merged commit 684a41f into developApr 15, 2026
174 checks passed
@mydea
mydea deleted the fn/vendor-otel-resource branch April 15, 2026 14:36
Sign up for freeto 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

@mydea@JPeer264