fix(sentry): drop operator-input/config noise events (#3034) - #3158
Merged
Conversation
- 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]>
|
There was a problem hiding this comment.
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.DisallowedHostvia Sentry’s logging integration ignore list. - Add a regression unit test asserting the
DisallowedHostlogger is ignored. - Downgrade two basic-auth migration log lines from
logging.errortologging.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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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:DisallowedHost) — internet background-scanners hit an exposed device with a bogus/spoofed Host header. Django rejects with a 400 and logs todjango.security.DisallowedHostat ERROR, which the logging integration turns into an event.ignore_logger('django.security.DisallowedHost'), mirroring the existing celery ignores.0005's fail-openauth_basicconfig warnings ("credentials missing", "insecure password hash … clearing credentials") werelogging.error→ events. Downgraded tologging.warning; the device recovers on its own and the message already tells the operator how to re-set the password.DisallowedHostlogger is ignored.ANTHIAS-1P / 1R / 1X (
AuthSettingsErrorfrom settings-save) were already downgraded towarningand backstopped inbefore_sendby 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
🤖 Generated with Claude Code