Skip to main content

Overview

Vane integrates with Sentry via @sentry/node. When SENTRY_DSN is set, unhandled exceptions in request handlers are captured and sent to Sentry. If SENTRY_DSN is not set, Sentry is not initialized and the server runs without error reporting.

Setup

1. Create a Sentry project

In your Sentry dashboard: Projects → Create Project → Node.js. Copy the DSN — it looks like:

2. Set the DSN

3. Verify

Start the server and trigger an error. Check your Sentry dashboard — the error should appear within seconds. A simple test: call a valid endpoint with a malformed JSON body:
This returns a 400 (expected) but should not send to Sentry — only unhandled errors (5xx) are captured.

What gets captured

Vane uses captureException in the global error handler:
This captures unhandled exceptions that reach the top-level error handler (HTTP 500 responses). It does not capture:
  • Expected errors (4xx responses)
  • PostgreSQL connection errors that are caught and re-thrown as JSON errors
  • Errors in background tasks (e.g., attestation fire-and-forget calls)

Correlation with structured logs

Every request has an X-Request-ID header. The request ID is included in the structured log entry for every request. When debugging a Sentry event, look up the request ID in your log aggregation system to find the full request context.

Structured logging

Even without Sentry, all request logs are structured JSON (via Pino) and include: Log level is controlled by LOG_LEVEL. Set LOG_LEVEL=debug to see additional internal events.