mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-22 18:32:29 +01:00
Sentry route filtering
This commit is contained in:
parent
6459393153
commit
8bfdc58277
@ -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)}`)}`);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user