Comment utiliser Quasar.js avec la surveillance des applications Sentry
P粉323050780
P粉323050780 2024-03-26 12:52:42
0
1
380

J'ai ajouté la surveillance Sentinel à mon application Quasar mais Sentinel ne reçoit aucune erreur et n'apparaît pas dans son panneau

J'ai créé /src/boot/sentry.js et écrit le code suivant :

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,
  });
});

Mon application Quasar est ssr. Comment dois-je le réparer ?

P粉323050780
P粉323050780

répondre à tous(1)
P粉032977207

J'ai résolu mon problème en modifiant le code comme suit :

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;
        },
      }),
    ],
  });
});
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!