Files
firecrawl/apps/api/src/services/sentry.ts
T

17 lines
615 B
TypeScript
Raw Normal View History

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-11-07 20:57:33 +01: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-11-07 20:57:33 +01:00
logger.info("Setting up Sentry...");
2024-08-21 17:58:27 +02:00
Sentry.init({
dsn: process.env.SENTRY_DSN,
2024-12-11 19:46:11 -03:00
integrations: [nodeProfilingIntegration()],
tracesSampleRate: process.env.SENTRY_ENVIRONMENT === "dev" ? 1.0 : 0.045,
2024-08-21 20:51:35 +02:00
profilesSampleRate: 1.0,
2024-08-21 19:39:10 +02:00
serverName: process.env.FLY_MACHINE_ID,
2024-12-11 19:51:08 -03:00
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
2024-08-21 17:58:27 +02:00
});
}