Initialize sentry after getting API status
This commit is contained in:
parent
839abcbd28
commit
986d12eab2
3 changed files with 17 additions and 10 deletions
|
|
@ -3,9 +3,24 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import * as Sentry from "@sentry/vue";
|
||||
import { onMounted } from "vue";
|
||||
import { apiClient } from "@/client";
|
||||
import router from "@/router";
|
||||
|
||||
import { SSEManager, type SSEMessage } from "@/SSEManager";
|
||||
|
||||
async function sentryInit() {
|
||||
const config = await apiClient.JSONGet("/api");
|
||||
Sentry.init({
|
||||
dsn: config.DSN,
|
||||
integrations: [Sentry.browserTracingIntegration({ router })],
|
||||
environment: config.ENVIRONMENT,
|
||||
release: config.RELEASE,
|
||||
tracesSampleRate: 0.01,
|
||||
});
|
||||
console.log("sentry initialized");
|
||||
}
|
||||
onMounted(() => {
|
||||
SSEManager.connect("/api/events");
|
||||
SSEManager.subscribe((msg: SSEMessage) => {
|
||||
|
|
@ -13,5 +28,6 @@ onMounted(() => {
|
|||
console.log("SSE", msg);
|
||||
}
|
||||
});
|
||||
sentryInit();
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue