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

Fix Celery Instrumentation for Workers #1133

Merged
merged 16 commits into from May 9, 2024

Conversation

TimPansino
Copy link
Contributor

@TimPansino TimPansino commented May 3, 2024

Overview

  • Celery apps run with worker optimizations would overwrite instrumentation wrappers.
  • This has been corrected by instrumenting the setup and reset methods to always ensure our wrapper is always applied, is never duplicated, and is always the top wrapper for BaseTask.call
  • Add new tests file for wrapper unit tests with new test for worker optimizations.
  • Run task method tests with and without worker optimizations.
  • Fix bug in @validate_transaction_count where state from previous tests is never cleared.

@TimPansino TimPansino requested a review from a team as a code owner May 3, 2024 19:44
Copy link

github-actions bot commented May 3, 2024

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON bandit 2 0 5.55s
✅ PYTHON black 5 3 0 2.09s
❌ PYTHON flake8 5 3 1.07s
✅ PYTHON isort 5 4 0 0.31s
✅ PYTHON pylint 5 0 6.55s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@mergify mergify bot added the tests-failing label May 3, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 3, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 81.71%. Comparing base (df2b159) to head (2a88b39).

Files Patch % Lines
newrelic/hooks/application_celery.py 70.37% 3 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1133      +/-   ##
==========================================
- Coverage   81.74%   81.71%   -0.03%     
==========================================
  Files         192      192              
  Lines       21304    21323      +19     
  Branches     3706     3710       +4     
==========================================
+ Hits        17415    17425      +10     
- Misses       2813     2819       +6     
- Partials     1076     1079       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mergify mergify bot removed the tests-failing label May 9, 2024
@TimPansino TimPansino merged commit 3e5be52 into main May 9, 2024
48 of 49 checks passed
@TimPansino TimPansino deleted the fix-celery-instrumentation-missing branch May 9, 2024 21:00
@TimPansino TimPansino added this to the v9.9.1 milestone May 13, 2024
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.

None yet

3 participants