Skip to content

Conversation

@rithikanarayan
Copy link
Contributor

@rithikanarayan rithikanarayan commented Oct 20, 2025

What does this PR do?

Applies strip --strip-unneeded to all .so files included in the Python lambda layer.

Motivation

Frequent increases in Python lambda layer size, exceeding checks.
Stripping binaries further (originally only applied strip --strip-debug) can reduce the unzipped layer size by about 2.5MB.

Testing Guidelines

Ran serverless e2e tests and manually inspected traces on a Python sample app.

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

# benchmark uses pre-built wheels instead of building from sources.
RUN find ./python/lib/$runtime/site-packages/ddtrace -name "*.so" -exec strip -g {} \;
RUN find ./python/lib/$runtime/site-packages -name "*.so" -exec strip -g {} \;
# RUN find ./python/lib/$runtime/site-packages/ddtrace -name "*.so" -exec strip -g {} \;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hGreat idea! I'm surprised we weren't already stripping all the binaries in site-packages. Good find.

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