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 Reporter class for Newrelic abstraction and job utility #21

Merged
merged 6 commits into from
Dec 20, 2023

Conversation

hammady
Copy link
Member

@hammady hammady commented Dec 20, 2023

  • This introduces a new class Reporter which abstracts away all implementation details for the Newrelic agent from the Worker class.
  • Additionally, an instance of this reporter is injected into jobs when constructing them so that they can report additional custom attributes using the reporter interface: .reporter.report(**attributes).
  • When instantiating an instance from the Worker class, you can configure all custom reported attributes to have a common prefix using the new parameter: reported_attributes_prefix.
  • This also enhances the Github action by testing on a matrix of Python versions from 3.8 to 3.12.

@hammady hammady self-assigned this Dec 20, 2023
@hammady hammady mentioned this pull request Dec 20, 2023
@hammady
Copy link
Member Author

hammady commented Dec 20, 2023

Shouldn't have specific attributes like review id articles count. Deprecate the report function.

@hammady
Copy link
Member Author

hammady commented Dec 20, 2023

Shouldn't have specific attributes like review id articles count. Deprecate the report function.

Done.

@hammady hammady merged commit 495893f into master Dec 20, 2023
5 checks passed
@hammady hammady deleted the transaction-reporter branch December 20, 2023 14:25
hammady added a commit that referenced this pull request Dec 20, 2023
* Decouple Worker class from Newrelic using new Reporter class
* Add new Reporter class to abstract Newrelic reporting
* Inject reporter into job from worker
* Test multiple python versions using GH actions
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