sentry-node-sdk
Audited by Runlayer on Mar 4, 2026
Malicious tool definition detected
```bash # Both must be the same version npm install @sentry/node@latest @sentry/profiling-node@latest ``` --- ## SDK Configuration ### Trace Mode (Recommended) Profiles auto-attach to all sampled spans with no additional code: ```typescript import * as Sentry from "@sentry/node"; import { nodeProfilingIntegration } from "@sentry/profiling-node"; Sentry.init({ dsn: process.env.SENTRY_DSN, integrations: [ nodeProfilingIntegration(), ], tracesSampleRate: 1.0, // Session-level sampling: decision mad
> "For high-throughput environments, we recommend testing prior to deployment to ensure that your service's performance characteristics maintain expectations." — Sentry docs For high-traffic servers, start conservative: ```typescript // Start at 1–5% and increase after measuring overhead profileSessionSampleRate: 0.01 ``` --- ## Complete Setup Example ```typescript // instrument.ts (loaded before app code) import * as Sentry from "@sentry/node"; import { nodeProfilingIntegration } from "@sentry/
Malicious tool definition detected
Tool passed security scan
Malicious tool definition detected
Use `denoCronIntegration` to automatically monitor all native Deno crons: ```typescript import * as Sentry from "@sentry/deno"; Sentry.init({ dsn: Deno.env.get("SENTRY_DSN"), integrations: [ Sentry.denoCronIntegration(), ], }); // Automatically monitored — no manual check-ins needed Deno.cron("daily-cleanup", "0 0 * * *", async () => { await cleanupOldRecords(); }); Deno.cron("hourly-sync", "0 * * * *", async () => { await syncExternalData(); }); ``` The integration intercepts `Deno.cron()` call
Tool passed security scan
Malicious tool definition detected
```javascript // Runs on every event — enrich with deploy metadata Sentry.addEventProcessor((event, hint) => { event.tags = { ...event.tags, git_sha: process.env.GIT_SHA ??
--- ## Deno ```typescript // instrument.ts import * as Sentry from "npm:@sentry/deno"; Sentry.init({ dsn: "https://examplePublicKey@o0.ingest.sentry.io/0", tracesSampleRate: 1.0, }); ``` ```typescript // server.ts import "../instrument.ts"; import * as Sentry from "npm:@sentry/deno"; Deno.serve({ port: 3000 }, async (request) => { try { return new Response("Hello from Deno!"); } catch (error) { Sentry.captureException(error); return new Response("Internal Server Error", { status: 500 }); } }); `
Tool passed security scan
Malicious tool definition detected
Malicious tool definition detected
Without one of these, no spans are created. ```typescript // instrument.ts (must run before your app) import * as Sentry from "@sentry/node"; Sentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 1.0, // 100% in development, lower in production }); ``` > **To disable tracing entirely:** omit both `tracesSampleRate` and `tracesSampler`.
Passed Files (1)Click to expand
Tool passed security scan