New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@inngest/middleware-sentry

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inngest/middleware-sentry

Sentry middleware for Inngest.

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@inngest/middleware-sentry

This package provides a middleware for Inngest to interface with Sentry.

Features

  • Capture exceptions for reporting
  • Add tracing to each function run
  • Include useful context for each exception and trace like function ID and event names

Installation

npm install @inngest/middleware-sentry

[!NOTE] Requires inngest@>=3.0.0 and @sentry/*@>=8.0.0`

Usage

To use the middleware, import and initialize it. It assumes that Sentry has already been initialized elsewhere in your code using Sentry.init().

import * as Sentry from "@sentry/node";
import { Inngest } from "inngest";
import { sentryMiddleware } from "@inngest/middleware-sentry";

// Initialize Sentry as usual wherever is appropriate
Sentry.init(...);

const inngest = new Inngest({
  id: "my-app",
  middleware: [sentryMiddleware()],
});

Flushing

By default, the middleware will force Sentry to flush as part of the Inngest request, ensuring all events, execptions, and traces are sent before a response is returned.

This is important for serverless environments where the runtime doesn't wait for the event loop to be empty and background tasks such as sending exception data may be lost.

If you're not in a serverless runtime or otherwise wish to have Sentry handle flushing itself, you can disable this behaviour by setting disableAutomaticFlush: true.

sentryMiddleware({
  disableAutomaticFlush: true,
});

Keywords

FAQs

Package last updated on 17 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc