From ade3a59495e97b8f0349cd0cf905f7c60a1df996 Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Mon, 24 Jul 2023 21:51:02 +0200 Subject: [PATCH] remove broken tracing --- src/lib/util/anilist.ts | 4 ++-- src/lib/util/tracing.ts | 32 ++++++++++++++++---------------- src/routes/+layout.svelte | 10 +++++----- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/lib/util/anilist.ts b/src/lib/util/anilist.ts index c001e4f..935a1fa 100644 --- a/src/lib/util/anilist.ts +++ b/src/lib/util/anilist.ts @@ -1,5 +1,5 @@ import * as Sentry from "@sentry/browser"; -import { apm } from "./tracing"; +// import { apm } from "./tracing"; var isLogedInCache: boolean | null = null; var isLogedInCacheTime: number | null = null; @@ -23,7 +23,7 @@ export function getUserID() { const token = localStorage.getItem("token")!; let data = JSON.parse(atob(token.substring(token.indexOf(".") + 1, token.lastIndexOf(".")))); Sentry.setUser({ id: data.sub }); - apm.setUserContext({ id: data.sub }); + // apm.setUserContext({ id: data.sub }); return data.sub; } diff --git a/src/lib/util/tracing.ts b/src/lib/util/tracing.ts index eb91e6f..f3a624a 100644 --- a/src/lib/util/tracing.ts +++ b/src/lib/util/tracing.ts @@ -1,22 +1,22 @@ -import { browser } from '$app/environment'; -import { ApmBase, init as initApm } from '@elastic/apm-rum' +// import { browser } from '$app/environment'; +// import { ApmBase, init as initApm } from '@elastic/apm-rum' -var apm_: ApmBase; +// var apm_: ApmBase; -if(browser) { - apm_ = initApm({ - // Set required service name (allowed characters: a-z, A-Z, 0-9, -, _, and space) - serviceName: 'mangades', +// if(browser) { +// apm_ = initApm({ +// // Set required service name (allowed characters: a-z, A-Z, 0-9, -, _, and space) +// serviceName: 'mangades', - // Set custom APM Server URL (default: http://localhost:8200) - serverUrl: 'https://apm.elasticsearch.danbulant.cloud', +// // Set custom APM Server URL (default: http://localhost:8200) +// serverUrl: 'https://apm.elasticsearch.danbulant.cloud', - // Set the service version (required for source map feature) - serviceVersion: import.meta.env.VITE_SENTRY_RELEASE, +// // Set the service version (required for source map feature) +// serviceVersion: import.meta.env.VITE_SENTRY_RELEASE, - // Set the service environment - environment: import.meta.env.VITE_SENTRY_ENVIRONMENT || 'production' - }); -} +// // Set the service environment +// environment: import.meta.env.VITE_SENTRY_ENVIRONMENT || 'production' +// }); +// } -export const apm = apm_; \ No newline at end of file +// export const apm = apm_; \ No newline at end of file diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 312a93c..25aa000 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -5,8 +5,8 @@ import * as Sentry from '@sentry/svelte'; import { BrowserTracing } from "@sentry/tracing"; import { browser } from '$app/environment'; - import { apm } from "$lib/util/tracing"; - import { page } from "$app/stores"; + // import { apm } from "$lib/util/tracing"; + // import { page } from "$app/stores"; export var data; // @ts-ignore @@ -27,9 +27,9 @@ autoSessionTracking: false }); } - if(browser) { - apm.setInitialPageLoadName($page.route.id); - } + // if(browser) { + // apm.setInitialPageLoadName($page.route.id); + // } let skipFirst = true; let last = typeof window !== "undefined" && window.location.pathname;