web: add sentry CaptureConsole

This commit is contained in:
Jens Langhammer 2021-02-27 17:18:42 +01:00
parent e930a1d0dc
commit 1a052913e9
3 changed files with 45 additions and 1 deletions

39
web/package-lock.json generated
View File

@ -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": { "@sentry/minimal": {
"version": "6.2.0", "version": "6.2.0",
"resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.2.0.tgz", "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", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz",
"integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" "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": { "import-fresh": {
"version": "3.3.0", "version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
@ -1976,6 +1999,14 @@
"type-check": "~0.4.0" "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": { "lit-analyzer": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/lit-analyzer/-/lit-analyzer-1.2.1.tgz", "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", "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-1.3.0.tgz",
"integrity": "sha512-0Q1bwmaFH9O14vycPHw8C/IeHMk/uSDldVLIefu/kfbTBGIc44KGH6A8p1bDfxUfHdc8q6Ct7kQklWoHgr4t1Q==" "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": { "locate-path": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",

View File

@ -13,6 +13,7 @@
"@fortawesome/fontawesome-free": "^5.15.2", "@fortawesome/fontawesome-free": "^5.15.2",
"@patternfly/patternfly": "^4.87.3", "@patternfly/patternfly": "^4.87.3",
"@sentry/browser": "^6.2.0", "@sentry/browser": "^6.2.0",
"@sentry/integrations": "^6.2.0",
"@sentry/tracing": "^6.2.0", "@sentry/tracing": "^6.2.0",
"@types/chart.js": "^2.9.31", "@types/chart.js": "^2.9.31",
"@types/codemirror": "0.0.108", "@types/codemirror": "0.0.108",

View File

@ -3,6 +3,7 @@ import * as Sentry from "@sentry/browser";
import { Integrations } from "@sentry/tracing"; import { Integrations } from "@sentry/tracing";
import { VERSION } from "../constants"; import { VERSION } from "../constants";
import { SentryIgnoredError } from "../common/errors"; import { SentryIgnoredError } from "../common/errors";
import { CaptureConsole as CaptureConsoleIntegration } from "@sentry/integrations";
export class Config { export class Config {
branding_logo: string; branding_logo: string;
@ -22,7 +23,10 @@ export class Config {
Sentry.init({ Sentry.init({
dsn: "https://a579bb09306d4f8b8d8847c052d3a1d3@sentry.beryju.org/8", dsn: "https://a579bb09306d4f8b8d8847c052d3a1d3@sentry.beryju.org/8",
release: `authentik@${VERSION}`, release: `authentik@${VERSION}`,
integrations: [new Integrations.BrowserTracing()], integrations: [
new Integrations.BrowserTracing(),
new CaptureConsoleIntegration(),
],
tracesSampleRate: 0.6, tracesSampleRate: 0.6,
environment: config.error_reporting_environment, environment: config.error_reporting_environment,
beforeSend(event: Sentry.Event, hint: Sentry.EventHint) { beforeSend(event: Sentry.Event, hint: Sentry.EventHint) {