Home  >  Q&A  >  body text

How to use Quasar.js with Sentry application monitoring

I added Sentinel monitoring to my Quasar application but Sentinel does not receive any errors nor does it show up in its panel

I created /src/boot/sentry.js and wrote the following code:

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

My Quasar application is ssr. How should I fix it?

P粉323050780P粉323050780206 days ago376

reply all(1)I'll reply

  • P粉032977207

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

    I solved my problem by changing the code as follows:

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

    reply
    0
  • Cancelreply