-
Notifications
You must be signed in to change notification settings - Fork 416
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
feat(onboarding): early exit conditions in lib-injection [backport 2.9] #10563
Conversation
This pull request adds "guardrails" to the "library injection" process. These are early exit conditions from the instrumentation process intended to avoid sending any traces when undefined behavior is likely. The code makes this determination on the basis of software versions present in the application environment, both of Python packages and the Python runtime itself. The biggest risk here is that instrumentation is disabled when it's not intended to be. I think existing tests in `tests/lib-injection` cover this pretty well. There's a new test added that verifies instrumentation was cancelled when an unsupported package version is present. Contains changes from #9418 Related RFC: "[RFC] One Step Guardrails" - [x] minimum package version checks - [x] Testing - [x] replace envvars with inject_force - [x] figure out what to use instead of pkg_resources - [x] replace local file path with `DD_TELEMETRY_FORWARDER_PATH` - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: Emmett Butler <[email protected]> Co-authored-by: Emmett Butler <[email protected]> (cherry picked from commit 0c38e09)
tests/lib-injection/dd-lib-python-init-test-django-unsupported-package-force/Dockerfile
Show resolved
Hide resolved
tests/lib-injection/dd-lib-python-init-test-django-unsupported-python/Dockerfile
Show resolved
Hide resolved
tests/lib-injection/dd-lib-python-init-test-django-unsupported-package/Dockerfile
Show resolved
Hide resolved
Datadog ReportBranch report: ❌ 1 Failed (0 Known Flaky), 160353 Passed, 15474 Skipped, 8h 58m 36.28s Total duration (2h 1m 12.31s time saved) ❌ Failed Tests (1)
⌛ Performance Regressions vs Default Branch (11)
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 2.9 #10563 +/- ##
==========================================
- Coverage 10.22% 10.15% -0.07%
==========================================
Files 1258 1258
Lines 120899 120919 +20
==========================================
- Hits 12356 12281 -75
- Misses 108543 108638 +95 ☔ View full report in Codecov by Sentry. |
This pull request adds "guardrails" to the "library injection" process. These are early exit conditions from the instrumentation process intended to avoid sending any traces when undefined behavior is likely. The code makes this determination on the basis of software versions present in the application environment, both of Python packages and the Python runtime itself.
The biggest risk here is that instrumentation is disabled when it's not intended to be. I think existing tests in
tests/lib-injection
cover this pretty well. There's a new test added that verifies instrumentation was cancelled when an unsupported package version is present.Contains changes from #9418 Related RFC: "[RFC] One Step Guardrails"
minimum package version checks
Testing
replace envvars with inject_force
figure out what to use instead of pkg_resources
replace local file path with
DD_TELEMETRY_FORWARDER_PATH
Change(s) are motivated and described in the PR description
Testing strategy is described if automated tests are not included in the PR
Risks are described (performance impact, potential for breakage, maintainability)
Change is maintainable (easy to change, telemetry, documentation)
Library release note guidelines are followed or label
changelog/no-changelog
is setDocumentation is included (in-code, generated user docs, public corp docs)
Backport labels are set (if applicable)
If this PR changes the public interface, I've notified
@DataDog/apm-tees
.Title is accurate
All changes are related to the pull request's stated goal
Description motivates each change
Avoids breaking API changes
Testing strategy adequately addresses listed risks
Change is maintainable (easy to change, telemetry, documentation)
Release note makes sense to a user of the library
Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
Backport labels are set in a manner that is consistent with the release branch maintenance
policy