|
| 1 | +/** |
| 2 | + * This file is names with a leading 0- so that the import reorder does not change its place. |
| 3 | + * |
| 4 | + * It NEEDS to be the first imported file otherwise sentry instrumentation does not work. |
| 5 | + */ |
| 6 | +import * as Sentry from '@sentry/node'; |
| 7 | +import { nodeProfilingIntegration } from '@sentry/profiling-node'; |
| 8 | + |
| 9 | +// Ensure to call this before importing any other modules! |
| 10 | +Sentry.init({ |
| 11 | + dsn: process.env.SENTRY_DSN, |
| 12 | + environment: process.env.SENTRY_ENV, |
| 13 | + release: process.env.APP_VERSION ?? 'not-specified', |
| 14 | + // Adds request headers and IP for users, for more info visit: |
| 15 | + // https://docs.sentry.io/platforms/javascript/guides/node/configuration/options/#sendDefaultPii |
| 16 | + sendDefaultPii: true, |
| 17 | + |
| 18 | + integrations: [ |
| 19 | + Sentry.fastifyIntegration(), |
| 20 | + // Add our Profiling integration |
| 21 | + nodeProfilingIntegration(), |
| 22 | + ], |
| 23 | + |
| 24 | + // Set tracesSampleRate to 1.0 to capture 100% |
| 25 | + // of transactions for tracing. |
| 26 | + // We recommend adjusting this value in production |
| 27 | + // Learn more at |
| 28 | + // https://docs.sentry.io/platforms/javascript/guides/node/configuration/options/#tracesSampleRate |
| 29 | + tracesSampleRate: 1.0, |
| 30 | + |
| 31 | + // Set profilesSampleRate to 1.0 to profile 100% |
| 32 | + // of sampled transactions. |
| 33 | + // This is relative to tracesSampleRate |
| 34 | + // Learn more at |
| 35 | + // https://docs.sentry.io/platforms/javascript/guides/node/configuration/options/#profilesSampleRate |
| 36 | + profilesSampleRate: 1.0, |
| 37 | + |
| 38 | + // Enable if you need to troubleshoot the Sentry config |
| 39 | + // debug: true, |
| 40 | +}); |
0 commit comments