ref(node): Streamline dataloader instrumentation#21475
Conversation
f1ab607 to
070c3c0
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 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
837e1db
Compare
837e1db to
f613978
Compare
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>


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