summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-21 14:28:53 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-21 14:28:53 +1000
commit5435fbd10cd9aa1427fdeaa0af938eb58bdfba4f (patch)
tree6c577abacbe27cf6d63b70c5bc5fe8fa8d271011
parentMember settings route (diff)
downloadserver-5435fbd10cd9aa1427fdeaa0af938eb58bdfba4f.tar.xz
Sentry route filtering
-rw-r--r--bundle/src/Server.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/bundle/src/Server.ts b/bundle/src/Server.ts
index 2fbba318..39a49b53 100644
--- a/bundle/src/Server.ts
+++ b/bundle/src/Server.ts
@@ -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)}`)}`);
 }