1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 04:32:35 +01:00

Sentry route filtering

This commit is contained in:
Madeline 2022-09-21 14:28:53 +10:00
parent 975a87232f
commit 5435fbd10c
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47

View File

@ -77,13 +77,20 @@ async function main() {
new Tracing.Integrations.Express({ app }),
],
tracesSampleRate: Config.get().sentry.traceSampleRate,
environment: Config.get().sentry.environment
environment: Config.get().sentry.environment,
beforeSend: (event, hint) => {
const url = event.request?.url;
if (url?.includes("/assets/")) return null;
return event;
},
});
app.use(Sentry.Handlers.requestHandler());
app.use(Sentry.Handlers.tracingHandler());
}
await Promise.all([api.start(), cdn.start(), gateway.start(), webrtc.start()]);
if (Config.get().sentry.enabled) {
app.use(Sentry.Handlers.errorHandler());
app.use(function onError(err: any, req: any, res: any, next: any) {
@ -92,7 +99,6 @@ async function main() {
});
}
await Promise.all([api.start(), cdn.start(), gateway.start(), webrtc.start()]);
console.log(`[Server] ${green(`listening on port ${bold(port)}`)}`);
}