Skip to content

fix(sentry): drop operator-input/config noise events (#3034) - #3158

Merged
vpetersson merged 1 commit into
masterfrom
fix/sentry-noise-config-input-3034
Jul 8, 2026
Merged

fix(sentry): drop operator-input/config noise events (#3034)#3158
vpetersson merged 1 commit into
masterfrom
fix/sentry-noise-config-input-3034

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Issues Fixed

Fixes #3034 — a cluster of post-deploy Sentry events that are operator-input / operator-config conditions logged at error level, not bugs.

Description

Same noise class already filtered for redis / CancelledError / GitHub / yt-dlp:

  • ANTHIAS-2A (DisallowedHost) — internet background-scanners hit an exposed device with a bogus/spoofed Host header. Django rejects with a 400 and logs to django.security.DisallowedHost at ERROR, which the logging integration turns into an event. ignore_logger('django.security.DisallowedHost'), mirroring the existing celery ignores.
  • ANTHIAS-1S / 1Z — migration 0005's fail-open auth_basic config warnings ("credentials missing", "insecure password hash … clearing credentials") were logging.error → events. Downgraded to logging.warning; the device recovers on its own and the message already tells the operator how to re-set the password.
  • Added a regression test asserting the DisallowedHost logger is ignored.

ANTHIAS-1P / 1R / 1X (AuthSettingsError from settings-save) were already downgraded to warning and backstopped in before_send by an earlier fix, so no change needed there.

This only affects what reaches Sentry — no device-visible runtime behavior — so the E2E boxes below are not applicable.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

🤖 Generated with Claude Code

- ignore django.security.DisallowedHost logger (scanner Host-header
  noise on internet-exposed devices) — ANTHIAS-2A
- downgrade migration 0005 auth_basic config warnings from error to
  warning so they no longer become Sentry events — ANTHIAS-1S/1Z
- add regression test asserting the DisallowedHost logger is ignored

AuthSettingsError logging (ANTHIAS-1P/1R/1X) was already downgraded and
backstopped in before_send by #3068.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vpetersson
vpetersson requested a review from a team as a code owner July 8, 2026 13:43
@vpetersson vpetersson self-assigned this Jul 8, 2026
@vpetersson
vpetersson requested a review from Copilot July 8, 2026 13:43
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request reduces non-actionable Sentry event noise by (1) ignoring Django’s DisallowedHost logger events caused by hostile/invalid Host headers and (2) downgrading operator-config “fail open” migration messages from ERROR to WARNING so they don’t become Sentry events.

Changes:

  • Ignore django.security.DisallowedHost via Sentry’s logging integration ignore list.
  • Add a regression unit test asserting the DisallowedHost logger is ignored.
  • Downgrade two basic-auth migration log lines from logging.error to logging.warning.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/test_sentry.py Adds a regression test validating django.security.DisallowedHost is included in Sentry’s ignored loggers.
src/anthias_server/django_project/settings.py Adds ignore_logger('django.security.DisallowedHost') with rationale alongside existing ignored noisy loggers.
src/anthias_server/app/migrations/0005_migrate_basic_auth_to_user.py Downgrades operator-config migration messages from error → warning to avoid generating Sentry events.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vpetersson
vpetersson merged commit 62d4e8d into master Jul 8, 2026
10 checks passed
@vpetersson
vpetersson deleted the fix/sentry-noise-config-input-3034 branch July 8, 2026 13:53
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.

Sentry noise: user/operator-input validation logged as errors (ANTHIAS-1P/1R/1X/1S/1Z/2A)

2 participants