feat: Integrate Cronitor RUM

This commit is contained in:
gpt-engineer-app[bot]
2025-11-05 15:07:31 +00:00
parent e1ffba593a
commit 0106bdb1d5
7 changed files with 160 additions and 16 deletions

View File

@@ -243,9 +243,28 @@ export async function withRetry<T>(
error: error instanceof Error ? error.message : String(error)
});
// Track exhausted retries in Cronitor
if (typeof window !== 'undefined' && window.cronitor) {
window.cronitor.track('retries_exhausted', {
totalAttempts: config.maxAttempts,
error: error instanceof Error ? error.name : 'UnknownError',
severity: 'high',
});
}
throw error;
}
// Track retry attempts in Cronitor
if (attempt > 0 && typeof window !== 'undefined' && window.cronitor) {
window.cronitor.track('retry_attempt', {
attempt: attempt + 1,
maxAttempts: config.maxAttempts,
error: error instanceof Error ? error.name : 'UnknownError',
willRetry: attempt < config.maxAttempts - 1,
});
}
// Calculate delay for next attempt
const delay = calculateBackoffDelay(attempt, config);