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 1
1
import * as path from 'path' ;
2
+ import { randomUUID } from 'crypto' ;
2
3
import * as child_process from 'child_process' ;
3
4
import * as Sentry from '@sentry/node' ;
4
5
import { RewriteFrames } from '@sentry/integrations' ;
@@ -86,6 +87,14 @@ export function initErrorTracking() {
86
87
scope . setTag ( 'platform' , process . platform ) ;
87
88
} ) ;
88
89
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
+
89
98
// Include breadcrumbs for subprocess spawning, to trace interceptor startup details:
90
99
const rawSpawn = child_process . spawn ;
91
100
( 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