Files
omnivore/packages/api/src/sentry.ts
2022-02-11 09:24:33 -08:00

20 lines
675 B
TypeScript

import { env } from './env'
import * as Sentry from '@sentry/node'
import { CaptureConsole } from '@sentry/integrations'
export const sentryConfig = {
dsn: env.sentry.dsn,
environment: env.server.apiEnv,
// Don't bother collecting and sending events locally (reduces overhead).
enabled: !env.dev.isLocal,
serverName: process.env.GAE_INSTANCE || '',
integrations: [
new Sentry.Integrations.OnUncaughtException(),
new CaptureConsole({ levels: ['error'] }),
],
debug: (env.dev.isLocal && process.env.DEBUG === 'true') || false,
// We recommend adjusting this value in production, or using tracesSampler
// for finer control
tracesSampleRate: 0,
}