Skip to content

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

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

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

Conversation

@mydea
Copy link
Copy Markdown
Member

@mydea mydea commented Apr 15, 2026

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

@mydea mydea self-assigned this Apr 15, 2026
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 6c9d83d. Configure here.

Comment thread packages/vercel-edge/src/sdk.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.78 kB - -
@sentry/browser - with treeshaking flags 24.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 flags 71.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/react 27.53 kB - -
@sentry/react (incl. Tracing) 45.09 kB - -
@sentry/vue 30.61 kB - -
@sentry/vue (incl. Tracing) 44.63 kB - -
@sentry/svelte 25.8 kB - -
CDN Bundle 28.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 - uncompressed 83.12 kB - -
CDN Bundle (incl. Tracing) - uncompressed 129.95 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 87.27 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 133.36 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 210.63 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 247.21 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 250.6 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 260.12 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 263.51 kB - -
@sentry/nextjs (client) 47.52 kB - -
@sentry/sveltekit (client) 43.24 kB - -
@sentry/node-core 57.94 kB +0.02% +8 B 🔺
@sentry/node 174.8 kB +0.04% +54 B 🔺
@sentry/node - without tracing 97.88 kB +0.09% +86 B 🔺
@sentry/aws-serverless 115.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 mydea force-pushed the fn/vendor-otel-resource branch from 6c9d83d to ba69f1c Compare April 15, 2026 12:14
Copy link
Copy Markdown
Member

@JPeer264 JPeer264 left a comment

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 develop Apr 15, 2026
174 checks passed
@mydea mydea deleted the fn/vendor-otel-resource branch April 15, 2026 14:36
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