File tree Expand file tree Collapse file tree 6 files changed +15
-3
lines changed
google-cloud-serverless/src
node-core/src/integrations Expand file tree Collapse file tree 6 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ export {
124
124
startSession ,
125
125
startSpan ,
126
126
startSpanManual ,
127
+ systemErrorIntegration ,
127
128
tediousIntegration ,
128
129
trpcMiddleware ,
129
130
updateSpanName ,
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ export {
114
114
spanToJSON ,
115
115
spanToTraceHeader ,
116
116
spanToBaggageHeader ,
117
+ systemErrorIntegration ,
117
118
trpcMiddleware ,
118
119
updateSpanName ,
119
120
supabaseIntegration ,
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ export {
115
115
trpcMiddleware ,
116
116
updateSpanName ,
117
117
supabaseIntegration ,
118
+ systemErrorIntegration ,
118
119
instrumentSupabaseClient ,
119
120
zodErrorsIntegration ,
120
121
profiler ,
Original file line number Diff line number Diff line change
1
+ import { getSystemErrorMap } from 'node:util' ;
1
2
import { defineIntegration } from '@sentry/core' ;
2
- import { getSystemErrorMap } from 'util' ;
3
3
4
4
const INTEGRATION_NAME = 'NodeSystemError' ;
5
5
@@ -25,10 +25,17 @@ function isSystemError(error: unknown): error is SystemError {
25
25
return getSystemErrorMap ( ) . has ( error . errno ) ;
26
26
}
27
27
28
+ type Options = {
29
+ /**
30
+ * If true, includes the `path` and `dest` properties in the error context.
31
+ */
32
+ includePaths ?: boolean ;
33
+ }
34
+
28
35
/**
29
36
* Captures context for Node.js SystemError errors.
30
37
*/
31
- export const systemErrorIntegration = defineIntegration ( ( ) => {
38
+ export const systemErrorIntegration = defineIntegration ( ( options : Options = { } ) => {
32
39
return {
33
40
name : INTEGRATION_NAME ,
34
41
processEvent : ( event , hint , client ) => {
@@ -42,7 +49,7 @@ export const systemErrorIntegration = defineIntegration(() => {
42
49
...error ,
43
50
} ;
44
51
45
- if ( ! client . getOptions ( ) . sendDefaultPii ) {
52
+ if ( ! client . getOptions ( ) . sendDefaultPii && options . includePaths !== true ) {
46
53
delete errorContext . path ;
47
54
delete errorContext . dest ;
48
55
}
Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ export {
165
165
childProcessIntegration ,
166
166
createSentryWinstonTransport ,
167
167
SentryContextManager ,
168
+ systemErrorIntegration ,
168
169
generateInstrumentOnce ,
169
170
getSentryRelease ,
170
171
defaultStackParser ,
Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ export {
113
113
startSession ,
114
114
startSpan ,
115
115
startSpanManual ,
116
+ systemErrorIntegration ,
116
117
tediousIntegration ,
117
118
trpcMiddleware ,
118
119
updateSpanName ,
You can’t perform that action at this time.
0 commit comments