Skip to content

docs(node): Add docs for maxIncomingRequestBodySize and ignoreIncomingRequestBody #13698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Member

@Lms24 Lms24 May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just noticed this:

image

Probably an issue on its own, so feel free to leave as-is for this PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created a PR: #13769

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thanks for doing this!

Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,32 @@ _Type: `boolean`_

If set to false, no breadcrumbs will be captured.

### `maxIncomingRequestBodySize`

_Type: `'none' | 'small' | 'medium' | 'always'`_ (Defaults to `'medium'`)

Controls the maximum size of incoming HTTP request bodies attached to events.

Available options:
- 'none': No request bodies will be attached
- 'small': Request bodies up to 1,000 bytes will be attached
- 'medium': Request bodies up to 10,000 bytes will be attached (default)
- 'always': Request bodies will always be attached

Note that even with the `'always'` setting, bodies exceeding 1 MB will never be attached for performance and security reasons.

### `ignoreIncomingRequestBody`

_Type: `(url: string, request: RequestOptions) => boolean`_

Allows you to ignore the request body for incoming HTTP requests to URLs where the given callback returns `true`.
This can be useful for long running requests where the body is not needed and we want to avoid capturing it.

The callback function receives two arguments:

- `url`: The full URL of the incoming request, including the protocol, host, port, path and query string. For example: `https://example.com/users?name=John`.
- `request`: An object of type `RequestOptions` containing the incoming request's options. You can use this to filter on properties like the request method or headers.

### `ignoreOutgoingRequests`

_Type: `(url: string, request: RequestOptions) => boolean`_
Expand Down