diff --git a/api/src/instrument.ts b/api/src/instrument.ts index 5ba4ebebe18..8f88fd39133 100644 --- a/api/src/instrument.ts +++ b/api/src/instrument.ts @@ -1,7 +1,11 @@ import * as Sentry from '@sentry/node'; import type { FastifyError } from 'fastify'; -import { SENTRY_DSN, SENTRY_ENVIRONMENT } from './utils/env'; +import { + DEPLOYMENT_VERSION, + SENTRY_DSN, + SENTRY_ENVIRONMENT +} from './utils/env'; const shouldIgnoreError = (error: FastifyError): boolean => { return !!error.statusCode && error.statusCode < 500; @@ -12,6 +16,7 @@ Sentry.init({ dsn: SENTRY_DSN, environment: SENTRY_ENVIRONMENT, maxValueLength: 8192, // the default is 250, which is too small. + release: DEPLOYMENT_VERSION, beforeSend: (event, hint) => shouldIgnoreError(hint.originalException as FastifyError) ? null : event });