added sentry

main
raphiniert 2023-04-27 14:30:05 +02:00
parent ec26ba1f2a
commit 95167e3db3
2 changed files with 19 additions and 0 deletions

View File

@ -1,6 +1,9 @@
<script setup>
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from './components/HelloWorld.vue'
function throwError() {
throw new Error('Sentry Error');
}
</script>
<template>
@ -13,6 +16,7 @@ import HelloWorld from './components/HelloWorld.vue'
<nav>
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/about">About</RouterLink>
<button @click="throwError">Throw error</button>
</nav>
</div>
</header>

View File

@ -1,5 +1,6 @@
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import * as Sentry from "@sentry/vue"
import App from './App.vue'
import router from './router'
@ -8,6 +9,20 @@ import './assets/main.css'
const app = createApp(App)
Sentry.init({
app,
dsn: "https://928141231c6c46718b9631004c903c3f@sentry.derdritte.net/3",
integrations: [
new Sentry.BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
}),
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
})
app.use(createPinia())
app.use(router)