Skip to content

Koa request body is not captured for events

Description

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

@sentry/node ^8.5.0

Framework Version

koa ^2.15.2

Link to Sentry event

No response

Reproduction Example/SDK Setup

This is my config:

init({
    dsn: '',
    tracesSampleRate: 0.1,
    profilesSampleRate: 1.0,
    normalizeDepth: 11,
    integrations: [nodeProfilingIntegration],
    environment: EnvVariablesUtility.NODE_ENV,
    enabled: EnvVariablesUtility.NODE_ENV !== 'local',
    beforeSend(event, hint) {
        const error = hint.originalException;

        if (isHttpError(error) && error.expose) {
            return null;
        }

        return event;
    },
});

Steps to Reproduce

The RequestData integration is a default integration and according to the doc, the request data should be included by default, however, it is not.

The issue page shows the curl request without the request data:

curl \
 -X POST \
 --compressed \
 -H "Accept: application/json, text/plain, */*" \
 -H "Accept-Encoding: gzip, br" \
 -H "Accept-Language: en-US,en;q=0.9" \
 ...
 "{the_url}"

Expected Result

The issue page shows the request body

Actual Result

The issue page doesn't show the request body

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Package: nodeIssues related to the Sentry Node SDKIssues related to the Sentry Node SDK

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions