Refactor: Remove Cronitor RUM tracking

This commit is contained in:
gpt-engineer-app[bot]
2025-11-05 15:59:05 +00:00
parent 1f93e7433b
commit 6e1ff944c8
6 changed files with 56 additions and 184 deletions

View File

@@ -4,16 +4,6 @@ import { supabase } from '@/integrations/supabase/client';
import { breadcrumbManager } from './errorBreadcrumbs';
import { captureEnvironmentContext } from './environmentContext';
// Cronitor RUM integration
declare global {
interface Window {
cronitor?: {
track: (eventName: string, data?: Record<string, any>) => void;
error: (error: Error | string, metadata?: Record<string, any>) => void;
};
}
}
export type ErrorContext = {
action: string;
userId?: string;
@@ -167,25 +157,6 @@ export const handleError = (
});
}
// Track error in Cronitor RUM
if (typeof window !== 'undefined' && window.cronitor) {
try {
window.cronitor.error(
error instanceof Error ? error : new Error(errorMessage),
{
errorId,
errorName,
action: context.action,
userId: context.userId,
supabaseError: supabaseErrorDetails,
breadcrumbCount: breadcrumbManager.getAll().length,
}
);
} catch (cronitorError) {
logger.error('Failed to track error in Cronitor', { cronitorError });
}
}
// Log to database with breadcrumbs (non-blocking)
try {
const envContext = captureEnvironmentContext();
@@ -281,21 +252,6 @@ export const handleNonCriticalError = (
severity: 'low',
});
// Track non-critical error in Cronitor (lower severity)
if (typeof window !== 'undefined' && window.cronitor) {
try {
window.cronitor.track('non_critical_error', {
errorId,
errorMessage,
action: context.action,
userId: context.userId,
severity: 'low',
});
} catch (cronitorError) {
logger.error('Failed to track non-critical error in Cronitor', { cronitorError });
}
}
// Log to database with breadcrumbs (non-blocking, fire-and-forget)
try {
const envContext = captureEnvironmentContext();