Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/vercel-edge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
},
"dependencies": {
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/resources": "^2.6.1",
"@sentry/core": "10.59.0"
},
"devDependencies": {
Expand Down
26 changes: 26 additions & 0 deletions packages/vercel-edge/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,32 @@ export default makeNPMConfigVariants(
}
},
},
{
// `@opentelemetry/sdk-trace-base` is bundled here, and its `BasicTracerProvider`
// statically imports `defaultResource` from `@opentelemetry/resources` as a fallback
// (`mergedConfig.resource ?? defaultResource()`). Sentry always supplies its own
// resource via `getSentryResource()`, so the fallback never runs. Shimming the import
// lets us drop the `@opentelemetry/resources` dependency and avoids bundling its
// node-only resource detectors into the edge runtime.
name: 'otel-resources-shim',
resolveId: source => (source === '@opentelemetry/resources' ? '\0otel_resources_sentry_shim' : null),
load: id =>
id === '\0otel_resources_sentry_shim'
? `
export function defaultResource() {
return {
attributes: {},
merge() {
return this;
},
getRawAttributes() {
return [];
},
};
}
`
: null,
},
],
},
}),
Expand Down
Loading