Skip to content

Sentry reports handled errors in Fastify integration #13197

Closed
@tmcw

Description

@tmcw

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

8.0.0

Framework Version

4.28.1

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

This has already been reported in #12055 but the auto-closer closed it and I can't reopen it, so I'm reporting it again.

Using Sentry.setupFastifyErrorHandler(app) for Fastify leads to Sentry reporting errors for issues that aren't issues: 400s for failed validation, 404s, etc, etc. Lots of errors, lots of noise, all of it not the kind of internal server errors that we want Sentry to track.

A good default might be what the immobiliare 3rd party Sentry plugin has been doing, which is to only track errors with status codes >= 500.

Expected Result

Sentry shouldn't track errors with status < 500 because they are expected.

Actual Result

it tracks all responses with status >= 400

Metadata

Metadata

Assignees

Labels

Integration: fastifyIssues related to Fastify support for the Sentry Node SDKPackage: nodeIssues related to the Sentry Node SDK

Type

Projects

  • Status

    No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions