Skip to content

fix: update pprof prebuild cleanup for @datadog/pprof 5.14.4 - #813

Merged
lucaspimentel merged 3 commits into
mainfrom
fix/pprof-prebuild-cleanup
Aug 25, 2026
Merged

fix: update pprof prebuild cleanup for @datadog/pprof 5.14.4#813
lucaspimentel merged 3 commits into
mainfrom
fix/pprof-prebuild-cleanup

Conversation

@lucaspimentel

@lucaspimentel lucaspimentel commented Aug 25, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Updates the Dockerfile prebuild cleanup for @datadog/pprof to match the package's new directory and file naming structure introduced in 5.14.4.

Motivation

PR #783 bumped @datadog/pprof from 5.13.2 to 5.14.4, which restructured the prebuilds in two ways that silently broke the Dockerfile cleanup (lines 53-66):

1. Platform directory names changed

  • linuxglibc-x64/linux-x64/
  • linuxglibc-arm64/linux-arm64/
  • linuxmusl-x64/ and linuxmusl-arm64/ no longer exist as separate directories. The musl .node files now live alongside glibc inside linux-x64/ and linux-arm64/ with a dd_pprof.musl.node.abi*.node naming pattern.

The Dockerfile removed linuxmusl-arm64/ and linuxmusl-x64/ as directories, which are now no-ops. The musl binaries ship in the layer even though Lambda runs glibc (Amazon Linux 2).

2. File naming convention changed

  • node-111.nodedd_pprof.node.abi111.node
  • node-120.nodedd_pprof.node.abi120.node
  • etc.

The glob prebuilds/*/node-111.node matches nothing in 5.14.4, so all ABI-specific removals are also no-ops.

Size impact:

Files after cleanup Size
5.13.2 (old cleanup worked) 8 glibc .node files 2.1 MB
5.14.4 (old cleanup broken) 36 files (18 glibc + 18 musl) 8.6 MB
5.14.4 after this fix 6 glibc .node files 1.8 MB

The regression was ~6.5 MB of unnecessary prebuilds shipping in the layer — 3.2 MB of musl binaries that Lambda can't use, plus unused ABIs for Node runtimes Lambda doesn't support.

This was identified in this Slack thread.

Testing Guidelines

Verified the cleanup logic by downloading @datadog/pprof 5.14.4 from npm and simulating the new Dockerfile rm -rf commands against the actual prebuilds directory. After the new cleanup, 6 files remain (glibc, x64 + arm64, ABIs for Node 18/20/22), totaling 1.8 MB — down from 36 files / 8.6 MB with the old broken cleanup, and slightly smaller than the 8 files / 2.1 MB on the old 5.13.2.

End-to-end layer size measurements

Built the Node 20 layer (NODE_VERSION=20.19) at the commit immediately before this PR merged (5095655) and at the merge commit (2d3f33d).

Metric Before After Change
ZIP archive 8,494 KiB 6,591 KiB -1,903 KiB (-22.4%)
Extracted layer 25,680 KiB 19,954 KiB -5,726 KiB (-22.3%)
pprof prebuild files 36 10 -26 files

The repository's layer-size check fails before the PR because the extracted layer is over the 24 MiB limit (25,680 KiB vs. 24,576 KiB). It passes after the PR at 19,954 KiB. Both archives pass the 9 MiB compressed-size limit.

Additional Notes

The fix keeps ABIs for Node 18 (abi108), Node 20 (abi115), and Node 22 (abi127) — the currently supported Lambda Node runtimes. If new Node versions are added to Lambda, the ABI removal list will need updating. The existing TODOs about splitting x64/arm64 into separate images and shipping per-platform bindings still apply.

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 passes the integration tests (ask a Datadog member to run the tests)

@joeyzhao2018
joeyzhao2018 marked this pull request as ready for review August 25, 2026 15:34
@joeyzhao2018
joeyzhao2018 requested review from a team as code owners August 25, 2026 15:34
@lucaspimentel
lucaspimentel requested a balanced review from Copilot August 25, 2026 15:35

@joeyzhao2018 joeyzhao2018 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's safe to ship as long as the pipeline is clean

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates @datadog/pprof prebuild cleanup for its 5.14.4 layout.

Changes:

  • Removes non-Linux and musl binaries.
  • Updates ABI-specific cleanup patterns.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Dockerfile Outdated
Comment thread Dockerfile Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17e3dc7624

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Dockerfile Outdated
@ojproductions

Copy link
Copy Markdown
Contributor

@codex review

lucaspimentel and others added 3 commits August 25, 2026 13:27
The @datadog/pprof package restructured its prebuilds in 5.14.4,
breaking the Dockerfile cleanup that removes unused platform/ABI
binaries from the Lambda layer:

1. Platform directories renamed: linuxglibc-x64 -> linux-x64,
   linuxglibc-arm64 -> linux-arm64. The old linuxmusl-* dirs no
   longer exist as separate dirs; musl .node files now live alongside
   glibc inside linux-x64/ and linux-arm64/.

2. File naming changed: node-111.node -> dd_pprof.node.abi111.node,
   so the old glob patterns matched nothing.

This caused 36 files (8.6 MB) of unnecessary prebuilds to ship in the
layer instead of 8 files (2.1 MB). The fix updates the cleanup to use
the new directory/file naming and removes musl binaries via glob,
bringing the layer down to 6 files (1.8 MB).
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@lucaspimentel
lucaspimentel force-pushed the fix/pprof-prebuild-cleanup branch from d40c6c0 to 1ec755e Compare August 25, 2026 17:27
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: d40c6c0622

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@datadog-official

datadog-official Bot commented Aug 25, 2026

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 3 Pipeline jobs failed

DataDog/datadog-lambda-js | integration test (node24) — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

DataDog/datadog-lambda-js | integration test (node26) — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

DataDog/datadog-lambda-js | publish layer sandbox (node20): [us-west-2]

View more details · View in GitLab

ℹ️ Info

🔄 Datadog auto-retried 2 jobs - 2 passed on retry View in Datadog

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1ec755e | Docs | View more details | Give us feedback!

@lucaspimentel
lucaspimentel merged commit 2d3f33d into main Aug 25, 2026
49 of 51 checks passed
@lucaspimentel
lucaspimentel deleted the fix/pprof-prebuild-cleanup branch August 25, 2026 18:00
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.

4 participants