feat(mongoose): implement orchestrion mongoose integration#22202
Conversation
6c2328d to
d62144c
Compare
size-limit report 📦
|
d62144c to
2d38636
Compare
44073c9 to
05a59f8
Compare
05a59f8 to
7082702
Compare
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 7082702. Configure here.
b193268 to
7fea0e9
Compare
Port the OTel mongoose intstrumentation to Orchestrion. Add Deno integration, and node integration tests for mongoose versions 5, 6, 7, 8, and 9. Native diagnostics channel used on Mongoose versions supporting them (ie, 9.7+). Fix: JS-2412 Fix: #20761
7fea0e9 to
a192937
Compare
| import type { SentryTracingChannel } from '../../tracing-channel'; | ||
| import { bindTracingChannelToSpan } from '../../tracing-channel'; | ||
|
|
||
| const INTEGRATION_NAME = 'Mongoose' as const; |
There was a problem hiding this comment.
Bug: The Node.js mongoose integration imports the old mongooseIntegration instead of the new orchestrion-based one, causing a lack of instrumentation for mongoose versions < 9.7.
Severity: HIGH
Suggested Fix
In packages/node/src/integrations/tracing/mongoose/index.ts, update the import statement to pull from the new orchestrion path. Change import { mongooseIntegration as mongooseChannelIntegration } from '@sentry/server-utils'; to import { mongooseChannelIntegration } from '@sentry/server-utils/orchestrion'; to ensure the Node integration uses the correct, complete implementation.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: packages/server-utils/src/integrations/tracing-channel/mongoose.ts#L13
Potential issue: The Node.js mongoose integration in
`packages/node/src/integrations/tracing/mongoose/index.ts` incorrectly imports an older
`mongooseIntegration` from `@sentry/server-utils` instead of the new,
orchestrion-compatible `mongooseChannelIntegration`. The old integration only supports
native diagnostics channels for mongoose versions 9.7 and newer. The new integration is
designed to add support for older mongoose versions via orchestrion-injected channels.
By importing the old integration, the Node.js SDK will fail to instrument mongoose
versions older than 9.7, which undermines a primary goal of the changes in this pull
request.
Also affects:
packages/server-utils/src/mongoose/index.ts:2~10

Port the OTel mongoose intstrumentation to Orchestrion. Add Deno integration, and node integration tests for mongoose versions 5, 6, 7, 8, and 9.
Native diagnostics channel used on Mongoose versions supporting them (ie, 9.7+).
Fix: #20761
Fix: #20761