Fix Wagtail transaction names - #1705
Conversation
✅MegaLinter analysis: Success
Notices📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining See detailed reports in MegaLinter artifacts
|
a284b4d to
9fd7f38
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1705 +/- ##
==========================================
- Coverage 82.07% 82.07% -0.01%
==========================================
Files 216 216
Lines 26806 26827 +21
Branches 4245 4250 +5
==========================================
+ Hits 22002 22018 +16
+ Misses 3340 3337 -3
- Partials 1464 1472 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
49a14e6 to
58ac6f0
Compare
| try: | ||
| from wagtail.models.pages import Page | ||
| except: | ||
| Page = None | ||
| if instance and isinstance(instance, Page): |
There was a problem hiding this comment.
Can we maybe move this import to an import-hook and export it to the module level to avoid the overhead of constantly trying to import this for the vast majority of customers that don't have wagtail? We can change this if to check if Page is not none and ... and set Page to None by default.
There was a problem hiding this comment.
Because there was already the same import hook in the wagtail hook module I had to move the wagtail import hook to the django module to make this work. Let me know your thoughts and if you'd prefer a different approach.
Co-authored-by: Hannah Stepanek <hmstepanek@gmail.com>
ba9bf35 to
e253a3e
Compare
…ewrelic-python-agent into fix-wagtail-transaction-names
| _default_settings = { | ||
| "package_reporting.enabled": False, # Turn off package reporting for testing as it causes slow downs. | ||
| "transaction_tracer.explain_threshold": 0.0, | ||
| "transaction_tracer.transaction_threshold": 0.0, | ||
| "transaction_tracer.stack_trace_threshold": 0.0, | ||
| "debug.log_data_collector_payloads": True, | ||
| "debug.record_transaction_failure": True, | ||
| "debug.log_autorum_middleware": True, | ||
| } | ||
|
|
||
| collector_agent_registration = collector_agent_registration_fixture( | ||
| app_name="Python Agent Test (framework_wagtail)", default_settings=_default_settings, scope="module" | ||
| ) |
There was a problem hiding this comment.
Why is this stuff in here and not the conftest file?
There was a problem hiding this comment.
Good question. I think claude may have moved these and I didn't notice. Moved them back to conftest.

Overview
Fix Wagtail transaction names.
Related Github Issue
Fixes #1573.