From 0c470c08373bf527979bad58926f66a0374c2f5e Mon Sep 17 00:00:00 2001 From: yoshino-s Date: Mon, 25 Mar 2024 18:05:36 +0800 Subject: [PATCH] feat: sentry profile --- src/sentry.ts | 3 +++ vite.config.ts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/sentry.ts b/src/sentry.ts index 7cfbea9..544e63b 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -3,6 +3,7 @@ import * as Sentry from "@sentry/react"; Sentry.init({ dsn: "https://fee4fec58516c464f60613b40b5d3a7d@sentry.yoshino-s.xyz/2", integrations: [ + Sentry.browserProfilingIntegration(), Sentry.browserTracingIntegration(), Sentry.replayIntegration({ maskAllText: false, @@ -16,4 +17,6 @@ Sentry.init({ // Session Replay replaysSessionSampleRate: 1.0, // 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. + + profilesSampleRate: 1.0, // Capture 100% of the profiles }); diff --git a/vite.config.ts b/vite.config.ts index aa35d3e..51e90ff 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,6 +5,12 @@ import react from "@vitejs/plugin-react"; import { defineConfig } from "vite"; export default defineConfig({ + server: { + headers: { + "Document-Policy": "js-profiling", + }, + }, + plugins: [ react(), sentryVitePlugin({