Skip to content

Fix Sentry filtering for log-based configuration errors#152

Merged
vpetersson merged 1 commit intomasterfrom
fix-sentry-log-filtering
Jan 28, 2026
Merged

Fix Sentry filtering for log-based configuration errors#152
vpetersson merged 1 commit intomasterfrom
fix-sentry-log-filtering

Conversation

@vpetersson
Copy link
Contributor

Summary

  • Extends the before_send Sentry filter to also filter log-based events
  • Configuration errors logged via logger.error() were bypassing the exception filter since they come through the logging integration (no exc_info)
  • Now filters any log event where the message starts with "Configuration error:"

Test plan

  • Added test test_sentry_filters_configuration_error_log_messages covering both message and logentry.formatted formats
  • All existing Sentry filtering tests pass
  • Run uv run pytest tests/test_sentry_filtering.py -v

🤖 Generated with Claude Code

The before_send filter was only filtering exceptions (checking for exc_info),
but configuration errors logged via logger.error() bypass exception filtering
since they come through the logging integration. Now also filters log events
where the message starts with "Configuration error:".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vpetersson vpetersson merged commit 7487c42 into master Jan 28, 2026
11 checks passed
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.

1 participant