feat(sentry): Ajoute l'intégration de Sentry pour le suivi des erreurs.

This commit is contained in:
Serreau Jovann
2025-10-16 08:42:01 +02:00
parent c448043b5b
commit 6e6b571243
13 changed files with 157 additions and 16 deletions

View File

@@ -11,6 +11,7 @@ import {SecurityWall} from './class/SecurityWall'
import {IpWall} from './class/IpWall'
import {ConfirmModal} from './class/ConfirmModal'
import preactCustomElement from './functions/preact'
import * as Sentry from "@sentry/browser";
function script() {
@@ -49,6 +50,26 @@ function full() {
}
});
});
let metaSentry = document.querySelector('meta[name="sentry"]');
if(metaSentry != undefined) {
Sentry.init({
dsn: "https://f134747cc727471fefb197ab5fd4b1b0@o4510197735948288.ingest.de.sentry.io/4510197772320848",
// Setting this option to true will send default PII data to Sentry.
// For example, automatic IP address collection on events
sendDefaultPii: true,
tunnel: "/tunnel",
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration()
],
// Tracing
tracesSampleRate: 1.0, // Capture 100% of the transactions
// Session Replay
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
replaysOnErrorSampleRate: 1.0 // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
});
}
}
document.addEventListener('DOMContentLoaded', ()=>{

View File

@@ -1,6 +1,7 @@
import './app.scss'
import * as Turbo from "@hotwired/turbo"
import {PaymentChaque, PaymentPage, PaymentSepa, PaymentVirement} from "./class/PaymentPage.js";
import * as Sentry from "@sentry/browser";
customElements.define('payment-page',PaymentPage,{extends:'button'})
customElements.define('payment-cheque',PaymentChaque,{extends:'button'})
@@ -9,6 +10,26 @@ customElements.define('payment-virement',PaymentVirement,{extends:'button'})
document.addEventListener('DOMContentLoaded', () => {
let metaSentry = document.querySelector('meta[name="sentry"]');
if(metaSentry != undefined) {
Sentry.init({
dsn: "https://f134747cc727471fefb197ab5fd4b1b0@o4510197735948288.ingest.de.sentry.io/4510197772320848",
// Setting this option to true will send default PII data to Sentry.
// For example, automatic IP address collection on events
sendDefaultPii: true,
tunnel: "/tunnel",
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration()
],
// Tracing
tracesSampleRate: 1.0, // Capture 100% of the transactions
// Session Replay
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
replaysOnErrorSampleRate: 1.0 // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
});
}
function createSvgIconPassword(paths, classes) {
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
svg.setAttribute("fill", "none");