We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3ffbb0d + e4ec417 commit 5bba419Copy full SHA for 5bba419
1 file changed
src/instrument.mjs
@@ -1,17 +1,20 @@
1
import * as Sentry from '@sentry/node';
2
import { nodeProfilingIntegration } from "@sentry/profiling-node";
3
4
+const env = process.env.SENTRY_ENVIRONMENT;
5
+
6
// Ensure to call this before importing any other modules!
7
Sentry.init({
8
dsn: process.env.SENTRY_DSN,
9
integrations: [
10
nodeProfilingIntegration(),
11
],
12
enabled:
- process.env.SENTRY_ENVIRONMENT === "production" ||
- process.env.SENTRY_ENVIRONMENT === "staging",
13
+ env === "production" ||
14
+ env === "staging",
15
16
// Add Performance Monitoring by setting tracesSampleRate
- // We recommend adjusting this value in production
- tracesSampleRate: 1.0,
17
+ tracesSampleRate: env === "production" ? 0.1 : 1.0,
18
19
+ profilesSampleRate: env === "production" ? 0.1 : 1.0,
20
});
0 commit comments