Add sentry integration with Vue frontend
This commit is contained in:
parent
baaa3bff5b
commit
2b30411c1b
5 changed files with 104 additions and 11 deletions
|
|
@ -2,7 +2,9 @@ import { createApp } from "vue";
|
|||
import { createPinia } from "pinia";
|
||||
import App from "@/AppSync.vue";
|
||||
import router from "@/router";
|
||||
import { SSEManager, type SSEMessage } from "@/SSEManager";
|
||||
import * as Sentry from "@sentry/vue";
|
||||
import * as config from "@/config";
|
||||
|
||||
import "maplibre-gl/dist/maplibre-gl.css";
|
||||
|
||||
// Import Bootstrap Icons CSS
|
||||
|
|
@ -16,17 +18,16 @@ import "@/gen/custom-icons.scss";
|
|||
import * as bootstrap from "bootstrap";
|
||||
window.bootstrap = bootstrap;
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
SSEManager.connect("/api/events");
|
||||
SSEManager.subscribe((msg: SSEMessage) => {
|
||||
if (msg.type != "heartbeat") {
|
||||
console.log("SSE", msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const pinia = createPinia();
|
||||
const app = createApp(App);
|
||||
app.use(pinia);
|
||||
app.use(router);
|
||||
app.mount("#app");
|
||||
|
||||
Sentry.init({
|
||||
dsn: config.DSN,
|
||||
integrations: [Sentry.browserTracingIntegration({ router })],
|
||||
environment: config.ENVIRONMENT,
|
||||
release: config.RELEASE,
|
||||
tracesSampleRate: 0.01,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue