diff --git a/.github/workflows/java-eks-otlp-ocb-canary.yml b/.github/workflows/java-eks-otlp-ocb-canary.yml new file mode 100644 index 000000000..a02bea0e6 --- /dev/null +++ b/.github/workflows/java-eks-otlp-ocb-canary.yml @@ -0,0 +1,36 @@ +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: Apache-2.0 + +## 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: + 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 + +permissions: + id-token: write + contents: read + +jobs: + eks: + strategy: + fail-fast: false + matrix: + aws-region: ['us-east-1'] + # TODO: Reintroduce all regions + # aws-region: ['af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1', + # 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1', + # 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1', + # 'us-east-1','us-east-2','us-west-1','us-west-2'] + uses: ./.github/workflows/java-eks-otlp-ocb-retry.yml + secrets: inherit + with: + aws-region: ${{ matrix.aws-region }} + test-cluster-name: 'e2e-java-otlp-ocb-canary-test' + caller-workflow-name: 'appsignals-java-e2e-eks-otlp-ocb-canary-test' + java-version: '11' diff --git a/.github/workflows/java-eks-otlp-ocb-retry.yml b/.github/workflows/java-eks-otlp-ocb-retry.yml new file mode 100644 index 000000000..b66c58743 --- /dev/null +++ b/.github/workflows/java-eks-otlp-ocb-retry.yml @@ -0,0 +1,71 @@ +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: Apache-2.0 + +# This is a reusable workflow for running the Enablement test for App Signals. +# It is meant to be called from another workflow. +# Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview +name: Java EKS OTLP/OCB Retry +on: + workflow_call: + inputs: + aws-region: + required: true + type: string + test-cluster-name: + required: true + type: string + caller-workflow-name: + required: true + type: string + java-version: + required: true + type: string + +concurrency: + group: 'java-eks-otlp-ocb-${{ inputs.aws-region }}-${{ github.ref_name }}' + cancel-in-progress: false + +permissions: + id-token: write + contents: read + +jobs: + java-eks-otlp-ocb-attempt-1: + 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-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 new file mode 100644 index 000000000..f159fe1d3 --- /dev/null +++ b/.github/workflows/java-eks-otlp-ocb-test.yml @@ -0,0 +1,391 @@ +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: Apache-2.0 + +# This is a reusable workflow for running the Enablement test for App Signals. +# It is meant to be called from another workflow. +# Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview +name: Java EKS OTLP/OCB Use Case +on: + workflow_call: + inputs: + aws-region: + required: true + type: string + test-cluster-name: + required: true + type: string + caller-workflow-name: + required: true + type: string + java-version: + description: "Currently support version 8, 11, 17, 21, 22" + required: false + type: string + default: '11' + adot-image-name: + required: false + type: string + cw-agent-operator-tag: + required: false + type: string + e2e-otel-collector-image-tag: + required: false + type: string + default: latest + outputs: + job-started: + value: ${{ jobs.java-eks-otlp-ocb.outputs.job-started }} + validation-result: + value: ${{ jobs.java-eks-otlp-ocb.outputs.validation-result }} + +permissions: + id-token: write + contents: read + +env: + # The precense of this env var is required for use by terraform and AWS CLI commands + # It is not redundant + E2E_TEST_AWS_REGION: ${{ inputs.aws-region }} + CLUSTER_NAME: ${{ inputs.test-cluster-name }} + CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }} + JAVA_VERSION: ${{ inputs.java-version }} + ADOT_IMAGE_NAME: ${{ inputs.adot-image-name }} + CW_AGENT_OPERATOR_TAG: ${{ inputs.cw-agent-operator-tag }} + E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }} + E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} + METRIC_NAMESPACE: ApplicationSignals + LOG_GROUP_NAME: /aws/application-signals/data + TEST_RESOURCES_FOLDER: ${GITHUB_WORKSPACE} + E2E_OTEL_COLLECTOR_IMAGE_TAG: ${{ inputs.e2e-otel-collector-image-tag }} + +jobs: + java-eks-otlp-ocb: + runs-on: ubuntu-latest + timeout-minutes: 30 + outputs: + job-started: ${{ steps.job-started.outputs.job-started }} + validation-result: ${{ steps.validation-result.outputs.validation-result }} + steps: + - name: Check if the job started + id: job-started + run: echo "job-started=true" >> $GITHUB_OUTPUT + + - name: Generate testing id and sample app namespace + run: | + echo TESTING_ID="${{ github.job }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" >> $GITHUB_ENV + echo SAMPLE_APP_NAMESPACE="ns-${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_ENV + + - uses: actions/checkout@v4 + with: + repository: 'aws-observability/aws-application-signals-test-framework' + ref: ${{ env.CALLER_WORKFLOW_NAME == 'main-build' && 'main' || github.ref }} + fetch-depth: 0 + + # We initialize Gradlew Daemon early on during the workflow because sometimes initialization + # fails due to transient issues. If it fails here, then we will try again later before the validators + - name: Initiate Gradlew Daemon + id: initiate-gradlew + uses: ./.github/workflows/actions/execute_and_retry + continue-on-error: true + with: + command: "./gradlew :validator:build" + cleanup: "./gradlew clean" + max_retry: 3 + sleep_time: 60 + + - name: Download enablement script + uses: ./.github/workflows/actions/execute_and_retry + with: + pre-command: "mkdir enablement-script && cd enablement-script" + command: "wget https://raw.githubusercontent.com/aws-observability/application-signals-demo/refs/heads/ocb/scripts/eks/appsignals/install-otel-operator.sh" + cleanup: "rm -f install-otel-operator.sh" + post-command: "chmod +x install-otel-operator.sh" + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} + aws-region: us-east-1 + + - name: Retrieve account + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + ACCOUNT_ID, otlp-region-account/gamma-${{ env.E2E_TEST_AWS_REGION }} + JAVA_MAIN_SAMPLE_APP_IMAGE, e2e-test/java-main-sample-app-image + JAVA_REMOTE_SAMPLE_APP_IMAGE, e2e-test/java-remote-sample-app-image + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} + aws-region: ${{ env.E2E_TEST_AWS_REGION }} + + # local directory to store the kubernetes config + - name: Create kubeconfig directory + run: mkdir -p ${{ github.workspace }}/.kube + + - name: Set KUBECONFIG environment variable + run: echo KUBECONFIG="${{ github.workspace }}/.kube/config" >> $GITHUB_ENV + + - name: Set up kubeconfig + run: aws eks update-kubeconfig --name ${{ env.CLUSTER_NAME }} --region ${{ env.E2E_TEST_AWS_REGION }} + + - name: Download and install eksctl + uses: ./.github/workflows/actions/execute_and_retry + with: + pre-command: 'mkdir ${{ github.workspace }}/eksctl' + command: 'curl -sLO "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_Linux_amd64.tar.gz" + && tar -xzf eksctl_Linux_amd64.tar.gz -C ${{ github.workspace }}/eksctl && rm eksctl_Linux_amd64.tar.gz' + cleanup: 'rm -f eksctl_Linux_amd64.tar.gz' + + - name: Add eksctl to Github Path + run: | + echo "${{ github.workspace }}/eksctl" >> $GITHUB_PATH + + # This step deletes lingering resources from previous test runs + - name: Delete all sample app namespaces + continue-on-error: true + timeout-minutes: 5 + run: kubectl get namespace | awk '/^ns-[0-9]+-[0-9]+/{print $1}' | xargs --no-run-if-empty kubectl delete namespace + + # Set up App Signals permissions and resources + # Renamed `service-account` to `sa` to get under 128 character limit for CFN stack names, which includes the namespace + - name: Create role for AWS access from the sample app + id: create_service_account + uses: ./.github/workflows/actions/execute_and_retry + with: + command: "eksctl create iamserviceaccount \ + --name sa-${{ env.TESTING_ID }} \ + --namespace ${{ env.SAMPLE_APP_NAMESPACE }} \ + --cluster ${{ env.CLUSTER_NAME }} \ + --role-name eks-s3-access-${{ env.TESTING_ID }} \ + --attach-policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess \ + --region ${{ env.E2E_TEST_AWS_REGION }} \ + --approve" + cleanup: "eksctl delete iamserviceaccount \ + --name sa-${{ env.TESTING_ID }} \ + --namespace ${{ env.SAMPLE_APP_NAMESPACE }} \ + --cluster ${{ env.CLUSTER_NAME }} \ + --region ${{ env.E2E_TEST_AWS_REGION }}" + sleep_time: 60 + + - name: Set up terraform + uses: ./.github/workflows/actions/execute_and_retry + with: + command: "wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg" + post-command: 'echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list + && sudo apt update && sudo apt install terraform' + sleep_time: 60 + + - name: Initiate Terraform + uses: ./.github/workflows/actions/execute_and_retry + with: + command: "cd ${{ env.TEST_RESOURCES_FOLDER }}/terraform/java/eks-otlp-ocb && terraform init && terraform validate" + cleanup: "rm -rf .terraform && rm -rf .terraform.lock.hcl" + max_retry: 6 + sleep_time: 60 + + - name: Set Sample App Image + run: | + 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 + + - name: Install OTel Operator using enablement script + uses: ./.github/workflows/actions/execute_and_retry + with: + command: "${{ env.TEST_RESOURCES_FOLDER }}/enablement-script/install-otel-operator.sh \ + ${{ env.CLUSTER_NAME }} \ + ${{ env.E2E_TEST_AWS_REGION }} \ + ${{ env.SAMPLE_APP_NAMESPACE }}" + max_retry: 3 + sleep_time: 60 + + - name: Install OTel Collector + uses: ./.github/workflows/actions/execute_and_retry + with: + command: "cd ${{ env.TEST_RESOURCES_FOLDER }}/terraform/java/eks-otlp-ocb/util && \ + sed -i -e 's#${E2E_TEST_AWS_REGION}#${{ env.E2E_TEST_AWS_REGION }}#g' ./appsignals-collector.yaml && \ + sed -i -e 's#${SAMPLE_APP_NAMESPACE}#${{ env.SAMPLE_APP_NAMESPACE }}#g' ./appsignals-collector.yaml && \ + sed -i -e 's#${E2E_OTEL_COLLECTOR_IMAGE}#${{ env.ACCOUNT_ID }}.dkr.ecr.${{ env.E2E_TEST_AWS_REGION }}.amazonaws.com/ocb-release-test-collector:${{ env.E2E_OTEL_COLLECTOR_IMAGE_TAG }}#g' ./appsignals-collector.yaml && \ + 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 + uses: ./.github/workflows/actions/execute_and_retry + with: + command: "cd ${{ env.TEST_RESOURCES_FOLDER }}/terraform/java/eks-otlp-ocb && \ + terraform apply -auto-approve \ + -var=\"test_id=${{ env.TESTING_ID }}\" \ + -var=\"aws_region=${{ env.E2E_TEST_AWS_REGION }}\" \ + -var=\"kube_directory_path=${{ github.workspace }}/.kube\" \ + -var=\"eks_cluster_name=${{ env.CLUSTER_NAME }}\" \ + -var=\"eks_cluster_context_name=$(kubectl config current-context)\" \ + -var=\"test_namespace=${{ env.SAMPLE_APP_NAMESPACE }}\" \ + -var=\"service_account_aws_access=sa-${{ env.TESTING_ID }}\" \ + -var=\"sample_app_image=${{ env.MAIN_SAMPLE_APP_IMAGE_ARN }}\" \ + -var=\"sample_remote_app_image=${{ env.REMOTE_SAMPLE_APP_IMAGE_ARN }}\" \ + -var='account_id=${{ env.ACCOUNT_ID }}'" + cleanup: "terraform destroy -auto-approve \ + -var=\"test_id=${{ env.TESTING_ID }}\" \ + -var=\"aws_region=${{ env.E2E_TEST_AWS_REGION }}\" \ + -var=\"kube_directory_path=${{ github.workspace }}/.kube\" \ + -var=\"eks_cluster_name=${{ env.CLUSTER_NAME }}\" \ + -var=\"test_namespace=${{ env.SAMPLE_APP_NAMESPACE }}\" \ + -var=\"service_account_aws_access=sa-${{ env.TESTING_ID }}\" \ + -var=\"sample_app_image=${{ env.MAIN_SAMPLE_APP_IMAGE_ARN }}\" \ + -var=\"sample_remote_app_image=${{ env.REMOTE_SAMPLE_APP_IMAGE_ARN }}\"" + max_retry: 2 + sleep_time: 60 + + - name: Get Remote Service Deployment Name + uses: ./.github/workflows/actions/execute_and_retry + with: + command: echo "REMOTE_SERVICE_DEPLOYMENT_NAME=$(kubectl get deployments -n ${{ env.SAMPLE_APP_NAMESPACE }} --selector=app=remote-app -o jsonpath='{.items[0].metadata.name}')" >> $GITHUB_ENV + max_retry: 3 + sleep_time: 30 + + - name: Get Remote Service IP + uses: ./.github/workflows/actions/execute_and_retry + with: + command: echo "REMOTE_SERVICE_POD_IP=$(kubectl get pods -n ${{ env.SAMPLE_APP_NAMESPACE }} --selector=app=remote-app -o jsonpath='{.items[0].status.podIP}')" >> $GITHUB_ENV + max_retry: 3 + sleep_time: 30 + + - name: Get Remote Service IP + uses: ./.github/workflows/actions/execute_and_retry + with: + command: echo "APP_ENDPOINT=$(kubectl get pods -n ${{ env.SAMPLE_APP_NAMESPACE }} --selector=app=sample-app -o jsonpath='{.items[0].status.podIP}'):8080" >> $GITHUB_ENV + max_retry: 3 + sleep_time: 30 + + - name: Set endpoints for the traffic generator + uses: ./.github/workflows/actions/execute_and_retry + with: + command: kubectl set env -n ${{ env.SAMPLE_APP_NAMESPACE }} deployment/traffic-generator MAIN_ENDPOINT=${{ env.APP_ENDPOINT }} REMOTE_ENDPOINT=${{ env.REMOTE_SERVICE_POD_IP }} + max_retry: 3 + sleep_time: 30 + + # Validation for app signals telemetry data + - name: Call endpoint and validate generated EMF logs + id: log-validation + if: steps.deploy-sample-app.outcome == 'success' && !cancelled() + run: ./gradlew validator:run --args='-c java/eks-otlp-ocb/log-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://${{ env.APP_ENDPOINT }} + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --app-namespace ${{ env.SAMPLE_APP_NAMESPACE }} + --platform-info ${{ env.CLUSTER_NAME }} + --service-name sample-application-${{ env.TESTING_ID }} + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }} + --remote-service-ip ${{ env.REMOTE_SERVICE_POD_IP }} + --query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }} + --rollup' + + - name: Call endpoints and validate generated metrics + id: metric-validation + if: (steps.deploy-sample-app.outcome == 'success' || steps.log-validation.outcome == 'failure') && !cancelled() + run: ./gradlew validator:run --args='-c java/eks-otlp-ocb/metric-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://${{ env.APP_ENDPOINT }} + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --app-namespace ${{ env.SAMPLE_APP_NAMESPACE }} + --platform-info ${{ env.CLUSTER_NAME }} + --service-name sample-application-${{ env.TESTING_ID }} + --remote-service-name sample-remote-application-${{ env.TESTING_ID }} + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }} + --remote-service-ip ${{ env.REMOTE_SERVICE_POD_IP }} + --query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }} + --rollup' + + - name: Call endpoints and validate generated traces + id: trace-validation + if: (steps.deploy-sample-app.outcome == 'success' || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled() + run: ./gradlew validator:run --args='-c java/eks-otlp-ocb/trace-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://${{ env.APP_ENDPOINT }} + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --app-namespace ${{ env.SAMPLE_APP_NAMESPACE }} + --platform-info ${{ env.CLUSTER_NAME }} + --service-name sample-application-${{ env.TESTING_ID }} + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_DEPLOYMENT_NAME }} + --remote-service-ip ${{ env.REMOTE_SERVICE_POD_IP }} + --query-string ip=${{ env.REMOTE_SERVICE_POD_IP }}&testingId=${{ env.TESTING_ID }} + --rollup' + + - name: Refresh AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} + aws-region: ${{ env.E2E_TEST_AWS_REGION }} + + - name: Save test results + if: always() + id: validation-result + run: | + if [ "${{ steps.trace-validation.outcome }}" = "success" ]; then + echo "validation-result=success" >> $GITHUB_OUTPUT + else + echo "validation-result=failure" >> $GITHUB_OUTPUT + fi + + - name: Clean up + if: always() + continue-on-error: true + timeout-minutes: 5 + working-directory: terraform/java/eks-otlp-ocb/util + run: | + aws eks update-kubeconfig --name ${{ env.CLUSTER_NAME }} --region ${{ env.E2E_TEST_AWS_REGION }} + kubectl delete ns ${{ env.SAMPLE_APP_NAMESPACE }} + eksctl delete iamserviceaccount --name cloudwatch-agent --namespace amazon-cloudwatch --cluster ${{ env.CLUSTER_NAME }} --region ${{ env.E2E_TEST_AWS_REGION }} + kubectl delete ns opentelemetry-operator-system + aws eks update-kubeconfig --name ${{ env.CLUSTER_NAME }} --region ${{ env.E2E_TEST_AWS_REGION }} + + - name: Terraform destroy + if: always() + continue-on-error: true + timeout-minutes: 5 + working-directory: terraform/java/eks-otlp-ocb + run: | + terraform destroy -auto-approve \ + -var="test_id=${{ env.TESTING_ID }}" \ + -var="aws_region=${{ env.E2E_TEST_AWS_REGION }}" \ + -var="kube_directory_path=${{ github.workspace }}/.kube" \ + -var="eks_cluster_name=${{ env.CLUSTER_NAME }}" \ + -var="test_namespace=${{ env.SAMPLE_APP_NAMESPACE }}" \ + -var="service_account_aws_access=sa-${{ env.TESTING_ID }}" \ + -var="sample_app_image=${{ env.MAIN_SAMPLE_APP_IMAGE_ARN }}" \ + -var="sample_remote_app_image=${{ env.REMOTE_SAMPLE_APP_IMAGE_ARN }}" + + - name: Remove aws access service account + if: always() + continue-on-error: true + run: | + eksctl delete iamserviceaccount \ + --name sa-${{ env.TESTING_ID }} \ + --namespace ${{ env.SAMPLE_APP_NAMESPACE }} \ + --cluster ${{ env.CLUSTER_NAME }} \ + --region ${{ env.E2E_TEST_AWS_REGION }} + + - name: Remove Application Signals Collector IAM service account + if: always() + continue-on-error: true + run: | + eksctl delete iamserviceaccount \ + --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/terraform/java/eks-otlp-ocb/kubeconfig.tpl b/terraform/java/eks-otlp-ocb/kubeconfig.tpl new file mode 100644 index 000000000..bbcaa8aed --- /dev/null +++ b/terraform/java/eks-otlp-ocb/kubeconfig.tpl @@ -0,0 +1,18 @@ +apiVersion: v1 +clusters: +- cluster: + certificate-authority-data: ${CA_DATA} + server: ${SERVER_ENDPOINT} + name: ${CLUSTER_NAME} +contexts: +- context: + cluster: ${CLUSTER_NAME} + user: terraform_user + name: ${CLUSTER_NAME} +current-context: ${CLUSTER_NAME} +kind: Config +preferences: {} +users: +- name: terraform_user + user: + token: ${TOKEN} \ No newline at end of file diff --git a/terraform/java/eks-otlp-ocb/main.tf b/terraform/java/eks-otlp-ocb/main.tf new file mode 100644 index 000000000..6566bf0ef --- /dev/null +++ b/terraform/java/eks-otlp-ocb/main.tf @@ -0,0 +1,251 @@ +# ------------------------------------------------------------------------ +# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# or in the "license" file accompanying this file. This file is distributed +# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either +# express or implied. See the License for the specific language governing +# permissions and limitations under the License. +# ------------------------------------------------------------------------- + +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + } + + kubernetes = { + source = "hashicorp/kubernetes" + version = ">= 2.16.1" + } + + kubectl = { + source = "gavinbunney/kubectl" + version = ">= 1.7.0" + } + } +} + +provider "aws" { + region = var.aws_region +} + +# get eks cluster +data "aws_eks_cluster" "testing_cluster" { + name = var.eks_cluster_name +} +data "aws_eks_cluster_auth" "testing_cluster" { + name = var.eks_cluster_name +} + +# set up kubectl +provider "kubernetes" { + host = data.aws_eks_cluster.testing_cluster.endpoint + cluster_ca_certificate = base64decode(data.aws_eks_cluster.testing_cluster.certificate_authority[0].data) + token = data.aws_eks_cluster_auth.testing_cluster.token +} + +provider "kubectl" { + // Note: copy from eks module. Please avoid use shorted-lived tokens when running locally. + // For more information: https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs#exec-plugins + host = data.aws_eks_cluster.testing_cluster.endpoint + cluster_ca_certificate = base64decode(data.aws_eks_cluster.testing_cluster.certificate_authority[0].data) + token = data.aws_eks_cluster_auth.testing_cluster.token + load_config_file = false +} + +data "template_file" "kubeconfig_file" { + template = file("./kubeconfig.tpl") + vars = { + CLUSTER_NAME : var.eks_cluster_context_name + CA_DATA : data.aws_eks_cluster.testing_cluster.certificate_authority[0].data + SERVER_ENDPOINT : data.aws_eks_cluster.testing_cluster.endpoint + TOKEN = data.aws_eks_cluster_auth.testing_cluster.token + } +} + +resource "local_file" "kubeconfig" { + content = data.template_file.kubeconfig_file.rendered + filename = "${var.kube_directory_path}/config" +} + +### Setting up the sample app on the cluster + +resource "kubernetes_deployment" "sample_app_deployment" { + + metadata { + name = "sample-app-deployment-${var.test_id}" + namespace = var.test_namespace + } + + spec { + replicas = 1 + selector { + match_labels = { + app = "sample-app" + } + } + template { + metadata { + labels = { + app = "sample-app" + } + annotations = { + # these annotations allow for OTel Java instrumentation + "instrumentation.opentelemetry.io/inject-java" = "true" + } + } + spec { + service_account_name = var.service_account_aws_access + container { + name = "back-end" + image = var.sample_app_image + image_pull_policy = "Always" + env { + #inject the test id to service name for unique App Signals metrics + name = "OTEL_SERVICE_NAME" + value = "sample-application-${var.test_id}" + } + env { + name = "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED" + value = "false" + } + port { + container_port = 8080 + } + } + } + } + } +} + +resource "kubernetes_service" "sample_app_service" { + depends_on = [ kubernetes_deployment.sample_app_deployment ] + + metadata { + name = "sample-app-service" + namespace = var.test_namespace + } + spec { + type = "NodePort" + selector = { + app = "sample-app" + } + port { + protocol = "TCP" + port = 8080 + target_port = 8080 + node_port = 30100 + } + } +} + +# Set up the remote service + +resource "kubernetes_deployment" "sample_remote_app_deployment" { + + metadata { + name = "sample-r-app-deployment-${var.test_id}" + namespace = var.test_namespace + labels = { + app = "remote-app" + } + } + + spec { + replicas = 1 + selector { + match_labels = { + app = "remote-app" + } + } + template { + metadata { + labels = { + app = "remote-app" + } + annotations = { + # these annotations allow for OTel Java instrumentation + "instrumentation.opentelemetry.io/inject-java" = "true" + } + } + spec { + service_account_name = var.service_account_aws_access + container { + name = "back-end" + image = var.sample_remote_app_image + image_pull_policy = "Always" + port { + container_port = 8080 + } + env { + name = "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED" + value = "false" + } + } + } + } + } +} + +resource "kubernetes_service" "sample_remote_app_service" { + depends_on = [ kubernetes_deployment.sample_remote_app_deployment ] + + metadata { + name = "sample-remote-app-service" + namespace = var.test_namespace + } + spec { + type = "NodePort" + selector = { + app = "remote-app" + } + port { + protocol = "TCP" + port = 8080 + target_port = 8080 + node_port = 30101 + } + } +} + +resource "kubernetes_deployment" "traffic_generator" { + metadata { + name = "traffic-generator" + namespace = var.test_namespace + labels = { + app = "traffic-generator" + } + } + spec { + replicas = 1 + selector { + match_labels = { + app = "traffic-generator" + } + } + template { + metadata { + labels = { + app = "traffic-generator" + } + } + spec { + container { + name = "traffic-generator" + image = "${var.account_id}.dkr.ecr.${var.aws_region}.amazonaws.com/e2e-test-resource:traffic-generator" + image_pull_policy = "Always" + env { + name = "ID" + value = var.test_id + } + } + } + } + } +} \ No newline at end of file diff --git a/terraform/java/eks-otlp-ocb/util/appsignals-collector.yaml b/terraform/java/eks-otlp-ocb/util/appsignals-collector.yaml new file mode 100644 index 000000000..b8a67c43a --- /dev/null +++ b/terraform/java/eks-otlp-ocb/util/appsignals-collector.yaml @@ -0,0 +1,177 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: otel-collector-role +rules: + - apiGroups: [""] + resources: ["pods", "nodes", "namespaces", "endpoints"] + verbs: ["list", "watch", "get"] + - apiGroups: [""] + resources: ["services"] + verbs: ["list", "watch"] + - apiGroups: ["apps"] + resources: ["replicasets", "daemonsets", "deployments", "statefulsets"] + verbs: ["list", "watch", "get"] + - apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["list", "watch"] + - apiGroups: [""] + resources: ["nodes/proxy"] + verbs: ["get"] + - apiGroups: [""] + resources: ["nodes/stats", "configmaps", "events"] + verbs: ["create", "get"] + - apiGroups: [""] + resources: ["configmaps"] + verbs: ["update"] + +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: otel-collector-role-binding +subjects: + - kind: ServiceAccount + name: appsignals-collector + namespace: ${SAMPLE_APP_NAMESPACE} +roleRef: + kind: ClusterRole + name: otel-collector-role + apiGroup: rbac.authorization.k8s.io +--- + +apiVersion: opentelemetry.io/v1alpha1 +kind: OpenTelemetryCollector +metadata: + name: appsignals +spec: + # mode: daemonset + image: ${E2E_OTEL_COLLECTOR_IMAGE} + config: | + extensions: + sigv4auth: + region: "${E2E_TEST_AWS_REGION}" + service: "xray" + + receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + + processors: + awsapplicationsignals: + resolvers: + - platform: eks + name: appsignals-ocb-demo + resourcedetection: + detectors: + - eks + - env + - ec2 + ec2: + resource_attributes: + cloud.account.id: + enabled: true + cloud.availability_zone: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + host.id: + enabled: true + host.image.id: + enabled: true + host.name: + enabled: true + host.type: + enabled: true + tags: + - ^kubernetes.io/cluster/.*$ + - ^aws:autoscaling:groupName + ecs: + resource_attributes: + aws.ecs.cluster.arn: + enabled: true + aws.ecs.launchtype: + enabled: true + aws.ecs.task.arn: + enabled: true + aws.ecs.task.family: + enabled: true + aws.ecs.task.id: + enabled: true + aws.ecs.task.revision: + enabled: true + aws.log.group.arns: + enabled: true + aws.log.group.names: + enabled: true + aws.log.stream.arns: + enabled: true + aws.log.stream.names: + enabled: true + cloud.account.id: + enabled: true + cloud.availability_zone: + enabled: true + cloud.platform: + enabled: true + cloud.provider: + enabled: true + cloud.region: + enabled: true + eks: + resource_attributes: + cloud.platform: + enabled: true + cloud.provider: + enabled: true + k8s.cluster.name: + enabled: true + + exporters: + otlphttp: + traces_endpoint: https://xray.${E2E_TEST_AWS_REGION}.amazonaws.com/v1/traces + auth: + authenticator: sigv4auth + + service: + pipelines: + traces: + receivers: [otlp] + processors: [resourcedetection, awsapplicationsignals] + exporters: [otlphttp] + extensions: [sigv4auth] + telemetry: + logs: + level: debug +--- +apiVersion: opentelemetry.io/v1alpha1 +kind: Instrumentation +metadata: + name: my-instrumentation +spec: + # OTEL_EXPORTER_OTLP_ENDPOINT + exporter: + endpoint: http://appsignals-collector:4318 + java: + image: public.ecr.aws/aws-observability/adot-autoinstrumentation-java:v1.32.5 + env: + - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + value: http://appsignals-collector:4318/v1/traces + # - name: OTEL_AWS_APPLICATION_SIGNALS_ENABLED + # value: "true" + # - name: OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT + # value: http://appsignals-collector:4316/v1/metrics + - name: OTEL_EXPORTER_OTLP_PROTOCOL + value: "http/protobuf" + # - name: OTEL_JMX_ENABLE + # value: "true" + # - name: OTEL_JMX_TARGET_SYSTEM + # value: "jvm" \ No newline at end of file diff --git a/terraform/java/eks-otlp-ocb/variables.tf b/terraform/java/eks-otlp-ocb/variables.tf new file mode 100644 index 000000000..2c71dcd3f --- /dev/null +++ b/terraform/java/eks-otlp-ocb/variables.tf @@ -0,0 +1,54 @@ +# ------------------------------------------------------------------------ +# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# or in the "license" file accompanying this file. This file is distributed +# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either +# express or implied. See the License for the specific language governing +# permissions and limitations under the License. +# ------------------------------------------------------------------------- + +variable "test_id" { + default = "dummy-123" +} + +variable "kube_directory_path" { + default = "./.kube" +} + +variable "aws_region" { + default = "" +} + +variable "eks_cluster_name" { + default = "" +} + +variable "eks_cluster_context_name" { + default = "." +} + +variable "test_namespace" { + default = "sample-app-namespace" +} + +variable "service_account_aws_access" { + default = "sample-app-service-account" +} + +variable "sample_app_image" { + default = ":" +} + +variable "sample_remote_app_image" { + default = ":" +} + +variable "account_id" { + default = "" +} diff --git a/validator/src/main/java/com/amazon/aoc/App.java b/validator/src/main/java/com/amazon/aoc/App.java index 73cd71c3c..5074eccf4 100644 --- a/validator/src/main/java/com/amazon/aoc/App.java +++ b/validator/src/main/java/com/amazon/aoc/App.java @@ -75,6 +75,9 @@ public class App implements Callable { @CommandLine.Option(names = {"--remote-service-deployment-name"}) private String remoteServiceDeploymentName; + @CommandLine.Option(names = {"--remote-service-ip"}) + private String remoteServiceIp; + @CommandLine.Option(names = {"--remote-resource-identifier"}) private String remoteResourceIdentifier; @@ -176,6 +179,7 @@ public Integer call() throws Exception { context.setServiceName(this.serviceName); context.setRemoteServiceName(this.remoteServiceName); context.setRemoteServiceDeploymentName(this.remoteServiceDeploymentName); + context.setRemoteServiceIp(this.remoteServiceIp); context.setRemoteResourceIdentifier(this.remoteResourceIdentifier); context.setRemoteDbUser(this.remoteDbUser); context.setEndpoint(this.endpoint); diff --git a/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java b/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java index 8d4ae1f84..de0d86723 100644 --- a/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java +++ b/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java @@ -43,6 +43,23 @@ public enum PredefinedExpectedTemplate implements FileConfig { JAVA_EKS_RDS_MYSQL_METRIC("/expected-data-template/java/eks/rds-mysql-metric.mustache"), JAVA_EKS_RDS_MYSQL_TRACE("/expected-data-template/java/eks/rds-mysql-trace.mustache"), + /** JAVA EKS Test Case Validations */ + JAVA_EKS_OTLP_OCB_OUTGOING_HTTP_CALL_LOG("/expected-data-template/java/eks-otlp-ocb/outgoing-http-call-log.mustache"), + JAVA_EKS_OTLP_OCB_OUTGOING_HTTP_CALL_METRIC("/expected-data-template/java/eks-otlp-ocb/outgoing-http-call-metric.mustache"), + JAVA_EKS_OTLP_OCB_OUTGOING_HTTP_CALL_TRACE("/expected-data-template/java/eks-otlp-ocb/outgoing-http-call-trace.mustache"), + + JAVA_EKS_OTLP_OCB_AWS_SDK_CALL_LOG("/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-log.mustache"), + JAVA_EKS_OTLP_OCB_AWS_SDK_CALL_METRIC("/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-metric.mustache"), + JAVA_EKS_OTLP_OCB_AWS_SDK_CALL_TRACE("/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-trace.mustache"), + + JAVA_EKS_OTLP_OCB_REMOTE_SERVICE_LOG("/expected-data-template/java/eks-otlp-ocb/remote-service-log.mustache"), + JAVA_EKS_OTLP_OCB_REMOTE_SERVICE_METRIC("/expected-data-template/java/eks-otlp-ocb/remote-service-metric.mustache"), + JAVA_EKS_OTLP_OCB_REMOTE_SERVICE_TRACE("/expected-data-template/java/eks-otlp-ocb/remote-service-trace.mustache"), + + JAVA_EKS_OTLP_OCB_CLIENT_CALL_LOG("/expected-data-template/java/eks-otlp-ocb/client-call-log.mustache"), + JAVA_EKS_OTLP_OCB_CLIENT_CALL_METRIC("/expected-data-template/java/eks-otlp-ocb/client-call-metric.mustache"), + JAVA_EKS_OTLP_OCB_CLIENT_CALL_TRACE("/expected-data-template/java/eks-otlp-ocb/client-call-trace.mustache"), + /** Java EC2 Default Test Case Validations */ JAVA_EC2_DEFAULT_OUTGOING_HTTP_CALL_LOG("/expected-data-template/java/ec2/default/outgoing-http-call-log.mustache"), JAVA_EC2_DEFAULT_OUTGOING_HTTP_CALL_METRIC( diff --git a/validator/src/main/java/com/amazon/aoc/models/Context.java b/validator/src/main/java/com/amazon/aoc/models/Context.java index 43293b320..6e607591a 100644 --- a/validator/src/main/java/com/amazon/aoc/models/Context.java +++ b/validator/src/main/java/com/amazon/aoc/models/Context.java @@ -49,6 +49,8 @@ public class Context { private String remoteServiceDeploymentName; + private String remoteServiceIp; + private String remoteResourceIdentifier; private String remoteDbUser; diff --git a/validator/src/main/java/com/amazon/aoc/models/xray/Entity.java b/validator/src/main/java/com/amazon/aoc/models/xray/Entity.java index 3f95d0634..943f79694 100644 --- a/validator/src/main/java/com/amazon/aoc/models/xray/Entity.java +++ b/validator/src/main/java/com/amazon/aoc/models/xray/Entity.java @@ -57,6 +57,6 @@ public class Entity { private Map sql; private Map service; - private Map> metadata; + private Map metadata; private Map annotations; } diff --git a/validator/src/main/java/com/amazon/aoc/validators/CWMetricValidator.java b/validator/src/main/java/com/amazon/aoc/validators/CWMetricValidator.java index 785971436..3553bc1a8 100644 --- a/validator/src/main/java/com/amazon/aoc/validators/CWMetricValidator.java +++ b/validator/src/main/java/com/amazon/aoc/validators/CWMetricValidator.java @@ -102,6 +102,9 @@ public void validate() throws Exception { if (context.getRemoteServiceName() != null && !context.getRemoteServiceName().isEmpty()) { serviceNames.add(context.getRemoteServiceName()); } + if (context.getRemoteServiceIp() != null && !context.getRemoteServiceIp().isEmpty()) { + remoteServiceNames.add(context.getRemoteServiceIp() + ":8080"); + } if (context.getTestingId() != null && !context.getTestingId().isEmpty()) { remoteTargetNames.add("::s3:::e2e-test-bucket-name-" + context.getTestingId()); } diff --git a/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-log.mustache b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-log.mustache new file mode 100644 index 000000000..52dc71069 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-log.mustache @@ -0,0 +1,26 @@ +[{ + "EC2.AutoScalingGroup": "^eks-.+", + "EC2.InstanceId": "^i-[A-Za-z0-9]{17}$", + "Environment": "^generic:default$", + "K8s.Namespace": "^{{appNamespace}}$", + "K8s.Node": "^ip(-[0-9]{1,3}){4}.*$", + "PlatformType": "^Generic$", + "Service": "^{{serviceName}}$", + "Operation": "GET /aws-sdk-call", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}, +{ + "EC2.AutoScalingGroup": "^eks-.+", + "EC2.InstanceId": "^i-[A-Za-z0-9]{17}$", + "Environment": "^generic:default$", + "K8s.Namespace": "^{{appNamespace}}$", + "K8s.Node": "^ip(-[0-9]{1,3}){4}.*$", + "PlatformType": "^Generic$", + "Service": "^{{serviceName}}$", + "Operation": "UnmappedOperation", + "RemoteService": "AWS::S3", + "RemoteOperation": "GetBucketLocation", + "RemoteResourceIdentifier": "^e2e-test-bucket-name-{{testingId}}$", + "RemoteResourceType": "^AWS::S3::Bucket$", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-metric.mustache b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-metric.mustache new file mode 100644 index 000000000..f1e7ec629 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-metric.mustache @@ -0,0 +1,434 @@ +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceType + value: AWS::S3::Bucket + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceType + value: AWS::S3::Bucket + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceType + value: AWS::S3::Bucket + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceType + value: AWS::S3::Bucket + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceType + value: AWS::S3::Bucket + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceType + value: AWS::S3::Bucket + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceType + value: AWS::S3::Bucket + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceType + value: AWS::S3::Bucket + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceType + value: AWS::S3::Bucket + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} 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 new file mode 100644 index 000000000..6901a38a4 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/aws-sdk-call-trace.mustache @@ -0,0 +1,62 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "method": "^GET$" + }, + "response": { + "status": "^200$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET /aws-sdk-call$", + "aws.local.environment": "^generic:default$" + }, + "metadata": { + "EC2.AutoScalingGroup": "^eks-.+", + "EKS.Cluster": "^{{platformInfo}}$", + "K8s.Namespace": "^{{appNamespace}}", + "PlatformType": "^Generic$" + }, + "subsegments": [ + { + "subsegments": [ + { + "name": "^S3$", + "http": { + "request": { + "url": "^https://e2e-test-bucket-name-{{testingId}}.s3.[a-z]+-[a-z]+-\\d.amazonaws.com\\?location$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^AWS::S3$", + "aws.remote.operation": "^GetBucketLocation$", + "aws.remote.resource.type": "^AWS::S3::Bucket$", + "aws.remote.resource.identifier": "^e2e-test-bucket-name-{{testingId}}$", + "aws.local.environment": "^generic:default$" + }, + "metadata": { + "EC2.AutoScalingGroup": "^eks-.+", + "EKS.Cluster": "^{{platformInfo}}$", + "K8s.Namespace": "^{{appNamespace}}$", + "PlatformType": "^Generic$" + }, + "namespace": "^aws$" + } + ] + } + ] +}, +{ + "name": "^S3$", + "annotations": { + "aws.local.service": "^AWS::S3$", + "aws.local.operation": "^GetBucketLocation$", + "aws.local.resource.identifier": "^e2e-test-bucket-name-{{testingId}}$", + "aws.local.resource.type": "^AWS::S3::Bucket$" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/client-call-log.mustache b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/client-call-log.mustache new file mode 100644 index 000000000..c3a8a6c49 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/client-call-log.mustache @@ -0,0 +1,13 @@ +[{ + "EC2.AutoScalingGroup": "^eks-.+", + "EC2.InstanceId": "^i-[A-Za-z0-9]{17}$", + "Environment": "^generic:default$", + "K8s.Namespace": "^{{appNamespace}}$", + "K8s.Node": "^ip(-[0-9]{1,3}){4}.*$", + "PlatformType": "^Generic$", + "Service": "^{{serviceName}}$", + "Operation": "InternalOperation", + "RemoteService": "local-root-client-call", + "RemoteOperation": "GET /", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/client-call-metric.mustache b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/client-call-metric.mustache new file mode 100644 index 000000000..3ecb58eae --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/client-call-metric.mustache @@ -0,0 +1,227 @@ +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: GET /client-call + - + name: Environment + value: generic:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: generic:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: local-root-client-call + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: GET /client-call + - + name: Environment + value: generic:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: generic:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: local-root-client-call + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: GET /client-call + - + name: Environment + value: generic:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: generic:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: local-root-client-call \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/client-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/client-call-trace.mustache new file mode 100644 index 000000000..d06fbe34a --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/client-call-trace.mustache @@ -0,0 +1,49 @@ +[{ + "name": "^{{serviceName}}$", + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^InternalOperation$", + "aws.local.environment": "^generic:default$" + }, + "metadata": { + "k8s.cluster.name": "^{{platformInfo}}$" + }, + "subsegments": [ + { + "name": "^local-root-client-call$", + "http": { + "request": { + "url": "^http://local-root-client-call$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^InternalOperation$", + "aws.remote.service": "^local-root-client-call$", + "aws.remote.operation": "GET /", + "aws.local.environment": "^generic:default$" + }, + "metadata": { + "EC2.AutoScalingGroup": "^eks-.+", + "EKS.Cluster": "^{{platformInfo}}$", + "K8s.Namespace": "^{{appNamespace}}$", + "PlatformType": "^Generic$" + }, + "namespace": "^remote$" + } + ] +}, +{ + "name": "^local-root-client-call$", + "http": { + "request": { + "url": "^http://local-root-client-call$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^local-root-client-call$", + "aws.local.operation": "^GET /$" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/outgoing-http-call-log.mustache b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/outgoing-http-call-log.mustache new file mode 100644 index 000000000..7fbbc80c6 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/outgoing-http-call-log.mustache @@ -0,0 +1,25 @@ +[{ + "EC2.AutoScalingGroup": "^eks-.+", + "EC2.InstanceId": "^i-[A-Za-z0-9]{17}$", + "Environment": "^generic:default$", + "K8s.Namespace": "^{{appNamespace}}$", + "K8s.Node": "^ip(-[0-9]{1,3}){4}.*$", + "PlatformType": "^Generic$", + "Service": "^{{serviceName}}$", + "Operation": "GET /outgoing-http-call", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}, +{ + "EC2.AutoScalingGroup": "^eks-.+", + "EC2.InstanceId": "^i-[A-Za-z0-9]{17}$", + "Environment": "^generic:default$", + "K8s.Namespace": "^{{appNamespace}}$", + "K8s.Node": "^ip(-[0-9]{1,3}){4}.*$", + "PlatformType": "^Generic$", + "Service": "^{{serviceName}}$", + "Operation": "UnmappedOperation", + "RemoteService": "www.amazon.com", + "RemoteOperation": "GET /", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}] + diff --git a/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/outgoing-http-call-metric.mustache b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/outgoing-http-call-metric.mustache new file mode 100644 index 000000000..a2982bcc4 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/outgoing-http-call-metric.mustache @@ -0,0 +1,227 @@ +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /outgoing-http-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: www.amazon.com + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /outgoing-http-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: www.amazon.com + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /outgoing-http-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: www.amazon.com \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/outgoing-http-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/outgoing-http-call-trace.mustache new file mode 100644 index 000000000..71afa92ad --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/outgoing-http-call-trace.mustache @@ -0,0 +1,54 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "method": "^GET$" + }, + "response": { + "status": "^200$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET /outgoing-http-call$", + "aws.local.environment": "^generic:default$" + }, + "metadata": { + "EC2.AutoScalingGroup": "^eks-.+", + "EKS.Cluster": "^{{platformInfo}}$", + "K8s.Namespace": "^{{appNamespace}}", + "PlatformType": "^Generic$" + }, + "subsegments": [ + { + "subsegments": [ + { + "name": "^www.amazon.com$", + "http": { + "request": { + "url": "^https://www.amazon.com$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^www.amazon.com$", + "aws.remote.operation": "^GET /$", + "aws.local.environment": "^generic:default$" + }, + "metadata": { + "EC2.AutoScalingGroup": "^eks-.+", + "EKS.Cluster": "^{{platformInfo}}$", + "K8s.Namespace": "^{{appNamespace}}$", + "PlatformType": "^Generic$" + }, + "namespace": "^remote$" + } + ] + } + ] +}, +{ + "name": "^www.amazon.com$" +}] diff --git a/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/remote-service-log.mustache b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/remote-service-log.mustache new file mode 100644 index 000000000..7b7b7e103 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/remote-service-log.mustache @@ -0,0 +1,24 @@ +[{ + "EC2.AutoScalingGroup": "^eks-.+", + "EC2.InstanceId": "^i-[A-Za-z0-9]{17}$", + "Environment": "^generic:default$", + "K8s.Namespace": "^{{appNamespace}}$", + "K8s.Node": "^ip(-[0-9]{1,3}){4}.*$", + "PlatformType": "^Generic$", + "Service": "^{{serviceName}}$", + "Operation": "GET /remote-service", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}, +{ + "EC2.AutoScalingGroup": "^eks-.+", + "EC2.InstanceId": "^i-[A-Za-z0-9]{17}$", + "Environment": "^generic:default$", + "K8s.Namespace": "^{{appNamespace}}$", + "K8s.Node": "^ip(-[0-9]{1,3}){4}.*$", + "PlatformType": "^Generic$", + "Service": "^{{serviceName}}$", + "Operation": "UnmappedOperation", + "RemoteService": "{{remoteServiceIp}}:8080", + "RemoteOperation": "GET /healthcheck", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/remote-service-metric.mustache b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/remote-service-metric.mustache new file mode 100644 index 000000000..549fbf006 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/remote-service-metric.mustache @@ -0,0 +1,326 @@ +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceIp}}:8080 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: generic:default + - + name: Operation + value: GET /healthcheck + - + name: Service + value: {{remoteServiceDeploymentName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceDeploymentName}} + - + name: Environment + value: generic:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: {{remoteServiceIp}}:8080 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceIp}}:8080 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceIp}}:8080 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceIp}}:8080 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: generic:default + - + name: Operation + value: GET /healthcheck + - + name: Service + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceDeploymentName}} + - + name: Environment + value: generic:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: {{remoteServiceIp}}:8080 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceIp}}:8080 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceIp}}:8080 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceIp}}:8080 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: generic:default + - + name: Operation + value: GET /healthcheck + - + name: Service + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceDeploymentName}} + - + name: Environment + value: generic:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteService + value: {{remoteServiceIp}}:8080 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: generic:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceIp}}:8080 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceIp}}:8080 diff --git a/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/remote-service-trace.mustache b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/remote-service-trace.mustache new file mode 100644 index 000000000..010ed32c0 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/eks-otlp-ocb/remote-service-trace.mustache @@ -0,0 +1,81 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "method": "^GET$" + }, + "response": { + "status": "^200$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET /remote-service$", + "aws.local.environment": "^generic:default$" + }, + "metadata": { + "EC2.AutoScalingGroup": "^eks-.+", + "EKS.Cluster": "^{{platformInfo}}$", + "K8s.Namespace": "^{{appNamespace}}", + "PlatformType": "^Generic$" + }, + "subsegments": [ + { + "subsegments": [ + { + "name": "^{{remoteServiceIp}}:8080$", + "http": { + "request": { + "url": "^http://{{remoteServiceIp}}:8080/healthcheck$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^{{remoteServiceIp}}:8080$", + "aws.remote.operation": "^GET /healthcheck$", + "aws.local.environment": "^generic:default$" + }, + "metadata": { + "EC2.AutoScalingGroup": "^eks-.+", + "EKS.Cluster": "^{{platformInfo}}$", + "K8s.Namespace": "^{{appNamespace}}$", + "PlatformType": "^Generic$" + }, + "namespace": "^remote$" + } + ] + } + ] +}, +{ + "name": "^{{remoteServiceDeploymentName}}$", + "http": { + "request": { + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{remoteServiceDeploymentName}}$", + "aws.local.operation": "^GET /healthcheck$", + "aws.local.environment": "^generic:default$" + }, + "metadata": { + "EC2.AutoScalingGroup": "^eks-.+", + "EKS.Cluster": "^{{platformInfo}}$", + "K8s.Namespace": "^{{appNamespace}}", + "PlatformType": "^Generic$", + "K8s.Workload": "^{{remoteServiceDeploymentName}}$" + }, + "subsegments": [ + { + "name": "^RemoteServiceController.healthcheck$", + "annotations": { + "aws.local.environment": "^eks:{{platformInfo}}/{{appNamespace}}$" + } + } + ] +}] + + diff --git a/validator/src/main/resources/validations/java/eks-otlp-ocb/log-validation.yml b/validator/src/main/resources/validations/java/eks-otlp-ocb/log-validation.yml new file mode 100644 index 000000000..2f3013c1d --- /dev/null +++ b/validator/src/main/resources/validations/java/eks-otlp-ocb/log-validation.yml @@ -0,0 +1,24 @@ +- + validationType: "cw-log" + httpPath: "/outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedLogStructureTemplate: "JAVA_EKS_OTLP_OCB_OUTGOING_HTTP_CALL_LOG" +- + validationType: "cw-log" + httpPath: "/aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedLogStructureTemplate: "JAVA_EKS_OTLP_OCB_AWS_SDK_CALL_LOG" +- + validationType: "cw-log" + httpPath: "/remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedLogStructureTemplate: "JAVA_EKS_OTLP_OCB_REMOTE_SERVICE_LOG" +- + validationType: "cw-log" + httpPath: "/client-call" + httpMethod: "get" + callingType: "http" + expectedLogStructureTemplate: "JAVA_EKS_OTLP_OCB_CLIENT_CALL_LOG" \ No newline at end of file diff --git a/validator/src/main/resources/validations/java/eks-otlp-ocb/metric-validation.yml b/validator/src/main/resources/validations/java/eks-otlp-ocb/metric-validation.yml new file mode 100644 index 000000000..35e85f9c4 --- /dev/null +++ b/validator/src/main/resources/validations/java/eks-otlp-ocb/metric-validation.yml @@ -0,0 +1,24 @@ +- + validationType: "cw-metric" + httpPath: "/outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedMetricTemplate: "JAVA_EKS_OTLP_OCB_OUTGOING_HTTP_CALL_METRIC" +- + validationType: "cw-metric" + httpPath: "/aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedMetricTemplate: "JAVA_EKS_OTLP_OCB_AWS_SDK_CALL_METRIC" +- + validationType: "cw-metric" + httpPath: "/remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedMetricTemplate: "JAVA_EKS_OTLP_OCB_REMOTE_SERVICE_METRIC" +- + validationType: "cw-metric" + httpPath: "/client-call" + httpMethod: "get" + callingType: "http" + expectedMetricTemplate: "JAVA_EKS_OTLP_OCB_CLIENT_CALL_METRIC" \ No newline at end of file diff --git a/validator/src/main/resources/validations/java/eks-otlp-ocb/trace-validation.yml b/validator/src/main/resources/validations/java/eks-otlp-ocb/trace-validation.yml new file mode 100644 index 000000000..7934c27a4 --- /dev/null +++ b/validator/src/main/resources/validations/java/eks-otlp-ocb/trace-validation.yml @@ -0,0 +1,24 @@ +- + validationType: "trace" + httpPath: "/outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedTraceTemplate: "JAVA_EKS_OTLP_OCB_OUTGOING_HTTP_CALL_TRACE" +- + validationType: "trace" + httpPath: "/aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedTraceTemplate: "JAVA_EKS_OTLP_OCB_AWS_SDK_CALL_TRACE" +- + validationType: "trace" + httpPath: "/remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedTraceTemplate: "JAVA_EKS_OTLP_OCB_REMOTE_SERVICE_TRACE" +- + validationType: "trace" + httpPath: "/client-call" + httpMethod: "get" + callingType: "http" + expectedTraceTemplate: "JAVA_EKS_OTLP_OCB_CLIENT_CALL_TRACE" \ No newline at end of file