mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
fix(ui): use Sentry namespace for browserTracingIntegration (#9503)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* Client-side Sentry instrumentation
|
||||
*
|
||||
@@ -9,12 +11,11 @@
|
||||
*/
|
||||
|
||||
import * as Sentry from "@sentry/nextjs";
|
||||
import { browserTracingIntegration } from "@sentry/nextjs";
|
||||
|
||||
const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN;
|
||||
|
||||
// Only initialize Sentry if DSN is configured
|
||||
if (SENTRY_DSN) {
|
||||
// Only initialize Sentry in the browser (not during SSR)
|
||||
if (typeof window !== "undefined" && SENTRY_DSN) {
|
||||
const isDevelopment = process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT === "local";
|
||||
|
||||
/**
|
||||
@@ -43,12 +44,12 @@ if (SENTRY_DSN) {
|
||||
tracesSampleRate: isDevelopment ? 1.0 : 0.5,
|
||||
profilesSampleRate: isDevelopment ? 1.0 : 0.5,
|
||||
|
||||
// 🔌 Integrations
|
||||
// 🔌 Integrations - browserTracingIntegration is client-only
|
||||
integrations: [
|
||||
// 📊 Performance Monitoring: Core Web Vitals + RUM
|
||||
// Tracks LCP, FID, CLS, INP
|
||||
// Real User Monitoring captures actual user experience, not synthetic tests
|
||||
browserTracingIntegration({
|
||||
Sentry.browserTracingIntegration({
|
||||
enableLongTask: true, // Detect tasks that block UI (>50ms)
|
||||
enableInp: true, // Interaction to Next Paint (Core Web Vital)
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user