fix(node): Send ANR events without scope if event loop blocked indefinitely#11578
fix(node): Send ANR events without scope if event loop blocked indefinitely#11578AbhiPrasad merged 1 commit intodevelopfrom
Conversation
AbhiPrasad
left a comment
There was a problem hiding this comment.
Thinking about this, do you think we can create spans that represent how long the event loop was blocked (and use the inspector to attach stacktrace or similar?)
Yes, assuming the event loop becomes unblocked we can run any code in the main app thread. The only limitation I can think of is that our resolution will only be as good as our poll interval which is currently 50ms. How would you add stack traces to spans? |
you can add code locations to span via the code attributes: https://opentelemetry.io/docs/specs/semconv/attributes-registry/code/ otherwise I guess most people rely on profiling data |
…nitely (getsentry#11578) When experimenting for getsentry#11525 I found that `Runtime.evaluate` only returns when the event loop becomes unblocked. This means that we are not sending ANR events if the event loop is blocked indefinitely. This PR adds a timeout that sends the ANR event if we have not been able to evaluate the scope within 5 seconds.
When experimenting for #11525 I found that
Runtime.evaluateonly returns when the event loop becomes unblocked. This means that we are not sending ANR events if the event loop is blocked indefinitely.This PR adds a timeout that sends the ANR event if we have not been able to evaluate the scope within 5 seconds.