搜尋

首頁  >  問答  >  主體

使用Quasar.js與Sentry應用程式監控的方法

我向我的類星體應用程式添加了哨兵監控,但哨兵沒有收到任何錯誤,也沒有顯示在其面板中

我建立了 /src/boot/sentry.js 並寫了以下程式碼:

import { boot } from "quasar/wrappers";
import * as Sentry from "@sentry/vue";
import { BrowserTracing } from "@sentry/tracing";

export default boot(({ app, router }) => {
  Sentry.init({
    app,
    dsn: "<my sentry dns>",
    integrations: [
      new BrowserTracing({
        routingInstrumentation: Sentry.vueRouterInstrumentation(router),
        tracingOrigins: ["localhost", "my-site-url.com", regex],
      }),
    ],

    trackComponents: true,
    tracesSampleRate: 1.0,
  });
});

我的 Quasar 應用程式是 ssr。我應該如何修復它?

P粉323050780P粉323050780271 天前470

全部回覆(1)我來回復

  • P粉032977207

    P粉0329772072024-03-27 11:04:24

    我透過更改程式碼解決了我的問題,如下所示:

    import { boot } from "quasar/wrappers";
    import * as Sentry from "@sentry/browser";
    import * as Integrations from "@sentry/integrations";
    
    export default boot(({ Vue }) => {
      Sentry.init({
        dsn: "",
        release: process.env.SENTRY_RELEASE,
        integrations: [
          new Integrations.Vue({ Vue, attachProps: true }),
          new Integrations.RewriteFrames({
            iteratee(frame) {
              // Strip out the query part (which contains `?__WB_REVISION__=**`)
              frame.abs_path = frame.abs_path.split("?")[0];
    
              return frame;
            },
          }),
        ],
      });
    });
    

    回覆
    0
  • 取消回覆