mirror of
https://github.com/prowler-cloud/prowler.git
synced 2025-12-19 05:17:47 +00:00
Co-authored-by: Chandrapal Badshah <12944530+Chan9390@users.noreply.github.com> Co-authored-by: alejandrobailo <alejandrobailo94@gmail.com> Co-authored-by: Alejandro Bailo <59607668+alejandrobailo@users.noreply.github.com> Co-authored-by: Alan Buscaglia <gentlemanprogramming@gmail.com> Co-authored-by: Adrián Jesús Peña Rodríguez <adrianjpr@gmail.com> Co-authored-by: Andoni Alonso <14891798+andoniaf@users.noreply.github.com> Co-authored-by: Rubén De la Torre Vico <ruben@prowler.com> Co-authored-by: Daniel Barranquero <danielbo2001@gmail.com>
Sentry Error Tracking Configuration
This folder contains all Sentry-related configuration and utilities for the Prowler UI.
Files
sentry.server.config.ts- Server-side error tracking configurationsentry.edge.config.ts- Edge runtime error tracking configurationutils.ts- Enums for standardized error types and sourcesindex.ts- Main export file
Client Configuration
The client-side configuration is located in app/instrumentation.client.ts following Next.js conventions.
Usage
// Import Sentry enums for error categorization
import { SentryErrorType, SentryErrorSource } from "@/sentry";
// Use in error handling
Sentry.captureException(error, {
tags: {
error_type: SentryErrorType.SERVER_ERROR,
error_source: SentryErrorSource.API_ROUTE,
},
});
Environment Variables
Required environment variables (add to .env):
SENTRY_DSN=https://YOUR_KEY@o0.ingest.sentry.io/0
NEXT_PUBLIC_SENTRY_DSN=https://YOUR_KEY@o0.ingest.sentry.io/0
SENTRY_ORG=your-org-slug
SENTRY_PROJECT=your-project-slug
SENTRY_AUTH_TOKEN=sntrys_YOUR_AUTH_TOKEN
SENTRY_ENVIRONMENT=development
NEXT_PUBLIC_SENTRY_ENVIRONMENT=development
Ignored Errors
The following errors are intentionally ignored as they are expected behavior:
NEXT_REDIRECT- Next.js redirect mechanismNEXT_NOT_FOUND- Next.js 404 handling401- Unauthorized (expected when token expires)403- Forbidden (expected for permission checks)404- Not Found (expected for missing resources)