All Skills > SDK Setup > Node.js / Bun / Deno SDK
Sentry Node.js / Bun / Deno SDK
Opinionated wizard that scans your project and guides you through complete Sentry setup for server-side JavaScript and TypeScript runtimes: Node.js, Bun, and Deno.
Invoke This Skill When
- User asks to "add Sentry to Node.js", "Bun", or "Deno"
- User wants to install or configure , , or
- User wants error monitoring, tracing, logging, profiling, crons, metrics, or AI monitoring for a backend JS/TS app
- User asks about ,
--import ./instrument.mjs
, , or
- User wants to monitor Express, Fastify, Koa, Hapi, Connect, Bun.serve(), or Deno.serve()
NestJS? Use
instead — it uses
with NestJS-native decorators and filters.
Next.js? Use
instead — it handles the three-runtime architecture (browser, server, edge).
Note: SDK versions below reflect current Sentry docs at time of writing (
≥10.42.0,
≥10.42.0,
≥10.42.0).
Always verify against
docs.sentry.io/platforms/javascript/guides/node/ before implementing.
Phase 1: Detect
Run these commands to identify the runtime, framework, and existing Sentry setup:
bash
# Detect runtime
bun --version 2>/dev/null && echo "Bun detected"
deno --version 2>/dev/null && echo "Deno detected"
node --version 2>/dev/null && echo "Node.js detected"
# Detect existing Sentry packages
cat package.json 2>/dev/null | grep -E '"@sentry/'
cat deno.json deno.jsonc 2>/dev/null | grep -i sentry
# Detect Node.js framework
cat package.json 2>/dev/null | grep -E '"express"|"fastify"|"@hapi/hapi"|"koa"|"@nestjs/core"|"connect"'
# Detect Bun-specific frameworks
cat package.json 2>/dev/null | grep -E '"elysia"|"hono"'
# Detect Deno frameworks (deno.json imports)
cat deno.json deno.jsonc 2>/dev/null | grep -E '"oak"|"hono"|"fresh"'
# Detect module system (Node.js)
cat package.json 2>/dev/null | grep '"type"'
ls *.mjs *.cjs 2>/dev/null | head -5
# Detect existing instrument file
ls instrument.js instrument.mjs instrument.ts instrument.cjs 2>/dev/null
# Detect logging libraries
cat package.json 2>/dev/null | grep -E '"winston"|"pino"|"bunyan"'
# Detect cron / scheduling
cat package.json 2>/dev/null | grep -E '"node-cron"|"cron"|"agenda"|"bull"|"bullmq"'
# Detect AI / LLM usage
cat package.json 2>/dev/null | grep -E '"openai"|"@anthropic-ai"|"@langchain"|"@vercel/ai"|"@google/generative-ai"'
# Detect OpenTelemetry tracing
cat package.json 2>/dev/null | grep -E '"@opentelemetry/sdk-node"|"@opentelemetry/sdk-trace-node"|"@opentelemetry/sdk-trace-base"'
grep -rn "NodeTracerProvider\|trace\.getTracer\|startActiveSpan" \
--include="*.ts" --include="*.js" --include="*.mjs" 2>/dev/null | head -5
# Check for companion frontend
ls frontend/ web/ client/ ui/ 2>/dev/null
cat package.json 2>/dev/null | grep -E '"react"|"vue"|"svelte"|"next"'
What to determine:
| Question | Impact |
|---|
| Which runtime? (Node.js / Bun / Deno) | Determines package, init pattern, and preload flag |
| Node.js: ESM or CJS? | ESM requires --import ./instrument.mjs
; CJS uses |
| Framework detected? | Determines which error handler to register |
| already installed? | Skip install, go straight to feature config |
| / already exists? | Merge into it rather than overwrite |
| Logging library detected? | Recommend Sentry Logs |
| Cron / job scheduler detected? | Recommend Crons monitoring |
| AI library detected? | Recommend AI Monitoring |
| OpenTelemetry tracing detected? | Use OTLP path instead of native tracing |
| Companion frontend found? | Trigger Phase 4 cross-link |
Phase 2: Recommend
Present a concrete recommendation based on what you found. Don't ask open-ended questions — lead with a proposal:
Route from OTel detection:
- OTel tracing detected ( or
@opentelemetry/sdk-trace-node
in , or in source) → use OTLP path: via ; do not set ; Sentry links errors to OTel traces automatically
Recommended (core coverage):
- ✅ Error Monitoring — always; captures unhandled exceptions, promise rejections, and framework errors
- ✅ Tracing — automatic HTTP, DB, and queue instrumentation via OpenTelemetry
Optional (enhanced observability):
- ⚡ Logging — structured logs via ; recommend when // or log search is needed
- ⚡ Profiling — continuous CPU profiling (Node.js only; not available on Bun or Deno); not available with OTLP path
- ⚡ AI Monitoring — OpenAI, Anthropic, LangChain, Vercel AI SDK; recommend when AI/LLM calls detected
- ⚡ Crons — detect missed or failed scheduled jobs; recommend when node-cron, Bull, or Agenda is detected
- ⚡ Metrics — custom counters, gauges, distributions; recommend when custom KPIs needed
- ⚡ Runtime Metrics — automatic collection of memory, CPU, and event loop metrics;
nodeRuntimeMetricsIntegration()
(Node.js) / bunRuntimeMetricsIntegration()
(Bun)
Recommendation logic:
| Feature | Recommend when... |
|---|
| Error Monitoring | Always — non-negotiable baseline |
| OTLP Integration | OTel tracing detected — replaces native Tracing |
| Tracing | Always for server apps — HTTP spans + DB spans are high-value; skip if OTel tracing detected |
| Logging | App uses winston, pino, bunyan, or needs log-to-trace correlation |
| Profiling | Node.js only — performance-critical service; native addon compatible; skip if OTel tracing detected (requires , incompatible with OTLP) |
| AI Monitoring | App calls OpenAI, Anthropic, LangChain, Vercel AI, or Google GenAI |
| Crons | App uses node-cron, Bull, BullMQ, Agenda, or any scheduled task pattern |
| Metrics | App needs custom counters, gauges, or histograms |
| Runtime Metrics | Any Node.js or Bun service wanting automatic memory/CPU/event-loop visibility |
OTel tracing detected: "I see OpenTelemetry tracing in the project. I recommend Sentry's OTLP integration for tracing (via your existing OTel setup) + Error Monitoring + Sentry Logging [+ Metrics/Crons/AI Monitoring if applicable]. Shall I proceed?"
No OTel: "I recommend setting up Error Monitoring + Tracing. Want me to also add Logging or Profiling?"
Phase 3: Guide
Runtime: Node.js
Option 1: Wizard (Recommended for Node.js)
You need to run this yourself — the wizard opens a browser for login and requires interactive input that the agent can't handle. Copy-paste into your terminal:
npx @sentry/wizard@latest -i node
It handles login, org/project selection, SDK installation,
creation, and package.json script updates.
Once it finishes, come back and skip to Verification.
If the user skips the wizard, proceed with Option 2 (Manual Setup) below.
Option 2: Manual Setup — Node.js
Install
bash
npm install @sentry/node --save
# or
yarn add @sentry/node
# or
pnpm add @sentry/node
Create the Instrument File
javascript
// instrument.js — must be loaded before all other modules
const Sentry = require("@sentry/node");
Sentry.init({
dsn: process.env.SENTRY_DSN ?? "___DSN___",
sendDefaultPii: true,
// 100% in dev, lower in production
tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1,
// Capture local variable values in stack frames
includeLocalVariables: true,
enableLogs: true,
});
javascript
// instrument.mjs — loaded via --import flag before any other module
import * as Sentry from "@sentry/node";
Sentry.init({
dsn: process.env.SENTRY_DSN ?? "___DSN___",
sendDefaultPii: true,
tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1,
includeLocalVariables: true,
enableLogs: true,
});
Start Your App with Sentry Loaded First
CommonJS — add
as the very first line of your entry file:
javascript
// app.js
require("./instrument"); // must be first
const express = require("express");
// ... rest of your app
ESM — use the
flag so Sentry loads before all other modules (Node.js 18.19.0+ required):
bash
node --import ./instrument.mjs app.mjs
json
{
"scripts": {
"start": "node --import ./instrument.mjs server.mjs",
"dev": "node --import ./instrument.mjs --watch server.mjs"
}
}
Or via environment variable (useful for wrapping existing start commands):
bash
NODE_OPTIONS="--import ./instrument.mjs" npm start
Framework Error Handlers
Register the Sentry error handler after all routes so it can capture framework errors:
Express:
javascript
const express = require("express");
const Sentry = require("@sentry/node");
const app = express();
// ... your routes
// Add AFTER all routes — captures 5xx errors by default
Sentry.setupExpressErrorHandler(app);
// Optional: capture 4xx errors too
// Sentry.setupExpressErrorHandler(app, {
// shouldHandleError(error) { return error.status >= 400; },
// });
app.listen(3000);
Fastify:
javascript
const Fastify = require("fastify");
const Sentry = require("@sentry/node");
const fastify = Fastify();
// Add BEFORE routes (unlike Express!)
Sentry.setupFastifyErrorHandler(fastify);
// ... your routes
await fastify.listen({ port: 3000 });
Koa:
javascript
const Koa = require("koa");
const Sentry = require("@sentry/node");
const app = new Koa();
// Add as FIRST middleware (catches errors thrown by later middleware)
Sentry.setupKoaErrorHandler(app);
// ... your other middleware and routes
app.listen(3000);
Hapi (async — must await):
javascript
const Hapi = require("@hapi/hapi");
const Sentry = require("@sentry/node");
const server = Hapi.server({ port: 3000 });
// ... your routes
// Must await — Hapi registration is async
await Sentry.setupHapiErrorHandler(server);
await server.start();
Connect:
javascript
const connect = require("connect");
const Sentry = require("@sentry/node");
const app = connect();
// Add BEFORE routes (like Fastify and Koa)
Sentry.setupConnectErrorHandler(app);
// ... your middleware and routes
require("http").createServer(app).listen(3000);
NestJS — has its own dedicated skill with full coverage:
Use the skill instead.
NestJS uses a separate package (
) with NestJS-native constructs:
,
,
,
decorators,
and GraphQL/Microservices support. Load that skill for complete NestJS setup.
Vanilla Node.js module — wrap request handler manually:
javascript
const http = require("http");
const Sentry = require("@sentry/node");
const server = http.createServer((req, res) => {
Sentry.withIsolationScope(() => {
try {
// your handler
res.end("OK");
} catch (err) {
Sentry.captureException(err);
res.writeHead(500);
res.end("Internal Server Error");
}
});
});
server.listen(3000);
Framework error handler summary:
| Framework | Function | Placement | Async? |
|---|
| Express | setupExpressErrorHandler(app)
| After all routes | No |
| Fastify | setupFastifyErrorHandler(fastify)
| Before routes | No |
| Koa | setupKoaErrorHandler(app)
| First middleware | No |
| Hapi | setupHapiErrorHandler(server)
| Before | Yes |
| Connect | setupConnectErrorHandler(app)
| Before routes | No |
| NestJS | → Use | Dedicated skill | — |
Runtime: Bun
No wizard available for Bun. Manual setup only.
Install
Create (or )
typescript
// instrument.ts
import * as Sentry from "@sentry/bun";
Sentry.init({
dsn: process.env.SENTRY_DSN ?? "___DSN___",
sendDefaultPii: true,
tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1,
enableLogs: true,
});
Start Your App with
bash
bun --preload ./instrument.ts server.ts
json
{
"scripts": {
"start": "bun --preload ./instrument.ts server.ts",
"dev": "bun --watch --preload ./instrument.ts server.ts"
}
}
Bun.serve() — Auto-Instrumentation
automatically instruments
via JavaScript Proxy. No extra setup is required — just initialize with
and your
calls are traced:
typescript
// server.ts
const server = Bun.serve({
port: 3000,
fetch(req) {
return new Response("Hello from Bun!");
},
});
Framework Error Handlers on Bun
Bun can run Express, Fastify, Hono, and Elysia. Use the same
import and the
error handler functions (re-exported by
):
typescript
import * as Sentry from "@sentry/bun";
import express from "express";
const app = express();
// ... routes
Sentry.setupExpressErrorHandler(app);
app.listen(3000);
Bun Feature Support
| Feature | Bun Support | Notes |
|---|
| Error Monitoring | ✅ Full | Same API as Node |
| Tracing | ✅ Via OTel | Most auto-instrumentations work |
| Logging | ✅ Full | + |
| Profiling | ❌ Not available | uses native addons incompatible with Bun |
| Metrics | ✅ Full | |
| Runtime Metrics | ✅ Full | bunRuntimeMetricsIntegration()
— memory, CPU, event loop (no event loop delay percentiles) |
| Crons | ✅ Full | |
| AI Monitoring | ✅ Full | OpenAI, Anthropic integrations work |
Runtime: Deno
No wizard available for Deno. Manual setup only.
Requires Deno 2.0+. Deno 1.x is not supported.
Use specifier. The
registry is deprecated.
Install via (Recommended)
json
{
"imports": {
"@sentry/deno": "npm:@sentry/deno@10.42.0"
}
}
Or import directly with the
specifier:
typescript
import * as Sentry from "npm:@sentry/deno";
Initialize — Add to Entry File
typescript
// main.ts — Sentry.init() must be called before any other code
import * as Sentry from "@sentry/deno";
Sentry.init({
dsn: Deno.env.get("SENTRY_DSN") ?? "___DSN___",
sendDefaultPii: true,
tracesSampleRate: Deno.env.get("DENO_ENV") === "development" ? 1.0 : 0.1,
enableLogs: true,
});
// Your application code follows
Deno.serve({ port: 8000 }, (req) => {
return new Response("Hello from Deno!");
});
Unlike Node.js and Bun, Deno does not have a
or
flag. Sentry must be the first
in your entry file.
Required Deno Permissions
The SDK requires network access to reach your Sentry ingest domain:
bash
deno run \
--allow-net=o<ORG_ID>.ingest.sentry.io \
--allow-read=./src \
--allow-env=SENTRY_DSN,SENTRY_RELEASE \
main.ts
For development,
works but is not recommended for production.
Deno Cron Integration
Deno provides native cron scheduling. Use
for automatic monitoring:
typescript
import * as Sentry from "@sentry/deno";
import { denoCronIntegration } from "@sentry/deno";
Sentry.init({
dsn: Deno.env.get("SENTRY_DSN") ?? "___DSN___",
integrations: [denoCronIntegration()],
});
// Cron is automatically monitored
Deno.cron("daily-cleanup", "0 0 * * *", () => {
// cleanup logic
});
Deno Feature Support
| Feature | Deno Support | Notes |
|---|
| Error Monitoring | ✅ Full | Unhandled exceptions + |
| Tracing | ✅ Custom OTel | Automatic spans for and |
| Logging | ✅ Full | + |
| Profiling | ❌ Not available | No profiling addon for Deno |
| Metrics | ✅ Full | |
| Runtime Metrics | ❌ Not available | No runtime metrics integration for Deno |
| Crons | ✅ Full | + |
| AI Monitoring | ✅ Partial | Vercel AI SDK integration works; OpenAI/Anthropic via |
OTLP Integration (OTel-First Projects — Node.js Only)
Use this path
only when OpenTelemetry tracing was detected in Phase 1
(e.g.,
or
@opentelemetry/sdk-trace-node
in
).
For projects without an existing OTel setup, use the standard
path above.
The OTLP integration uses
— a lightweight Sentry SDK that does not bundle its own OpenTelemetry. Instead, it hooks into the user's existing OTel
and exports spans to Sentry via OTLP.
When to Use
| Scenario | Recommended path |
|---|
| New project, no existing OTel | Standard (above) — includes built-in OTel |
| Existing OTel setup, want Sentry tracing | + |
| Existing OTel setup, sending to own Collector | + otlpIntegration({ collectorUrl })
|
Install
bash
npm install @sentry/node-core @opentelemetry/api @opentelemetry/sdk-trace-node @opentelemetry/sdk-trace-base
# or
yarn add @sentry/node-core @opentelemetry/api @opentelemetry/sdk-trace-node @opentelemetry/sdk-trace-base
# or
pnpm add @sentry/node-core @opentelemetry/api @opentelemetry/sdk-trace-node @opentelemetry/sdk-trace-base
The
packages are peer dependencies. If the project already has them installed, skip duplicates.
Initialize
javascript
// instrument.mjs — load via --import flag before any other module
import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
import * as Sentry from '@sentry/node-core/light';
import { otlpIntegration } from '@sentry/node-core/light/otlp';
// Register the user's OTel TracerProvider first
const provider = new NodeTracerProvider();
provider.register();
Sentry.init({
dsn: process.env.SENTRY_DSN ?? '___DSN___',
sendDefaultPii: true,
enableLogs: true,
// Do NOT set tracesSampleRate — OTel controls sampling
integrations: [
otlpIntegration({
// Export OTel spans to Sentry via OTLP (default: true)
setupOtlpTracesExporter: true,
}),
],
});
With a custom Collector endpoint:
javascript
Sentry.init({
dsn: process.env.SENTRY_DSN ?? '___DSN___',
integrations: [
otlpIntegration({
collectorUrl: 'http://localhost:4318/v1/traces',
}),
],
});
Start Your App
Same
pattern as the standard Node.js setup:
bash
node --import ./instrument.mjs app.mjs
Key Differences from Standard
| Aspect | (standard) | (OTLP) |
|---|
| OTel bundled | ✅ Yes — built-in TracerProvider | ❌ No — uses your existing provider |
| Tracing control | in | OTel SDK controls sampling |
| Auto-instrumentation | ✅ Built-in (HTTP, DB, etc.) | ❌ You manage OTel instrumentations |
| Profiling | ✅ Available | ❌ Not compatible |
| Error ↔ trace linking | ✅ Automatic | ✅ Automatic (via ) |
| Package size | Larger (includes OTel) | Smaller (light mode) |
For Each Agreed Feature
Load the corresponding reference file and follow its steps:
| Feature | Reference file | Load when... |
|---|
| Error Monitoring | references/error-monitoring.md
| Always (baseline) — captures, scopes, enrichment, beforeSend |
| OTLP Integration | See OTLP Integration above | OTel tracing detected — replaces native Tracing |
| Tracing | | OTel auto-instrumentation, custom spans, distributed tracing, sampling; skip if OTel tracing detected |
| Logging | | Structured logs, , log-to-trace correlation |
| Profiling | | Node.js only — CPU profiling, Bun/Deno gaps documented; skip if OTel tracing detected |
| Metrics | | Custom counters, gauges, distributions |
| Runtime Metrics | See inline below | Automatic memory, CPU, and event loop metrics for Node.js and Bun |
| Crons | | Scheduled job monitoring, node-cron, Bull, Agenda, Deno.cron |
| AI Monitoring | Load sentry-setup-ai-monitoring
skill | OpenAI, Anthropic, LangChain, Vercel AI, Google GenAI |
For each feature: read the reference file, follow its steps exactly, and verify before moving on.
Runtime Metrics
Automatically collect Node.js and Bun runtime health metrics (memory, CPU utilization, event loop delay/utilization, uptime) at a configurable interval. Metrics appear in Sentry's Metrics product under the
/
namespace.
Node.js — add
nodeRuntimeMetricsIntegration()
to your
:
javascript
const Sentry = require("@sentry/node");
Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [
Sentry.nodeRuntimeMetricsIntegration(),
// Optional: change collection interval (default 30 000 ms)
// Sentry.nodeRuntimeMetricsIntegration({ collectionIntervalMs: 60_000 }),
],
});
Metrics collected by default:
,
node.runtime.mem.heap_used
,
node.runtime.mem.heap_total
,
node.runtime.cpu.utilization
,
node.runtime.event_loop.delay.p50
,
node.runtime.event_loop.delay.p99
,
node.runtime.event_loop.utilization
,
node.runtime.process.uptime
.
Bun — add
bunRuntimeMetricsIntegration()
to your
:
typescript
import * as Sentry from "@sentry/bun";
import { bunRuntimeMetricsIntegration } from "@sentry/bun";
Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [
bunRuntimeMetricsIntegration(),
// Optional: change collection interval (default 30 000 ms)
// bunRuntimeMetricsIntegration({ collectionIntervalMs: 60_000 }),
],
});
Metrics collected: same as Node.js except no event loop delay percentiles (unavailable in Bun). Prefixed with
.
Verification
After setup, verify Sentry is receiving events:
javascript
// Add temporarily to your entry file or a test route, then remove
import * as Sentry from "@sentry/node"; // or @sentry/bun / @sentry/deno
Sentry.captureException(new Error("Sentry test error — delete me"));
Or trigger an unhandled exception:
javascript
// In a route handler or startup — will be captured automatically
throw new Error("Sentry test error — delete me");
Then check your
Sentry Issues dashboard — the error should appear within ~30 seconds.
Verification checklist:
| Check | How |
|---|
| Error captured | Throw in a handler, verify in Sentry Issues |
| Tracing working | Check Performance tab — should show HTTP spans |
| working | Stack frame in Sentry should show variable values |
| Source maps working | Stack trace shows readable file names, not minified |
Config Reference
Core Options
| Option | Type | Default | Notes |
|---|
| | — | Required. Also from env var |
| | — | 0–1; required to enable tracing; do not set when using OTLP path |
| | | Include IP, request headers, user info |
| | | Add local variable values to stack frames (Node.js) |
| | | Enable Sentry Logs product (v9.41.0+) |
| | | Also from env var |
| | — | Also from env var |
| | | Log SDK activity to console |
| | | Set in tests to disable sending |
| | | Fraction of error events to send (0–1) |
| | | Milliseconds to flush events before process exit |
nativeNodeFetchIntegration()
Options
Configures outgoing
/
span capture. Since
@opentelemetry/instrumentation-undici@0.22.0
, response headers like
are no longer captured automatically — use
to opt in:
javascript
Sentry.init({
integrations: [
Sentry.nativeNodeFetchIntegration({
headersToSpanAttributes: {
requestHeaders: ["x-request-id"],
responseHeaders: ["content-length", "content-type"],
},
}),
],
});
| Option | Type | Default | Notes |
|---|
| | | Record breadcrumbs for outgoing fetch requests |
headersToSpanAttributes.requestHeaders
| | — | Request header names to capture as span attributes |
headersToSpanAttributes.responseHeaders
| | — | Response header names to capture as span attributes |
Options (@sentry/node-core/light/otlp
)
For OTel-first projects using
. Import:
import { otlpIntegration } from '@sentry/node-core/light/otlp'
.
| Option | Type | Default | Purpose |
|---|
| | | Auto-configure OTLP exporter to send spans to Sentry; set if you already export to your own Collector |
| | | OTLP HTTP endpoint of an OTel Collector (e.g., http://localhost:4318/v1/traces
); when set, spans are sent to the collector instead of the DSN-derived Sentry endpoint |
Graceful Shutdown
Flush buffered events before process exit — important for short-lived scripts and serverless:
javascript
process.on("SIGTERM", async () => {
await Sentry.close(2000); // flush with 2s timeout
process.exit(0);
});
Environment Variables
| Variable | Purpose | Runtime |
|---|
| DSN (alternative to hardcoding in ) | All |
| Deployment environment | All |
| Release version string (auto-detected from git) | All |
| Source map upload token | Build time |
| Org slug for source map upload | Build time |
| Project slug for source map upload | Build time |
| Set --import ./instrument.mjs
for ESM | Node.js |
Source Maps (Node.js)
Readable stack traces in production require source map upload. Use
or the webpack/esbuild/rollup plugins:
bash
npm install @sentry/cli --save-dev
bash
# Create a Sentry auth token at sentry.io/settings/auth-tokens/
# Set in .env.sentry-build-plugin (gitignore this file):
SENTRY_AUTH_TOKEN=sntrys_eyJ...
Add upload step to your build:
json
{
"scripts": {
"build": "tsc && sentry-cli sourcemaps inject ./dist && sentry-cli sourcemaps upload ./dist"
}
}
Phase 4: Cross-Link
After completing backend setup, check for companion services:
bash
# Frontend companion
ls frontend/ web/ client/ ui/ 2>/dev/null
cat package.json 2>/dev/null | grep -E '"react"|"vue"|"svelte"|"next"'
# Other backend services
ls ../go.mod ../requirements.txt ../Gemfile 2>/dev/null
If a frontend, framework-specific SDK, or other backend is found, suggest the matching skill:
Dedicated JavaScript framework skills (prefer these over generic node-sdk):
| Detected | Prefer skill | Why |
|---|
| NestJS ( in ) | | Uses with NestJS-native decorators, filters, and GraphQL support |
| Next.js ( in ) | | Three-runtime architecture (browser, server, edge), , source map upload |
Frontend companions:
| Detected | Suggest |
|---|
| React app ( in ) | |
| Svelte/SvelteKit | |
Other backend companions:
| Detected | Suggest |
|---|
| Go backend () | |
| Python backend (, ) | |
| Ruby backend () | |
Connecting frontend and backend with the same DSN or linked projects enables distributed tracing — stack traces that span your browser, API server, and database in a single trace view.
Troubleshooting
| Issue | Cause | Solution |
|---|
| Events not appearing | loaded too late | Ensure it's the first / loaded via or |
| Tracing spans missing | not set | Add to |
| ESM instrumentation not working | Missing flag | Run with node --import ./instrument.mjs
; import "./instrument.mjs"
inside app is not sufficient |
| install fails on Bun | Native addon incompatible | Profiling is not supported on Bun — remove |
| Deno: events not sent | Missing permission | Run with --allow-net=o<ORG_ID>.ingest.sentry.io
|
| Deno: not working | Deprecated and frozen at v8.55.0 | Switch to specifier |
| not showing values | Integration not activated or minified code | Ensure includeLocalVariables: true
in init; check source maps |
| NestJS: errors not captured | Wrong SDK or missing filter | Use — NestJS needs , not |
| Hapi: timing issue | Not awaited | Must await Sentry.setupHapiErrorHandler(server)
before |
| Shutdown: events lost | Process exits before flush | Add in SIGTERM/SIGINT handler |
| Stack traces show minified code | Source maps not uploaded | Configure source map upload in build step |
| No traces appearing (OTLP) | Missing packages or not added | Verify @opentelemetry/sdk-trace-node
is installed; add to ; do not set |
| OTLP: errors not linked to traces | not registered | Ensure is in the array — it registers the propagation context that links errors to OTel traces |
| Profiling not starting (OTLP) | Profiling requires | Profiling is not compatible with the OTLP path; use the standard setup instead |