-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: sentry integration #470
Conversation
apps/drec-api/src/index.ts
Outdated
@@ -5,7 +5,7 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; | |||
import { useContainer } from 'class-validator'; | |||
import fs from 'fs'; | |||
import { DrecModule } from './drec.module'; | |||
|
|||
import './instrument'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we call this sentry
why instrument ?
apps/drec-api/src/instrument.ts
Outdated
if (process.env.NODE_ENV !== 'local') { | ||
Sentry.init({ | ||
dsn: process.env.SENTRY_DSN, | ||
environment: process.env.NODE_ENV, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should separate the environment
here with process.env.NODE_ENV
.
process.env.NODE_ENV
is primarily used to indicate if we are running in local or built (production) mode.
We should have an env Variable that we will assign to the environment
property that will be called SENTRY_ENV
We should disable reporting if process.env.NODE_ENV
is not equal to production
Describe your changes
Integrated Sentry for logging errors in production.
Issue ticket number and link
Checklist before requesting a review
Testing the implementation
Add this variables in the .env file
choose one either
production
,staging
,local