feat(sentry): integrate Sentry for error tracking and performance mon…#42
Merged
Merged
Conversation
8 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #23
PR: Add Sentry Error Tracking Integration
Summary
This PR integrates Sentry into the NestJS backend for centralized error reporting, performance tracing, and production monitoring.
What changed
src/config/sentry.tsto initialize Sentry with DSN, environment, release, traces sampling, and uncaught exception / unhandled rejection handling.src/common/middleware/sentry.middleware.tsto capture request-level breadcrumbs for request method, path, params, and query context.src/main.tsto initialize Sentry during bootstrap and register request/tracing middleware.src/common/filters/global-exception.filter.tsto report server errors and auth failures to Sentry with request tags and correlation IDs.src/config/env.validation.tsto includeSENTRY_DSN,SENTRY_ENVIRONMENT,SENTRY_RELEASE, andSENTRY_TRACES_SAMPLE_RATE..env.exampleand.env.production.example.README.md.@sentry/nodetopackage.json.Files changed
src/config/sentry.tssrc/common/middleware/sentry.middleware.tssrc/main.tssrc/common/filters/global-exception.filter.tssrc/config/env.validation.ts.env.example.env.production.exampleREADME.mdpackage.jsonEnvironment variables added
SENTRY_DSNSENTRY_ENVIRONMENTSENTRY_RELEASESENTRY_TRACES_SAMPLE_RATENotes for reviewers
SENTRY_DSNis not set.500,401, and403errors to Sentry for alerting and grouping.Testing
npm installafterpackage.jsonupdate.SENTRY_DSNand verify startup logs includeSentry initialized.