Skip to content

Conversation

@dannon
Copy link
Member

@dannon dannon commented Dec 1, 2025

Description

Adds Sentry error tracking integration for client-side error monitoring.

Configuration:

  • DSN configured in site-config/brc-analytics/{dev,prod}/.env
  • Uses NEXT_PUBLIC_SITE_CONFIG as the environment tag to segment errors (e.g., brc-analytics-dev vs brc-analytics-prod)
  • Uses the Galaxy-hosted Sentry instance at sentry.galaxyproject.org

Implementation:

  • Client-side error capture via instrumentation-client.ts
  • Pages Router error handling via pages/_error.tsx
  • Source map uploads disabled (no hosted Sentry project for builds)

Related Issue

Closes #1020

@github-actions github-actions bot added the feat label Dec 1, 2025
@dannon dannon changed the title feat: Sentry integration feat: sentry integration Dec 1, 2025
@dannon
Copy link
Member Author

dannon commented Dec 1, 2025

Run ./.github/actions/check-input-commit-message
Checking for Conventional Commits format
⧗   input: feat: Sentry integration
✖   subject must not be sentence-case, start-case, pascal-case, upper-case [subject-case]

✖   found 1 problems, 0 warnings

🤦

fixed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Sentry error tracking integration for client-side error monitoring in the brc-analytics application. The implementation initializes Sentry client-side instrumentation, configures environment-specific DSNs for dev and prod, and sets up a custom error page for Next.js Pages Router. Source map uploads are intentionally disabled as noted in the description.

Key Changes:

  • Added @sentry/nextjs v10.27.0 dependency for error tracking
  • Configured Sentry initialization in instrumentation-client.ts with environment-based settings
  • Created custom error page (pages/_error.tsx) to capture errors via Sentry
  • Added DSN configuration in dev/prod environment files

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
instrumentation-client.ts New file initializing Sentry client-side with DSN and environment configuration
pages/_error.tsx New custom error page capturing errors to Sentry using Pages Router
next.config.mjs Wrapped Next.js config with Sentry, disabled source maps
package.json Added @sentry/nextjs dependency
site-config/brc-analytics/{dev,prod}/.env Added NEXT_PUBLIC_SENTRY_DSN configuration
.env Added example Sentry configuration with documentation
.gitignore Added .env.sentry-build-plugin to ignore list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@frano-m frano-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @dannon thank you!

@frano-m
Copy link
Contributor

frano-m commented Dec 3, 2025

@dannon would you mind rebasing this PR so it can be merged thank you!

Configure via NEXT_PUBLIC_SENTRY_DSN environment variable.
- Remove unneeded server/edge configs (static export)
- Remove App Router files (using Pages Router)
- Remove example pages
- Use env var for DSN instead of hardcoding
- Add typed _error.tsx for Pages Router error capture
Not needed for Pages Router projects.
Uses NEXT_PUBLIC_SITE_CONFIG to segment errors by environment.
Add DSN to site-config env files.
@NoopDog NoopDog changed the title feat: sentry integration feat: sentry integration (#1020) Dec 3, 2025
@NoopDog NoopDog merged commit aab5d32 into galaxyproject:main Dec 3, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add "Sentry" for client side error monitoring

4 participants