chore: remove ddtrace patch.py files from layer#763
Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits intomainfrom Mar 30, 2026
Merged
chore: remove ddtrace patch.py files from layer#763gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits intomainfrom
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits intomainfrom
Conversation
Member
Author
|
Need to think about how to incorporate this change, since it depends on a specific change in dd-trace-py. |
purple4reina
approved these changes
Mar 30, 2026
brettlangdon
commented
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Removes the
patch.pysource files from the ddtrace package when ddtrace >= 4.7.0rc4.Motivation
Removing these will save ~800kb from unzipped layer size.
The only reason these were being included is a specific file existence check in _monkey.py that only looks for
.pyfiles.DataDog/dd-trace-py#17196 updates that check to also look for
.pycfiles, so the lambda layer can drop thepatch.pysources. That fix lands in ddtrace4.7.0rc4.Implementation
Since there is an indirect version dependency between these two projects, the Dockerfile uses a version gate:
.pyfiles are removed (new behavior, ~800kb savings)patch.pyfiles are kept for instrumentation discovery (old behavior)Once the minimum ddtrace version in
pyproject.tomlis bumped past4.7.0rc4, the version gate can be simplified.Testing Guidelines
Additional Notes
Types of Changes
Check all that apply