Skip to content

feat(observability): enable Sentry tracking in preview deployments (#1374)#1387

Draft
Orlandohub wants to merge 2 commits intodevfrom
feat/1374-implement-sentry-error-tracking
Draft

feat(observability): enable Sentry tracking in preview deployments (#1374)#1387
Orlandohub wants to merge 2 commits intodevfrom
feat/1374-implement-sentry-error-tracking

Conversation

@Orlandohub
Copy link
Copy Markdown
Contributor

@Orlandohub Orlandohub commented Feb 25, 2026

IMPORTANT

Tests are failing because of header error test button added without updating snapshots!
This is known and expected while in DRAFT mode

Summary

  • fix [Feature]: Implement Sentry error tracking #1374
  • Enable Sentry error tracking for preview deployments so runtime exceptions are captured consistently in non-production environments.
  • Ensure preview stack traces are symbolicated by wiring Sentry source map upload token and build-time DSN configuration through CI, Docker, and env validation.

Changes

  • Add Sentry integration points for Next.js app error tracking (src/instrumentation-client.ts, src/global-error.tsx) and gate behavior for staging/preview.
  • Wrap Next config with Sentry build plugin settings and auth token usage for source map upload (next.config.ts).
  • Add and validate SENTRY_AUTH_TOKEN and NEXT_PUBLIC_SENTRY_DSN in env parsing (src/libs/env/env.ts) and document DSN in .env.example.
  • Pass Sentry-related build args in preview image workflow and Docker builder args (.github/workflows/build-docker-image.yml, Dockerfile).
  • Include project Sentry guidance rule and dependency/lockfile updates needed for the integration (.cursor/rules/sentry.mdc, package.json, package-lock.json).
Screen.Recording.2026-02-25.at.12.50.02.mov

Test plan

  • Trigger an error on a preview deployment and confirm the event appears in Sentry.
  • Verify stack traces in Sentry are de-minified for preview errors (source maps uploaded).
  • Confirm preview deployment pipeline succeeds with SENTRY_AUTH_TOKEN configured in GitHub Actions secrets.

Notes

  • NEXT_PUBLIC_SENTRY_DSN is public by design and included as a build-time public env value; only SENTRY_AUTH_TOKEN must remain secret.
  • Docker lint still reports existing warnings about sensitive ARG usage and base image vulnerabilities; these are pre-existing risk signals to address separately.

…1374)

Configure Sentry for preview builds by wiring auth token and public DSN through env validation, Docker build args, and CI workflow settings. This ensures preview errors are captured with source maps while keeping runtime setup environment-driven.
@Orlandohub Orlandohub requested review from MiguelMedeiros, infin1t3, secondl1ght and tipogi and removed request for MiguelMedeiros February 25, 2026 11:35
@github-actions
Copy link
Copy Markdown

🚀 Preview Deployment

URL: https://franky-preview-pr-1387-fzxmjul7ya-oa.a.run.app

franky-preview-pr-13878a9eedf

@Orlandohub Orlandohub self-assigned this Feb 25, 2026
@Orlandohub Orlandohub added the 📈 enhancement New feature or request label Feb 25, 2026
@Orlandohub Orlandohub added this to the Q1 - 2026 milestone Feb 25, 2026
@secondl1ght secondl1ght removed their request for review March 24, 2026 17:09
Base automatically changed from master to dev March 25, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📈 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants