Uh oh!
There was an error while loading. Please reload this page.
ref(node): Streamline dataloader instrumentation - #21475
Conversation
Uh oh!
There was an error while loading. Please reload this page.
f1ab607 to
070c3c0CompareThere 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 070c3c0. Configure here.
| await runner.makeRequest('get', '/load'); | ||
| await runner.makeRequest('get', '/load-many'); | ||
| await runner.makeRequest('get', '/cache-ops'); | ||
| await runner.makeRequest('get', '/named'); |
There was a problem hiding this comment.
Chained expects assume envelope order
Medium Severity
The test chains four .expect({ transaction: … }) callbacks, but the integration runner matches incoming envelopes with expectedEnvelopes.shift(), so the first callback always runs on the first transaction received—not necessarily GET /load. Four back-to-back HTTP requests can emit transactions in a different order than the expects, causing flaky failures when the wrong callback validates the wrong route.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 070c3c0. Configure here.
There was a problem hiding this comment.
this should not be possible to flush in a different order
946b207 to
837e1dbCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
837e1db to
f613978CompareUh oh!
There was an error while loading. Please reload this page.
This streamlines the vendored `fs` instrumentation, following the same approach as the dataloader (#21475) and generic-pool (#21523) refactors: * Use `Sentry.startSpan`/`startInactiveSpan`/`suppressTracing` instead of the OTel tracer APIs * Use the built-in `onlyIfParent` option instead of `requireParentSpan` + a hand-rolled parent check * Remove the unused `createHook`/`endHook`/`requireParentSpan` config and inline the span name, `op`/`origin` and file-path/error attributes directly into the instrumentation * Streamline the types to what we actually need * Remove the `/* eslint-disable */` and make the vendored files pass the (type-aware) linter * Add tests covering the previously-untested option gating While inlining the attribute logic, this also fixes a pre-existing bug: the documented `recordFilePaths` option was never read — file-path span attributes were gated on `recordErrorMessagesAsSpanAttributes` instead. File paths are now gated on `recordFilePaths` and error messages on `recordErrorMessagesAsSpanAttributes`, matching the docs. Closes#20726 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
## Summary This streamlines the vendored `fs` instrumentation, following the same approach as the dataloader (#21475) and generic-pool (#21523) refactors: - Use `Sentry.startSpan`/`startInactiveSpan`/`suppressTracing` instead of the OTel tracer APIs - Use the built-in `onlyIfParent` option instead of `requireParentSpan` + a hand-rolled parent check - Remove the unused `createHook`/`endHook`/`requireParentSpan` config and inline the span name, `op`/`origin` and file-path/error attributes directly into the instrumentation - Streamline the types to what we actually need - Remove the `/* eslint-disable */` and make the vendored files pass the (type-aware) linter - Add tests covering the previously-untested option gating `context.bind` from `@opentelemetry/api` is kept only for the callback-style functions, where the user's async callback must be restored to the parent context (so it isn't parented to the fs span or caught by tracing suppression) — there is no Sentry equivalent for this. ## Root cause (drive-by bug fix) While inlining the attribute logic, this also fixes a pre-existing bug: the documented `recordFilePaths` option was never read — file-path span attributes (`path_argument`, `src_argument`, etc.) were gated on `recordErrorMessagesAsSpanAttributes` instead (dates back to the original integration in #13291). File paths are now gated on `recordFilePaths` and error messages on `recordErrorMessagesAsSpanAttributes`, matching the documented options. New integration tests cover each gate in isolation. Closes#20726 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>


This streamlines the vendored dataloader instrumentation:
Sentry.startSpaninstead of tracer APIson('spanStart')directly into the instrumentationThis is overall much simpler, as we use the built-in error handling etc. from Sentry.startSpan.
Closes#20725