-
-
Couldn't load subscription status.
- Fork 1.7k
-
Setup
- Node.js application with main thread + worker threads (using
worker_threadsmodule) - Sentry initialized in both main thread and each worker thread
- Mongoose used for database operations
- Worker threads perform scheduled tasks (Bree) and exit after completion
Sentry configuration
Sentry.init({
enabled: true,
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV,
integrations: [
Sentry.nodeProfilingIntegration(),
Sentry.extraErrorDataIntegration(),
Sentry.httpIntegration({
ignoreOutgoingRequests: (url) => url.includes("someservice")
}),
Sentry.mongoIntegration(),
Sentry.mongooseIntegration()
],
profilesSampler: () => 0.2,
tracesSampler: () => 0.2
});
Questions
- Is it safe to call Sentry.init() in multiple worker threads with the same configuration?
- Do the
mongoIntegration()andmongooseIntegration()create shared state that could cause issues across worker threads? - Are there recommended patterns for using Sentry with Node.js worker threads?
Environment
- Node.js: v20.x
- Sentry version: 9.17.0
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment