Skip to content

feat(node-native): Add option to disable event loop blocked detection #16919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 14, 2025

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Jul 10, 2025

This PR updates @sentry-internal/node-native-stacktrace to v0.2.0 which supports disabling last time tracking per thread.

The integration needed quite a few changes and I split it into more functions but all the tests still pass!

This PR then adds pauseEventLoopBlockDetection(), restartEventLoopBlockDetection() which can be used to pause and restart detection and disableBlockDetectionForCallback which can be used like this:

import { disableBlockDetectionForCallback } from '@sentry/node-native';

disableBlockDetectionForCallback(() => {
  someLongBlockingFn();
});

@timfish timfish marked this pull request as ready for review July 11, 2025 09:26
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@AbhiPrasad AbhiPrasad merged commit 676fc50 into develop Jul 14, 2025
168 checks passed
@AbhiPrasad AbhiPrasad deleted the timfish/feat/disable-blocked-detection branch July 14, 2025 17:59
msonnb pushed a commit that referenced this pull request Jul 15, 2025
…#16919)

This PR updates `@sentry-internal/node-native-stacktrace` to v0.2.0
which supports disabling last time tracking per thread.

The integration needed quite a few changes and I split it into more
functions but all the tests still pass!

This PR then adds `pauseEventLoopBlockDetection()`,
`restartEventLoopBlockDetection()` which can be used to pause and
restart detection and `disableBlockDetectionForCallback` which can be
used like this:

```ts
import { disableBlockDetectionForCallback } from '@sentry/node-native';

disableBlockDetectionForCallback(() => {
  someLongBlockingFn();
});
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants