Skip to content

fix(server): Prevent 404s from flooding Sentry - #56

Open
sentry[bot] wants to merge 1 commit into
devfrom
seer/fix/sentry-404-noise-r6JijG
Open

fix(server): Prevent 404s from flooding Sentry#56
sentry[bot] wants to merge 1 commit into
devfrom
seer/fix/sentry-404-noise-r6JijG

Conversation

@sentry

@sentry sentry Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

The starlette_http_error_handler was configured to capture all 4xx HTTP errors, including 404 Not Found responses. This led to Sentry being flooded with 'Invalid API request' warnings from bots and health-checkers probing non-existent routes like /health.

This change modifies the starlette_http_error_handler to explicitly exclude 404 status codes from being captured by capture_invalid_request. This ensures that only actionable client errors (400-403, 405-499) are reported to Sentry, reducing noise while maintaining error visibility for legitimate issues. App-level 404s (e.g., JobNotFoundError) are handled separately and remain unaffected.

Fixes NURSE-SCHEDULING-3M

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.65%. Comparing base (1c60cc8) to head (03c33f5).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##              dev      #56   +/-   ##
=======================================
  Coverage   92.65%   92.65%           
=======================================
  Files         100      100           
  Lines        8250     8250           
  Branches      705      705           
=======================================
  Hits         7644     7644           
  Misses        460      460           
  Partials      146      146           
Flag Coverage Δ
core 94.15% <100.00%> (ø)
core-macos 94.17% <100.00%> (ø)
core-windows 94.15% <100.00%> (ø)
web-frontend 88.84% <ø> (ø)
web-frontend-macos 88.84% <ø> (ø)
web-frontend-windows 88.84% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
core/nurse_scheduling/server/app.py 91.33% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants