-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsentry.client.config.js
More file actions
49 lines (41 loc) · 1.35 KB
/
sentry.client.config.js
File metadata and controls
49 lines (41 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import * as Sentry from '@sentry/astro';
Sentry.init({
// Reemplaza con tu DSN de Sentry
// Obtén tu DSN en: https://sentry.io/settings/projects/
dsn: import.meta.env.PUBLIC_SENTRY_DSN,
// Configuración del entorno
environment: import.meta.env.MODE,
// Controla qué porcentaje de errores se envían (1.0 = 100%)
tracesSampleRate: 1.0,
// Configuración de replays (capturas de sesión cuando hay errores)
replaysSessionSampleRate: 0.1, // 10% de sesiones normales
replaysOnErrorSampleRate: 1.0, // 100% cuando hay error
// Filtrar errores conocidos/esperados
beforeSend(event, hint) {
// Ignorar errores de extensiones del navegador
if (event.exception) {
const frames = event.exception.values?.[0]?.stacktrace?.frames;
if (frames?.some(frame =>
frame.filename?.includes('chrome-extension://') ||
frame.filename?.includes('moz-extension://')
)) {
return null;
}
}
// Ignorar errores de Pagefind en desarrollo
if (import.meta.env.DEV &&
(event.message?.includes('pagefind') ||
hint?.originalException?.message?.includes('pagefind'))) {
return null;
}
return event;
},
// Integrations
integrations: [
Sentry.replayIntegration({
maskAllText: false,
blockAllMedia: false,
}),
Sentry.browserTracingIntegration(),
],
});