From b3a198cae64b422706d3fc7d1049bb2cb0b79f29 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 8 Jan 2021 21:43:56 +0900 Subject: Sentry integration --- src/client/init.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/client/init.ts') diff --git a/src/client/init.ts b/src/client/init.ts index 7c3df68c34..f39f50eea6 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -36,13 +36,15 @@ if (localStorage.getItem('vuex') != null) { location.reload(); } +import * as Sentry from '@sentry/browser'; +import { Integrations } from '@sentry/tracing'; import { createApp, watch } from 'vue'; import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; import widgets from '@/widgets'; import directives from '@/directives'; import components from '@/components'; -import { version, ui, lang } from '@/config'; +import { version, ui, lang, host } from '@/config'; import { router } from '@/router'; import { applyTheme } from '@/scripts/theme'; import { isDeviceDarkmode } from '@/scripts/is-device-darkmode'; @@ -88,6 +90,18 @@ if (_DEV_) { }); } +if (defaultStore.state.reportError && !_DEV_) { + Sentry.init({ + dsn: 'https://fd273254a07a4b61857607a9ea05d629@o501808.ingest.sentry.io/5583438', + tracesSampleRate: 1.0, + }); + + Sentry.setTag('misskey_version', version); + Sentry.setTag('ui', ui); + Sentry.setTag('lang', lang); + Sentry.setTag('host', host); +} + // タッチデバイスでCSSの:hoverを機能させる document.addEventListener('touchend', () => {}, { passive: true }); -- cgit v1.2.3-freya