使用Quasar.js与Sentry应用程序监控的方法
P粉323050780
P粉323050780 2024-03-26 12:52:42
0
1
448

我向我的类星体应用程序添加了哨兵监控,但哨兵没有收到任何错误,也没有显示在其面板中

我创建了 /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粉323050780
P粉323050780

全部回复(1)
P粉032977207

我通过更改代码解决了我的问题,如下所示:

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;
        },
      }),
    ],
  });
});
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板