Skip to content

update list of dd-trace-dotnet files removed from layer #10

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

Merged
merged 10 commits into from
Mar 31, 2025

Conversation

lucaspimentel
Copy link
Member

@lucaspimentel lucaspimentel commented Feb 14, 2025

What does this PR do?

  • Stop removing the native loader library Datadog.Trace.ClrProfiler.Native.so (1.4MB) and its config file from the Lambda layer. Skipping the loader is not officially supported and can break Lambda if incompatible changes are made in dd-trace-dotnet.
    • Also stop renaming the native tracing library Datadog.Tracer.Native.so to Datadog.Trace.ClrProfiler.Native.so so it would get loaded by the Profiling API.
  • Remove libdatadog_profiling.so (7.6MB) which is currently only used by Continuous Profiling, which is unsupported in AWS Lambda.
  • Bonus 1: Just to be safe, try to also remove net461/ and win-*/.
  • Bonus 2: Add .gitattributes to set *.sh line endings to LF, even on Windows. Otherwise, execution of shell scripts inside Docker fails.

All files

❯ du -s datadog-dotnet-apm_3.13.0_amd64
50992

❯ tree -F -h --sort size datadog-dotnet-apm_3.13.0_amd64
[4.0K]  datadog-dotnet-apm_3.13.0_amd64/
├── [4.0K]  opt/
│   └── [4.0K]  datadog/
│       ├── [2.4M]  libddwaf.so
│       ├── [1.4M]  Datadog.Trace.ClrProfiler.Native.so
│       ├── [4.0K]  continuousprofiler/
│       │   └── [ 18K]  Datadog.Linux.ApiWrapper.x64.so
│       ├── [4.0K]  linux-x64/
│       │   ├── [7.6M]  libdatadog_profiling.so
│       │   ├── [5.3M]  Datadog.Tracer.Native.so
│       │   ├── [3.8M]  dd-dotnet*
│       │   ├── [2.7M]  Datadog.Profiler.Native.so
│       │   ├── [2.4M]  libddwaf.so
│       │   ├── [1.4M]  Datadog.Trace.ClrProfiler.Native.so
│       │   ├── [ 18K]  Datadog.Linux.ApiWrapper.x64.so
│       │   └── [1.3K]  loader.conf
│       ├── [4.0K]  net6.0/
│       │   ├── [7.5M]  Datadog.Trace.dll
│       │   ├── [ 21K]  Datadog.Trace.MSBuild.dll
│       │   └── [8.5K]  Datadog.Trace.MSBuild.deps.json
│       ├── [4.0K]  netcoreapp3.1/
│       │   ├── [7.4M]  Datadog.Trace.dll
│       │   ├── [ 20K]  Datadog.Trace.MSBuild.dll
│       │   └── [8.5K]  Datadog.Trace.MSBuild.deps.json
│       ├── [4.0K]  netstandard2.0/
│       │   ├── [7.5M]  Datadog.Trace.dll
│       │   ├── [ 49K]  System.Threading.dll
│       │   ├── [ 43K]  System.Diagnostics.DiagnosticSource.dll
│       │   ├── [ 22K]  System.Reflection.Emit.ILGeneration.dll
│       │   ├── [ 22K]  System.Reflection.Emit.Lightweight.dll
│       │   ├── [ 22K]  System.Reflection.Emit.dll
│       │   ├── [ 20K]  Datadog.Trace.MSBuild.dll
│       │   └── [ 14K]  Datadog.Trace.MSBuild.deps.json
│       ├── [3.5K]  dd-dotnet.sh*
│       ├── [1.4K]  loader.conf
│       └── [ 101]  createLogPath.sh*
└── [4.0K]  usr/
    └── [4.0K]  share/
        └── [4.0K]  doc/
            └── [4.0K]  datadog-dotnet-apm/
                └── [ 919]  copyright

Before this PR

❯ du -s datadog-dotnet-apm_3.13.0_amd64
20912

❯ tree -F -h --sort size datadog-dotnet-apm_3.13.0_amd64
[4.0K]  datadog-dotnet-apm_3.13.0_amd64/
├── [4.0K]  opt/
│   └── [4.0K]  datadog/
│       ├── [4.0K]  linux-x64/
│       │   ├── [7.6M]  libdatadog_profiling.so
│       │   └── [5.3M]  Datadog.Tracer.Native.so -> Datadog.Trace.ClrProfiler.Native.so
│       └── [4.0K]  net6.0/
│           └── [7.5M]  Datadog.Trace.dll
└── [4.0K]  usr/
    └── [4.0K]  share/
        └── [4.0K]  doc/
            └── [4.0K]  datadog-dotnet-apm/
                └── [ 919]  copyright

After this PR

 ❯ du -s datadog-dotnet-apm_3.13.0_amd64
 14524

 ❯ tree -F -h --sort size datadog-dotnet-apm_3.13.0_amd64
 [4.0K]  datadog-dotnet-apm_3.13.0_amd64/
 ├── [4.0K]  opt/
 │   └── [4.0K]  datadog/
 │       ├── [4.0K]  linux-x64/
-│       │   ├── [7.6M]  libdatadog_profiling.so
 │       │   ├── [5.3M]  Datadog.Tracer.Native.so
+│       │   ├── [1.4M]  Datadog.Trace.ClrProfiler.Native.so
+│       │   └── [1.3K]  loader.conf
 │       └── [4.0K]  net6.0/
 │           └── [7.5M]  Datadog.Trace.dll
 └── [4.0K]  usr/
     └── [4.0K]  share/
         └── [4.0K]  doc/
             └── [4.0K]  datadog-dotnet-apm/
                 └── [ 919]  copyright

Motivation

  • Adding files: We need to keep the loader library to use dd-trace-dotnet in a supported manner.
  • Removing files: We want to remove new unused files to keep the layer size as small as possible.

Testing Guidelines

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)

@lucaspimentel lucaspimentel changed the title keep the loader library update list of removed files Feb 14, 2025
@lucaspimentel lucaspimentel requested a review from a team February 14, 2025 20:36
@lucaspimentel lucaspimentel force-pushed the lpimentel/keep-loader branch from 7f80df4 to 9ef024d Compare March 26, 2025 17:44
@lucaspimentel lucaspimentel marked this pull request as ready for review March 26, 2025 18:25
@lucaspimentel lucaspimentel requested a review from a team as a code owner March 26, 2025 18:25
@lucaspimentel lucaspimentel changed the title update list of removed files update list of dd-trace-dotnet files removed from layer Mar 31, 2025
@lucaspimentel lucaspimentel merged commit 6fc2fc1 into main Mar 31, 2025
1 check passed
@lucaspimentel lucaspimentel deleted the lpimentel/keep-loader branch March 31, 2025 15:59
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