Skip to content

Commit 5bba419

Browse files
authored
Merge pull request #271 from hypercerts-org/chore/lower_sentry_sample_rates
chore(sentry): lower polling rates
2 parents 3ffbb0d + e4ec417 commit 5bba419

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/instrument.mjs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
import * as Sentry from '@sentry/node';
22
import { nodeProfilingIntegration } from "@sentry/profiling-node";
33

4+
const env = process.env.SENTRY_ENVIRONMENT;
5+
46
// Ensure to call this before importing any other modules!
57
Sentry.init({
68
dsn: process.env.SENTRY_DSN,
79
integrations: [
810
nodeProfilingIntegration(),
911
],
1012
enabled:
11-
process.env.SENTRY_ENVIRONMENT === "production" ||
12-
process.env.SENTRY_ENVIRONMENT === "staging",
13+
env === "production" ||
14+
env === "staging",
1315

1416
// Add Performance Monitoring by setting tracesSampleRate
15-
// We recommend adjusting this value in production
16-
tracesSampleRate: 1.0,
17+
tracesSampleRate: env === "production" ? 0.1 : 1.0,
18+
19+
profilesSampleRate: env === "production" ? 0.1 : 1.0,
1720
});

0 commit comments

Comments
 (0)