Skip to content
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

Add support for reporting extra fields if configured #20

Merged
merged 4 commits into from
Dec 19, 2023

Conversation

hammady
Copy link
Member

@hammady hammady commented Dec 19, 2023

Sometimes the delayed_jobs table would contain extra fields that we need to report too to Newrelic.
For example, we may have a field called "enqueue_attributes" or the standard "priority" field which is not reported by default.
To cover these cases, this PR introduces a new parameter to the Worker constructor: extra_delayed_job_fields of type list. If supplied, will read those fields when constructing jobs, and finally report their values along other custom attributes.

@hammady hammady self-assigned this Dec 19, 2023
@hammady hammady force-pushed the extra-fields-reporting branch from 4dc77f6 to ff32692 Compare December 19, 2023 03:00
@hammady hammady force-pushed the extra-fields-reporting branch from ff32692 to d8a4aa4 Compare December 19, 2023 03:03
Base automatically changed from job-tests to master December 19, 2023 16:53
@hammady hammady merged commit a4cc795 into master Dec 19, 2023
1 check passed
@hammady hammady deleted the extra-fields-reporting branch December 19, 2023 16:55
hammady added a commit that referenced this pull request Dec 20, 2023
* Add support for reporting extra fields if configured
hammady added a commit that referenced this pull request Dec 21, 2023
* Instrument using custom attributes + add Worker tests (#18)
* Add tests to the Job class (#19)
* Add support for reporting extra fields if configured (#20)
* Add Reporter class for Newrelic abstraction and job utility (#21)
* Fix integration bugs + add report_raw and flatten dicts (#23)

* Patch GH action to work on python 2.7 only
* Downgrade pytest, PyYAML, psycopg2-binary to work with python 2.7
* Fix tests and job to be python 2.7 compatible
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