-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: configure initial config for Sentry in the backend
- Loading branch information
Showing
10 changed files
with
728 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* eslint-disable @typescript-eslint/no-magic-numbers */ | ||
|
||
import env from '$configs'; | ||
import * as Sentry from '@sentry/nestjs'; | ||
import { nodeProfilingIntegration } from '@sentry/profiling-node'; | ||
import { Environment } from '~env'; | ||
|
||
Sentry.init({ | ||
dsn: env.SENTRY_DSN, | ||
integrations: [nodeProfilingIntegration()], | ||
|
||
environment: env.NODE_ENV === Environment.Production ? 'api-prod' : 'api-develop', | ||
|
||
// Add Tracing by setting tracesSampleRate | ||
// We recommend adjusting this value in production | ||
tracesSampleRate: env.NODE_ENV !== Environment.Production ? 1.0 : 0.1, | ||
|
||
// Set sampling rate for profiling | ||
// This is relative to tracesSampleRate | ||
profilesSampleRate: 1.0, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { APP_FILTER } from '@nestjs/core'; | ||
import { SentryGlobalFilter, SentryModule as SentryModuleNestJS } from '@sentry/nestjs/setup'; | ||
|
||
@Module({ | ||
imports: [SentryModuleNestJS.forRoot()], | ||
providers: [ | ||
{ | ||
provide: APP_FILTER, | ||
useClass: SentryGlobalFilter, | ||
}, | ||
], | ||
}) | ||
export class SentryModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.