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

Sentry route filtering

This commit is contained in:
Madeline 2022-09-21 14:28:53 +10:00
parent 6459393153
commit 8bfdc58277

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)}`)}`);
}