---
title: "Event Loop Block"
description: "Monitor for blocked event loops in all threads of a Node.js application."
url: https://docs.sentry.io/platforms/javascript/guides/electron/configuration/integrations/event-loop-block/
---

# Event Loop Block | Sentry for Electron

This integration only works in the Node.js runtime.

*Import name: `eventLoopBlockIntegration` from `@sentry/node-native`*

The `eventLoopBlockIntegration` can be used to monitor for blocked event loops in all threads of a Node.js application. Stack traces are automatically captured when blocking is detected.

## [Installation](https://docs.sentry.io/platforms/javascript/guides/electron/configuration/integrations/event-loop-block.md#installation)

```bash
npm install @sentry/node-native
```

## [Usage](https://docs.sentry.io/platforms/javascript/guides/electron/configuration/integrations/event-loop-block.md#usage)

*(Available in version 6.9.0 and above)*

```javascript
import * as Sentry from "@sentry/electron/main";
import { eventLoopBlockIntegration } from "@sentry/electron/native";

Sentry.init({
  dsn: "___PUBLIC_DSN___",
  integrations: [eventLoopBlockIntegration({ threshold: 500 })],
});
```

## [Configuration Options](https://docs.sentry.io/platforms/javascript/guides/electron/configuration/integrations/event-loop-block.md#configuration-options)

You can pass a configuration object to the `eventLoopBlockIntegration` to customize the behavior:

```typescript
interface ThreadBlockedIntegrationOptions {
  /**
   * Threshold in milliseconds to trigger an event.
   *
   * Defaults to 1000ms.
   */
  threshold: number;
  /**
   * Maximum number of blocked events to send per clock hour.
   *
   * Defaults to 1.
   */
  maxEventsPerHour: number;
  /**
   * Tags to include with blocked events.
   */
  staticTags: { [key: string]: Primitive };
}
```
