Skip to content

Commit

Permalink
reduce sentry sampling rate
Browse files Browse the repository at this point in the history
  • Loading branch information
franzns committed Jan 9, 2024
1 parent 70f7823 commit 1bc36c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 2 additions & 3 deletions app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ async function startServer() {

Sentry.init({
dsn: env.SENTRY_DSN,
// tracesSampleRate: 0.005,
environment: `multichain-${env.DEPLOYMENT_ENV}`,
enabled: env.NODE_ENV === 'production',
ignoreErrors: [/.*error: Provide.*chain.*param/],
Expand All @@ -39,8 +38,8 @@ async function startServer() {
new Sentry.Integrations.Http({ tracing: true }),
new ProfilingIntegration(),
],
tracesSampleRate: 0.2,
profilesSampleRate: 0.1,
tracesSampleRate: 0.005,
profilesSampleRate: 0.005,
beforeSend(event, hint) {
const error = hint.originalException as string;
if (error?.toString().includes('Unknown token:')) {
Expand Down
10 changes: 7 additions & 3 deletions worker/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as Sentry from '@sentry/node';
import { ProfilingIntegration } from '@sentry/profiling-node';
import { env } from '../app/env';
import { configureWorkerRoutes } from './job-handlers';
import { prisma } from '../prisma/prisma-client';

export async function startWorker() {
const app = express();
Expand All @@ -12,12 +13,15 @@ export async function startWorker() {
environment: `multichain-worker-${env.DEPLOYMENT_ENV}`,
enabled: env.NODE_ENV === 'production',
integrations: [
// new Tracing.Integrations.Express({ app }),
new Sentry.Integrations.Apollo(),
new Sentry.Integrations.GraphQL(),
new Sentry.Integrations.Prisma({ client: prisma }),
new Sentry.Integrations.Express({ app }),
new Sentry.Integrations.Http({ tracing: true }),
new ProfilingIntegration(),
],
tracesSampleRate: 0.2,
profilesSampleRate: 0.1,
tracesSampleRate: 0.005,
profilesSampleRate: 0.005,
});

app.use(Sentry.Handlers.requestHandler());
Expand Down

0 comments on commit 1bc36c8

Please sign in to comment.