Skip to content

Commit

Permalink
fix: change Sentry ANR threshold to 10 seconds (#1542)
Browse files Browse the repository at this point in the history
  • Loading branch information
philprime authored Feb 27, 2025
1 parent 13e09dc commit 9835fbf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Sentry.init({

integrations: [
Sentry.anrIntegration({
anrThreshold: sentryConfig.anrThreshold,
captureStackTrace: true,
}),
Sentry.extraErrorDataIntegration(),
Expand Down
1 change: 1 addition & 0 deletions src/config/interfaces/SentryConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export interface SentryConfig {
sampleRate?: number;
profilesSampleRate?: number;
tracesSampleRate?: number;
anrThreshold?: number;
}
2 changes: 2 additions & 0 deletions src/config/loadServerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ export function loadServerConfig(): ServerConfig {
sampleRate: parseNumberEnvValue(env.SENTRY_SAMPLE_RATE),
profilesSampleRate: parseNumberEnvValue(env.SENTRY_PROFILES_SAMPLE_RATE),
tracesSampleRate: parseNumberEnvValue(env.SENTRY_TRACES_SAMPLE_RATE),
// Increased the default threshold to 10 seconds, due to slow startup times on Kubernetes
anrThreshold: parseNumberEnvValue(env.SENTRY_ANR_THRESHOLD) ?? 10_000,
},
};
return config;
Expand Down

0 comments on commit 9835fbf

Please sign in to comment.