Skip to content
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(api): Add Sentry Integeration #133

Merged
merged 21 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Thumbs.db
.next
.vscode
.env
.env.local
HarshPatel5940 marked this conversation as resolved.
Show resolved Hide resolved
pnpm-lock.yaml

# Database
Expand Down
3 changes: 2 additions & 1 deletion apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CustomLogger implements LoggerService {
async function bootstrap() {
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV,
environment: process.env.NODE_ENV || 'development',
HarshPatel5940 marked this conversation as resolved.
Show resolved Hide resolved
tracesSampleRate: Number(process.env.SENTRY_TRACES_SAMPLE_RATE) || 1.0,
profilesSampleRate: Number(process.env.SENTRY_PROFILES_SAMPLE_RATE) || 1.0,
integrations: [new ProfilingIntegration()],
Expand All @@ -65,6 +65,7 @@ async function bootstrap() {
})
app.use(Sentry.Handlers.requestHandler())
app.use(Sentry.Handlers.tracingHandler())

const globalPrefix = 'api'
app.setGlobalPrefix(globalPrefix)
app.useGlobalPipes(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"db:format": "nx run api:prisma:format",
"db:reset": "nx run api:prisma:reset",
"prepare": "husky install",
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org programmingnotcoding --project node ./dist && sentry-cli sourcemaps upload --org programmingnotcoding --project node ./dist"
"sentry:sourcemaps": "sentry-cli sourcemaps inject ./dist && sentry-cli sourcemaps upload ./dist"
},
"devDependencies": {
"@nestjs/schematics": "^10.0.3",
Expand Down
Loading