Skip to content

Conversation

Copy link

Copilot AI commented Jul 4, 2025

Resolves @WATonomous/infra-config/issues/3079

This PR adds the Sentry Console integration to all three Sentry configuration files (client, server, and edge) to capture console.error, console.warn, and other console method calls as Sentry issues.

Changes Made

  • sentry.client.config.ts: Added new Sentry.Integrations.Console() to the existing integrations array
  • sentry.server.config.ts: Added integrations array with new Sentry.Integrations.Console()
  • sentry.edge.config.ts: Added integrations array with new Sentry.Integrations.Console()

What This Accomplishes

The Console integration will now:

  • Capture console.error(), console.warn(), console.log(), and other console method calls
  • Send these console messages to Sentry as issues when running in production
  • Provide visibility into client-side and server-side JavaScript errors that are logged to the console
  • Help the team monitor and debug issues that may not be caught by other error handling

Example

Console errors like those in scripts/generate-assets.js will now be surfaced in Sentry:

console.error("Please provide a path to the user profiles JSON file");
console.error(`User profiles file "${USER_PROFILES_PATH}" does not exist`);

The integration only activates in production environments as configured in all three Sentry configuration files, maintaining the existing pattern of development vs. production behavior.

Verification

  • ✅ ESLint passes with no errors on all modified files
  • ✅ Confirmed Sentry.Integrations.Console exists and can be instantiated in the current Sentry version (@sentry/nextjs ^7.76.0)
  • ✅ Implementation follows existing Sentry patterns in the codebase

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • downloads.sentry-cdn.com

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Resolve @WATonomous/infra-config/issues/3079 Add Console integration to Sentry configuration to capture console errors Jul 4, 2025
Copilot AI requested a review from ben-z July 4, 2025 08:43
Copilot finished work on behalf of ben-z July 4, 2025 08:43
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