newrelic / newrelic-python-agent

New Relic Python Agent
https://docs.newrelic.com/docs/agents/python-agent
Apache License 2.0
178 stars 102 forks source link

Package capture harvest #1228

Closed lrafeei closed 1 day ago

lrafeei commented 1 month ago

This PR aims to alleviate some of the time consumed by package data collection in the connect cycle. Instead of collecting all modules used in the application at startup, the agent uses the fast harvest cycle to incrementally collect this data and sends it though the update_loaded_modules endpoint instead of the connect endpoint (through the "environment" key).

Note: despite the term "Jars" not being used by Python to refer to packages/modules, this is the exact string the endpoint needs in order to process the data.

github-actions[bot] commented 1 month ago

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON bandit 4 0 5.34s
✅ PYTHON black 6 0 0 1.44s
✅ PYTHON flake8 6 0 0.76s
✅ PYTHON isort 6 0 0 0.34s
✅ PYTHON pylint 6 0 6.02s

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_

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 72.54902% with 14 lines in your changes missing coverage. Please review.

Project coverage is 81.17%. Comparing base (dacf155) to head (fd3b91c).

Files with missing lines Patch % Lines
newrelic/core/application.py 64.00% 8 Missing and 1 partial :warning:
newrelic/core/environment.py 77.77% 3 Missing and 1 partial :warning:
newrelic/common/agent_http.py 75.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1228 +/- ## ========================================== - Coverage 81.34% 81.17% -0.18% ========================================== Files 200 200 Lines 21891 21913 +22 Branches 3469 3472 +3 ========================================== - Hits 17808 17787 -21 - Misses 2941 2977 +36 - Partials 1142 1149 +7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.