sentry.js 936 B

1234567891011121314151617181920212223242526
  1. import * as Sentry from "@sentry/vue";
  2. import { BrowserTracing } from "@sentry/tracing";
  3. import { appVersionCode } from '@/http/configAPI.js'
  4. class CoutomSentry {
  5. initVue(app) {
  6. Sentry.init({
  7. app,
  8. dsn: "https://529fc1c357b248eda7473c119093f5db@sentry.piaoquantv.com/5",
  9. integrations: [
  10. new BrowserTracing({
  11. // routingInstrumentation: Sentry.vueRouterInstrumentation(router),
  12. tracingOrigins: ["localhost", "my-site-url.com", /^\//],
  13. }),
  14. ],
  15. // Set tracesSampleRate to 1.0 to capture 100%
  16. // of transactions for performance monitoring.
  17. // We recommend adjusting this value in production
  18. tracesSampleRate: 1.0,
  19. release: `${process.env.NODE_ENV}-${appVersionCode}`,
  20. logErrors: true
  21. });
  22. }
  23. }
  24. export default new CoutomSentry()