ref(node): Stop using registerSpanErrorInstrumentation() on server#21169
Conversation
53a9eb2 to
c0f6a9e
Compare
size-limit report 📦
|
c0f6a9e to
163d0fa
Compare
648b60d to
d1be7c0
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 d1be7c0. Configure here.
Lms24
left a comment
There was a problem hiding this comment.
Sounds reasonable to me, though I had one question/concern. But apart from that it seems like no tests fail and the tests added demonstrate unchanged behavior.
| ); | ||
| }, | ||
| ).length; | ||
| const userProvidedListenersCount = global.process.listeners('uncaughtException').filter(listener => { |
There was a problem hiding this comment.
hmm this change has me slightly suspicious because IIUC it implies that the registerSpanErrorInstrumentation() had an effect that we needed to skip here. Any idea why this might be? Could also just be a false flag and the tag condition just never made a difference...
There was a problem hiding this comment.
yeah also not sure, the code was here to handle the theoretical case where this would have worked but it hasn't - either it used to work differently back in the day, or it never worked - there was also not really test coverage for this as far as I can tell 😬

I think this does nothing on node, because the implementation of this calls this under the hood:
basically browser-only, using
window.onerror. I believe this is handled specifically in node anyhow so should not be used/needed and allows us to streamline this a bit and potentially move this to a browser-only place eventually.This also means we can remove the tag we put here, because this is actually not needed.
I adjusted a node-integration-test to verify this works there, both with using our own startSpan implementations (express uses this). With otel-native spans, it does not work, but it did not work before either - IMHO this is fine for the time being.