From f9e144b21f279391683100b9182aca92e9024a35 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 00:18:02 +0000 Subject: [PATCH 2/4] Add Sentry integration with browser tracing and replay Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com> --- package.json | 1 + src/main.js | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/package.json b/package.json index 2f4e86c..d4d1cee 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@fingerprintjs/fingerprintjs": "^5.0.1", "@mdi/font": "7.4.47", "@microsoft/clarity": "^1.0.2", + "@sentry/vue": "^10.36.0", "@vueuse/core": "^14.1.0", "axios": "^1.13.2", "idb": "^8.0.3", diff --git a/src/main.js b/src/main.js index 105e14d..82a5c4d 100644 --- a/src/main.js +++ b/src/main.js @@ -7,6 +7,7 @@ // Plugins import {registerPlugins} from '@/plugins' import {createPinia} from 'pinia' +import router from './router' const pinia = createPinia() @@ -23,8 +24,31 @@ import {createApp} from 'vue' import messageService from './utils/message'; import { getVisitorId } from './utils/visitorId'; +import * as Sentry from "@sentry/vue"; + const app = createApp(App) +Sentry.init({ + app, + dsn: "https://2f8e5e4ec986c6077d3798ba9f683fdd@o4510762489151488.ingest.us.sentry.io/4510762503438336", + // Setting this option to true will send default PII data to Sentry. + // For example, automatic IP address collection on events + sendDefaultPii: true, + integrations: [ + Sentry.browserTracingIntegration({ router }), + Sentry.replayIntegration() + ], + // Tracing + tracesSampleRate: 1.0, // Capture 100% of the transactions + // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + // 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., + // Logs + enableLogs: true +}); + registerPlugins(app) //app.use(TDesign) app.use(messageService); From 890fb147b0089a09898fdd5a9291c15fd5a935ca Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 00:19:10 +0000 Subject: [PATCH 3/4] Fix syntax error: remove extra comma in Sentry config Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com> --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 82a5c4d..e25ff9f 100644 --- a/src/main.js +++ b/src/main.js @@ -44,7 +44,7 @@ Sentry.init({ tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], // 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., + replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. // Logs enableLogs: true }); From bd7a42b889d3f02846c6f0288fcee308f8cc322a Mon Sep 17 00:00:00 2001 From: Sunwuyuan Date: Sat, 24 Jan 2026 08:28:19 +0800 Subject: [PATCH 4/4] Update tracePropagationTargets and replaysSessionSampleRate --- src/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index e25ff9f..8580c6a 100644 --- a/src/main.js +++ b/src/main.js @@ -41,9 +41,9 @@ Sentry.init({ // Tracing tracesSampleRate: 1.0, // Capture 100% of the transactions // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + tracePropagationTargets: ["localhost", /^https:\/\/kv-service\.(houlang\.cloud|wuyuan\.dev)/], // 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. + replaysSessionSampleRate: 0.01, // 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. // Logs enableLogs: true