File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 11import * as path from 'path' ;
2+ import { randomUUID } from 'crypto' ;
23import * as child_process from 'child_process' ;
34import * as Sentry from '@sentry/node' ;
45import { RewriteFrames } from '@sentry/integrations' ;
@@ -86,6 +87,14 @@ export function initErrorTracking() {
8687 scope . setTag ( 'platform' , process . platform ) ;
8788 } ) ;
8889
90+ Sentry . configureScope ( ( scope ) => {
91+ // We use a random id to distinguish between many errors in one session vs
92+ // one error in many sessions. This isn't persisted and can't be used to
93+ // identify anybody between sessions.
94+ const randomId = randomUUID ( ) ;
95+ scope . setUser ( { id : randomId , username : `anon-${ randomId } ` } ) ;
96+ } ) ;
97+
8998 // Include breadcrumbs for subprocess spawning, to trace interceptor startup details:
9099 const rawSpawn = child_process . spawn ;
91100 ( child_process as any ) . spawn = function ( command : any , args ?: any , options ?: { [ key : string ] : string } ) {
You can’t perform that action at this time.
0 commit comments