Skip to content

Conversation

@JoJoPuppe
Copy link

@JoJoPuppe JoJoPuppe commented Mar 4, 2025

Sentry-sdk library can replace the deprecated raven library.

There is the option to use a Flask Integration or use the WSGI Integration.

The WSGI Integration is less intrusive.

To provide the necessary filtering a callback function can be declared that receives the exception event before it gets send to Sentry. here we can filter over a list of exception names that should be ignored.

env vars that should be provided:

  • SENTRY_EXCLUSIONS_LIST are the comma separated exception names.
  • SENTRY_DSN = sentry DSN but in the legacy format.

@JoJoPuppe
Copy link
Author

JoJoPuppe commented Mar 4, 2025

How could we test if the Image would work?
(edit): A new Image is deployed in qa-de-3.

Copy link
Author

Choose a reason for hiding this comment

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

@JoJoPuppe JoJoPuppe marked this pull request as ready for review March 10, 2025 12:11
JoJoPuppe and others added 9 commits October 24, 2025 16:37
…tests

- Added SentryFilterEngine for filtering Sentry events based on configurable rules.
- Introduced RuleValidationError for handling rule validation errors.
- Created load_rules_from_file function to load and validate rules from YAML configuration.
- Developed unit tests for SentryFilterEngine and rule loader to ensure functionality and validation.
- Updated Sentry WSGI middleware to integrate filtering engine and handle environment configurations.
- Added example YAML configuration for Sentry filtering rules.
- Updated requirements to use the latest version of sentry-sdk.
@JoJoPuppe JoJoPuppe force-pushed the sentry-library-change branch from 4cfdde2 to e6451a2 Compare October 24, 2025 14:38
@JoJoPuppe
Copy link
Author

I thought about the Problem more and came to the conclusion that SENTRY_EXCLUSIONS_LIST is not robust enough to handle different filter cases. Also there requirements came to my mind:

  • easily extensible
  • decoupled from other keystone code
  • configure with config file
  • support for different rules

the new implementation features a FilterEngine for Sentry.
for more details look at this file sentry_filters_example.yaml

this currently is based on the latest version of sentry-sdk and needs a new Sentry Deployment (23.6) to function correctly.

@JoJoPuppe JoJoPuppe self-assigned this Oct 24, 2025
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.

2 participants