feat: upgrade to OpenTelemetry v2.x with cross-platform build support (Nodejs)#50
Merged
rnishtala-sumo merged 15 commits intoAug 25, 2025
Merged
Conversation
- Update package.json to OpenTelemetry v2.x dependencies (47+ packages) - Fix TypeScript compilation errors with global.d.ts declarations - Add automatic architecture detection for arm64/amd64 builds - Update import paths for v2.x compatibility (otlp-proto → otlp-http) - Add webpack TypeScript configuration with test file exclusions - Add install-externals.sh for import-in-the-middle ESM instrumentation - Update opentelemetry-lambda submodule to commit 1fca858 (v2.x) Resolves build failures and enables cross-platform Lambda layer generation. Tested: make build-nodejs now builds successfully on arm64/amd64.
- Fix architecture detection to prioritize ARCHITECTURE env var from CI
- Update collector build to use GOARCH from CI environment
- Fix global.d.ts to avoid test conflicts
- Support both auto-detection (local) and explicit setting (CI)
Resolves 'No files were found' CI error by generating correctly named
opentelemetry-nodejs-{amd64,arm64}.zip files.
- Add npm run build to execute lerna build for all packages - Ensure sample apps like aws-sdk generate function.zip artifacts - Fix CI pipeline artifact generation issues - Remove redundant individual layer build step
- Replace branch name in bucket name with static prefix
- Bucket name 'feat-upgrade-opentelemetry-v2-cross-platform-nodejs-arm64-16839545560'
was too long and contained uppercase letters
- New format: 'sumologic-otel-lambda-dev-{run_id}-{architecture}'
- Also clean up layer naming for consistency
- Replace deprecated 'vpc = true' with 'domain = "vpc"' - Fixes compatibility with newer Terraform AWS provider versions - Resolves 'An argument named "vpc" is not expected here' error
samiura
approved these changes
Aug 8, 2025
- Update telemetry.sdk.version from '1.17.1' to '2.0.0' - Aligns test expectations with OpenTelemetry v2.x upgrade - Ensures integration tests validate correct SDK version reporting
65c08f3 to
ea3a1b6
Compare
- Create detect-arch.sh to handle architecture detection logic - Update build.sh to use the new script instead of inline logic - Improves maintainability and reusability of architecture detection
- Replace deprecated v1.x wrapper with v2.0.0 compatible implementation - Fix tsconfig.webpack.json to work without broken extends reference - Add missing otel-handler script for proper Lambda initialization - Resolves Runtime.ExitError during wrapper initialization
- Replace getEnv() with getStringFromEnv() for OTEL_LOG_LEVEL - Replace detectResourcesSync() with async detectResources() - Update build scripts for cross-platform architecture support
- Use ${env:SUMO_OTLP_HTTP_ENDPOINT_URL} in collector config
- Add getExportersFromEnv() following OTel 2.0 patterns
- Remove debug traces and sensitive URL logging
echlebek
approved these changes
Aug 19, 2025
chan-tim-sumo
approved these changes
Aug 20, 2025
be33d4a to
f67dcbc
Compare
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.
🚀 OpenTelemetry v2.x Upgrade (Nodejs)
Summary
This PR upgrades the Node.js Lambda layer from OpenTelemetry v1.x to v2.x with cross-platform build support and CI compatibility. Related upstream PR - https://github.com/open-telemetry/opentelemetry-lambda/pull/1789/files
🔧 Key Changes
Dependencies & Compatibility
Build System Enhancements
✅ Cross-platform architecture detection (auto-detects arm64/amd64)
✅ CI environment compatibility (respects env var)
✅ External package installer for runtime dependencies