-
Notifications
You must be signed in to change notification settings - Fork 28
feat(insights): basic framework event hooks #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a basic framework for event hooks—referred to as Honeybadger Insights—for Django, Flask, ASGI, and Celery, along with updated tests and documentation.
- Introduces helper functions like get_duration and extract_honeybadger_config
- Implements insights event registrations in middleware and extensions
- Updates tests across supported frameworks and enhances README documentation
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
honeybadger/utils.py | Adds helper functions for configuration extraction and timing |
honeybadger/tests/contrib/test_flask.py | Adds new tests for Flask insights events |
honeybadger/tests/contrib/test_django.py | Adds new tests for Django insights events |
honeybadger/tests/contrib/test_celery.py | Updates Celery tests to work with new task event hooks |
honeybadger/tests/contrib/test_asgi.py | Adds async tests for ASGI insights events |
honeybadger/contrib/flask.py | Incorporates insights instrumentation and SQLAlchemy event patching |
honeybadger/contrib/django.py | Adds insights instrumentation through middleware enhancements |
honeybadger/contrib/celery.py | Introduces task event listener and improves event payload generation |
honeybadger/contrib/asgi.py | Refactors the ASGI app runner to include insights event reporting |
honeybadger/config.py | Adds a new insights_enabled configuration option |
README.md | Updates documentation to include insights automatic instrumentation |
Comments suppressed due to low confidence (1)
honeybadger/tests/contrib/test_asgi.py:70
- The exception SomeError is used without a clear import or definition in this test context. Ensure that SomeError is properly imported or defined to prevent a NameError during test execution.
with self.assertRaises(SomeError):
} | ||
|
||
|
||
def get_duration(start_time): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring states that the duration is returned in milliseconds, but the return type is a float. Consider clarifying the unit (ms) and data type (float) in the docstring for consistency.
Copilot uses AI. Check for mistakes.
I followed the naming from our notice data. The more common name for this field is "app", so renaming to that.
Until we have filtering and before_event functionality.
This includes the basic framework hooks & tests for Django, Flask, ASGI & Celery.
A few notes: