diff --git a/packages/frontend-2/.env.example b/packages/frontend-2/.env.example index d28478896..9945e3f42 100644 --- a/packages/frontend-2/.env.example +++ b/packages/frontend-2/.env.example @@ -22,11 +22,6 @@ NUXT_REDIS_URL=redis://localhost:6379 NUXT_PUBLIC_VIEWER_DEBUG=false # RUM monitoring -NUXT_PUBLIC_RAYGUN_KEY= -NUXT_PUBLIC_LOGROCKET_APP_ID= -NUXT_PUBLIC_SPEEDCURVE_ID= -NUXT_PUBLIC_DEBUGBEAR_ID= - NUXT_PUBLIC_DATADOG_APP_ID= NUXT_PUBLIC_DATADOG_CLIENT_TOKEN= NUXT_PUBLIC_DATADOG_SITE= diff --git a/packages/frontend-2/nuxt.config.ts b/packages/frontend-2/nuxt.config.ts index 6f07b3f16..db1d1a40f 100644 --- a/packages/frontend-2/nuxt.config.ts +++ b/packages/frontend-2/nuxt.config.ts @@ -63,10 +63,6 @@ export default defineNuxtConfig({ speckleServerVersion: SPECKLE_SERVER_VERSION || 'unknown', serverName: 'UNDEFINED', viewerDebug: false, - raygunKey: '', - logrocketAppId: '', - speedcurveId: 0, - debugbearId: '', debugCoreWebVitals: false, datadogAppId: '', datadogClientToken: '', diff --git a/packages/frontend-2/package.json b/packages/frontend-2/package.json index 38d5a93e4..72f6bfac3 100644 --- a/packages/frontend-2/package.json +++ b/packages/frontend-2/package.json @@ -70,7 +70,6 @@ "pino": "^8.14.1", "pino-http": "^8.3.3", "portal-vue": "^3.0.0", - "raygun": "^0.13.2", "seq-logging": "^2.1.1", "subscriptions-transport-ws": "^0.11.0", "tweetnacl-sealedbox-js": "^1.2.0", @@ -106,7 +105,6 @@ "@types/mixpanel-browser": "^2.38.0", "@types/node": "^18.17.5", "@types/pino-http": "^5.8.1", - "@types/raygun4js": "^3.0.0", "@typescript-eslint/eslint-plugin": "^7.12.0", "@typescript-eslint/parser": "^7.12.0", "@vitejs/plugin-legacy": "^5.4.1", diff --git a/packages/frontend-2/pages/projects/[id]/models/[modelId]/index.vue b/packages/frontend-2/pages/projects/[id]/models/[modelId]/index.vue index 4be8063fb..ba2b79703 100644 --- a/packages/frontend-2/pages/projects/[id]/models/[modelId]/index.vue +++ b/packages/frontend-2/pages/projects/[id]/models/[modelId]/index.vue @@ -26,8 +26,7 @@ definePageMeta({ middleware: ['require-valid-project'], pageTransition: false, // NOTE: transitions fuck viewer up layoutTransition: false, - key: '/projects/:id/models/resources', // To prevent controls flickering on resource url param changes - raygunTags: ['viewer'] + key: '/projects/:id/models/resources' // To prevent controls flickering on resource url param changes }) const ViewerScope = resolveComponent('ViewerScope') diff --git a/packages/frontend-2/plugins/002-rum.ts b/packages/frontend-2/plugins/002-rum.ts index 90c667382..490287ae6 100644 --- a/packages/frontend-2/plugins/002-rum.ts +++ b/packages/frontend-2/plugins/002-rum.ts @@ -1,4 +1,3 @@ -import { trimStart } from 'lodash-es' import { useGetInitialAuthState, useOnAuthStateChange @@ -11,74 +10,13 @@ import { isBrave, isSafari } from '@speckle/shared' type PluginNuxtApp = Parameters[0] -async function initRumClient(app: PluginNuxtApp) { - const { keys, baseUrl, speckleServerVersion } = resolveInitParams(app) +function initRumClient(app: PluginNuxtApp) { + const { keys } = resolveInitParams(app) const router = useRouter() const onAuthStateChange = useOnAuthStateChange() const registerErrorTransport = useCreateErrorLoggingTransport() const reqId = useRequestId() - // RayGun - const rg4js = window.rg4js - if (keys.raygun && rg4js) { - const setupTags = (extraTags: string[]) => { - rg4js('withTags', [ - `baseUrl:${baseUrl}`, - `version:${speckleServerVersion}`, - ...extraTags - ]) - } - - router.beforeEach((to, from) => { - // Update with tags - const newTags = (to.meta.raygunTags || []) as string[] - setupTags(newTags) - - if (!from?.path || from.path === to.path) return - - rg4js('trackEvent', { - type: 'pageView', - path: '/' + trimStart(to.path, '/') - }) - }) - - await onAuthStateChange( - (user, { resolveDistinctId }) => { - const distinctId = resolveDistinctId(user) - rg4js('setUser', { - identifier: distinctId || '', - isAnonymous: !distinctId - }) - }, - { immediate: true } - ) - - registerErrorTransport({ - onError: ({ args, firstError, firstString, otherData, nonObjectOtherData }) => { - const error = firstError || firstString || args[0] - rg4js('send', { - error, - customData: { - ...otherData, - extraData: nonObjectOtherData, - mainErrorMessage: firstString - } - }) - } - // Apparently unhandleds are auto-handled by raygun - // onUnhandledError: ({ isUnhandledRejection, error, message }) => { - // rg4js('send', { - // error: error || message, - // customData: { - // isUnhandledRejection, - // message, - // mainErrorMessage: message - // } - // }) - // } - }) - } - // Datadog const datadog = window.DD_RUM if (keys.datadog && datadog) { @@ -160,8 +98,7 @@ async function initRumClient(app: PluginNuxtApp) { } async function initRumServer(app: PluginNuxtApp) { - const registerErrorTransport = useCreateErrorLoggingTransport() - const { keys, baseUrl, speckleServerVersion, debug, debugCoreWebVitals } = + const { keys, baseUrl, speckleServerVersion, debugCoreWebVitals } = resolveInitParams(app) const initUser = useGetInitialAuthState() @@ -193,57 +130,6 @@ async function initRumServer(app: PluginNuxtApp) { }) } - // RayGun - if (keys.raygun) { - const raygun = (await import('raygun')).default - const raygunClient = new raygun.Client().init({ - apiKey: keys.raygun, - batch: true, - reportUncaughtExceptions: true - }) - - registerErrorTransport({ - onError: ({ firstError, firstString, otherData, nonObjectOtherData }) => { - const error = firstError || firstString || 'Unknown error' - raygunClient.send(error, { - ...otherData, - extraData: nonObjectOtherData, - mainErrorMessage: firstString - }) - } - }) - - // Add client-side snippet - app.hook('app:rendered', (context) => { - const initRaygunTags = app._route?.meta.raygunTags || [] - - context.ssrContext!.head.push({ - script: [ - { - innerHTML: `!function(a,b,c,d,e,f,g,h){a.RaygunObject=e,a[e]=a[e]||function(){ - (a[e].o=a[e].o||[]).push(arguments)},f=b.createElement(c),g=b.getElementsByTagName(c)[0], - f.async=1,f.src=d,g.parentNode.insertBefore(f,g),h=a.onerror,a.onerror=function(b,c,d,f,g){ - h&&h(b,c,d,f,g),g||(g=new Error(b)),a[e].q=a[e].q||[],a[e].q.push({ - e:g})}}(window,document,"script","//cdn.raygun.io/raygun4js/raygun.min.js","rg4js");` - }, - { - innerHTML: ` - rg4js('apiKey', '${keys.raygun}') - rg4js('enableCrashReporting', true) - rg4js('enablePulse', true) - rg4js('withTags', ['baseUrl:${baseUrl}', 'version:${speckleServerVersion}', ...${JSON.stringify( - initRaygunTags - )}]) - rg4js('options', { - debugMode: ${!!debug}, - }) - ` - } - ] - }) - }) - } - // Datadog if (keys.datadog) { const { @@ -330,7 +216,6 @@ async function initRumServer(app: PluginNuxtApp) { function resolveInitParams(app: PluginNuxtApp) { const { public: { - raygunKey, speckleServerVersion, logCsrEmitProps, baseUrl, @@ -343,7 +228,6 @@ function resolveInitParams(app: PluginNuxtApp) { } } = useRuntimeConfig() const logger = useLogger() - const raygun = raygunKey?.length ? raygunKey : null const datadog = datadogClientToken?.length && datadogAppId?.length && @@ -357,7 +241,6 @@ function resolveInitParams(app: PluginNuxtApp) { return { keys: { - raygun, datadog }, speckleServerVersion, @@ -372,6 +255,6 @@ export default defineNuxtPlugin(async (app) => { if (import.meta.server) { await initRumServer(app) } else { - await initRumClient(app) + initRumClient(app) } }) diff --git a/packages/frontend-2/type-augmentations/vue.d.ts b/packages/frontend-2/type-augmentations/vue.d.ts index 98d95e5f1..76c8d376f 100644 --- a/packages/frontend-2/type-augmentations/vue.d.ts +++ b/packages/frontend-2/type-augmentations/vue.d.ts @@ -1,9 +1,5 @@ declare module 'nuxt/dist/pages/runtime' { interface PageMeta { - /** - * Optional tags to be sent to Raygun - */ - raygunTags?: string[] /** * Optional view name to override the default one */ diff --git a/packages/frontend-2/type-augmentations/window.d.ts b/packages/frontend-2/type-augmentations/window.d.ts index c15521f1d..b35f7a450 100644 --- a/packages/frontend-2/type-augmentations/window.d.ts +++ b/packages/frontend-2/type-augmentations/window.d.ts @@ -1,6 +1,5 @@ declare global { interface Window { - rg4js?: import('raygun4js').RaygunV2 DD_RUM?: | Pick | import('@datadog/browser-rum').RumGlobal diff --git a/utils/helm/speckle-server/templates/frontend_2/deployment.yml b/utils/helm/speckle-server/templates/frontend_2/deployment.yml index 8150300c1..a0b398121 100644 --- a/utils/helm/speckle-server/templates/frontend_2/deployment.yml +++ b/utils/helm/speckle-server/templates/frontend_2/deployment.yml @@ -89,22 +89,6 @@ spec: secretKeyRef: name: {{ default .Values.secretName .Values.redis.connectionString.secretName }} key: {{ default "redis_url" .Values.redis.connectionString.secretKey }} - {{- if .Values.analytics.raygun_key }} - - name: NUXT_PUBLIC_RAYGUN_KEY - value: {{ .Values.analytics.raygun_key | quote }} - {{- end }} - {{- if .Values.analytics.logrocket_app_id }} - - name: NUXT_PUBLIC_LOGROCKET_APP_ID - value: {{ .Values.analytics.logrocket_app_id | quote }} - {{- end }} - {{- if .Values.analytics.speedcurve_id }} - - name: NUXT_PUBLIC_SPEEDCURVE_ID - value: {{ .Values.analytics.speedcurve_id | quote }} - {{- end }} - {{- if .Values.analytics.debugbear_id }} - - name: NUXT_PUBLIC_DEBUGBEAR_ID - value: {{ .Values.analytics.debugbear_id | quote }} - {{- end }} {{- if .Values.analytics.datadog_app_id }} - name: NUXT_PUBLIC_DATADOG_APP_ID value: {{ .Values.analytics.datadog_app_id | quote }} diff --git a/yarn.lock b/yarn.lock index f688fef97..4290cd08d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15190,7 +15190,6 @@ __metadata: "@types/mixpanel-browser": ^2.38.0 "@types/node": ^18.17.5 "@types/pino-http": ^5.8.1 - "@types/raygun4js": ^3.0.0 "@typescript-eslint/eslint-plugin": ^7.12.0 "@typescript-eslint/parser": ^7.12.0 "@vitejs/plugin-legacy": ^5.4.1 @@ -15228,7 +15227,6 @@ __metadata: postcss-html: ^1.5.0 postcss-nesting: ^10.2.0 prettier: ^2.7.1 - raygun: ^0.13.2 react: ^18.2.0 react-dom: ^18.2.0 rollup-plugin-node-builtins: ^2.1.2 @@ -17999,18 +17997,6 @@ __metadata: languageName: node linkType: hard -"@types/express-serve-static-core@npm:^4.17.33": - version: 4.17.43 - resolution: "@types/express-serve-static-core@npm:4.17.43" - dependencies: - "@types/node": "*" - "@types/qs": "*" - "@types/range-parser": "*" - "@types/send": "*" - checksum: 08e940cae52eb1388a7b5f61d65f028e783add77d1854243ae920a6a2dfb5febb6acaafbcf38be9d678b0411253b9bc325893c463a93302405f24135664ab1e4 - languageName: node - linkType: hard - "@types/express@npm:*, @types/express@npm:4.17.13, @types/express@npm:^4.17.13": version: 4.17.13 resolution: "@types/express@npm:4.17.13" @@ -18023,18 +18009,6 @@ __metadata: languageName: node linkType: hard -"@types/express@npm:^4.17.6": - version: 4.17.21 - resolution: "@types/express@npm:4.17.21" - dependencies: - "@types/body-parser": "*" - "@types/express-serve-static-core": ^4.17.33 - "@types/qs": "*" - "@types/serve-static": "*" - checksum: fb238298630370a7392c7abdc80f495ae6c716723e114705d7e3fb67e3850b3859bbfd29391463a3fb8c0b32051847935933d99e719c0478710f8098ee7091c5 - languageName: node - linkType: hard - "@types/express@npm:^4.7.0": version: 4.17.14 resolution: "@types/express@npm:4.17.14" @@ -18750,13 +18724,6 @@ __metadata: languageName: node linkType: hard -"@types/raygun4js@npm:^3.0.0": - version: 3.0.0 - resolution: "@types/raygun4js@npm:3.0.0" - checksum: abed23dc2a06e60b56e99a4538901e8ede496064eec273f17c68a3092fd8174a7b0853365c890647dacae3143429cbd0e962cc2c08482c694bdbac3fa2adc1cf - languageName: node - linkType: hard - "@types/react@file:./packages/frontend-2/type-augmentations/stubs/types__react::locator=root%40workspace%3A.": version: 0.0.0 resolution: "@types/react@file:./packages/frontend-2/type-augmentations/stubs/types__react#./packages/frontend-2/type-augmentations/stubs/types__react::hash=2ea486&locator=root%40workspace%3A." @@ -18828,16 +18795,6 @@ __metadata: languageName: node linkType: hard -"@types/send@npm:*": - version: 0.17.4 - resolution: "@types/send@npm:0.17.4" - dependencies: - "@types/mime": ^1 - "@types/node": "*" - checksum: cf4db48251bbb03cd6452b4de6e8e09e2d75390a92fd798eca4a803df06444adc94ed050246c94c7ed46fb97be1f63607f0e1f13c3ce83d71788b3e08640e5e0 - languageName: node - linkType: hard - "@types/serve-index@npm:^1.9.1": version: 1.9.1 resolution: "@types/serve-index@npm:1.9.1" @@ -39390,13 +39347,6 @@ __metadata: languageName: node linkType: hard -"object-to-human-string@npm:0.0.3": - version: 0.0.3 - resolution: "object-to-human-string@npm:0.0.3" - checksum: 0f3b9f1f43d6202cfe484e65c8bd6900daaa1e163602e8dc296981bbcc78c8d1203d512ed40013481baf3ad745b7d8dc505cab5be055c213185a446efa6d3479 - languageName: node - linkType: hard - "object.assign@npm:^4.1.0, object.assign@npm:^4.1.2": version: 4.1.2 resolution: "object.assign@npm:4.1.2" @@ -43054,19 +43004,6 @@ __metadata: languageName: node linkType: hard -"raygun@npm:^0.13.2": - version: 0.13.2 - resolution: "raygun@npm:0.13.2" - dependencies: - "@types/express": ^4.17.6 - debug: ^4.1.1 - object-to-human-string: 0.0.3 - stack-trace: 0.0.6 - uuid: ^7.0.3 - checksum: 044b7b566c22d3a5eba5fcf7a95a1c98cf8ecd8c50c0aa00bc30353e4f3e97e44cdd5664c6c1b739dd3bdcf3320fa83aef7e68e603a661134a191fd4d2c045ea - languageName: node - linkType: hard - "rc9@npm:^2.0.0": version: 2.0.0 resolution: "rc9@npm:2.0.0" @@ -45717,13 +45654,6 @@ __metadata: languageName: node linkType: hard -"stack-trace@npm:0.0.6": - version: 0.0.6 - resolution: "stack-trace@npm:0.0.6" - checksum: 761d19c468ecc460c8192b5dc96137dc97d7723ee700a40552dc974e7a4c92b5b4e56c4aa0d221e3203e1247daffb90c88a8f2ee5e25fcd108f5c2775329c52f - languageName: node - linkType: hard - "stack-utils@npm:^2.0.3": version: 2.0.5 resolution: "stack-utils@npm:2.0.5" @@ -49004,15 +48934,6 @@ __metadata: languageName: node linkType: hard -"uuid@npm:^7.0.3": - version: 7.0.3 - resolution: "uuid@npm:7.0.3" - bin: - uuid: dist/bin/uuid - checksum: f5b7b5cc28accac68d5c083fd51cca64896639ebd4cca88c6cfb363801aaa83aa439c86dfc8446ea250a7a98d17afd2ad9e88d9d4958c79a412eccb93bae29de - languageName: node - linkType: hard - "uuid@npm:^9.0.0": version: 9.0.0 resolution: "uuid@npm:9.0.0"