Repository navigation
Expand file tree
/
Copy pathsentry.server.config.js
More file actions
33 lines (31 loc) · 1.51 KB
/
Copy pathsentry.server.config.js
File metadata and controls
33 lines (31 loc) · 1.51 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
// 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/
import * as Sentry from '@sentry/nextjs';
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment:
process.env.NEXT_PUBLIC_DEPLOY_ENV ||
process.env.DEPLOY_ENV ||
process.env.NODE_ENV,
// Without this every event lands untagged and GlitchTip cannot answer "did
// the release fix it?" — the only version signal was the ?dpl= query Next
// glues onto client chunk URLs, which server events never carry.
// Inlined at build time by next.config.mjs's `env` block.
release: process.env.NEXT_PUBLIC_APP_VERSION,
// The SDK defaults server_name to os.hostname(), which inside Docker is the
// container ID — a fresh random value every redeploy, so the tag splits one
// server's history across dozens of meaningless names. Swarm fills this
// with `{{.Node.Hostname}}` so the tag names the machine instead. Unset
// (local dev) falls back to the SDK default, which is the real hostname.
serverName: process.env.SENTRY_SERVER_NAME || undefined,
// Sentry 11's defaults collect more than v10 did (local variables, DB query
// data, every HTTP body); keep the v10 scope.
dataCollection: {
httpBodies: ['incomingRequest'],
databaseQueryData: false,
stackFrameVariables: false,
},
tracesSampleRate: 1.0,
debug: false,
});