Skip to content

Commit 96fcdb2

Browse files
committed
sample Discord bot queue requests
1 parent c11d070 commit 96fcdb2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/tracing.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ export const init = (serviceName: string) => {
2929
instrumentations: [
3030
new HttpInstrumentation({
3131
ignoreIncomingRequestHook(req) {
32-
return req.url?.startsWith('/health') ?? false;
32+
if (req.url?.startsWith('/health')) {
33+
return true; // Ignore health check requests
34+
}
35+
else if (req.url?.startsWith('/api/action/getNextQueuedDiscordVerification')) {
36+
return Math.random() < 0.008; // Only sample 0.8% of Discord bot queue requests
37+
}
38+
return false;
3339
}
3440
}),
3541
new ExpressInstrumentation(),

0 commit comments

Comments
 (0)