From 125951230fa2a4f0602c2fd60b11cb25951d8796 Mon Sep 17 00:00:00 2001 From: liustve Date: Thu, 10 Apr 2025 19:52:56 +0000 Subject: [PATCH 1/8] test --- .../workflows/java-lambda-layer-perf-test.yml | 100 ++++++++++++++++++ .../workflows/node-lambda-layer-perf-test.yml | 2 +- .../python-lambda-layer-perf-test.yml | 4 +- 3 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/java-lambda-layer-perf-test.yml diff --git a/.github/workflows/java-lambda-layer-perf-test.yml b/.github/workflows/java-lambda-layer-perf-test.yml new file mode 100644 index 000000000..9273fa9a7 --- /dev/null +++ b/.github/workflows/java-lambda-layer-perf-test.yml @@ -0,0 +1,100 @@ +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: Apache-2.0 + +name: Java Lambda Layer Performance Test +on: + workflow_dispatch: + inputs: + test_runs: + description: 'Number of test runs to perform' + required: true + default: 20 + type: number + + java_version: + description: 'The Java version to run the test' + required: true + default: '17' + type: string + +jobs: + java-lambda-layer-performance-test: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + + env: + NUM_TEST_RUNS: ${{ github.event.inputs.test_runs }} + + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} + aws-region: us-east-1 + + - name: Checkout aws-otel-java-instrumentation + uses: actions/checkout@v4 + with: + repository: aws-observability/aws-otel-java-instrumentation + path: aws-otel-java-instrumentation + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v2 + + - name: Checkout current repository + uses: actions/checkout@v4 + with: + path: current-repo + + - name: Run Cold Start Iterations for Base Lambda + Lambda Layer + run: | + cd current-repo + chmod +x lambda-layer-perf-test/lambda-layer-run.sh + ./lambda-layer-perf-test/lambda-layer-run.sh false aws-opentelemetry-distro-java + + - name: Remove Application Signals Lambda Layer + run: | + echo "Removing Lambda layer..." + + OUTPUT=$(aws lambda update-function-configuration \ + --function-name aws-opentelemetry-distro-java \ + --layers []) + + echo "Lambda configuration:" + echo "$OUTPUT" + + LAYERS=$(echo "$OUTPUT" | jq -r '.Layers | length') + + if [ "$LAYERS" -ne 0 ]; then + echo "::error::Found $LAYERS layer(s) still attached to the function" + echo "::error::Layer details:" + echo "$OUTPUT" | jq -r '.Layers' + exit 1 + else + echo "✅ Layers successfully removed" + fi + + - name: Run Cold Start Iterations for Base Lambda + run: | + cd current-repo + chmod +x lambda-layer-perf-test/lambda-layer-run.sh + ./lambda-layer-perf-test/lambda-layer-run.sh true aws-opentelemetry-distro-java + + - name: Upload test results + uses: actions/upload-artifact@v4 + with: + name: java-performance-test-results + path: | + no_layer_results.txt + layer_results.txt + retention-days: 90 + + - name: Cleanup Terraform Resources + if: success() || failure() || cancelled() + run: | + cd aws-otel-js-instrumentation/lambda-layer/terraform/lambda + echo "Starting Terraform cleanup..." + terraform init + terraform destroy -auto-approve \ No newline at end of file diff --git a/.github/workflows/node-lambda-layer-perf-test.yml b/.github/workflows/node-lambda-layer-perf-test.yml index 3955ae20e..c3e355c21 100644 --- a/.github/workflows/node-lambda-layer-perf-test.yml +++ b/.github/workflows/node-lambda-layer-perf-test.yml @@ -104,7 +104,7 @@ jobs: - name: Upload test results uses: actions/upload-artifact@v4 with: - name: performance-test-results + name: js-performance-test-results path: | no_layer_results.txt layer_results.txt diff --git a/.github/workflows/python-lambda-layer-perf-test.yml b/.github/workflows/python-lambda-layer-perf-test.yml index 38d1c259e..eacbf1531 100644 --- a/.github/workflows/python-lambda-layer-perf-test.yml +++ b/.github/workflows/python-lambda-layer-perf-test.yml @@ -9,7 +9,7 @@ on: required: true default: 20 type: number - + python_version: description: 'The Python version to run the test' required: true @@ -95,7 +95,7 @@ jobs: - name: Upload test results uses: actions/upload-artifact@v4 with: - name: performance-test-results + name: python-performance-test-results path: | no_layer_results.txt layer_results.txt From 40a3fbb6f945da1f28df5729fcc5159919cff0a9 Mon Sep 17 00:00:00 2001 From: liustve Date: Fri, 11 Apr 2025 17:38:29 +0000 Subject: [PATCH 2/8] add Java Lambda Layer performance test --- .../dotnet-lambda-layer-perf-test.yml | 113 ++++++++++++++++++ .../workflows/java-lambda-layer-perf-test.yml | 29 ++++- 2 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/dotnet-lambda-layer-perf-test.yml diff --git a/.github/workflows/dotnet-lambda-layer-perf-test.yml b/.github/workflows/dotnet-lambda-layer-perf-test.yml new file mode 100644 index 000000000..8ed92a4c0 --- /dev/null +++ b/.github/workflows/dotnet-lambda-layer-perf-test.yml @@ -0,0 +1,113 @@ +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: Apache-2.0 + +name: DotNet Lambda Layer Performance Test +on: + workflow_dispatch: + inputs: + test_runs: + description: 'Number of test runs to perform' + required: true + default: 20 + type: number + + dotnet-version: + description: 'dotnet version to use' + required: true + default: '8.0.x' + type: string + +jobs: + dotnet-lambda-layer-performance-test: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + + env: + NUM_TEST_RUNS: ${{ github.event.inputs.test_runs }} + + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}:role/${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} + aws-region: us-east-1 + + - name: Checkout aws-otel-dotnet-instrumentation + uses: actions/checkout@v4 + with: + repository: aws-observability/aws-otel-dotnet-instrumentation + path: aws-otel-dotnet-instrumentation + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ github.event.inputs.dotnet-version }} + + - name: Setup AWS Lambda Tools + run: dotnet tool install -g Amazon.Lambda.Tools + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v2 + + - name: Build and Deploy .NET Sample App and Lambda Layer + run: | + cd aws-otel-dotnet-instrumentation/sample-applications/lambda-test-apps/SimpleLambdaFunction/ + ./build-and-deploy.sh + + - name: Checkout current repository + uses: actions/checkout@v4 + with: + path: current-repo + + - name: Run Cold Start Iterations for Base Lambda + Lambda Layer + run: | + cd current-repo + chmod +x lambda-layer-perf-test/lambda-layer-run.sh + ./lambda-layer-perf-test/lambda-layer-run.sh false SimpleLambdaFunction + + - name: Remove Application Signals Lambda Layer + run: | + echo "Removing Lambda layer..." + + OUTPUT=$(aws lambda update-function-configuration \ + --function-name SimpleLambdaFunction \ + --layers []) + + echo "Lambda configuration:" + echo "$OUTPUT" + + LAYERS=$(echo "$OUTPUT" | jq -r '.Layers | length') + + if [ "$LAYERS" -ne 0 ]; then + echo "::error::Found $LAYERS layer(s) still attached to the function" + echo "::error::Layer details:" + echo "$OUTPUT" | jq -r '.Layers' + exit 1 + else + echo "✅ Layers successfully removed" + fi + + - name: Run Cold Start Iterations for Base Lambda + run: | + cd current-repo + chmod +x lambda-layer-perf-test/lambda-layer-run.sh + ./lambda-layer-perf-test/lambda-layer-run.sh true SimpleLambdaFunction + + - name: Upload test results + uses: actions/upload-artifact@v4 + with: + name: dotnet-performance-test-results + path: | + no_layer_results.txt + layer_results.txt + retention-days: 90 + + - name: Cleanup Terraform Resources + if: success() || failure() || cancelled() + run: | + cd aws-otel-dotnet-instrumentation/sample-applications/lambda-test-apps/SimpleLambdaFunction/terraform/lambda + echo "Starting Terraform cleanup..." + terraform init + terraform destroy -auto-approve \ No newline at end of file diff --git a/.github/workflows/java-lambda-layer-perf-test.yml b/.github/workflows/java-lambda-layer-perf-test.yml index 9273fa9a7..7a86a80c0 100644 --- a/.github/workflows/java-lambda-layer-perf-test.yml +++ b/.github/workflows/java-lambda-layer-perf-test.yml @@ -38,10 +38,37 @@ jobs: uses: actions/checkout@v4 with: repository: aws-observability/aws-otel-java-instrumentation + ref: release/v1.33.x path: aws-otel-java-instrumentation - name: Setup Terraform uses: hashicorp/setup-terraform@v2 + + - name: Build and Deploy Lambda Layer + run: | + cd aws-otel-java-instrumentation/lambda-layer + chmod +x build-layer.sh + ./build-layer.sh + + LAYER_VERSION_ARN=$(aws lambda publish-layer-version \ + --layer-name AWSOpenTelemetryDistroJava \ + --zip-file fileb://build/distributions/aws-opentelemetry-java-layer.zip \ + --compatible-runtimes "java11" "java17" "java21" \ + --compatible-architectures "x86_64" "arm64" \ + --query 'LayerVersionArn' \ + --output text) + + echo Published layer ARN $LAYER_VERSION_ARN + + - name: Build and Deploy Sample Application with Lambda Layer + run: | + cd aws-otel-java-instrumentation/sample-apps/apigateway-lambda + gradle clean build + gradle createLambdaZip + + cd terraform + terraform init + terraform apply -auto-approve -var "adot_layer_arn=$LAYER_VERSION_ARN" - name: Checkout current repository uses: actions/checkout@v4 @@ -94,7 +121,7 @@ jobs: - name: Cleanup Terraform Resources if: success() || failure() || cancelled() run: | - cd aws-otel-js-instrumentation/lambda-layer/terraform/lambda + cd aws-otel-java-instrumentation/sample-apps/apigateway-lambda/terraform echo "Starting Terraform cleanup..." terraform init terraform destroy -auto-approve \ No newline at end of file From cd9c1814bdc0b2bc35ca921cd32f2018ffec0638 Mon Sep 17 00:00:00 2001 From: liustve Date: Fri, 11 Apr 2025 19:07:38 +0000 Subject: [PATCH 3/8] test --- .github/workflows/java-lambda-layer-perf-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/java-lambda-layer-perf-test.yml b/.github/workflows/java-lambda-layer-perf-test.yml index 7a86a80c0..5ab620b7b 100644 --- a/.github/workflows/java-lambda-layer-perf-test.yml +++ b/.github/workflows/java-lambda-layer-perf-test.yml @@ -3,6 +3,9 @@ name: Java Lambda Layer Performance Test on: + push: + branches: + - perf_testing_lambda_layer_java workflow_dispatch: inputs: test_runs: From a2e6a9e2631d3618c508de26cc23aabd0a119f17 Mon Sep 17 00:00:00 2001 From: liustve Date: Fri, 11 Apr 2025 19:08:36 +0000 Subject: [PATCH 4/8] test --- .github/workflows/java-lambda-layer-perf-test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/java-lambda-layer-perf-test.yml b/.github/workflows/java-lambda-layer-perf-test.yml index 5ab620b7b..7a86a80c0 100644 --- a/.github/workflows/java-lambda-layer-perf-test.yml +++ b/.github/workflows/java-lambda-layer-perf-test.yml @@ -3,9 +3,6 @@ name: Java Lambda Layer Performance Test on: - push: - branches: - - perf_testing_lambda_layer_java workflow_dispatch: inputs: test_runs: From 54f1f0d91f018f88df92656a9d26b2ed819d1add Mon Sep 17 00:00:00 2001 From: liustve Date: Fri, 11 Apr 2025 20:30:37 +0000 Subject: [PATCH 5/8] add version arn to env variables --- .github/workflows/java-lambda-layer-perf-test.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/java-lambda-layer-perf-test.yml b/.github/workflows/java-lambda-layer-perf-test.yml index 7a86a80c0..15c8ac943 100644 --- a/.github/workflows/java-lambda-layer-perf-test.yml +++ b/.github/workflows/java-lambda-layer-perf-test.yml @@ -3,6 +3,9 @@ name: Java Lambda Layer Performance Test on: + push: + branches: + - perf_testing_lambda_layer_java workflow_dispatch: inputs: test_runs: @@ -58,7 +61,8 @@ jobs: --query 'LayerVersionArn' \ --output text) - echo Published layer ARN $LAYER_VERSION_ARN + echo "LAYER_VERSION_ARN=$LAYER_VERSION_ARN" >> $GITHUB_ENV + echo "Published layer ARN $LAYER_VERSION_ARN" - name: Build and Deploy Sample Application with Lambda Layer run: | @@ -68,7 +72,7 @@ jobs: cd terraform terraform init - terraform apply -auto-approve -var "adot_layer_arn=$LAYER_VERSION_ARN" + terraform apply -auto-approve -var "adot_layer_arn=${{ env.LAYER_VERSION_ARN }} - name: Checkout current repository uses: actions/checkout@v4 From 2f05a765af3445924334f9f32f5dc11d2d1e1413 Mon Sep 17 00:00:00 2001 From: liustve Date: Fri, 11 Apr 2025 20:30:59 +0000 Subject: [PATCH 6/8] revert --- .github/workflows/java-lambda-layer-perf-test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/java-lambda-layer-perf-test.yml b/.github/workflows/java-lambda-layer-perf-test.yml index 15c8ac943..0930e59a2 100644 --- a/.github/workflows/java-lambda-layer-perf-test.yml +++ b/.github/workflows/java-lambda-layer-perf-test.yml @@ -3,9 +3,6 @@ name: Java Lambda Layer Performance Test on: - push: - branches: - - perf_testing_lambda_layer_java workflow_dispatch: inputs: test_runs: From a112a4668c0dcb9d029cbf32dbcb251041577ab3 Mon Sep 17 00:00:00 2001 From: liustve Date: Sat, 12 Apr 2025 03:15:50 +0000 Subject: [PATCH 7/8] test --- .github/workflows/java-lambda-layer-perf-test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/java-lambda-layer-perf-test.yml b/.github/workflows/java-lambda-layer-perf-test.yml index 0930e59a2..8c2c42af0 100644 --- a/.github/workflows/java-lambda-layer-perf-test.yml +++ b/.github/workflows/java-lambda-layer-perf-test.yml @@ -3,6 +3,9 @@ name: Java Lambda Layer Performance Test on: + push: + branches: + - perf_testing_lambda_layer_java workflow_dispatch: inputs: test_runs: @@ -69,7 +72,7 @@ jobs: cd terraform terraform init - terraform apply -auto-approve -var "adot_layer_arn=${{ env.LAYER_VERSION_ARN }} + terraform apply -auto-approve -var "adot_layer_arn=${{ env.LAYER_VERSION_ARN }}" - name: Checkout current repository uses: actions/checkout@v4 From 989e28cf7767db1f351b70ffa8d627958b359550 Mon Sep 17 00:00:00 2001 From: liustve Date: Sat, 12 Apr 2025 03:16:08 +0000 Subject: [PATCH 8/8] test --- .github/workflows/java-lambda-layer-perf-test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/java-lambda-layer-perf-test.yml b/.github/workflows/java-lambda-layer-perf-test.yml index 8c2c42af0..ada7a742c 100644 --- a/.github/workflows/java-lambda-layer-perf-test.yml +++ b/.github/workflows/java-lambda-layer-perf-test.yml @@ -3,9 +3,6 @@ name: Java Lambda Layer Performance Test on: - push: - branches: - - perf_testing_lambda_layer_java workflow_dispatch: inputs: test_runs: