From 1a052913e92f2c4520d56a62b1525a1cef0c97bb Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 27 Feb 2021 17:18:42 +0100 Subject: [PATCH] web: add sentry CaptureConsole --- web/package-lock.json | 39 +++++++++++++++++++++++++++++++++++++++ web/package.json | 1 + web/src/api/Config.ts | 6 +++++- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/web/package-lock.json b/web/package-lock.json index 23e66a4ea..1d2243f38 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -197,6 +197,24 @@ } } }, + "@sentry/integrations": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-6.2.0.tgz", + "integrity": "sha512-gvAhP61qs2fog2xCTDs94ZT8cZbWEjFZmOWfT1VXlZDIVopIporj5Qe6IgrLTiCWL61Yko5h5nFnPZ4mpjf+0w==", + "requires": { + "@sentry/types": "6.2.0", + "@sentry/utils": "6.2.0", + "localforage": "^1.8.1", + "tslib": "^1.9.3" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, "@sentry/minimal": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.2.0.tgz", @@ -1722,6 +1740,11 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" + }, "import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -1976,6 +1999,14 @@ "type-check": "~0.4.0" } }, + "lie": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", + "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "requires": { + "immediate": "~3.0.5" + } + }, "lit-analyzer": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/lit-analyzer/-/lit-analyzer-1.2.1.tgz", @@ -2157,6 +2188,14 @@ "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-1.3.0.tgz", "integrity": "sha512-0Q1bwmaFH9O14vycPHw8C/IeHMk/uSDldVLIefu/kfbTBGIc44KGH6A8p1bDfxUfHdc8q6Ct7kQklWoHgr4t1Q==" }, + "localforage": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.9.0.tgz", + "integrity": "sha512-rR1oyNrKulpe+VM9cYmcFn6tsHuokyVHFaCM3+osEmxaHTbEk8oQu6eGDfS6DQLWi/N67XRmB8ECG37OES368g==", + "requires": { + "lie": "3.1.1" + } + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", diff --git a/web/package.json b/web/package.json index f9c5160a1..344d6ac8a 100644 --- a/web/package.json +++ b/web/package.json @@ -13,6 +13,7 @@ "@fortawesome/fontawesome-free": "^5.15.2", "@patternfly/patternfly": "^4.87.3", "@sentry/browser": "^6.2.0", + "@sentry/integrations": "^6.2.0", "@sentry/tracing": "^6.2.0", "@types/chart.js": "^2.9.31", "@types/codemirror": "0.0.108", diff --git a/web/src/api/Config.ts b/web/src/api/Config.ts index 7e28086a5..c5066ed7e 100644 --- a/web/src/api/Config.ts +++ b/web/src/api/Config.ts @@ -3,6 +3,7 @@ import * as Sentry from "@sentry/browser"; import { Integrations } from "@sentry/tracing"; import { VERSION } from "../constants"; import { SentryIgnoredError } from "../common/errors"; +import { CaptureConsole as CaptureConsoleIntegration } from "@sentry/integrations"; export class Config { branding_logo: string; @@ -22,7 +23,10 @@ export class Config { Sentry.init({ dsn: "https://a579bb09306d4f8b8d8847c052d3a1d3@sentry.beryju.org/8", release: `authentik@${VERSION}`, - integrations: [new Integrations.BrowserTracing()], + integrations: [ + new Integrations.BrowserTracing(), + new CaptureConsoleIntegration(), + ], tracesSampleRate: 0.6, environment: config.error_reporting_environment, beforeSend(event: Sentry.Event, hint: Sentry.EventHint) {