-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsentry.server.config.ts
More file actions
45 lines (36 loc) · 1.35 KB
/
Copy pathsentry.server.config.ts
File metadata and controls
45 lines (36 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// This file configures the initialization of Sentry on the server.
// The config you add here will be used whenever the server handles a request.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
//
// En modo desktop (DESKTOP_MODE=true), @sentry/nextjs está en serverExternalPackages
// y no se incluye en el standalone. Este archivo no se cargará en desktop.
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.SENTRY_DSN,
// Only enable in production
enabled: process.env.NODE_ENV === "production",
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 0.1,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
// Filter out certain errors that are not actionable
ignoreErrors: [
// Network errors
"ECONNREFUSED",
"ECONNRESET",
"ETIMEDOUT",
"ENOTFOUND",
// Database connection issues (transient)
"Connection terminated unexpectedly",
"Connection timeout",
// Cancelled requests
"AbortError",
"The operation was aborted",
],
// Set environment
environment: process.env.NODE_ENV,
// Release tracking (set during build)
release: process.env.SENTRY_RELEASE,
// Spotlight (Sentry for development)
spotlight: process.env.NODE_ENV === "development",
});