Skip to content

Set up Sentry observability for Next.js runtime paths#53

Open
Copilot wants to merge 6 commits into
mainfrom
copilot/setup-sentry
Open

Set up Sentry observability for Next.js runtime paths#53
Copilot wants to merge 6 commits into
mainfrom
copilot/setup-sentry

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

image

This PR adds first-pass Sentry integration to the Next.js app so client navigation, server runtime, and edge runtime errors/performance signals are captured through a single configuration path. It also introduces explicit env knobs for DSN and trace sampling.

  • SDK + framework wiring

    • Added @sentry/nextjs dependency.
    • Wrapped Next config with withSentryConfig(...) in next.config.js to enable Sentry build/runtime integration.
  • Runtime initialization across execution targets

    • Added instrumentation.ts to register runtime-specific Sentry configs.
    • Added sentry.server.config.ts and sentry.edge.config.ts for server/edge initialization.
    • Added instrumentation-client.ts for browser initialization and router transition capture.
  • Sampling + environment configuration

    • Added SENTRY_DSN and NEXT_PUBLIC_SENTRY_DSN.
    • Added SENTRY_TRACES_SAMPLE_RATE and NEXT_PUBLIC_SENTRY_TRACES_SAMPLE_RATE (default 0.1 in example env).
    • Runtime sampling values are parsed from env with fallback behavior.
// instrumentation.ts
export async function register() {
  if (process.env.NEXT_RUNTIME === "nodejs") await import("./sentry.server.config");
  if (process.env.NEXT_RUNTIME === "edge") await import("./sentry.edge.config");
}

export const onRequestError = Sentry.captureRequestError;

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solar-car-website-next Ready Ready Preview, Comment May 23, 2026 4:40pm

Copilot AI and others added 4 commits May 18, 2026 00:06
Agent-Logs-Url: https://github.com/UCSolarCarTeam/Solar-Car-Website-Next/sessions/0075eefd-926e-4432-8d31-9571595e9391

Co-authored-by: justin-phxm <113923596+justin-phxm@users.noreply.github.com>
Agent-Logs-Url: https://github.com/UCSolarCarTeam/Solar-Car-Website-Next/sessions/0075eefd-926e-4432-8d31-9571595e9391

Co-authored-by: justin-phxm <113923596+justin-phxm@users.noreply.github.com>
Agent-Logs-Url: https://github.com/UCSolarCarTeam/Solar-Car-Website-Next/sessions/0075eefd-926e-4432-8d31-9571595e9391

Co-authored-by: justin-phxm <113923596+justin-phxm@users.noreply.github.com>
Agent-Logs-Url: https://github.com/UCSolarCarTeam/Solar-Car-Website-Next/sessions/0075eefd-926e-4432-8d31-9571595e9391

Co-authored-by: justin-phxm <113923596+justin-phxm@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants