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 {
124124 startSession ,
125125 startSpan ,
126126 startSpanManual ,
127+ systemErrorIntegration ,
127128 tediousIntegration ,
128129 trpcMiddleware ,
129130 updateSpanName ,
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ export {
114114 spanToJSON ,
115115 spanToTraceHeader ,
116116 spanToBaggageHeader ,
117+ systemErrorIntegration ,
117118 trpcMiddleware ,
118119 updateSpanName ,
119120 supabaseIntegration ,
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ export {
115115 trpcMiddleware ,
116116 updateSpanName ,
117117 supabaseIntegration ,
118+ systemErrorIntegration ,
118119 instrumentSupabaseClient ,
119120 zodErrorsIntegration ,
120121 profiler ,
Original file line number Diff line number Diff line change 1+ import { getSystemErrorMap } from 'node:util' ;
12import { defineIntegration } from '@sentry/core' ;
2- import { getSystemErrorMap } from 'util' ;
33
44const INTEGRATION_NAME = 'NodeSystemError' ;
55
@@ -25,10 +25,17 @@ function isSystemError(error: unknown): error is SystemError {
2525 return getSystemErrorMap ( ) . has ( error . errno ) ;
2626}
2727
28+ type Options = {
29+ /**
30+ * If true, includes the `path` and `dest` properties in the error context.
31+ */
32+ includePaths ?: boolean ;
33+ }
34+
2835/**
2936 * Captures context for Node.js SystemError errors.
3037 */
31- export const systemErrorIntegration = defineIntegration ( ( ) => {
38+ export const systemErrorIntegration = defineIntegration ( ( options : Options = { } ) => {
3239 return {
3340 name : INTEGRATION_NAME ,
3441 processEvent : ( event , hint , client ) => {
@@ -42,7 +49,7 @@ export const systemErrorIntegration = defineIntegration(() => {
4249 ...error ,
4350 } ;
4451
45- if ( ! client . getOptions ( ) . sendDefaultPii ) {
52+ if ( ! client . getOptions ( ) . sendDefaultPii && options . includePaths !== true ) {
4653 delete errorContext . path ;
4754 delete errorContext . dest ;
4855 }
Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ export {
165165 childProcessIntegration ,
166166 createSentryWinstonTransport ,
167167 SentryContextManager ,
168+ systemErrorIntegration ,
168169 generateInstrumentOnce ,
169170 getSentryRelease ,
170171 defaultStackParser ,
Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ export {
113113 startSession ,
114114 startSpan ,
115115 startSpanManual ,
116+ systemErrorIntegration ,
116117 tediousIntegration ,
117118 trpcMiddleware ,
118119 updateSpanName ,
You can’t perform that action at this time.
0 commit comments