|
|
@ -21,6 +21,7 @@ interface GrafanaCrashReport extends BaseStateReport { |
|
|
|
email: string; |
|
|
|
email: string; |
|
|
|
login: string; |
|
|
|
login: string; |
|
|
|
name: string; |
|
|
|
name: string; |
|
|
|
|
|
|
|
lastInteraction: number; |
|
|
|
}; |
|
|
|
}; |
|
|
|
memory?: { |
|
|
|
memory?: { |
|
|
|
heapUtilization: number; |
|
|
|
heapUtilization: number; |
|
|
@ -36,6 +37,11 @@ export function initializeCrashDetection() { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let lastInteraction = Date.now(); |
|
|
|
|
|
|
|
// Add last interaction listeners to capture phase to reduce skipped events when stopPropagation() is called
|
|
|
|
|
|
|
|
document.body.addEventListener('click', () => (lastInteraction = Date.now()), true); |
|
|
|
|
|
|
|
document.body.addEventListener('keypress', () => (lastInteraction = Date.now()), true); |
|
|
|
|
|
|
|
|
|
|
|
initCrashDetection<GrafanaCrashReport>({ |
|
|
|
initCrashDetection<GrafanaCrashReport>({ |
|
|
|
id: nanoid(5), |
|
|
|
id: nanoid(5), |
|
|
|
|
|
|
|
|
|
|
@ -81,6 +87,7 @@ export function initializeCrashDetection() { |
|
|
|
email: contextSrv.user.email, |
|
|
|
email: contextSrv.user.email, |
|
|
|
login: contextSrv.user.login, |
|
|
|
login: contextSrv.user.login, |
|
|
|
name: contextSrv.user.name, |
|
|
|
name: contextSrv.user.name, |
|
|
|
|
|
|
|
lastInteraction, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (isChromePerformance(performance)) { |
|
|
|
if (isChromePerformance(performance)) { |
|
|
|