Skip to content

Add @browserstack/ai-sdk to server-external-packages#93739

Open
deyancodez wants to merge 1 commit intovercel:canaryfrom
deyancodez:add-browserstack-ai-sdk-external
Open

Add @browserstack/ai-sdk to server-external-packages#93739
deyancodez wants to merge 1 commit intovercel:canaryfrom
deyancodez:add-browserstack-ai-sdk-external

Conversation

@deyancodez
Copy link
Copy Markdown

@deyancodez deyancodez commented May 10, 2026

@browserstack/ai-sdk auto-instruments OpenAI, Anthropic, Bedrock, Vertex AI, LangChain, etc. via OpenTelemetry's require-in-the-middle / import-in-the-middle hooks. Those hooks only fire on the runtime require, so bundling the package into the server output breaks instrumentation.

Same reason dd-trace, newrelic, @appsignal/nodejs, and @sentry/profiling-node are already on this list.

Package: https://www.npmjs.com/package/@browserstack/ai-sdk

The @browserstack/ai-sdk package auto-instruments LLM and agent SDKs
(OpenAI, Anthropic, Bedrock, Vertex AI, LangChain, etc.) via
OpenTelemetry's require-in-the-middle / import-in-the-middle hooks.

For the hooks to fire correctly, the SDK must remain a runtime require
rather than being inlined into the server bundle. When Turbopack/Webpack
bundles it, the hook registers but the runtime require call no longer
exists, so instrumentation silently breaks for downstream users.

This follows the same pattern already established for sister
observability packages on this list: dd-trace, newrelic,
@appsignal/nodejs, and @sentry/profiling-node.

Reference: https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation/README.md#limitations
@deyancodez deyancodez force-pushed the add-browserstack-ai-sdk-external branch from 0e85f30 to 26d6a44 Compare May 10, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant