diff --git a/.github/workflows/java-eks-otlp-ocb-canary.yml b/.github/workflows/java-eks-otlp-ocb-canary.yml index 17aa5f54..fcff6157 100644 --- a/.github/workflows/java-eks-otlp-ocb-canary.yml +++ b/.github/workflows/java-eks-otlp-ocb-canary.yml @@ -1,9 +1,14 @@ ## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. ## SPDX-License-Identifier: Apache-2.0 -# TODO: Add comment +## This workflow aims to run the Application Signals end-to-end tests as a canary to +## test the artifacts for App Signals enablement. It will deploy a sample app and remote +## service onto an EKS cluster, instrumented using an OTel Collector built through +## OTel Collector Builder (OCB) and interacting with the OTLP endpoint for this use case. +## Logs, metrics, and traces are all validated. name: Java EKS OTLP/OCB Enablement Canary Test on: + # TODO: Reintroduce cron-job # schedule: # - cron: '12,37 * * * *' # run the workflow at 12th and 37th minute of every hour workflow_dispatch: # be able to run the workflow on demand diff --git a/.github/workflows/java-eks-otlp-ocb-retry.yml b/.github/workflows/java-eks-otlp-ocb-retry.yml index 38d698d2..b66c5874 100644 --- a/.github/workflows/java-eks-otlp-ocb-retry.yml +++ b/.github/workflows/java-eks-otlp-ocb-retry.yml @@ -39,33 +39,33 @@ jobs: caller-workflow-name: ${{ inputs.caller-workflow-name }} java-version: ${{ inputs.java-version }} - # java-eks-otlp-ocb-attempt-2: - # needs: [ java-eks-otlp-ocb-attempt-1 ] - # if: ${{ needs.java-eks-otlp-ocb-attempt-1.outputs.job-started != 'true' }} - # uses: ./.github/workflows/java-eks-otlp-ocb-test.yml - # secrets: inherit - # with: - # aws-region: ${{ inputs.aws-region }} - # test-cluster-name: ${{ inputs.test-cluster-name }} - # caller-workflow-name: ${{ inputs.caller-workflow-name }} - # java-version: ${{ inputs.java-version }} + java-eks-otlp-ocb-attempt-2: + needs: [ java-eks-otlp-ocb-attempt-1 ] + if: ${{ needs.java-eks-otlp-ocb-attempt-1.outputs.job-started != 'true' }} + uses: ./.github/workflows/java-eks-otlp-ocb-test.yml + secrets: inherit + with: + aws-region: ${{ inputs.aws-region }} + test-cluster-name: ${{ inputs.test-cluster-name }} + caller-workflow-name: ${{ inputs.caller-workflow-name }} + java-version: ${{ inputs.java-version }} - # publish-metric-attempt-1: - # needs: [ java-eks-otlp-ocb-attempt-1, java-eks-otlp-ocb-attempt-2 ] - # if: always() - # uses: ./.github/workflows/enablement-test-publish-result.yml - # secrets: inherit - # with: - # aws-region: ${{ inputs.aws-region }} - # caller-workflow-name: ${{ inputs.caller-workflow-name }} - # validation-result: ${{ needs.java-eks-otlp-ocb-attempt-1.outputs.validation-result || needs.java-eks-otlp-ocb-attempt-2.outputs.validation-result }} + publish-metric-attempt-1: + needs: [ java-eks-otlp-ocb-attempt-1, java-eks-otlp-ocb-attempt-2 ] + if: always() + uses: ./.github/workflows/enablement-test-publish-result.yml + secrets: inherit + with: + aws-region: ${{ inputs.aws-region }} + caller-workflow-name: ${{ inputs.caller-workflow-name }} + validation-result: ${{ needs.java-eks-otlp-ocb-attempt-1.outputs.validation-result || needs.java-eks-otlp-ocb-attempt-2.outputs.validation-result }} - # publish-metric-attempt-2: - # needs: [ java-eks-otlp-ocb-attempt-1, java-eks-otlp-ocb-attempt-2, publish-metric-attempt-1 ] - # if: ${{ always() && needs.publish-metric-attempt-1.outputs.job-started != 'true' }} - # uses: ./.github/workflows/enablement-test-publish-result.yml - # secrets: inherit - # with: - # aws-region: ${{ inputs.aws-region }} - # caller-workflow-name: ${{ inputs.caller-workflow-name }} - # validation-result: ${{ needs.java-eks-otlp-ocb-attempt-1.outputs.validation-result || needs.java-eks-otlp-ocb-attempt-2.outputs.validation-result }} \ No newline at end of file + publish-metric-attempt-2: + needs: [ java-eks-otlp-ocb-attempt-1, java-eks-otlp-ocb-attempt-2, publish-metric-attempt-1 ] + if: ${{ always() && needs.publish-metric-attempt-1.outputs.job-started != 'true' }} + uses: ./.github/workflows/enablement-test-publish-result.yml + secrets: inherit + with: + aws-region: ${{ inputs.aws-region }} + caller-workflow-name: ${{ inputs.caller-workflow-name }} + validation-result: ${{ needs.java-eks-otlp-ocb-attempt-1.outputs.validation-result || needs.java-eks-otlp-ocb-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/java-eks-otlp-ocb-test.yml b/.github/workflows/java-eks-otlp-ocb-test.yml index e8c0ea00..5c5bc886 100644 --- a/.github/workflows/java-eks-otlp-ocb-test.yml +++ b/.github/workflows/java-eks-otlp-ocb-test.yml @@ -189,7 +189,6 @@ jobs: echo MAIN_SAMPLE_APP_IMAGE_ARN="${{ env.ACCOUNT_ID }}.dkr.ecr.${{ env.E2E_TEST_AWS_REGION }}.amazonaws.com/${{ env.JAVA_MAIN_SAMPLE_APP_IMAGE }}:v${{ env.JAVA_VERSION }}" >> $GITHUB_ENV echo REMOTE_SAMPLE_APP_IMAGE_ARN="${{ env.ACCOUNT_ID }}.dkr.ecr.${{ env.E2E_TEST_AWS_REGION }}.amazonaws.com/${{ env.JAVA_REMOTE_SAMPLE_APP_IMAGE }}:v${{ env.JAVA_VERSION }}" >> $GITHUB_ENV - # TODO: Fix retry, clean-app-signals doesn't work for enable-app-signals-ocb.sh - name: Install OTel Operator using enablement script uses: ./.github/workflows/actions/execute_and_retry with: @@ -197,10 +196,8 @@ jobs: ${{ env.CLUSTER_NAME }} \ ${{ env.E2E_TEST_AWS_REGION }} \ ${{ env.SAMPLE_APP_NAMESPACE }}" - max_retry: 1 + max_retry: 3 sleep_time: 60 - # TODO: cleanup and increase retries - # cleanup: "TODO" - name: Install OTel Collector uses: ./.github/workflows/actions/execute_and_retry @@ -208,6 +205,8 @@ jobs: command: "cd ${{ env.TEST_RESOURCES_FOLDER }}/terraform/java/eks-otlp-ocb/util && kubectl apply -f ./appsignals-collector.yaml -n ${{ env.SAMPLE_APP_NAMESPACE }}" cleanup: "kubectl delete -f ./appsignals-collector.yaml -n ${{ env.SAMPLE_APP_NAMESPACE }} && \ aws eks update-kubeconfig --name ${{ env.CLUSTER_NAME }} --region ${{ env.E2E_TEST_AWS_REGION }}" + max_retry: 3 + sleep_time: 60 - name: Deploy sample app via terraform and wait for the endpoint to come online id: deploy-sample-app @@ -389,16 +388,13 @@ jobs: --namespace ${{ env.SAMPLE_APP_NAMESPACE }} \ --cluster ${{ env.CLUSTER_NAME }} \ --region ${{ env.E2E_TEST_AWS_REGION }} - - # TODO: Fix, doesn't work right now because of the following error - # `serviceaccount "default/appsignals-collector" was not created by eksctl; will not be deleted` - # Not a necessary piece of code anyways, service account persisting is not an issue + - name: Remove Application Signals Collector IAM service account if: always() continue-on-error: true run: | eksctl delete iamserviceaccount \ - --name appsignals-collector \ + --name appsignals-collector \ --namespace ${{ env.SAMPLE_APP_NAMESPACE }} \ --cluster ${{ env.CLUSTER_NAME }} \ --region ${{ env.E2E_TEST_AWS_REGION }} \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-trace.mustache index 257a458d..33ad22d3 100644 --- a/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-trace.mustache +++ b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-trace.mustache @@ -36,7 +36,7 @@ "name": "^S3$", "http": { "request": { - "url": "^https://e2e-test-bucket-name-{{testingId}}.s3.us-west-1.amazonaws.com\\?location$", + "url": "^https://e2e-test-bucket-name-{{testingId}}.s3.[a-z]+-[a-z]+-\\d.amazonaws.com\\?location$", "method": "^GET$" } },