feat(node): Add getInstrumentedModuleNames() - #24254
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1036b89. Configure here.
| for (const name of ['dataloader', 'ai', 'express', 'pg', 'redis']) { | ||
| expect(names).toContain(name); | ||
| } | ||
| }); |
There was a problem hiding this comment.
Test loop covers multiple cases
Low Severity
This test loops over several package names and asserts each one is present. The review guidelines ask for (it)|(test).each instead of a loop that covers multiple scenarios in one test, so a single missing name does not hide the rest. Flagged because that testing convention is in the review rules file.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 1036b89. Configure here.
size-limit report 📦
|
…-eve orchestrion test Exposes `getInstrumentedModuleNames()` — the package names Sentry instruments through the orchestrion module transform — so an app on a framework with no Sentry bundler plugin can keep those packages external and let the transform hook them, instead of hardcoding the list. Lives in `@sentry/server-utils` (where the orchestrion config lives) and is re-exported from `@sentry/node`, so `export *` consumers (nitro — eve's base —, astro, …) surface it too. It returns the plain `module.name` set, deliberately without the bundler-only additions in `INSTRUMENTED_MODULE_NAMES` (those force a helper package to be bundled, the opposite of keeping it external). The node-eve app's orchestrion variant now passes `getInstrumentedModuleNames()` to `build.externalDependencies` instead of a hardcoded `['dataloader']`. The app only uses `dataloader` of that set, so the rest are no-ops; `ai` v7 stays fine externalized (native diagnostics channel + registration-only under the transform). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Same footprint as eveConversationHook: added to the explicit re-export blocks of @sentry/bun, @sentry/aws-serverless and @sentry/google-cloud-serverless (from @sentry/node) and of @sentry/deno and @sentry/cloudflare (from @sentry/server-utils), so it is available wherever a server bundle is configured. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Astro's runtime entry curates its `@sentry/node` re-exports (it can't `export *`), so it needs the explicit listing like the other SDKs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2b5f1c9 to
3dd340f
Compare


Stacked on #24247 (base branch
feat/eve-conversation-hook).Exposes
getInstrumentedModuleNames()— the package names Sentry instruments through the orchestrion module transform (its diagnostics-channel injection).Why:
build.externalDependencies) otherwise has to hardcode which packages to keep external. An inlined dependency never reaches the transform'sonLoad, so it's silently never instrumented — this hands the app the authoritative set.module.nameset, deliberately without the bundler-only additions in the internalINSTRUMENTED_MODULE_NAMES(e.g.@remix-run/node), which exist to force a helper package to be bundled — the opposite of keeping it external.Export surface: lives in
@sentry/server-utils(home of the orchestrion config). Re-exported from@sentry/node, soexport *consumers — nitro (eve's base), astro, nestjs, hono, effect — surface it automatically; and added explicitly to@sentry/bun,@sentry/aws-serverless,@sentry/google-cloud-serverless(from node) and@sentry/deno,@sentry/cloudflare(from server-utils), i.e. everywhere a server bundle is configured — the same footprint aseveConversationHook.node-eve e2e: the orchestrion variant's
build.externalDependenciesnow usesgetInstrumentedModuleNames()instead of a hardcoded['dataloader']. The app only usesdataloaderof that set, so the others are no-ops;aiv7 stays correct when externalized (nativeai:telemetrychannel, and registration-only under the transform, so no double instrumentation). The existingdataloaderassertion continues to prove the transform still runs.🤖 Generated with Claude Code