Skip to content

Commit

Permalink
Merge pull request #192 from zhiyan114/master
Browse files Browse the repository at this point in the history
REDUCE SENTRY TX!!1!!11!1!
  • Loading branch information
zhiyan114 authored Oct 8, 2024
2 parents 4be3e7c + f559849 commit a1d41d6
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 109 deletions.
159 changes: 80 additions & 79 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import {errors} from 'undici';
sentryInit({
dsn: process.env["SENTRY_DSN"],
maxValueLength: 1000,
tracesSampleRate: 1.0,

integrations: [
extraErrorDataIntegration({
Expand Down Expand Up @@ -92,13 +91,22 @@ sentryInit({

return evnt;
},

tracesSampler: (ctx) => {
// This will be messy anyway
if(ctx.name === "Chat Reward Points")
return 0.2;
return 1;

},

beforeSendTransaction: (transaction) => {
// Ignore callback stuff from PubSubHubbub
if(new RegExp("/UwU/youtube/callback/").test(transaction.transaction ?? ""))
return null;
if(new RegExp("/test/").test(transaction.transaction ?? ""))
return null;

return transaction;
},

Expand Down
Loading

0 comments on commit a1d41d6

Please sign in to comment.