Skip to content

Commit ee9e964

Browse files
committed
add warning
1 parent a76e1de commit ee9e964

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/node/src/integrations/http/SentryHttpInstrumentation.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ type SentryHttpInstrumentationOptions = InstrumentationConfig & {
4141
ignoreOutgoingRequests?: (url: string, request: RequestOptions) => boolean;
4242
};
4343

44-
// We only want to capture request bodies up to 500kb.
45-
const MAX_BODY_BYTE_LENGTH = 1024 * 500;
44+
// We only want to capture request bodies up to 1mb.
45+
const MAX_BODY_BYTE_LENGTH = 1024 * 1024;
4646

4747
/**
4848
* This custom HTTP instrumentation is used to isolate incoming requests and annotate them with additional information.
@@ -375,6 +375,10 @@ function patchRequestToCaptureBody(req: IncomingMessage, normalizedRequest: Requ
375375
if (getChunksSize() < MAX_BODY_BYTE_LENGTH) {
376376
const chunk = args[0] as Buffer;
377377
chunks.push(chunk);
378+
} else if (DEBUG_BUILD) {
379+
logger.log(
380+
`Dropping request body chunk because it maximum body length of ${MAX_BODY_BYTE_LENGTH}b is exceeded.`,
381+
);
378382
}
379383

380384
return Reflect.apply(target, thisArg, args);

0 commit comments

Comments
 (0)