-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstrument.server.mjs
More file actions
33 lines (28 loc) · 1.01 KB
/
instrument.server.mjs
File metadata and controls
33 lines (28 loc) · 1.01 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
import * as Sentry from "@sentry/react-router";
import { nodeProfilingIntegration } from "@sentry/profiling-node";
Sentry.init({
dsn: "https://aabb17fa9d9d4ac4aa1193839af9fe74@o33492.ingest.us.sentry.io/4504314010730496",
release: process.env.VERCEL_GIT_COMMIT_SHA,
// Adds request headers and IP for users, for more info visit:
// https://docs.sentry.io/platforms/javascript/guides/react-router/configuration/options/#sendDefaultPii
sendDefaultPii: true,
// Enable logs to be sent to Sentry
enableLogs: true,
integrations: [nodeProfilingIntegration()],
tracesSampleRate: 1.0, // Capture 100% of the transactions
profilesSampleRate: 1.0, // profile every transaction
// Set up performance monitoring
beforeSend(event) {
// Filter out 404s from error reporting
if (event.exception) {
const error = event.exception.values?.[0];
if (
error?.type === "NotFoundException" ||
error?.value?.includes("404")
) {
return null;
}
}
return event;
},
});