Add (opt-outable) Sentry error tracking telemetry

This commit is contained in:
Max Goodhart
2020-10-10 16:28:08 -07:00
parent 4ee2f3ad2a
commit eeadb061bb
3 changed files with 143 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import yargs from 'yargs'
import TOML from '@iarna/toml'
import * as Y from 'yjs'
import { Repeater } from '@repeaterjs/repeater'
import * as Sentry from '@sentry/electron'
import { app, shell, session, BrowserWindow } from 'electron'
import { ensureValidURL } from '../util'
@@ -21,6 +22,9 @@ import TwitchBot from './TwitchBot'
import StreamdelayClient from './StreamdelayClient'
import initWebServer from './server'
const SENTRY_DSN =
'https://e630a21dcf854d1a9eb2a7a8584cbd0b@o459879.ingest.sentry.io/5459505'
function parseArgs() {
return yargs
.config('config', (configPath) => {
@@ -186,6 +190,12 @@ function parseArgs() {
describe: 'Streamdelay API key',
default: null,
})
.group(['telemetry.sentry'], 'Telemetry')
.option('telemetry.sentry', {
describe: 'Enable error reporting to Sentry',
boolean: true,
default: true,
})
.help().argv
}
@@ -195,6 +205,10 @@ async function main() {
return
}
if (argv.telemetry.sentry) {
Sentry.init({ dsn: SENTRY_DSN })
}
// Reject all permission requests from web content.
session
.fromPartition('persist:session')