Skip to content

Conversation

@tomaj
Copy link

@tomaj tomaj commented Jan 29, 2026

Summary

This PR adds a new ignore_exceptions configuration option that allows filtering out specific exception types from being sent to Sentry while still logging them locally via Tracy.

Motivation

In production environments with background workers (e.g., Hermes message queue workers), graceful shutdown is triggered via SIGTERM signal during deployments. This causes ShutdownException to be thrown as part of the normal shutdown process. However, these exceptions were being logged to Sentry, creating noise in error monitoring and making it harder to identify actual issues.

Changes

  • Added ignore_exceptions config option to SentryExtension
  • Added setIgnoredExceptions() method to SentryLogger
  • Added filtering logic in log() method to skip sending ignored exceptions to Sentry
  • Updated README with documentation and examples

Usage

sentry:
    ignore_exceptions:
        - Tomaj\Hermes\Shutdown\ShutdownException
        - App\MyCustomException

Ignored exceptions will still be logged to Tracy's local log files but won't be sent to Sentry.

Benefits

  • Reduces noise in Sentry error monitoring
  • Improves signal-to-noise ratio for actual errors
  • Allows graceful handling of expected exceptions like shutdown signals
  • Maintains local Tracy logs for debugging purposes

tomaj added 2 commits January 29, 2026 13:39
This change adds a new 'ignore_exceptions' configuration option that allows
filtering out specific exception types from being sent to Sentry while still
logging them locally via Tracy.

Use case:
In production environments with background workers (e.g., Hermes message queue
workers), graceful shutdown is triggered via SIGTERM signal during deployments.
This causes ShutdownException to be thrown, which is normal and expected
behavior. However, these exceptions were being logged to Sentry, creating
noise in error monitoring.

With this change, you can configure exceptions to ignore:

sentry:
    ignore_exceptions:
        - Tomaj\Hermes\Shutdown\ShutdownException

Ignored exceptions are still logged to Tracy's local log files but won't
be sent to Sentry, reducing noise and improving signal-to-noise ratio in
error monitoring.
- Suppress deprecation warning from ninjify/nunjuck using @ operator
  (nunjify/nunjuck uses deprecated lcg_value() function in PHP 8.4+)

- Fix ApplicationMonitor hook to check if application.application
  service exists before trying to access it (fixes tests that don't
  register application service)
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