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

Nestjs integration reports 404 errors to sentry #12523

Closed
3 tasks done
Tracked by #11720
strongpauly opened this issue Jun 18, 2024 · 1 comment · Fixed by #12695
Closed
3 tasks done
Tracked by #11720

Nestjs integration reports 404 errors to sentry #12523

strongpauly opened this issue Jun 18, 2024 · 1 comment · Fixed by #12695
Assignees
Labels
Package: node Issues related to the Sentry Node SDK Type: Bug

Comments

@strongpauly
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

8.9.2

Framework Version

No response

Link to Sentry event

https://zero1.sentry.io/issues/5500224353/events/?alert_rule_id=11637924&alert_type=issue&notification_uuid=5695e46f-daeb-45f7-b17a-c7b757adad3c&project=6391861&referrer=slack

SDK Setup

Sentry.init({
        dsn: dsn,
        attachStacktrace: true,
        release: release,
        environment: enviroment,
        serverName: serverName
})

Steps to Reproduce

  1. Bootstrap app as described in the documentation:
async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  const { httpAdapter } = app.get(HttpAdapterHost);

  Sentry.setupNestErrorHandler(app, new BaseExceptionFilter(httpAdapter));

  await app.listen(3000);
}
  1. Send a request to the server which results in a NotFoundException or 404

Expected Result

Server should respond with a 404 error and this error should not be sent to Sentry as its expected behaviour.

Actual Result

Event is reported and devs get a notification causing noise.

@mydea
Copy link
Member

mydea commented Jun 18, 2024

Hey, thanks for reporting this. We should ignore 4xx errors by default, you are right! We'll look into this. For now, you can filter them via the SDk, using beforeSend or ignore errors - see https://docs.sentry.io/platforms/javascript/guides/nestjs/configuration/filtering/

@strongpauly strongpauly changed the title Nestjs integration reports 404 errors to sentry with no way of filtering them Nestjs integration reports 404 errors to sentry Jun 18, 2024
@nicohrubec nicohrubec self-assigned this Jul 1, 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 Type: Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants