diff --git a/.github/collector/collector-config.yml b/.github/collector/collector-config.yml index 83147d1445..13ac39a41d 100644 --- a/.github/collector/collector-config.yml +++ b/.github/collector/collector-config.yml @@ -5,8 +5,8 @@ receivers: endpoint: 0.0.0.0:4317 exporters: - debug: - verbosity: normal + logging: + loglevel: info awsxray: region: us-west-2 awsemf: @@ -21,11 +21,11 @@ service: receivers: - otlp exporters: - - debug + - logging - awsxray metrics: receivers: - otlp exporters: - - debug + - logging - awsemf diff --git a/.github/collector/docker-compose.yml b/.github/collector/docker-compose.yml index ebd7b37f3d..16eb23fc02 100644 --- a/.github/collector/docker-compose.yml +++ b/.github/collector/docker-compose.yml @@ -1,7 +1,7 @@ version: "3.7" services: otel: - image: amazon/aws-otel-collector:latest + image: amazon/aws-otel-collector:v0.41.1 command: --config /config/collector-config.yml environment: - AWS_ACCESS_KEY_ID diff --git a/.github/workflows/e2e-tests-app-with-java-agent.yml b/.github/workflows/e2e-tests-app-with-java-agent.yml index b2c4d744bf..5bb102a6df 100644 --- a/.github/workflows/e2e-tests-app-with-java-agent.yml +++ b/.github/workflows/e2e-tests-app-with-java-agent.yml @@ -18,7 +18,7 @@ permissions: env: # The precense of this env var is required. It is not redundant - AWS_DEFAULT_REGION: ${{ inputs.aws-region }} + AWS_DEFAULT_REGION: 'us-east-1' jobs: build_Images_For_Testing_Sample_App_With_Java_Agent: @@ -166,19 +166,19 @@ jobs: APP_IMAGE: public.ecr.aws/aws-otel-test/aws-otel-java-spark-awssdkv1:${{ inputs.image_tag }} VALIDATOR_COMMAND: -c spark-otel-trace-metric-validation.yml --endpoint http://app:4567 --metric-namespace aws-otel-integ-test -t ${{ github.run_id }}-${{ github.run_number }} - # publish status - publish-build-status: - needs: [ test_Spring_App_With_Java_Agent, test_Spark_App_With_Java_Agent, test_Spark_AWS_SDK_V1_App_With_Java_Agent ] - if: ${{ always() }} - uses: ./.github/workflows/publish-status.yml - with: - namespace: 'ADOT/GitHubActions' - repository: ${{ github.repository }} - branch: ${{ github.ref_name }} - workflow: ${{ inputs.caller-workflow-name }} - success: ${{ needs.test_Spring_App_With_Java_Agent.result == 'success' && - needs.test_Spark_App_With_Java_Agent.result == 'success' && - needs.test_Spark_AWS_SDK_V1_App_With_Java_Agent.result == 'success' }} - region: us-east-1 - secrets: - roleArn: ${{ secrets.METRICS_ROLE_ARN }} +# # publish status +# publish-build-status: +# needs: [ test_Spring_App_With_Java_Agent, test_Spark_App_With_Java_Agent, test_Spark_AWS_SDK_V1_App_With_Java_Agent ] +# if: ${{ always() }} +# uses: ./.github/workflows/publish-status.yml +# with: +# namespace: 'ADOT/GitHubActions' +# repository: ${{ github.repository }} +# branch: ${{ github.ref_name }} +# workflow: ${{ inputs.caller-workflow-name }} +# success: ${{ needs.test_Spring_App_With_Java_Agent.result == 'success' && +# needs.test_Spark_App_With_Java_Agent.result == 'success' && +# needs.test_Spark_AWS_SDK_V1_App_With_Java_Agent.result == 'success' }} +# region: us-east-1 +# secrets: +# roleArn: ${{ secrets.METRICS_ROLE_ARN }} diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index 89870e82be..4324422038 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -1,5 +1,9 @@ name: Java Agent Main Build on: + pull_request: + branches: + - main + - "release/v*" push: branches: - main @@ -75,29 +79,24 @@ jobs: with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} gpg_password: ${{ secrets.GPG_PASSPHRASE }} - - - uses: gradle/wrapper-validation-action@v1 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} - - - name: Log in to AWS ECR - uses: docker/login-action@v3 - with: - registry: public.ecr.aws +# +# - uses: gradle/wrapper-validation-action@v1 + +# - name: Configure AWS Credentials +# uses: aws-actions/configure-aws-credentials@v4 +# with: +# role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }} +# aws-region: ${{ env.AWS_DEFAULT_REGION }} +# +# - name: Log in to AWS ECR +# uses: docker/login-action@v3 +# with: +# registry: public.ecr.aws - name: Build snapshot with Gradle uses: gradle/gradle-build-action@v3 with: - arguments: build integrationTests snapshot --stacktrace -PenableCoverage=true -PlocalDocker=true - env: - PUBLISH_TOKEN_USERNAME: ${{ secrets.PUBLISH_TOKEN_USERNAME }} - PUBLISH_TOKEN_PASSWORD: ${{ secrets.PUBLISH_TOKEN_PASSWORD }} - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + arguments: build integrationTests --stacktrace -PenableCoverage=true -PlocalDocker=true - name: Get current version id: getADOTJavaVersion @@ -117,21 +116,21 @@ jobs: echo "stagingRegistry=${{ env.STAGING_ECR_REGISTRY }}" >> $GITHUB_OUTPUT echo "stagingRepository=${{ env.STAGING_ECR_REPOSITORY }}" >> $GITHUB_OUTPUT echo "stagingImage=${{ env.STAGING_ECR_REGISTRY }}/${{ env.STAGING_ECR_REPOSITORY }}:${{ steps.java_agent_versioning.outputs.STAGING_TAG }}" >> $GITHUB_OUTPUT - - - name: Build and Push Java Agent Image and Execute cpUtility Tests - uses: ./.github/actions/cpUtility-testing - with: - aws-region: us-west-2 - image_uri_with_tag: ${{ steps.imageOutput.outputs.stagingImage }} - image_registry: ${{ steps.imageOutput.outputs.stagingRegistry }} - adot-java-version: ${{ steps.getADOTJavaVersion.outputs.adot_java_version }} - snapshot-ecr-role: ${{ secrets.JAVA_INSTRUMENTATION_SNAPSHOT_ECR }} - - - name: Upload to GitHub Actions - uses: actions/upload-artifact@v3 - with: - name: aws-opentelemetry-agent.jar - path: otelagent/build/libs/aws-opentelemetry-agent-*.jar +# +# - name: Build and Push Java Agent Image and Execute cpUtility Tests +# uses: ./.github/actions/cpUtility-testing +# with: +# aws-region: us-west-2 +# image_uri_with_tag: ${{ steps.imageOutput.outputs.stagingImage }} +# image_registry: ${{ steps.imageOutput.outputs.stagingRegistry }} +# adot-java-version: ${{ steps.getADOTJavaVersion.outputs.adot_java_version }} +# snapshot-ecr-role: ${{ secrets.JAVA_INSTRUMENTATION_SNAPSHOT_ECR }} +# +# - name: Upload to GitHub Actions +# uses: actions/upload-artifact@v3 +# with: +# name: aws-opentelemetry-agent.jar +# path: otelagent/build/libs/aws-opentelemetry-agent-*.jar default-region-output: runs-on: ubuntu-latest @@ -184,66 +183,66 @@ jobs: image_tag: ${{ github.sha }} caller-workflow-name: 'main-build' - # AppSignals Contract Tests - contract-tests: - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-java@v4 - with: - java-version: 23 - distribution: 'temurin' - - uses: gradle/wrapper-validation-action@v1 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }} - aws-region: ${{ env.AWS_DEFAULT_REGION }} - - - name: Log in to AWS ECR - uses: docker/login-action@v3 - with: - registry: public.ecr.aws - - # cache local patch outputs - - name: Cache local Maven repository - id: cache-local-maven-repo - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository/io/opentelemetry/ - key: ${{ runner.os }}-maven-local-${{ hashFiles('.github/patches/opentelemetry-java*.patch') }} - - - name: Pull base image of Contract Tests Sample Apps - run: docker pull public.ecr.aws/docker/library/amazoncorretto:23-alpine - - - name: Build snapshot with Gradle - uses: gradle/gradle-build-action@v3 - with: - arguments: contractTests -PlocalDocker=true - - application-signals-e2e-test: - needs: [build] - uses: ./.github/workflows/application-signals-e2e-test.yml - secrets: inherit - with: - adot-image-name: ${{ needs.build.outputs.staging-image }} - - publish-build-status: - needs: [ build, contract-tests ] - if: ${{ always() }} - uses: ./.github/workflows/publish-status.yml - with: - namespace: 'ADOT/GitHubActions' - repository: ${{ github.repository }} - branch: ${{ github.ref_name }} - workflow: main-build - success: ${{ needs.build.result == 'success' && - needs.contract-tests.result == 'success' }} - region: us-east-1 - secrets: - roleArn: ${{ secrets.METRICS_ROLE_ARN }} +# # AppSignals Contract Tests +# contract-tests: +# runs-on: ubuntu-latest +# needs: build +# steps: +# - uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# - uses: actions/setup-java@v4 +# with: +# java-version: 23 +# distribution: 'temurin' +# - uses: gradle/wrapper-validation-action@v1 +# +# - name: Configure AWS Credentials +# uses: aws-actions/configure-aws-credentials@v4 +# with: +# role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }} +# aws-region: ${{ env.AWS_DEFAULT_REGION }} +# +# - name: Log in to AWS ECR +# uses: docker/login-action@v3 +# with: +# registry: public.ecr.aws +# +# # cache local patch outputs +# - name: Cache local Maven repository +# id: cache-local-maven-repo +# uses: actions/cache@v3 +# with: +# path: | +# ~/.m2/repository/io/opentelemetry/ +# key: ${{ runner.os }}-maven-local-${{ hashFiles('.github/patches/opentelemetry-java*.patch') }} +# +# - name: Pull base image of Contract Tests Sample Apps +# run: docker pull public.ecr.aws/docker/library/amazoncorretto:23-alpine +# +# - name: Build snapshot with Gradle +# uses: gradle/gradle-build-action@v3 +# with: +# arguments: contractTests -PlocalDocker=true +# +# application-signals-e2e-test: +# needs: [build] +# uses: ./.github/workflows/application-signals-e2e-test.yml +# secrets: inherit +# with: +# adot-image-name: ${{ needs.build.outputs.staging-image }} +# +# publish-build-status: +# needs: [ build, contract-tests ] +# if: ${{ always() }} +# uses: ./.github/workflows/publish-status.yml +# with: +# namespace: 'ADOT/GitHubActions' +# repository: ${{ github.repository }} +# branch: ${{ github.ref_name }} +# workflow: main-build +# success: ${{ needs.build.result == 'success' && +# needs.contract-tests.result == 'success' }} +# region: us-east-1 +# secrets: +# roleArn: ${{ secrets.METRICS_ROLE_ARN }} diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 57fc2422d2..b741588d63 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -88,27 +88,35 @@ jobs: with: arguments: build integrationTests --stacktrace -PenableCoverage=true -PlocalDocker=true - - name: Set up Java version for tests - uses: actions/setup-java@v4 - with: - java-version: 23 - distribution: temurin - - - name: Pull base image of Contract Tests Sample Apps - if: ${{ matrix.os == 'ubuntu-latest' }} - run: docker pull public.ecr.aws/docker/library/amazoncorretto:23-alpine - - - name: Run contract tests - uses: gradle/gradle-build-action@v3 + - name: e2e-test if: ${{ matrix.os == 'ubuntu-latest' }} + uses: ./.github/workflows/e2e-tests-app-with-java-agent.yml with: - arguments: contractTests -PlocalDocker=true -i - - - name: Set up Java version for image build - uses: actions/setup-java@v4 - with: - java-version: 17 - distribution: temurin + aws-region: 'us-east-1' + image_tag: ${{ github.sha }} + caller-workflow-name: 'main-build' + +# - name: Set up Java version for tests +# uses: actions/setup-java@v4 +# with: +# java-version: 23 +# distribution: temurin +# +# - name: Pull base image of Contract Tests Sample Apps +# if: ${{ matrix.os == 'ubuntu-latest' }} +# run: docker pull public.ecr.aws/docker/library/amazoncorretto:23-alpine +# +# - name: Run contract tests +# uses: gradle/gradle-build-action@v3 +# if: ${{ matrix.os == 'ubuntu-latest' }} +# with: +# arguments: contractTests -PlocalDocker=true -i +# +# - name: Set up Java version for image build +# uses: actions/setup-java@v4 +# with: +# java-version: 17 +# distribution: temurin - name: Get current version if: ${{ matrix.os == 'ubuntu-latest' }}