dev(api): track sentry releases (#60444)

This commit is contained in:
Shaun Hamilton
2025-05-21 13:58:03 +02:00
committed by GitHub
parent 0f9c2705ef
commit 5e836cbdb4

View File

@@ -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
});