FeaturesMiddleware

Sentry Middleware

Using the Sentry middleware is useful to:

  • 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

Install the @inngest/middleware-sentry package and configure it as follows:

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()],
});

Requires inngest@>=3.0.0 and @sentry/*@>=8.0.0`.