Add @browserstack/ai-sdk to server-external-packages#93739
Open
deyancodez wants to merge 1 commit intovercel:canaryfrom
Open
Add @browserstack/ai-sdk to server-external-packages#93739deyancodez wants to merge 1 commit intovercel:canaryfrom
deyancodez wants to merge 1 commit intovercel:canaryfrom
Conversation
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
0e85f30 to
26d6a44
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@browserstack/ai-sdkauto-instruments OpenAI, Anthropic, Bedrock, Vertex AI, LangChain, etc. via OpenTelemetry'srequire-in-the-middle/import-in-the-middlehooks. 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-nodeare already on this list.Package: https://www.npmjs.com/package/@browserstack/ai-sdk