fix(sentry): use environments

This commit is contained in:
Mrugesh Mohapatra
2025-01-02 14:31:57 +05:30
parent abbd76fbc0
commit 4d4e617b7d
3 changed files with 13 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ import type { FastifyPluginCallback } from 'fastify';
import fastifySentry from '@immobiliarelabs/fastify-sentry';
import fp from 'fastify-plugin';
import { SENTRY_DSN } from '../utils/env';
import { SENTRY_DSN, SENTRY_ENVIRONMENT } from '../utils/env';
import { getRedirectParams } from '../utils/redirection';
/**
@@ -15,6 +15,7 @@ import { getRedirectParams } from '../utils/redirection';
const errorHandling: FastifyPluginCallback = (fastify, _options, done) => {
void fastify.register(fastifySentry, {
dsn: SENTRY_DSN,
environment: SENTRY_ENVIRONMENT,
maxValueLength: 8192, // the default is 250, which is too small.
// No need to initialize if DSN is not provided (e.g. in development and
// test environments)