Revert some local changes to API

This commit is contained in:
Jackson Harper 2024-01-02 18:11:39 +08:00
parent 67bc196496
commit 3806e971d3
4 changed files with 23 additions and 23 deletions

View file

@ -39,8 +39,8 @@
"@opentelemetry/tracing": "^0.24.0",
"@sendgrid/mail": "^7.6.0",
"@sentry/integrations": "^7.10.0",
"@sentry/node": "^6.10.0",
"@sentry/tracing": "^7.10.0",
"@sentry/node": "^5.26.0",
"@sentry/tracing": "^7.9.0",
"addressparser": "^1.0.1",
"analytics-node": "^6.0.0",
"apollo-datasource": "^3.3.1",
@ -151,4 +151,4 @@
"volta": {
"extends": "../../package.json"
}
}
}

View file

@ -102,7 +102,7 @@ export function makeApolloServer(): ApolloServer {
context: contextFunc,
formatError: (err) => {
logger.info('server error', err)
// Sentry.captureException(err)
Sentry.captureException(err)
// hide error messages from frontend on prod
return new Error('Unexpected server error')
},

View file

@ -2,18 +2,18 @@ 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,
// }
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,
}

View file

@ -36,7 +36,7 @@ import { userServiceRouter } from './routers/svc/user'
import { webhooksServiceRouter } from './routers/svc/webhooks'
import { textToSpeechRouter } from './routers/text_to_speech'
import { userRouter } from './routers/user_router'
// import { sentryConfig } from './sentry'
import { sentryConfig } from './sentry'
import {
getClaimsByToken,
getTokenByRequest,
@ -56,9 +56,9 @@ export const createApp = (): {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// Sentry.init(sentryConfig)
// app.use(Sentry.Handlers.requestHandler())
// app.use(Sentry.Handlers.tracingHandler())
Sentry.init(sentryConfig)
app.use(Sentry.Handlers.requestHandler())
app.use(Sentry.Handlers.tracingHandler())
app.use(cookieParser())
app.use(json({ limit: '100mb' }))