Repository navigation
Build the Ruby layer for both x86_64 and arm64 - #2665
Merged
Merged
Conversation
thompson-tomo
approved these changes
Oct 13, 2026
thompson-tomo
pushed a commit
to thompson-tomo/opentelemetry-lambda
that referenced
this pull request
Oct 14, 2026
…emetry#2665) * Build the Ruby layer for both x86_64 and arm64 * docs: cleanup comments in the Ruby layer build * Add Ruby 4.0 to the Ruby layer * Pin the SAM build images to 1.168.0
thompson-tomo
added a commit
that referenced
this pull request
Oct 14, 2026
…2669) * Build the Ruby layer for both x86_64 and arm64 * docs: cleanup comments in the Ruby layer build * Add Ruby 4.0 to the Ruby layer * Pin the SAM build images to 1.168.0 Co-authored-by: Warre Pessers <45464718+wpessers@users.noreply.github.com>
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.
Fixes #2340.
The Ruby layer was built on
x86_64only, so its native gems (google-protobuf,bigdecimal) crashed onarm64.What changes
ruby/src/otel/Dockerfilenow builds the gems for Ruby 3.3, 3.4 and 4.0 on bothlinux/amd64andlinux/arm64using the aws sam images, in six parallel stages. A final stage merges both architecture trees into oneruby/gems/<X.Y.0>and zips. RubyGems only activates specs whose platform matches the running machine, so both architectures' gems can live side by side.ruby/src/otel/install-gems.shinstalls with the lockfile frozen and setsinstall_extension_in_lib: false, so compiled extensions exist only underextensions/<arch>-linux/and never in the arch-agnosticgems/<name>/lib/. The build fails if any path differs between the two architecture trees, guarding against future clashes.Gemfile.lockinstead of running Ruby on the runner. The Ruby CI workflow now calls that action.FunctionErroris unset before parsing the payload, so an init crash surfaces as the real error.The layer keeps its same name as today.
Perf Test Results
The layer no longer bundles rbenv's default gems, the gem download cache or generated docs, so it shrinks despite the added architecture and Ruby version:
Verified locally with the Lambda emulator images (
public.ecr.aws/lambda/ruby:3.3,:3.4and:4.0, amd64 and arm64) throughAWS_LAMBDA_EXEC_WRAPPER=/opt/otel-handler: all six combinations load the matching native libraries and start the SDK tracer provider.