Repository navigation
feat(node): Add onSpanEnd to httpIntegration - #25581
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 cc344a9. Configure here.
size-limit report 📦Compared: 779cfe2 (PR test merge using develop at e196565) Against: 6fb6b07 (develop) · base run #62924
|
45ebb10 to
1f0fc7f
Compare
1f0fc7f to
4e495ab
Compare
4e495ab to
35530ea
Compare
| span_id: expect.stringMatching(/[a-f\d]{16}/), | ||
| trace_id: expect.stringMatching(/[a-f\d]{32}/), | ||
| status: 'ok', | ||
| attributes: expect.objectContaining({ |
There was a problem hiding this comment.
l: Since it was already here actually ok, but maybe we can remove the expect.objectContaining entirely, then this would even fail if we forget to add new attributes
| attributes: { |
`httpIntegration` takes `onSpanCreated` for incoming requests, but not `onSpanEnd`. A user could not change the server span based on the response, for example to rename it from data that is only known when the response finishes. Core's `node:http` server code already supports `onSpanEnd`, and `denoHttpIntegration` and `bunHttpServerIntegration` pass it through. `httpServerSpansIntegration` now accepts `onSpanEnd` and calls it as core does: when the response finishes, after the SDK sets the response attributes and the span status, before the span ends. `httpIntegration` passes it through. The shared `ServerRequestOptions` check for Node now lists no unsupported options. Fixes #25572 Fixes JS-3970 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
35530ea to
81d2783
Compare
Optional E2E testsSome optional checks were not successful. They do not block the merge. 3 failing, 47 successful. See the run.
Successful checks
|

httpIntegrationtakesonSpanCreatedfor incoming requests, but notonSpanEnd. A user could not change the server span based on the response, for example to rename it from data that is only known when the response finishes. Core'snode:httpserver code already supportsonSpanEnd, anddenoHttpIntegrationandbunHttpServerIntegrationpass it through.httpServerSpansIntegrationnow acceptsonSpanEndand calls it as core does: when the response finishes, after the SDK sets the response attributes and the span status, before the span ends.httpIntegrationpasses it through. The sharedServerRequestOptionscheck for Node now lists no unsupported options.Fixes #25572
Fixes JS-3970