mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-09 19:00:53 -04:00
dev(api): track sentry releases (#60444)
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user