2024-08-21 12:35:03 -03:00
|
|
|
// Import with `import * as Sentry from "@sentry/node"` if you are using ESM
|
2024-08-21 17:58:27 +02:00
|
|
|
import * as Sentry from "@sentry/node";
|
|
|
|
|
import { nodeProfilingIntegration } from "@sentry/profiling-node";
|
2024-08-21 19:39:10 +02:00
|
|
|
import { Logger } from "../lib/logger";
|
2024-08-21 12:35:03 -03:00
|
|
|
|
2024-08-21 17:58:27 +02:00
|
|
|
if (process.env.SENTRY_DSN) {
|
2024-08-21 19:39:10 +02:00
|
|
|
Logger.info("Setting up Sentry...");
|
2024-08-21 17:58:27 +02:00
|
|
|
Sentry.init({
|
|
|
|
|
dsn: process.env.SENTRY_DSN,
|
|
|
|
|
integrations: [
|
|
|
|
|
nodeProfilingIntegration(),
|
|
|
|
|
],
|
2024-08-21 20:51:35 +02:00
|
|
|
tracesSampleRate: 0.045,
|
|
|
|
|
profilesSampleRate: 1.0,
|
2024-08-21 19:39:10 +02:00
|
|
|
serverName: process.env.FLY_MACHINE_ID,
|
2024-08-21 17:58:27 +02:00
|
|
|
});
|
|
|
|
|
}
|