Sentry: add Soapbox context
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import sourceCode from 'soapbox/utils/code';
|
||||
|
||||
import type { Account } from './schemas';
|
||||
|
||||
/** Start Sentry. */
|
||||
@ -36,6 +38,8 @@ async function startSentry(dsn: string): Promise<void> {
|
||||
// for finer control
|
||||
tracesSampleRate: 1.0,
|
||||
});
|
||||
|
||||
Sentry.setContext('soapbox', sourceCode);
|
||||
}
|
||||
|
||||
/** Associate the account with Sentry events. */
|
||||
@ -45,6 +49,7 @@ async function setSentryAccount(account: Account) {
|
||||
Sentry.setUser({
|
||||
id: account.id,
|
||||
username: account.acct,
|
||||
url: account.url,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user