Skip to content
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

Koa request body is not captured for events #13722

Open
3 tasks done
maximedupre opened this issue Sep 18, 2024 · 3 comments · May be fixed by #13746
Open
3 tasks done

Koa request body is not captured for events #13722

maximedupre opened this issue Sep 18, 2024 · 3 comments · May be fixed by #13746
Assignees
Labels
Package: node Issues related to the Sentry Node SDK

Comments

@maximedupre
Copy link

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

@github-actions github-actions bot added the Package: node Issues related to the Sentry Node SDK label Sep 18, 2024
@andreiborza
Copy link
Member

Hi @maximedupre, thanks for writing in.

Are you using @koa/bodyparser? Could you please provide a reproduction repo or stackblitz so we can further investigate?

From my testing, even with the body parser the request passed to the integration doesn't contain the body already 🤔.

@mydea mydea self-assigned this Sep 19, 2024
@maximedupre
Copy link
Author

Hi @andreiborza,

I'm actually using koa-better-body.

I don't have time to create a repro right now, but when I do I'll be sure to post it here.

Thanks

@andreiborza
Copy link
Member

@maximedupre thanks, don't bother with the reproduction we identified the issue. Thanks again for reporting this.

@mydea mydea changed the title The request body isn't displayed on the Sentry issue page Koa request body is not captured for events Sep 23, 2024
@lforst lforst assigned lforst and AbhiPrasad and unassigned lforst Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: node Issues related to the Sentry Node SDK
Projects
Status: No status
5 participants