From 5e836cbdb429ac29359c16f2ced314c14302d9fe Mon Sep 17 00:00:00 2001 From: Shaun Hamilton Date: Wed, 21 May 2025 13:58:03 +0200 Subject: [PATCH] dev(api): track sentry releases (#60444) --- api/src/instrument.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 });