From 03b1f47dbd827471975bca24929704964e39334e Mon Sep 17 00:00:00 2001 From: Mahad Janjua Date: Fri, 28 Feb 2025 09:26:33 -0800 Subject: [PATCH 01/15] [Python] Add ADOT SigV4 release test workflow + validations --- .../workflows/python-ec2-adot-sigv4-test.yml | 235 ++++++++++++ terraform/python/ec2/adot-sigv4/main.tf | 354 ++++++++++++++++++ terraform/python/ec2/adot-sigv4/output.tf | 26 ++ terraform/python/ec2/adot-sigv4/variables.tf | 46 +++ .../PredefinedExpectedTemplate.java | 20 + .../amazon/aoc/validators/CWLogValidator.java | 58 ++- .../ec2/adot-sigv4/aws-sdk-call-log.mustache | 49 +++ .../adot-sigv4/aws-sdk-call-metric.mustache | 227 +++++++++++ .../adot-sigv4/aws-sdk-call-trace.mustache | 65 ++++ .../ec2/adot-sigv4/client-call-log.mustache | 49 +++ .../adot-sigv4/client-call-metric.mustache | 227 +++++++++++ .../ec2/adot-sigv4/client-call-trace.mustache | 71 ++++ .../outgoing-http-call-log.mustache | 49 +++ .../outgoing-http-call-metric.mustache | 227 +++++++++++ .../outgoing-http-call-trace.mustache | 57 +++ .../adot-sigv4/remote-service-log.mustache | 49 +++ .../adot-sigv4/remote-service-metric.mustache | 326 ++++++++++++++++ .../adot-sigv4/remote-service-trace.mustache | 72 ++++ .../python/ec2/adot-sigv4/log-validation.yml | 24 ++ .../ec2/adot-sigv4/metric-validation.yml | 24 ++ .../ec2/adot-sigv4/trace-validation.yml | 24 ++ 21 files changed, 2276 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/python-ec2-adot-sigv4-test.yml create mode 100644 terraform/python/ec2/adot-sigv4/main.tf create mode 100644 terraform/python/ec2/adot-sigv4/output.tf create mode 100644 terraform/python/ec2/adot-sigv4/variables.tf create mode 100644 validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-trace.mustache create mode 100644 validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/client-call-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/client-call-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/client-call-trace.mustache create mode 100644 validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/outgoing-http-call-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/outgoing-http-call-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/outgoing-http-call-trace.mustache create mode 100644 validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/remote-service-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/remote-service-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/remote-service-trace.mustache create mode 100644 validator/src/main/resources/validations/python/ec2/adot-sigv4/log-validation.yml create mode 100644 validator/src/main/resources/validations/python/ec2/adot-sigv4/metric-validation.yml create mode 100644 validator/src/main/resources/validations/python/ec2/adot-sigv4/trace-validation.yml diff --git a/.github/workflows/python-ec2-adot-sigv4-test.yml b/.github/workflows/python-ec2-adot-sigv4-test.yml new file mode 100644 index 000000000..6febd034e --- /dev/null +++ b/.github/workflows/python-ec2-adot-sigv4-test.yml @@ -0,0 +1,235 @@ +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: Apache-2.0 + +# This is a reusable workflow for running the Python Enablement Canary test for Application 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: Python EC2 ADOT SigV4 (Stand-Alone ADOT) Use Case +on: + workflow_call: + inputs: + caller-workflow-name: + required: true + type: string + python-version: + description: "Currently support version 3.8, 3.9, 3.10, 3.11, 3.12" + required: false + type: string + default: '3.9' + cpu-architecture: + description: "Permitted values: x86_64 or arm64" + required: false + type: string + default: "x86_64" + staging-wheel-name: + required: false + default: 'aws-opentelemetry-distro' + type: string + +permissions: + id-token: write + contents: read + +env: + E2E_TEST_AWS_REGION: 'us-west-2' + CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }} + PYTHON_VERSION: ${{ inputs.python-version }} + CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }} + ADOT_WHEEL_NAME: ${{ inputs.staging-wheel-name }} + 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/spans + TEST_RESOURCES_FOLDER: ${GITHUB_WORKSPACE} + +jobs: + python-ec2-adot-sigv4: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + with: + repository: 'aws-observability/aws-application-signals-test-framework' + ref: ${{ inputs.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: Generate testing id + run: echo TESTING_ID="${{ github.run_id }}-${{ github.run_number }}-${RANDOM}" >> $GITHUB_ENV + + - name: Refresh 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: ${{ env.E2E_TEST_AWS_REGION }} + + - name: Set Get ADOT Wheel command environment variable + run: | + if [ "${{ github.event.repository.name }}" = "aws-otel-python-instrumentation" ]; then + # Reusing the adot-main-build-staging-jar bucket to store the python wheel file + echo GET_ADOT_WHEEL_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/${{ env.ADOT_WHEEL_NAME }} ./${{ env.ADOT_WHEEL_NAME }} && sudo python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV + else + latest_release_version=$(curl -sL https://github.com/aws-observability/aws-otel-python-instrumentation/releases/latest | grep -oP '/releases/tag/v\K[0-9]+\.[0-9]+\.[0-9]+' | head -n 1) + echo "The latest version is $latest_release_version" + echo GET_ADOT_WHEEL_COMMAND="wget -O ${{ env.ADOT_WHEEL_NAME }} https://github.com/aws-observability/aws-otel-python-instrumentation/releases/latest/download/aws_opentelemetry_distro-$latest_release_version-py3-none-any.whl \ + && sudo python${{ env.PYTHON_VERSION }} -m pip install ${{ env.ADOT_WHEEL_NAME }}" >> $GITHUB_ENV + fi + + - 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/python/ec2/adot-sigv4 && terraform init && terraform validate" + cleanup: "rm -rf .terraform && rm -rf .terraform.lock.hcl" + max_retry: 6 + sleep_time: 60 + + - name: Deploy sample app via terraform and wait for endpoint to come online + working-directory: terraform/python/ec2/adot-sigv4 + run: | + # Attempt to deploy the sample app on an EC2 instance and wait for its endpoint to come online. + # There may be occasional failures due to transitivity issues, so try up to 2 times. + # deployment_failed of 0 indicates that both the terraform deployment and the endpoint are running, while 1 indicates + # that it failed at some point + retry_counter=0 + max_retry=2 + while [ $retry_counter -lt $max_retry ]; do + echo "Attempt $retry_counter" + deployment_failed=0 + terraform apply -auto-approve \ + -var="aws_region=${{ env.E2E_TEST_AWS_REGION }}" \ + -var="test_id=${{ env.TESTING_ID }}" \ + -var="sample_app_zip=s3://aws-appsignals-sample-app-prod-us-east-1/python-sample-app.zip" \ + -var="get_adot_wheel_command=${{ env.GET_ADOT_WHEEL_COMMAND }}" \ + -var="language_version=${{ env.PYTHON_VERSION }}" \ + -var="cpu_architecture=${{ env.CPU_ARCHITECTURE }}" \ + || deployment_failed=$? + + if [ $deployment_failed -eq 1 ]; then + echo "Terraform deployment was unsuccessful. Will attempt to retry deployment." + fi + + # If the success is 1 then either the terraform deployment or the endpoint connection failed, so first destroy the + # resources created from terraform and try again. + if [ $deployment_failed -eq 1 ]; then + echo "Destroying terraform" + terraform destroy -auto-approve \ + -var="test_id=${{ env.TESTING_ID }}" + + retry_counter=$(($retry_counter+1)) + else + # If deployment succeeded, then exit the loop + break + fi + + if [ $retry_counter -eq $max_retry ]; then + echo "Max retry reached, failed to deploy terraform and connect to the endpoint. Exiting code" + exit 1 + fi + done + + - name: Get the ec2 instance ami id + run: | + echo "EC2_INSTANCE_AMI=$(terraform output ec2_instance_ami)" >> $GITHUB_ENV + working-directory: terraform/python/ec2/adot-sigv4 + + - name: Get the sample app endpoint + run: | + echo "REMOTE_SERVICE_IP=$(terraform output sample_app_remote_service_private_ip)" >> $GITHUB_ENV + echo "MAIN_SERVICE_INSTANCE_ID=$(terraform output main_service_instance_id)" >> $GITHUB_ENV + working-directory: terraform/python/ec2/adot-sigv4 + + - name: Initiate Gradlew Daemon + if: steps.initiate-gradlew == 'failure' + 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 + + # Validation for pulse telemetry data + - name: Validate generated EMF logs + id: log-validation + run: ./gradlew validator:run --args='-c python/ec2/adot-sigv4/log-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://localhost:8000 + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8001 + --region ${{ env.E2E_TEST_AWS_REGION }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name python-sample-application-${{ env.TESTING_ID }} + --remote-service-name python-sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' + + - name: Validate generated metrics + id: metric-validation + if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() + run: ./gradlew validator:run --args='-c python/ec2/adot-sigv4/metric-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://localhost:8000 + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8001 + --region ${{ env.E2E_TEST_AWS_REGION }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name python-sample-application-${{ env.TESTING_ID }} + --remote-service-name python-sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' + + - name: Validate generated traces + id: trace-validation + if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled() + run: ./gradlew validator:run --args='-c python/ec2/adot-sigv4/trace-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://localhost:8000 + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8001 + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name python-sample-application-${{ env.TESTING_ID }} + --remote-service-name python-sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' + + - name: Refresh 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: ${{ env.E2E_TEST_AWS_REGION }} + + # Clean up Procedures + - name: Terraform destroy + if: always() + continue-on-error: true + working-directory: terraform/python/ec2/adot-sigv4 + run: | + terraform destroy -auto-approve \ + -var="test_id=${{ env.TESTING_ID }}" \ No newline at end of file diff --git a/terraform/python/ec2/adot-sigv4/main.tf b/terraform/python/ec2/adot-sigv4/main.tf new file mode 100644 index 000000000..50b51e36f --- /dev/null +++ b/terraform/python/ec2/adot-sigv4/main.tf @@ -0,0 +1,354 @@ +# ------------------------------------------------------------------------ +# 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" + } + } +} + +# Define the provider for AWS +provider "aws" {} + +resource "aws_default_vpc" "default" {} + +resource "tls_private_key" "ssh_key" { + algorithm = "RSA" + rsa_bits = 4096 +} + +resource "aws_key_pair" "aws_ssh_key" { + key_name = "instance_key-${var.test_id}" + public_key = tls_private_key.ssh_key.public_key_openssh +} + +locals { + ssh_key_name = aws_key_pair.aws_ssh_key.key_name + private_key_content = tls_private_key.ssh_key.private_key_pem +} + +data "aws_ami" "ami" { + owners = ["amazon"] + most_recent = true + filter { + name = "name" + values = ["al20*-ami-minimal-*-${var.cpu_architecture}"] + } + filter { + name = "state" + values = ["available"] + } + filter { + name = "architecture" + values = [var.cpu_architecture] + } + filter { + name = "image-type" + values = ["machine"] + } + + filter { + name = "root-device-name" + values = ["/dev/xvda"] + } + + filter { + name = "root-device-type" + values = ["ebs"] + } + + filter { + name = "virtualization-type" + values = ["hvm"] + } +} + +resource "aws_instance" "main_service_instance" { + ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier) + instance_type = var.cpu_architecture == "x86_64" ? "t3.micro" : "t4g.micro" + key_name = local.ssh_key_name + iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE" + vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id] + associate_public_ip_address = true + instance_initiated_shutdown_behavior = "terminate" + + metadata_options { + http_tokens = "required" + } + + root_block_device { + volume_size = 5 + } + + tags = { + Name = "main-service-${var.test_id}" + } +} + +resource "null_resource" "main_service_setup" { + connection { + type = "ssh" + user = var.user + private_key = local.private_key_content + host = aws_instance.main_service_instance.public_ip + } + + provisioner "remote-exec" { + inline = [ + <<-EOF + #!/bin/bash + + # Install Python and wget + sudo yum install wget -y + sudo yum install unzip -y + + # Dnf does not have the module for python 3.10, 3,10, 3.12, therefore we need to manually install it by downloading the package from the python website. + # Building and installing the package takes longer then installing it through dnf, so a seperate installation process was made. + # The canary should run on a version without the manual installation process + if [ "${var.language_version}" == "3.8" ] || [ "${var.language_version}" = "3.10" ] || [ "${var.language_version}" = "3.12" ]; then + # Install modules required to compile Python and also run the sample app + sudo dnf groupinstall "Development Tools" -y + sudo dnf install openssl-devel sqlite-devel libffi-devel -y + + # Download the Python package + cd /usr/src + sudo wget https://www.python.org/ftp/python/${var.language_version}.0/Python-${var.language_version}.0.tgz + sudo tar xzf Python-${var.language_version}.0.tgz + + # Compile and install Python using c++ + cd Python-${var.language_version}.0 + sudo ./configure + sudo make install + + # Return back to ec2-user directory + cd ~ + else + sudo dnf install -y python${var.language_version} + sudo dnf install -y python${var.language_version}-pip + fi + + # enable ec2 instance connect for debug + sudo yum install ec2-instance-connect -y + + # Install modules with specific version so that it doesn't cause errors with Python 3.8 + sudo python${var.language_version} -m pip install importlib-metadata==8.4.0 "protobuf>=3.19,<5.0" + sudo python${var.language_version} -m pip install grpcio --only-binary=:all: + + # Get ADOT Wheel and install it + ${var.get_adot_wheel_command} + + # Get and run the sample application with configuration + aws s3 cp ${var.sample_app_zip} ./python-sample-app.zip + unzip -o python-sample-app.zip + + # Export environment variables for instrumentation + cd ./django_frontend_service + sudo python${var.language_version} -m pip install -r ec2-requirements.txt + export DJANGO_SETTINGS_MODULE="django_frontend_service.settings" + export OTEL_PYTHON_DISTRO="aws_distro" + export OTEL_PYTHON_CONFIGURATOR="aws_configurator" + export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=false + export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \ + export OTEL_LOGS_EXPORT=none \ + export OTEL_METRICS_EXPORTER=none \ + export OTEL_TRACES_EXPORTER=otlp + export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray.${var.aws_region}.amazonaws.com/v1/traces \ + export OTEL_SERVICE_NAME=python-sample-application-${var.test_id} + export OTEL_TRACES_SAMPLER=always_on + python${var.language_version} manage.py migrate + nohup opentelemetry-instrument python${var.language_version} manage.py runserver 0.0.0.0:8000 --noreload & + + # The application needs time to come up and reach a steady state, this should not take longer than 30 seconds + sleep 30 + + # Check if the application is up. If it is not up, then exit 1. + attempt_counter=0 + max_attempts=30 + until $(curl --output /dev/null --silent --head --fail --max-time 5 $(echo "http://localhost:8000" | tr -d '"')); do + if [ $attempt_counter -eq $max_attempts ];then + echo "Failed to connect to endpoint." + exit 1 + fi + echo "Attempting to connect to the main endpoint. Tried $attempt_counter out of $max_attempts" + attempt_counter=$(($attempt_counter+1)) + sleep 10 + done + + echo "Successfully connected to main endpoint" + + EOF + ] + } + + depends_on = [aws_instance.main_service_instance] +} + +resource "aws_instance" "remote_service_instance" { + ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier) + instance_type = var.cpu_architecture == "x86_64" ? "t3.micro" : "t4g.micro" + key_name = local.ssh_key_name + iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE" + vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id] + associate_public_ip_address = true + instance_initiated_shutdown_behavior = "terminate" + + metadata_options { + http_tokens = "required" + } + + root_block_device { + volume_size = 5 + } + + tags = { + Name = "remote-service-${var.test_id}" + } +} + +resource "null_resource" "remote_service_setup" { + connection { + type = "ssh" + user = var.user + private_key = local.private_key_content + host = aws_instance.remote_service_instance.public_ip + } + + provisioner "remote-exec" { + inline = [ + <<-EOF + #!/bin/bash + + # Install Python and wget + sudo yum install wget -y + sudo yum install unzip -y + + # Dnf does not have the module for python 3.10, 3,10, 3.12, therefore we need to manually install it by downloading the package from the python website. + # Building and installing the package takes longer then installing it through dnf, so a seperate installation process was made. + # The canary should run on a version without the manual installation process + if [ "${var.language_version}" == "3.8" ] || [ "${var.language_version}" = "3.10" ] || [ "${var.language_version}" = "3.12" ]; then + # Install modules required to compile Python and also run the sample app + sudo dnf groupinstall "Development Tools" -y + sudo dnf install openssl-devel sqlite-devel libffi-devel -y + + # Download the Python package + cd /usr/src + sudo wget https://www.python.org/ftp/python/${var.language_version}.0/Python-${var.language_version}.0.tgz + sudo tar xzf Python-${var.language_version}.0.tgz + + # Compile and install Python using c++ + cd Python-${var.language_version}.0 + sudo ./configure + sudo make install + + # Return back to ec2-user directory + cd ~ + else + sudo dnf install -y python${var.language_version} + sudo dnf install -y python${var.language_version}-pip + fi + + # enable ec2 instance connect for debug + sudo yum install ec2-instance-connect -y + + # Install modules with specific version so that it doesn't cause errors with Python 3.8 + sudo python${var.language_version} -m pip install importlib-metadata==8.4.0 "protobuf>=3.19,<5.0" + sudo python${var.language_version} -m pip install grpcio --only-binary=:all: + + # Get ADOT Wheel and install it + ${var.get_adot_wheel_command} + + # Get and run the sample application with configuration + aws s3 cp ${var.sample_app_zip} ./python-sample-app.zip + unzip -o python-sample-app.zip + + # Export environment variables for instrumentation + cd ./django_remote_service + sudo python${var.language_version} -m pip install -r requirements.txt --force-reinstall + sudo python${var.language_version} -m pip install "boto3~=1.34.3" + export DJANGO_SETTINGS_MODULE="django_remote_service.settings" + export OTEL_PYTHON_DISTRO="aws_distro" + export OTEL_PYTHON_CONFIGURATOR="aws_configurator" + export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=false + export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \ + export OTEL_LOGS_EXPORT=none \ + export OTEL_METRICS_EXPORTER=none \ + export OTEL_TRACES_EXPORTER=otlp + export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray.${var.aws_region}.amazonaws.com/v1/traces \ + export OTEL_SERVICE_NAME=python-sample-remote-application-${var.test_id} + export OTEL_TRACES_SAMPLER=always_on + python${var.language_version} manage.py migrate + nohup opentelemetry-instrument python${var.language_version} manage.py runserver 0.0.0.0:8001 --noreload & + + # The application needs time to come up and reach a steady state, this should not take longer than 30 seconds + sleep 30 + + # Check if the application is up. If it is not up, then exit 1. + attempt_counter=0 + max_attempts=30 + until $(curl --output /dev/null --silent --head --fail --max-time 5 $(echo "http://localhost:8001/healthcheck" | tr -d '"')); do + if [ $attempt_counter -eq $max_attempts ];then + echo "Failed to connect to endpoint." + exit 1 + fi + echo "Attempting to connect to the remote endpoint. Tried $attempt_counter out of $max_attempts" + attempt_counter=$(($attempt_counter+1)) + sleep 10 + done + + echo "Successfully connected to remote endpoint" + + sleep 30 + + EOF + ] + } + + depends_on = [aws_instance.remote_service_instance] +} + +resource "null_resource" "traffic_generator_setup" { + connection { + type = "ssh" + user = var.user + private_key = local.private_key_content + host = aws_instance.main_service_instance.public_ip + } + + provisioner "remote-exec" { + inline = [ + <<-EOF + sudo yum install nodejs aws-cli unzip tmux -y + + # Bring in the traffic generator files to EC2 Instance + aws s3 cp s3://aws-appsignals-sample-app-prod-us-east-1/traffic-generator.zip ./traffic-generator.zip + unzip ./traffic-generator.zip -d ./ + + # Install the traffic generator dependencies + npm install + + tmux new -s traffic-generator -d + tmux send-keys -t traffic-generator "export MAIN_ENDPOINT=\"localhost:8000\"" C-m + tmux send-keys -t traffic-generator "export REMOTE_ENDPOINT=\"${aws_instance.remote_service_instance.private_ip}\"" C-m + tmux send-keys -t traffic-generator "export ID=\"${var.test_id}\"" C-m + tmux send-keys -t traffic-generator "npm start" C-m + + EOF + ] + } + + depends_on = [null_resource.main_service_setup, null_resource.remote_service_setup] +} diff --git a/terraform/python/ec2/adot-sigv4/output.tf b/terraform/python/ec2/adot-sigv4/output.tf new file mode 100644 index 000000000..be572868a --- /dev/null +++ b/terraform/python/ec2/adot-sigv4/output.tf @@ -0,0 +1,26 @@ +# ------------------------------------------------------------------------ +# 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. +# ------------------------------------------------------------------------- + +output "sample_app_remote_service_private_ip" { + value = aws_instance.remote_service_instance.private_ip +} + +output "main_service_instance_id" { + value = aws_instance.main_service_instance.id +} + +output "ec2_instance_ami" { + value = data.aws_ami.ami.id +} \ No newline at end of file diff --git a/terraform/python/ec2/adot-sigv4/variables.tf b/terraform/python/ec2/adot-sigv4/variables.tf new file mode 100644 index 000000000..82284ce3c --- /dev/null +++ b/terraform/python/ec2/adot-sigv4/variables.tf @@ -0,0 +1,46 @@ +# ------------------------------------------------------------------------ +# 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 "aws_region" { + default = "" +} + +variable "user" { + default = "ec2-user" +} + +variable "sample_app_zip" { + default = "s3:///" +} + +variable "get_adot_wheel_command" { + default = "aws s3 cp s3:/// ./ && pip install " +} + +variable "canary_type" { + default = "python-ec2-default" +} + +variable "language_version" { + default = "3.9" +} + +variable "cpu_architecture" { + default = "x86_64" +} \ No newline at end of file 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 2bd01de29..4e890a2e6 100644 --- a/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java +++ b/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java @@ -201,6 +201,26 @@ public enum PredefinedExpectedTemplate implements FileConfig { PYTHON_EC2_ASG_CLIENT_CALL_METRIC("/expected-data-template/python/ec2/asg/client-call-metric.mustache"), PYTHON_EC2_ASG_CLIENT_CALL_TRACE("/expected-data-template/python/ec2/asg/client-call-trace.mustache"), + /** Python EC2 ADOT SigV4 (Stand Alone ADOT) Test Case Validations */ + PYTHON_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_LOG( + "/expected-data-template/python/ec2/adot-sigv4/outgoing-http-call-log.mustache"), + PYTHON_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_METRIC( + "/expected-data-template/python/ec2/adot-sigv4/outgoing-http-call-metric.mustache"), + PYTHON_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_TRACE( + "/expected-data-template/python/ec2/adot-sigv4/outgoing-http-call-trace.mustache"), + + PYTHON_EC2_ADOT_SIGV4_AWS_SDK_CALL_LOG("/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-log.mustache"), + PYTHON_EC2_ADOT_SIGV4_AWS_SDK_CALL_METRIC("/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-metric.mustache"), + PYTHON_EC2_ADOT_SIGV4_AWS_SDK_CALL_TRACE("/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-trace.mustache"), + + PYTHON_EC2_ADOT_SIGV4_REMOTE_SERVICE_LOG("/expected-data-template/python/ec2/adot-sigv4/remote-service-log.mustache"), + PYTHON_EC2_ADOT_SIGV4_REMOTE_SERVICE_METRIC("/expected-data-template/python/ec2/adot-sigv4/remote-service-metric.mustache"), + PYTHON_EC2_ADOT_SIGV4_REMOTE_SERVICE_TRACE("/expected-data-template/python/ec2/adot-sigv4/remote-service-trace.mustache"), + + PYTHON_EC2_ADOT_SIGV4_CLIENT_CALL_LOG("/expected-data-template/python/ec2/adot-sigv4/client-call-log.mustache"), + PYTHON_EC2_ADOT_SIGV4_CLIENT_CALL_METRIC("/expected-data-template/python/ec2/adot-sigv4/client-call-metric.mustache"), + PYTHON_EC2_ADOT_SIGV4_CLIENT_CALL_TRACE("/expected-data-template/python/ec2/adot-sigv4/client-call-trace.mustache"), + /** Python K8S Test Case Validations */ PYTHON_K8S_OUTGOING_HTTP_CALL_LOG("/expected-data-template/python/k8s/outgoing-http-call-log.mustache"), PYTHON_K8S_OUTGOING_HTTP_CALL_METRIC("/expected-data-template/python/k8s/outgoing-http-call-metric.mustache"), diff --git a/validator/src/main/java/com/amazon/aoc/validators/CWLogValidator.java b/validator/src/main/java/com/amazon/aoc/validators/CWLogValidator.java index 156644dfb..c5ea44e1a 100644 --- a/validator/src/main/java/com/amazon/aoc/validators/CWLogValidator.java +++ b/validator/src/main/java/com/amazon/aoc/validators/CWLogValidator.java @@ -71,8 +71,26 @@ public void validate() throws Exception { String remoteResourceType = (String) expectedAttributes.get("RemoteResourceType"); String remoteResourceIdentifier = (String) expectedAttributes.get("RemoteResourceIdentifier"); - Map actualLog = - this.getActualLog(operation, remoteService, remoteOperation, remoteResourceType, remoteResourceIdentifier); + Map actualLog; + + // Parsing unique identifiers in OTLP spans + if (operation == null) { + operation = (String) expectedAttributes.get("attributes[\\\"aws.local.operation\\\"]"); + remoteService = (String) expectedAttributes.get("attributes[\\\"aws.remote.service\\\"]"); + remoteOperation = (String) expectedAttributes.get("attributes[\\\"aws.remote.operation\\\"]"); + // Runtime metrics have no operation at all, we must ensure we are in the proper use case + if (operation != null) { + actualLog = this.getActualOtelSpanLog(operation, remoteService, remoteOperation); + } else { + // No operation at all -> Runtime metric + actualLog = + this.getActualLog(operation, remoteService, remoteOperation, remoteResourceType, remoteResourceIdentifier); + } + } + else { + actualLog = + this.getActualLog(operation, remoteService, remoteOperation, remoteResourceType, remoteResourceIdentifier); + } log.info("Value of an actual log: {}", actualLog); if (actualLog == null) throw new BaseException(ExceptionCode.EXPECTED_LOG_NOT_FOUND); @@ -140,7 +158,7 @@ private Map getActualLog( if (remoteService == null && remoteOperation == null) { dependencyFilter = "&& ($.RemoteService NOT EXISTS) && ($.RemoteOperation NOT EXISTS)"; } else { - dependencyFilter = String.format("&& ($.RemoteService = \"%s\") && ($.RemoteOperation = \"%s\")", remoteService, remoteOperation); + dependencyFilter = String.format(" && ($.RemoteService = \"%s\") && ($.RemoteOperation = \"%s\")", remoteService, remoteOperation); } if (remoteResourceType != null && remoteResourceIdentifier != null) { @@ -171,6 +189,40 @@ private Map getActualLog( return JsonFlattener.flattenAsMap(retrievedLogs.get(0).getMessage()); } + private Map getActualOtelSpanLog(String operation, String remoteService, String remoteOperation) throws Exception { + String dependencyFilter = null; + + if (operation != null) { + dependencyFilter = String.format("&& ($.attributes.['aws.local.operation'] = \"%s\")", operation); + } + if (remoteService != null) { + dependencyFilter += String.format("&& ($.attributes.['aws.remote.service'] = \"%s\")", remoteService); + } else { + dependencyFilter += "&& ($.attributes.['aws.remote.service'] NOT EXISTS)"; + } + if (remoteOperation != null) { + dependencyFilter += String.format("&& ($.attributes.['aws.remote.operation'] = \"%s\")", remoteOperation); + } else { + dependencyFilter += "&& ($.attributes.['aws.remote.operation'] NOT EXISTS)"; + } + + String filterPattern = String.format("{ ($.attributes.['aws.local.service'] = %s) %s }", context.getServiceName(), dependencyFilter); + log.info("Filter Pattern for Log Search: " + filterPattern); + + List retrievedLogs = + this.cloudWatchService.filterLogs( + context.getLogGroup(), + filterPattern, + System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(5), + 10); + + if (retrievedLogs == null || retrievedLogs.isEmpty()) { + throw new BaseException(ExceptionCode.EMPTY_LIST); + } + + return JsonFlattener.flattenAsMap(retrievedLogs.get(0).getMessage()); + } + @Override public void init( Context context, diff --git a/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-log.mustache b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-log.mustache new file mode 100644 index 000000000..a9c944359 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-log.mustache @@ -0,0 +1,49 @@ +[{ + "name": "GET aws-sdk-call", + "kind": "SERVER", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET aws-sdk-call", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "http.route": "aws-sdk-call", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}, +{ + "name": "S3.GetBucketLocation", + "kind": "CLIENT", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "UnmappedOperation", + "aws.remote.service": "AWS::S3", + "aws.remote.operation": "GetBucketLocation", + "aws.local.environment": "ec2:default", + "aws.s3.bucket": "e2e-test-bucket-name-{{testingId}}", + "aws.span.kind": "CLIENT", + "aws.region": "us-east-1", + "PlatformType": "AWS::EC2" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-metric.mustache b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-metric.mustache new file mode 100644 index 000000000..92e8104d3 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-metric.mustache @@ -0,0 +1,227 @@ +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-trace.mustache b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-trace.mustache new file mode 100644 index 000000000..b38dccc35 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/aws-sdk-call-trace.mustache @@ -0,0 +1,65 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "method": "^GET$" + } + }, + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET aws-sdk-call$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET aws-sdk-call$", + "span.kind": "^SERVER$" + }, + "metadata": { + "http.url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "http.method": "^GET$", + "http.route": "^aws-sdk-call$", + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$", + "PlatformType": "^AWS::EC2$" + }, + "subsegments": [ + { + "name": "^S3$", + "aws": { + "bucket_name": "^e2e-test-bucket-name-{{testingId}}$", + "s3.bucket": "^e2e-test-bucket-name-{{testingId}}$", + "span.kind": "^CLIENT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^AWS::S3$", + "aws.remote.operation": "^GetBucketLocation$", + "aws.local.environment": "^ec2:default$", + "span.name": "^S3.GetBucketLocation$", + "span.kind": "^CLIENT$" + }, + "namespace": "^aws$" + } + ] +}, +{ + "name": "^S3$", + "aws": { + "bucket_name": "^e2e-test-bucket-name-{{testingId}}$", + "s3.bucket": "^e2e-test-bucket-name-{{testingId}}$", + "span.kind": "^CLIENT$" + }, + "annotations": { + "aws.local.service": "^AWS::S3$", + "aws.local.operation": "^GetBucketLocation$" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/client-call-log.mustache b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/client-call-log.mustache new file mode 100644 index 000000000..991b4041d --- /dev/null +++ b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/client-call-log.mustache @@ -0,0 +1,49 @@ +[{ + "name": "GET client-call", + "kind": "SERVER", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET client-call", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "{{endpoint}}/client-call", + "http.route": "client-call", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}, +{ + "name": "GET", + "kind": "CLIENT", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "InternalOperation", + "aws.remote.service": "local-root-client-call", + "aws.remote.operation": "GET /", + "aws.local.environment": "ec2:default", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "http://local-root-client-call/", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/client-call-metric.mustache b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/client-call-metric.mustache new file mode 100644 index 000000000..86fa8bbf5 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/client-call-metric.mustache @@ -0,0 +1,227 @@ +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/client-call-trace.mustache b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/client-call-trace.mustache new file mode 100644 index 000000000..261cfbac2 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/client-call-trace.mustache @@ -0,0 +1,71 @@ +[{ + "name": "^{{serviceName}}$", + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^InternalOperation$", + "aws.local.environment": "^ec2:default$", + "span.name": "^InternalOperation$", + "span.kind": "^SERVER$" + }, + "metadata": { + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$" + }, + "subsegments": [ + { + "name": "^local-root-client-call$", + "http": { + "request": { + "url": "^http://local-root-client-call/$", + "method": "^GET$" + } + }, + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^InternalOperation$", + "aws.remote.service": "^local-root-client-call$", + "aws.remote.operation": "GET /", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^CLIENT$" + }, + "metadata": { + "service.name": "^{{serviceName}}$", + "http.url": "^http://local-root-client-call/$", + "http.method": "^GET$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$" + }, + "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/python/ec2/adot-sigv4/outgoing-http-call-log.mustache b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/outgoing-http-call-log.mustache new file mode 100644 index 000000000..48f9df70a --- /dev/null +++ b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/outgoing-http-call-log.mustache @@ -0,0 +1,49 @@ +[{ + "name": "GET outgoing-http-call", + "kind": "SERVER", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET outgoing-http-call", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "{{endpoint}}/outgoing-http-call", + "http.route": "outgoing-http-call", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}, +{ + "name": "GET", + "kind": "CLIENT", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "UnmappedOperation", + "aws.remote.service": "www.amazon.com", + "aws.remote.operation": "GET /", + "aws.local.environment": "ec2:default", + "aws.span.kind": "CLIENT", + "http.url": "https://www.amazon.com/", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/outgoing-http-call-metric.mustache b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/outgoing-http-call-metric.mustache new file mode 100644 index 000000000..f4ce2515b --- /dev/null +++ b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/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: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2: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: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2: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: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: www.amazon.com diff --git a/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/outgoing-http-call-trace.mustache b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/outgoing-http-call-trace.mustache new file mode 100644 index 000000000..831649e19 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/outgoing-http-call-trace.mustache @@ -0,0 +1,57 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "url": "^{{endpoint}}/outgoing-http-call$", + "method": "^GET$" + } + }, + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET outgoing-http-call$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET outgoing-http-call$", + "span.kind": "^SERVER$" + }, + "metadata": { + "http.url": "^{{endpoint}}/outgoing-http-call$", + "http.method": "^GET$", + "http.route": "^outgoing-http-call$", + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$", + "PlatformType": "^AWS::EC2$" + }, + "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": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^CLIENT$" + }, + "namespace": "^remote$" + } + ] +}, +{ + "name": "^www.amazon.com$" +}] diff --git a/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/remote-service-log.mustache b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/remote-service-log.mustache new file mode 100644 index 000000000..8c342d820 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/remote-service-log.mustache @@ -0,0 +1,49 @@ +[{ + "name": "GET remote-service", + "kind": "SERVER", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET remote-service", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "{{endpoint}}/remote-service", + "http.route": "remote-service", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}, +{ + "name": "GET", + "kind": "CLIENT", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "UnmappedOperation", + "aws.remote.service": "{{remoteServiceDeploymentName}}", + "aws.remote.operation": "GET /healthcheck", + "aws.local.environment": "ec2:default", + "aws.span.kind": "CLIENT", + "http.url": "http://{{remoteServiceDeploymentName}}/healthcheck", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/remote-service-metric.mustache b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/remote-service-metric.mustache new file mode 100644 index 000000000..0d3714f71 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/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: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: ec2:default + - + name: Operation + value: GET healthcheck + - + name: Service + value: {{remoteServiceName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: ec2:default + - + name: Operation + value: GET healthcheck + - + name: Service + value: {{remoteServiceName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: ec2:default + - + name: Operation + value: GET healthcheck + - + name: Service + value: {{remoteServiceName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceDeploymentName}} diff --git a/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/remote-service-trace.mustache b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/remote-service-trace.mustache new file mode 100644 index 000000000..e56772553 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/python/ec2/adot-sigv4/remote-service-trace.mustache @@ -0,0 +1,72 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "url": "^{{endpoint}}/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "method": "^GET$" + }, + "response": { + "status": "^200$" + } + }, + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET remote-service$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET remote-service$", + "span.kind": "^SERVER$" + }, + "metadata": { + "http.url": "^{{endpoint}}/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "http.method": "^GET$", + "http.route": "^remote-service$", + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$", + "PlatformType": "^AWS::EC2$" + }, + "subsegments": [ + { + "name": "^{{remoteServiceDeploymentName}}$", + "http": { + "request": { + "url": "^http://{{remoteServiceDeploymentName}}/healthcheck$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^{{remoteServiceDeploymentName}}$", + "aws.remote.operation": "^GET /healthcheck$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^CLIENT$" + }, + "namespace": "^remote$" + } + ] +}, +{ + "name": "^{{remoteServiceName}}$", + "http": { + "request": { + "url": "^http://{{remoteServiceDeploymentName}}/healthcheck$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{remoteServiceName}}$", + "aws.local.operation": "^GET healthcheck$" + } +}] + + diff --git a/validator/src/main/resources/validations/python/ec2/adot-sigv4/log-validation.yml b/validator/src/main/resources/validations/python/ec2/adot-sigv4/log-validation.yml new file mode 100644 index 000000000..98cdb5af0 --- /dev/null +++ b/validator/src/main/resources/validations/python/ec2/adot-sigv4/log-validation.yml @@ -0,0 +1,24 @@ +- + validationType: "cw-log" + httpPath: "outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedLogStructureTemplate: "PYTHON_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_LOG" +- + validationType: "cw-log" + httpPath: "aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedLogStructureTemplate: "PYTHON_EC2_ADOT_SIGV4_AWS_SDK_CALL_LOG" +- + validationType: "cw-log" + httpPath: "remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedLogStructureTemplate: "PYTHON_EC2_ADOT_SIGV4_REMOTE_SERVICE_LOG" +- + validationType: "cw-log" + httpPath: "client-call" + httpMethod: "get" + callingType: "http" + expectedLogStructureTemplate: "PYTHON_EC2_ADOT_SIGV4_CLIENT_CALL_LOG" \ No newline at end of file diff --git a/validator/src/main/resources/validations/python/ec2/adot-sigv4/metric-validation.yml b/validator/src/main/resources/validations/python/ec2/adot-sigv4/metric-validation.yml new file mode 100644 index 000000000..76ea8b183 --- /dev/null +++ b/validator/src/main/resources/validations/python/ec2/adot-sigv4/metric-validation.yml @@ -0,0 +1,24 @@ +- + validationType: "cw-metric" + httpPath: "outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedMetricTemplate: "PYTHON_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_METRIC" +- + validationType: "cw-metric" + httpPath: "aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedMetricTemplate: "PYTHON_EC2_ADOT_SIGV4_AWS_SDK_CALL_METRIC" +- + validationType: "cw-metric" + httpPath: "remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedMetricTemplate: "PYTHON_EC2_ADOT_SIGV4_REMOTE_SERVICE_METRIC" +- + validationType: "cw-metric" + httpPath: "client-call" + httpMethod: "get" + callingType: "http" + expectedMetricTemplate: "PYTHON_EC2_ADOT_SIGV4_CLIENT_CALL_METRIC" \ No newline at end of file diff --git a/validator/src/main/resources/validations/python/ec2/adot-sigv4/trace-validation.yml b/validator/src/main/resources/validations/python/ec2/adot-sigv4/trace-validation.yml new file mode 100644 index 000000000..3abe2c925 --- /dev/null +++ b/validator/src/main/resources/validations/python/ec2/adot-sigv4/trace-validation.yml @@ -0,0 +1,24 @@ +- + validationType: "trace" + httpPath: "outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedTraceTemplate: "PYTHON_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_TRACE" +- + validationType: "trace" + httpPath: "aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedTraceTemplate: "PYTHON_EC2_ADOT_SIGV4_AWS_SDK_CALL_TRACE" +- + validationType: "trace" + httpPath: "remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedTraceTemplate: "PYTHON_EC2_ADOT_SIGV4_REMOTE_SERVICE_TRACE" +- + validationType: "trace" + httpPath: "client-call" + httpMethod: "get" + callingType: "http" + expectedTraceTemplate: "PYTHON_EC2_ADOT_SIGV4_CLIENT_CALL_TRACE" \ No newline at end of file From 724d080e7adb9587c9e71d8cd6f7d4269ce00f95 Mon Sep 17 00:00:00 2001 From: Mahad Janjua Date: Thu, 20 Feb 2025 10:14:09 -0800 Subject: [PATCH 02/15] Test --- .../workflows/java-ec2-adot-sigv4-test.yml | 260 ++++++++++++ .github/workflows/test.yml | 35 ++ terraform/java/ec2/adot-sigv4/main.tf | 287 +++++++++++++ terraform/java/ec2/adot-sigv4/output.tf | 26 ++ terraform/java/ec2/adot-sigv4/variables.tf | 50 +++ .../PredefinedExpectedTemplate.java | 19 + .../ec2/adot-sigv4/aws-sdk-call-log.mustache | 22 + .../adot-sigv4/aws-sdk-call-metric.mustache | 376 ++++++++++++++++++ .../adot-sigv4/aws-sdk-call-trace.mustache | 67 ++++ .../ec2/adot-sigv4/client-call-log.mustache | 20 + .../adot-sigv4/client-call-metric.mustache | 227 +++++++++++ .../ec2/adot-sigv4/client-call-trace.mustache | 56 +++ .../outgoing-http-call-log.mustache | 21 + .../outgoing-http-call-metric.mustache | 227 +++++++++++ .../outgoing-http-call-trace.mustache | 62 +++ .../adot-sigv4/remote-service-log.mustache | 20 + .../adot-sigv4/remote-service-metric.mustache | 326 +++++++++++++++ .../adot-sigv4/remote-service-trace.mustache | 97 +++++ .../java/ec2/adot-sigv4/log-validation.yml | 28 ++ .../java/ec2/adot-sigv4/metric-validation.yml | 28 ++ .../java/ec2/adot-sigv4/trace-validation.yml | 24 ++ 21 files changed, 2278 insertions(+) create mode 100644 .github/workflows/java-ec2-adot-sigv4-test.yml create mode 100644 .github/workflows/test.yml create mode 100644 terraform/java/ec2/adot-sigv4/main.tf create mode 100644 terraform/java/ec2/adot-sigv4/output.tf create mode 100644 terraform/java/ec2/adot-sigv4/variables.tf create mode 100644 validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-trace.mustache create mode 100644 validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache create mode 100644 validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache create mode 100644 validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-trace.mustache create mode 100644 validator/src/main/resources/validations/java/ec2/adot-sigv4/log-validation.yml create mode 100644 validator/src/main/resources/validations/java/ec2/adot-sigv4/metric-validation.yml create mode 100644 validator/src/main/resources/validations/java/ec2/adot-sigv4/trace-validation.yml diff --git a/.github/workflows/java-ec2-adot-sigv4-test.yml b/.github/workflows/java-ec2-adot-sigv4-test.yml new file mode 100644 index 000000000..37a87f3b7 --- /dev/null +++ b/.github/workflows/java-ec2-adot-sigv4-test.yml @@ -0,0 +1,260 @@ +## 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 + +# This test case validates ADOT used on its own to send traces to the X-Ray OTLP endpoint with SigV4 authentication +name: Java EC2 ADOT SigV4 (Stand-Alone ADOT) Use Case +on: + workflow_call: + inputs: + caller-workflow-name: + required: true + type: string + java-version: + description: "Currently support version 8, 11, 17, 21, 22" + required: false + type: string + default: '11' + cpu-architecture: + description: "Permitted values: x86_64 or arm64" + required: false + type: string + default: "x86_64" + outputs: + job-started: + value: ${{ jobs.java-ec2-adot-sigv4.outputs.job-started }} + validation-result: + value: ${{ jobs.java-ec2-adot-sigv4.outputs.validation-result }} + +permissions: + id-token: write + contents: read + +env: + E2E_TEST_AWS_REGION: 'us-west-2' # Test uses us-west-2 in the us-east-1 account + CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }} + JAVA_VERSION: ${{ inputs.java-version }} + CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }} + E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }} # us-east-1 test account + E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} + LOG_GROUP_NAME: aws/spans + TEST_RESOURCES_FOLDER: ${GITHUB_WORKSPACE} + +jobs: + java-ec2-adot-sigv4: + 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 + run: echo TESTING_ID="${{ github.run_id }}-${{ github.run_number }}-${RANDOM}" >> $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 + + # We use the us-east-1 account, but use us-west-2 for the test + # This is because transaction search is a regional setting, which would affect all other tests if run in the same region + - 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: ${{ env.E2E_TEST_AWS_REGION }} + + # TODO: Reintroduce ability to test latest public release + # if [ "${{ github.event.repository.name }}" = "aws-otel-java-instrumentation" ]; then + # echo GET_ADOT_JAR_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/aws-opentelemetry-agent.jar ./adot.jar" >> $GITHUB_ENV + # else + # echo GET_ADOT_JAR_COMMAND="wget -O adot.jar https://github.com/aws-observability/aws-otel-java-instrumentation/releases/latest/download/aws-opentelemetry-agent.jar" >> $GITHUB_ENV + # fi + - name: Set ADOT getter command environment variable + run: echo GET_ADOT_JAR_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/aws-opentelemetry-agent.jar ./adot.jar --region us-east-1" >> $GITHUB_ENV + + - 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/ec2/adot-sigv4 && terraform init && terraform validate" + cleanup: "rm -rf .terraform && rm -rf .terraform.lock.hcl" + max_retry: 6 + sleep_time: 60 + + - name: Deploy sample app via terraform and wait for endpoint to come online + working-directory: terraform/java/ec2/adot-sigv4 + run: | + # Attempt to deploy the sample app on an EC2 instance and wait for its endpoint to come online. + # There may be occasional failures due to transitivity issues, so try up to 2 times. + # deployment_failed of 0 indicates that both the terraform deployment and the endpoint are running, while 1 indicates + # that it failed at some point + retry_counter=0 + max_retry=2 + while [ $retry_counter -lt $max_retry ]; do + echo "Attempt $retry_counter" + deployment_failed=0 + terraform apply -auto-approve \ + -var="aws_region=${{ env.E2E_TEST_AWS_REGION }}" \ + -var="test_id=${{ env.TESTING_ID }}" \ + -var="sample_app_jar=s3://aws-appsignals-sample-app-prod-us-east-1/java-main-service-v${{ env.JAVA_VERSION }}.jar" \ + -var="sample_remote_app_jar=s3://aws-appsignals-sample-app-prod-us-east-1/java-remote-service-v${{ env.JAVA_VERSION }}.jar" \ + -var="get_adot_jar_command=${{ env.GET_ADOT_JAR_COMMAND }}" \ + -var="language_version=${{ env.JAVA_VERSION }}" \ + -var="cpu_architecture=${{ env.CPU_ARCHITECTURE }}" \ + || deployment_failed=$? + + if [ $deployment_failed -eq 1 ]; then + echo "Terraform deployment was unsuccessful. Will attempt to retry deployment." + fi + + # If the success is 1 then either the terraform deployment or the endpoint connection failed, so first destroy the + # resources created from terraform and try again. + if [ $deployment_failed -eq 1 ]; then + echo "Destroying terraform" + terraform destroy -auto-approve \ + -var="test_id=${{ env.TESTING_ID }}" + + retry_counter=$(($retry_counter+1)) + else + # If deployment succeeded, then exit the loop + break + fi + + if [ $retry_counter -eq $max_retry ]; then + echo "Max retry reached, failed to deploy terraform and connect to the endpoint. Exiting code" + exit 1 + fi + done + + - name: Get the ec2 instance ami id + working-directory: terraform/java/ec2/adot-sigv4 + run: | + echo "EC2_INSTANCE_AMI=$(terraform output ec2_instance_ami)" >> $GITHUB_ENV + + - name: Get the sample app and EC2 instance information + working-directory: terraform/java/ec2/adot-sigv4 + run: | + echo "MAIN_SERVICE_ENDPOINT=localhost:8080" >> $GITHUB_ENV + echo "REMOTE_SERVICE_IP=$(terraform output sample_app_remote_service_private_ip)" >> $GITHUB_ENV + echo "MAIN_SERVICE_INSTANCE_ID=$(terraform output main_service_instance_id)" >> $GITHUB_ENV + + - name: Initiate Gradlew Daemon + if: steps.initiate-gradlew == 'failure' + 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: Sleep 10 minutes + run: sleep 600 + + # Validation for pulse telemetry data + # - name: Validate generated EMF logs + # id: log-validation + # run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/log-validation.yml + # --testing-id ${{ env.TESTING_ID }} + # --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + # --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 + # --region ${{ env.E2E_TEST_AWS_REGION }} + # --account-id ${{ env.ACCOUNT_ID }} + # --metric-namespace ${{ env.METRIC_NAMESPACE }} + # --log-group ${{ env.LOG_GROUP_NAME }} + # --service-name sample-application-${{ env.TESTING_ID }} + # --remote-service-name sample-remote-application-${{ env.TESTING_ID }} + # --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + # --instance-ami ${{ env.EC2_INSTANCE_AMI }} + # --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + # --rollup' + + # - name: Validate generated metrics + # id: metric-validation + # if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() + # run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/metric-validation.yml + # --testing-id ${{ env.TESTING_ID }} + # --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + # --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 + # --region ${{ env.E2E_TEST_AWS_REGION }} + # --account-id ${{ env.ACCOUNT_ID }} + # --metric-namespace ${{ env.METRIC_NAMESPACE }} + # --log-group ${{ env.LOG_GROUP_NAME }} + # --service-name sample-application-${{ env.TESTING_ID }} + # --remote-service-name sample-remote-application-${{ env.TESTING_ID }} + # --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + # --instance-ami ${{ env.EC2_INSTANCE_AMI }} + # --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + # --rollup' + + # - name: Validate generated traces + # id: trace-validation + # if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled() + # run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/trace-validation.yml + # --testing-id ${{ env.TESTING_ID }} + # --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + # --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 + # --region ${{ env.E2E_TEST_AWS_REGION }} + # --account-id ${{ env.ACCOUNT_ID }} + # --metric-namespace ${{ env.METRIC_NAMESPACE }} + # --log-group ${{ env.LOG_GROUP_NAME }} + # --service-name sample-application-${{ env.TESTING_ID }} + # --remote-service-name sample-remote-application-${{ env.TESTING_ID }} + # --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + # --instance-ami ${{ env.EC2_INSTANCE_AMI }} + # --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + # --rollup' + + - name: Refresh AWS Credentials + if: ${{ github.event.repository.name == 'aws-application-signals-test-framework' }} + 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: ${{ env.E2E_TEST_AWS_REGION }} + + - name: Save test results + if: always() + id: validation-result + run: | + if [ "${{ steps.log-validation.outcome }}" = "success" ] && [ "${{ steps.metric-validation.outcome }}" = "success" ] && [ "${{ steps.trace-validation.outcome }}" = "success" ]; then + echo "validation-result=success" >> $GITHUB_OUTPUT + else + echo "validation-result=failure" >> $GITHUB_OUTPUT + fi + + # Clean up Procedures + - name: Terraform destroy + if: always() + continue-on-error: true + working-directory: terraform/java/ec2/adot-sigv4 + run: | + terraform destroy -auto-approve \ + -var="test_id=${{ env.TESTING_ID }}" \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..408081e79 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +## 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: Test +on: + push: + branches: + - java-sigv4 + +permissions: + id-token: write + contents: read + +jobs: + # Runs in us-west-1 using us-east-1 account + java-ec2-adot-sigv4: + uses: ./.github/workflows/java-ec2-adot-sigv4-test.yml + secrets: inherit + with: + caller-workflow-name: 'test' + java-version: 11 + cpu-architecture: x86_64 + + # publish-metric: + # needs: [ java-ec2-adot-sigv4 ] + # 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-ec2-default-attempt-1.outputs.validation-result || needs.java-ec2-default-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/terraform/java/ec2/adot-sigv4/main.tf b/terraform/java/ec2/adot-sigv4/main.tf new file mode 100644 index 000000000..f100de811 --- /dev/null +++ b/terraform/java/ec2/adot-sigv4/main.tf @@ -0,0 +1,287 @@ +# ------------------------------------------------------------------------ +# 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" + } + } +} + +# Define the provider for AWS +provider "aws" {} + +resource "aws_default_vpc" "default" {} + +resource "tls_private_key" "ssh_key" { + algorithm = "RSA" + rsa_bits = 4096 +} + +resource "aws_key_pair" "aws_ssh_key" { + key_name = "instance_key-${var.test_id}" + public_key = tls_private_key.ssh_key.public_key_openssh +} + +locals { + ssh_key_name = aws_key_pair.aws_ssh_key.key_name + private_key_content = tls_private_key.ssh_key.private_key_pem +} + +data "aws_ami" "ami" { + owners = ["amazon"] + most_recent = true + filter { + name = "name" + values = ["al20*-ami-minimal-*-${var.cpu_architecture}"] + } + filter { + name = "state" + values = ["available"] + } + filter { + name = "architecture" + values = [var.cpu_architecture] + } + filter { + name = "image-type" + values = ["machine"] + } + + filter { + name = "root-device-name" + values = ["/dev/xvda"] + } + + filter { + name = "root-device-type" + values = ["ebs"] + } + + filter { + name = "virtualization-type" + values = ["hvm"] + } +} + +resource "aws_instance" "main_service_instance" { + ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier) + instance_type = var.cpu_architecture == "x86_64" ? "t3.micro" : "t4g.micro" + key_name = local.ssh_key_name + iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE" + vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id] + associate_public_ip_address = true + instance_initiated_shutdown_behavior = "terminate" + + metadata_options { + http_tokens = "required" + } + + root_block_device { + volume_size = 5 + } + + tags = { + Name = "main-service-${var.test_id}" + } +} + +resource "null_resource" "main_service_setup" { + connection { + type = "ssh" + user = var.user + private_key = local.private_key_content + host = aws_instance.main_service_instance.public_ip + } + + provisioner "remote-exec" { + inline = [ + <<-EOF + # Make the Terraform fail if any step throws an error + set -o errexit + # Install wget + sudo yum install wget -y + # Install Java + echo + if [[ "${var.language_version}" == "8" ]]; then + sudo yum install java-1.8.0-amazon-corretto -y + else + sudo yum install java-${var.language_version}-amazon-corretto -y + fi + + # Get ADOT + ${var.get_adot_jar_command} + + # Get and run the sample application with configuration + aws s3 cp ${var.sample_app_jar} ./main-service.jar --region us-east-1 + + # OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED=true \ + export JAVA_TOOL_OPTIONS=' -javaagent:/home/ec2-user/adot.jar' + export OTEL_LOGS_EXPORT=none + export OTEL_METRICS_EXPORTER=none + export OTEL_TRACES_EXPORTER=otlp + export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray.${var.aws_region}.amazonaws.com/v1/traces + export OTEL_RESOURCE_ATTRIBUTES=service.name=sample-application-${var.test_id} + nohup java -jar main-service.jar &> nohup.out & + + # The application needs time to come up and reach a steady state, this should not take longer than 30 seconds + sleep 30 + + # Check if the application is up. If it is not up, then exit 1. + attempt_counter=0 + max_attempts=30 + until $(curl --output /dev/null --silent --head --fail --max-time 5 $(echo "http://localhost:8080" | tr -d '"')); do + if [ $attempt_counter -eq $max_attempts ];then + echo "Failed to connect to endpoint." + exit 1 + fi + echo "Attempting to connect to the main endpoint. Tried $attempt_counter out of $max_attempts" + attempt_counter=$(($attempt_counter+1)) + sleep 10 + done + + echo "Successfully connected to main endpoint" + + EOF + ] + } + + depends_on = [aws_instance.main_service_instance] +} + +resource "aws_instance" "remote_service_instance" { + ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier) + instance_type = var.cpu_architecture == "x86_64" ? "t3.micro" : "t4g.micro" + key_name = local.ssh_key_name + iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE" + vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id] + associate_public_ip_address = true + instance_initiated_shutdown_behavior = "terminate" + + metadata_options { + http_tokens = "required" + } + + root_block_device { + volume_size = 5 + } + + tags = { + Name = "remote-service-${var.test_id}" + } +} + +resource "null_resource" "remote_service_setup" { + connection { + type = "ssh" + user = var.user + private_key = local.private_key_content + host = aws_instance.remote_service_instance.public_ip + } + + provisioner "remote-exec" { + inline = [ + <<-EOF + # Make the Terraform fail if any step throws an error + set -o errexit + # Install wget + sudo yum install wget -y + # Install Java + if [[ "${var.language_version}" == "8" ]]; then + sudo yum install java-1.8.0-amazon-corretto -y + else + sudo yum install java-${var.language_version}-amazon-corretto -y + fi + + # enable ec2 instance connect for debug + sudo yum install ec2-instance-connect -y + + # Get ADOT + ${var.get_adot_jar_command} + + # Get and run the sample application with configuration + aws s3 cp ${var.sample_remote_app_jar} ./remote-service.jar --region us-east-1 + + # OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED=true \ + export JAVA_TOOL_OPTIONS=' -javaagent:/home/ec2-user/adot.jar' + export OTEL_LOGS_EXPORT=none + export OTEL_METRICS_EXPORTER=none + export OTEL_TRACES_EXPORTER=otlp + export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray.${var.aws_region}.amazonaws.com/v1/traces + OTEL_RESOURCE_ATTRIBUTES=service.name=sample-remote-application-${var.test_id} \ + nohup java -jar remote-service.jar &> nohup.out & + + # The application needs time to come up and reach a steady state, this should not take longer than 30 seconds + sleep 30 + + # Check if the application is up. If it is not up, then exit 1. + attempt_counter=0 + max_attempts=30 + until $(curl --output /dev/null --silent --head --fail --max-time 5 $(echo "http://localhost:8080/healthcheck" | tr -d '"')); do + if [ $attempt_counter -eq $max_attempts ];then + echo "Failed to connect to endpoint." + exit 1 + fi + echo "Attempting to connect to the remote endpoint. Tried $attempt_counter out of $max_attempts" + attempt_counter=$(($attempt_counter+1)) + sleep 10 + done + + echo "Successfully connected to remote endpoint" + + EOF + ] + } + + depends_on = [aws_instance.remote_service_instance] +} + +resource "null_resource" "traffic_generator_setup" { + connection { + type = "ssh" + user = var.user + private_key = local.private_key_content + host = aws_instance.main_service_instance.public_ip + } + + provisioner "remote-exec" { + inline = [ + <<-EOF + sudo yum install nodejs aws-cli unzip tmux -y + + # Bring in the traffic generator files to EC2 Instance + aws s3 cp s3://aws-appsignals-sample-app-prod-us-east-1/traffic-generator.zip ./traffic-generator.zip --region us-east-1 + unzip ./traffic-generator.zip -d ./ + + # Install the traffic generator dependencies + npm install + + tmux new -s traffic-generator -d + tmux send-keys -t traffic-generator "export MAIN_ENDPOINT=\"localhost:8080\"" C-m + tmux send-keys -t traffic-generator "export REMOTE_ENDPOINT=\"${aws_instance.remote_service_instance.private_ip}\"" C-m + tmux send-keys -t traffic-generator "export ID=\"${var.test_id}\"" C-m + tmux send-keys -t traffic-generator "npm start" C-m + + sleep 60 + + cat nohup.out + + EOF + ] + } + + depends_on = [null_resource.main_service_setup, null_resource.remote_service_setup] +} \ No newline at end of file diff --git a/terraform/java/ec2/adot-sigv4/output.tf b/terraform/java/ec2/adot-sigv4/output.tf new file mode 100644 index 000000000..be572868a --- /dev/null +++ b/terraform/java/ec2/adot-sigv4/output.tf @@ -0,0 +1,26 @@ +# ------------------------------------------------------------------------ +# 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. +# ------------------------------------------------------------------------- + +output "sample_app_remote_service_private_ip" { + value = aws_instance.remote_service_instance.private_ip +} + +output "main_service_instance_id" { + value = aws_instance.main_service_instance.id +} + +output "ec2_instance_ami" { + value = data.aws_ami.ami.id +} \ No newline at end of file diff --git a/terraform/java/ec2/adot-sigv4/variables.tf b/terraform/java/ec2/adot-sigv4/variables.tf new file mode 100644 index 000000000..4d861ee8b --- /dev/null +++ b/terraform/java/ec2/adot-sigv4/variables.tf @@ -0,0 +1,50 @@ +# ------------------------------------------------------------------------ +# 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 "aws_region" { + default = "" +} + +variable "user" { + default = "ec2-user" +} + +variable "sample_app_jar" { + default = "s3:///" +} + +variable "sample_remote_app_jar" { + default = "s3:///" +} + +variable "get_adot_jar_command" { + default = " s3:///" +} + +variable "canary_type" { + default = "java-ec2-default" +} + +variable "language_version" { + default = "11" +} + +variable "cpu_architecture" { + default = "x86_64" +} \ No newline at end of file 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 4e890a2e6..b68e05f94 100644 --- a/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java +++ b/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java @@ -115,6 +115,25 @@ public enum PredefinedExpectedTemplate implements FileConfig { JAVA_EC2_UBUNTU_CLIENT_CALL_METRIC("/expected-data-template/java/ec2/ubuntu/client-call-metric.mustache"), JAVA_EC2_UBUNTU_CLIENT_CALL_TRACE("/expected-data-template/java/ec2/ubuntu/client-call-trace.mustache"), + /** Java EC2 ADOT SigV4 (ADOT Stand-Alone) Test Case Validations */ + JAVA_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_LOG("/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-log.mustache"), + JAVA_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_METRIC( + "/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-metric.mustache"), + JAVA_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_TRACE( + "/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache"), + + JAVA_EC2_ADOT_SIGV4_AWS_SDK_CALL_LOG("/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-log.mustache"), + JAVA_EC2_ADOT_SIGV4_AWS_SDK_CALL_METRIC("/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-metric.mustache"), + JAVA_EC2_ADOT_SIGV4_AWS_SDK_CALL_TRACE("/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-trace.mustache"), + + JAVA_EC2_ADOT_SIGV4_REMOTE_SERVICE_LOG("/expected-data-template/java/ec2/adot-sigv4/remote-service-log.mustache"), + JAVA_EC2_ADOT_SIGV4_REMOTE_SERVICE_METRIC("/expected-data-template/java/ec2/adot-sigv4/remote-service-metric.mustache"), + JAVA_EC2_ADOT_SIGV4_REMOTE_SERVICE_TRACE("/expected-data-template/java/ec2/adot-sigv4/remote-service-trace.mustache"), + + JAVA_EC2_ADOT_SIGV4_CLIENT_CALL_LOG("/expected-data-template/java/ec2/adot-sigv4/client-call-log.mustache"), + JAVA_EC2_ADOT_SIGV4_CLIENT_CALL_METRIC("/expected-data-template/java/ec2/adot-sigv4/client-call-metric.mustache"), + JAVA_EC2_ADOT_SIGV4_CLIENT_CALL_TRACE("/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache"), + /** Java EC2 K8s Test Case Validations */ JAVA_K8S_OUTGOING_HTTP_CALL_LOG("/expected-data-template/java/k8s/outgoing-http-call-log.mustache"), JAVA_K8S_OUTGOING_HTTP_CALL_METRIC("/expected-data-template/java/k8s/outgoing-http-call-metric.mustache"), diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-log.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-log.mustache new file mode 100644 index 000000000..5d820b066 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-log.mustache @@ -0,0 +1,22 @@ +[{ + "EC2.InstanceId": "^{{instanceId}}$", + "Environment": "^ec2:default$", + "PlatformType": "^AWS::EC2$", + "Operation": "GET /aws-sdk-call", + "Version": "^1$", + "Telemetry.Source": "^LocalRootSpan$", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}, +{ + "EC2.InstanceId": "^{{instanceId}}$", + "Environment": "^ec2:default$", + "PlatformType": "^AWS::EC2$", + "Operation": "GET /aws-sdk-call", + "Version": "^1$", + "RemoteService": "AWS::S3", + "RemoteOperation": "GetBucketLocation", + "RemoteResourceIdentifier": "^e2e-test-bucket-name-{{testingId}}$", + "RemoteResourceType": "^AWS::S3::Bucket$", + "Telemetry.Source": "^ClientSpan$", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-metric.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-metric.mustache new file mode 100644 index 000000000..4ad5135e0 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-metric.mustache @@ -0,0 +1,376 @@ +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + - + name: RemoteResourceType + value: AWS::S3::Bucket + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + - + name: RemoteResourceType + value: AWS::S3::Bucket + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + - + name: RemoteResourceType + value: AWS::S3::Bucket + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + - + name: RemoteResourceType + value: AWS::S3::Bucket + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + - + name: RemoteResourceType + value: AWS::S3::Bucket + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + - + name: RemoteResourceIdentifier + value: e2e-test-bucket-name-{{testingId}} + - + name: RemoteResourceType + value: AWS::S3::Bucket + + diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-trace.mustache new file mode 100644 index 000000000..488ce397b --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-trace.mustache @@ -0,0 +1,67 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "url": "^{{endpoint}}/aws-sdk-call(?:\\?ip=(([0-9]{1,3}\\.){3}[0-9]{1,3})&testingId={{testingId}})?$", + "method": "^GET$" + }, + "response": { + "status": "^200$" + } + }, + "aws": { + "account_id": "^{{accountId}}$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET /aws-sdk-call$", + "aws.local.environment": "^ec2:default$" + }, + "metadata": { + "default": { + "EC2.InstanceId": "^{{instanceId}}$", + "PlatformType": "^AWS::EC2$", + "otel.resource.host.image.id": "^{{instanceAmi}}$", + "otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$", + "aws.span.kind": "^LOCAL_ROOT$" + } + }, + "subsegments": [ + { + "subsegments": [ + { + "name": "^S3$", + "http": { + "request": { + "url": "^https://e2e-test-bucket-name-{{testingId}}.s3.{{region}}.amazonaws.com\\?location$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET /aws-sdk-call$", + "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": "^ec2:default$" + }, + "metadata": { + "default": { + "EC2.InstanceId": "^{{instanceId}}$", + "PlatformType": "^AWS::EC2$", + "aws.span.kind": "^CLIENT$" + } + }, + "namespace": "^aws$" + } + ] + } + ] +}, +{ + "name": "^S3$", + "aws": { + "operation": "^GetBucketLocation$" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-log.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-log.mustache new file mode 100644 index 000000000..25c72000a --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-log.mustache @@ -0,0 +1,20 @@ +[{ + "EC2.InstanceId": "^{{instanceId}}$", + "Environment": "^ec2:default$", + "PlatformType": "^AWS::EC2$", + "Operation": "InternalOperation", + "Version": "^1$", + "Telemetry.Source": "^LocalRootSpan$", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}, +{ + "EC2.InstanceId": "^{{instanceId}}$", + "Environment": "^ec2:default$", + "PlatformType": "^AWS::EC2$", + "Operation": "InternalOperation", + "Version": "^1$", + "RemoteService": "local-root-client-call", + "RemoteOperation": "GET /", + "Telemetry.Source": "^ClientSpan$", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-metric.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-metric.mustache new file mode 100644 index 000000000..86fa8bbf5 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-metric.mustache @@ -0,0 +1,227 @@ +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2: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/ec2/adot-sigv4/client-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache new file mode 100644 index 000000000..5a7774e4b --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache @@ -0,0 +1,56 @@ +[{ + "name": "^{{serviceName}}$", + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^InternalOperation$", + "aws.local.environment": "^ec2:default$" + }, + "metadata": { + "default": { + "otel.resource.host.image.id": "^{{instanceAmi}}$", + "otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$" + } + }, + "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": "^ec2:default$" + }, + "metadata": { + "default": { + "EC2.InstanceId": "^{{instanceId}}$", + "PlatformType": "^AWS::EC2$", + "aws.span.kind": "^LOCAL_ROOT$" + } + }, + "namespace": "^remote$" + } + ] +}, +{ + "name": "^local-root-client-call$", + "http": { + "request": { + "url": "^http://local-root-client-call$", + "method": "^GET$" + }, + "response": { + "content_length": 0 + } + }, + "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/ec2/adot-sigv4/outgoing-http-call-log.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-log.mustache new file mode 100644 index 000000000..60c38935c --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-log.mustache @@ -0,0 +1,21 @@ +[{ + "EC2.InstanceId": "^{{instanceId}}$", + "Environment": "^ec2:default$", + "PlatformType": "^AWS::EC2$", + "Operation": "GET /outgoing-http-call", + "Version": "^1$", + "Telemetry.Source": "^LocalRootSpan$", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}, +{ + "EC2.InstanceId": "^{{instanceId}}$", + "Environment": "^ec2:default$", + "PlatformType": "^AWS::EC2$", + "Operation": "GET /outgoing-http-call", + "Version": "^1$", + "RemoteService": "www.amazon.com", + "RemoteOperation": "GET /", + "Telemetry.Source": "^ClientSpan$", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}] + diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-metric.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-metric.mustache new file mode 100644 index 000000000..bf4defe6b --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/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: GET /outgoing-http-call + - + 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: GET /outgoing-http-call + - + 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: GET /outgoing-http-call + - + 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 diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache new file mode 100644 index 000000000..c1a91c841 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache @@ -0,0 +1,62 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "url": "^{{endpoint}}/outgoing-http-call$", + "method": "^GET$" + }, + "response": { + "status": "^200$" + } + }, + "aws": { + "account_id": "^{{accountId}}$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET /outgoing-http-call$", + "aws.local.environment": "^ec2:default$" + }, + "metadata": { + "default": { + "EC2.InstanceId": "^{{instanceId}}$", + "PlatformType": "^AWS::EC2$", + "otel.resource.host.image.id": "^{{instanceAmi}}$", + "otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$", + "aws.span.kind": "^LOCAL_ROOT$" + } + }, + "subsegments": [ + { + "subsegments": [ + { + "name": "^www.amazon.com$", + "http": { + "request": { + "url": "^https://www.amazon.com$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET /outgoing-http-call$", + "aws.remote.service": "^www.amazon.com$", + "aws.remote.operation": "^GET /$", + "aws.local.environment": "^ec2:default$" + }, + "metadata": { + "default": { + "EC2.InstanceId": "^{{instanceId}}$", + "PlatformType": "^AWS::EC2$", + "aws.span.kind": "^CLIENT$" + } + }, + "namespace": "^remote$" + } + ] + } + ] +}, +{ + "name": "^www.amazon.com$" +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-log.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-log.mustache new file mode 100644 index 000000000..cd457dc7b --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-log.mustache @@ -0,0 +1,20 @@ +[{ + "EC2.InstanceId": "^{{instanceId}}$", + "Environment": "^ec2:default$", + "PlatformType": "^AWS::EC2$", + "Operation": "GET /remote-service", + "Version": "^1$", + "Telemetry.Source": "^LocalRootSpan$", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}, +{ + "EC2.InstanceId": "^{{instanceId}}$", + "Environment": "^ec2:default$", + "PlatformType": "^AWS::EC2$", + "Operation": "GET /remote-service", + "Version": "^1$", + "RemoteService": "{{remoteServiceDeploymentName}}", + "RemoteOperation": "GET /healthcheck", + "Telemetry.Source": "^ClientSpan$", + "Host": "^ip(-[0-9]{1,3}){4}.*$" +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-metric.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-metric.mustache new file mode 100644 index 000000000..4b1f0ad9c --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/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: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: ec2:default + - + name: Operation + value: GET /healthcheck + - + name: Service + value: {{remoteServiceName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: ec2:default + - + name: Operation + value: GET /healthcheck + - + name: Service + value: {{remoteServiceName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: ec2:default + - + name: Operation + value: GET /healthcheck + - + name: Service + value: {{remoteServiceName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceDeploymentName}} diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-trace.mustache new file mode 100644 index 000000000..2ef1f4d74 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-trace.mustache @@ -0,0 +1,97 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "url": "^{{endpoint}}/remote-service(?:\\?ip=(([0-9]{1,3}\\.){3}[0-9]{1,3})&testingId={{testingId}})?$", + "method": "^GET$" + }, + "response": { + "status": "^200$" + } + }, + "aws": { + "account_id": "^{{accountId}}$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET /remote-service$", + "aws.local.environment": "^ec2:default$" + }, + "metadata": { + "default": { + "EC2.InstanceId": "^{{instanceId}}$", + "PlatformType": "^AWS::EC2$", + "otel.resource.host.image.id": "^{{instanceAmi}}$", + "otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$", + "aws.span.kind": "^LOCAL_ROOT$" + } + }, + "subsegments": [ + { + "subsegments": [ + { + "name": "^{{remoteServiceDeploymentName}}$", + "http": { + "request": { + "url": "^http://(([0-9]{1,3}.){3}[0-9]{1,3}):8080/healthcheck$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET /remote-service$", + "aws.remote.service": "^{{remoteServiceDeploymentName}}$", + "aws.remote.operation": "^GET /healthcheck$", + "aws.local.environment": "^ec2:default$" + }, + "metadata": { + "default": { + "EC2.InstanceId": "^{{instanceId}}$", + "PlatformType": "^AWS::EC2$", + "aws.span.kind": "^CLIENT$" + } + }, + "namespace": "^remote$" + } + ] + } + ] +}, +{ + "name": "^{{remoteServiceName}}$", + "http": { + "request": { + "url": "^http://(([0-9]{1,3}.){3}[0-9]{1,3}):8080/healthcheck$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{remoteServiceName}}$", + "aws.local.operation": "^GET /healthcheck$", + "aws.local.environment": "^ec2:default$" + }, + "metadata": { + "default": { + "EC2.InstanceId": "^i-[A-Za-z0-9]{17}$", + "PlatformType": "^AWS::EC2$", + "otel.resource.host.image.id": "^{{instanceAmi}}$", + "otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$", + "aws.span.kind": "^LOCAL_ROOT$" + } + }, + "subsegments": [ + { + "name": "^RemoteServiceController.healthcheck$", + "annotations": { + "aws.local.operation": "^GET /healthcheck$", + "aws.local.environment": "^ec2:default$" + }, + "metadata": { + "default": { + "EC2.InstanceId": "^i-[A-Za-z0-9]{17}$", + "PlatformType": "^AWS::EC2$" + } + } + } + ] +}] \ No newline at end of file diff --git a/validator/src/main/resources/validations/java/ec2/adot-sigv4/log-validation.yml b/validator/src/main/resources/validations/java/ec2/adot-sigv4/log-validation.yml new file mode 100644 index 000000000..6c51bbf97 --- /dev/null +++ b/validator/src/main/resources/validations/java/ec2/adot-sigv4/log-validation.yml @@ -0,0 +1,28 @@ +- + validationType: "cw-log" + httpPath: "/outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedLogStructureTemplate: "JAVA_EC2_DEFAULT_OUTGOING_HTTP_CALL_LOG" +- + validationType: "cw-log" + httpPath: "/aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedLogStructureTemplate: "JAVA_EC2_DEFAULT_AWS_SDK_CALL_LOG" +- + validationType: "cw-log" + httpPath: "/remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedLogStructureTemplate: "JAVA_EC2_DEFAULT_REMOTE_SERVICE_LOG" +- + validationType: "cw-log" + httpPath: "/client-call" + httpMethod: "get" + callingType: "http" + expectedLogStructureTemplate: "JAVA_EC2_DEFAULT_CLIENT_CALL_LOG" +- + validationType: "cw-log" + callingType: "none" + expectedLogStructureTemplate: "JAVA_RUNTIME_METRIC_LOG" \ No newline at end of file diff --git a/validator/src/main/resources/validations/java/ec2/adot-sigv4/metric-validation.yml b/validator/src/main/resources/validations/java/ec2/adot-sigv4/metric-validation.yml new file mode 100644 index 000000000..92ee0d4f5 --- /dev/null +++ b/validator/src/main/resources/validations/java/ec2/adot-sigv4/metric-validation.yml @@ -0,0 +1,28 @@ +- + validationType: "cw-metric" + httpPath: "/outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedMetricTemplate: "JAVA_EC2_DEFAULT_OUTGOING_HTTP_CALL_METRIC" +- + validationType: "cw-metric" + httpPath: "/aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedMetricTemplate: "JAVA_EC2_DEFAULT_AWS_SDK_CALL_METRIC" +- + validationType: "cw-metric" + httpPath: "/remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedMetricTemplate: "JAVA_EC2_DEFAULT_REMOTE_SERVICE_METRIC" +- + validationType: "cw-metric" + httpPath: "/client-call" + httpMethod: "get" + callingType: "http" + expectedMetricTemplate: "JAVA_EC2_DEFAULT_CLIENT_CALL_METRIC" +- + validationType: "cw-metric" + callingType: "none" + expectedMetricTemplate: "JAVA_RUNTIME_METRIC" \ No newline at end of file diff --git a/validator/src/main/resources/validations/java/ec2/adot-sigv4/trace-validation.yml b/validator/src/main/resources/validations/java/ec2/adot-sigv4/trace-validation.yml new file mode 100644 index 000000000..15e685a31 --- /dev/null +++ b/validator/src/main/resources/validations/java/ec2/adot-sigv4/trace-validation.yml @@ -0,0 +1,24 @@ +- + validationType: "trace" + httpPath: "/outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedTraceTemplate: "JAVA_EC2_DEFAULT_OUTGOING_HTTP_CALL_TRACE" +- + validationType: "trace" + httpPath: "/aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedTraceTemplate: "JAVA_EC2_DEFAULT_AWS_SDK_CALL_TRACE" +- + validationType: "trace" + httpPath: "/remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedTraceTemplate: "JAVA_EC2_DEFAULT_REMOTE_SERVICE_TRACE" +- + validationType: "trace" + httpPath: "/client-call" + httpMethod: "get" + callingType: "http" + expectedTraceTemplate: "JAVA_EC2_DEFAULT_CLIENT_CALL_TRACE" \ No newline at end of file From 7d501efc8595721b42a8f734daecd02aafbcb9b8 Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 19 Mar 2025 22:40:35 +0000 Subject: [PATCH 03/15] added http protobuf protocol to env variable --- terraform/java/ec2/adot-sigv4/main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/java/ec2/adot-sigv4/main.tf b/terraform/java/ec2/adot-sigv4/main.tf index f100de811..17fccfa02 100644 --- a/terraform/java/ec2/adot-sigv4/main.tf +++ b/terraform/java/ec2/adot-sigv4/main.tf @@ -133,6 +133,7 @@ resource "null_resource" "main_service_setup" { export OTEL_LOGS_EXPORT=none export OTEL_METRICS_EXPORTER=none export OTEL_TRACES_EXPORTER=otlp + export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray.${var.aws_region}.amazonaws.com/v1/traces export OTEL_RESOURCE_ATTRIBUTES=service.name=sample-application-${var.test_id} nohup java -jar main-service.jar &> nohup.out & From d9be6a3266ad8307752e27f0c40e67ee1bf8bbe7 Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 19 Mar 2025 22:43:03 +0000 Subject: [PATCH 04/15] test --- terraform/java/ec2/adot-sigv4/main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/java/ec2/adot-sigv4/main.tf b/terraform/java/ec2/adot-sigv4/main.tf index 17fccfa02..5913b48fe 100644 --- a/terraform/java/ec2/adot-sigv4/main.tf +++ b/terraform/java/ec2/adot-sigv4/main.tf @@ -221,6 +221,7 @@ resource "null_resource" "remote_service_setup" { export OTEL_LOGS_EXPORT=none export OTEL_METRICS_EXPORTER=none export OTEL_TRACES_EXPORTER=otlp + export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray.${var.aws_region}.amazonaws.com/v1/traces OTEL_RESOURCE_ATTRIBUTES=service.name=sample-remote-application-${var.test_id} \ nohup java -jar remote-service.jar &> nohup.out & From 589f6421e42074423519f39544701080c47fdbe7 Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 19 Mar 2025 23:03:20 +0000 Subject: [PATCH 05/15] Test --- .../workflows/java-ec2-adot-sigv4-test.yml | 117 ++++++++---------- 1 file changed, 52 insertions(+), 65 deletions(-) diff --git a/.github/workflows/java-ec2-adot-sigv4-test.yml b/.github/workflows/java-ec2-adot-sigv4-test.yml index 37a87f3b7..ae052a6c4 100644 --- a/.github/workflows/java-ec2-adot-sigv4-test.yml +++ b/.github/workflows/java-ec2-adot-sigv4-test.yml @@ -176,62 +176,59 @@ jobs: max_retry: 3 sleep_time: 60 - - name: Sleep 10 minutes - run: sleep 600 - # Validation for pulse telemetry data - # - name: Validate generated EMF logs - # id: log-validation - # run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/log-validation.yml - # --testing-id ${{ env.TESTING_ID }} - # --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} - # --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 - # --region ${{ env.E2E_TEST_AWS_REGION }} - # --account-id ${{ env.ACCOUNT_ID }} - # --metric-namespace ${{ env.METRIC_NAMESPACE }} - # --log-group ${{ env.LOG_GROUP_NAME }} - # --service-name sample-application-${{ env.TESTING_ID }} - # --remote-service-name sample-remote-application-${{ env.TESTING_ID }} - # --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} - # --instance-ami ${{ env.EC2_INSTANCE_AMI }} - # --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} - # --rollup' - - # - name: Validate generated metrics - # id: metric-validation - # if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() - # run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/metric-validation.yml - # --testing-id ${{ env.TESTING_ID }} - # --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} - # --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 - # --region ${{ env.E2E_TEST_AWS_REGION }} - # --account-id ${{ env.ACCOUNT_ID }} - # --metric-namespace ${{ env.METRIC_NAMESPACE }} - # --log-group ${{ env.LOG_GROUP_NAME }} - # --service-name sample-application-${{ env.TESTING_ID }} - # --remote-service-name sample-remote-application-${{ env.TESTING_ID }} - # --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} - # --instance-ami ${{ env.EC2_INSTANCE_AMI }} - # --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} - # --rollup' - - # - name: Validate generated traces - # id: trace-validation - # if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled() - # run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/trace-validation.yml - # --testing-id ${{ env.TESTING_ID }} - # --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} - # --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 - # --region ${{ env.E2E_TEST_AWS_REGION }} - # --account-id ${{ env.ACCOUNT_ID }} - # --metric-namespace ${{ env.METRIC_NAMESPACE }} - # --log-group ${{ env.LOG_GROUP_NAME }} - # --service-name sample-application-${{ env.TESTING_ID }} - # --remote-service-name sample-remote-application-${{ env.TESTING_ID }} - # --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} - # --instance-ami ${{ env.EC2_INSTANCE_AMI }} - # --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} - # --rollup' + - name: Validate generated EMF logs + id: log-validation + run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/log-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name sample-application-${{ env.TESTING_ID }} + --remote-service-name sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' + + - name: Validate generated metrics + id: metric-validation + if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() + run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/metric-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name sample-application-${{ env.TESTING_ID }} + --remote-service-name sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' + + - name: Validate generated traces + id: trace-validation + if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled() + run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/trace-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name sample-application-${{ env.TESTING_ID }} + --remote-service-name sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' - name: Refresh AWS Credentials if: ${{ github.event.repository.name == 'aws-application-signals-test-framework' }} @@ -240,16 +237,6 @@ jobs: role-to-assume: arn:aws:iam::${{ env.E2E_TEST_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.log-validation.outcome }}" = "success" ] && [ "${{ steps.metric-validation.outcome }}" = "success" ] && [ "${{ steps.trace-validation.outcome }}" = "success" ]; then - echo "validation-result=success" >> $GITHUB_OUTPUT - else - echo "validation-result=failure" >> $GITHUB_OUTPUT - fi - # Clean up Procedures - name: Terraform destroy if: always() From 42351a3412deb4545b7e614dfcfd19629c90ccbb Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 19 Mar 2025 23:04:54 +0000 Subject: [PATCH 06/15] test --- .github/workflows/java-ec2-adot-sigv4-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/java-ec2-adot-sigv4-test.yml b/.github/workflows/java-ec2-adot-sigv4-test.yml index ae052a6c4..813269b0b 100644 --- a/.github/workflows/java-ec2-adot-sigv4-test.yml +++ b/.github/workflows/java-ec2-adot-sigv4-test.yml @@ -46,7 +46,6 @@ env: jobs: java-ec2-adot-sigv4: runs-on: ubuntu-latest - timeout-minutes: 30 outputs: job-started: ${{ steps.job-started.outputs.job-started }} validation-result: ${{ steps.validation-result.outputs.validation-result }} From e34ad815db3785a3217183117a930b4705a6324d Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 19 Mar 2025 23:12:14 +0000 Subject: [PATCH 07/15] test --- .../workflows/java-ec2-adot-sigv4-test.yml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/java-ec2-adot-sigv4-test.yml b/.github/workflows/java-ec2-adot-sigv4-test.yml index 813269b0b..0b325d1fa 100644 --- a/.github/workflows/java-ec2-adot-sigv4-test.yml +++ b/.github/workflows/java-ec2-adot-sigv4-test.yml @@ -179,19 +179,19 @@ jobs: - name: Validate generated EMF logs id: log-validation run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/log-validation.yml - --testing-id ${{ env.TESTING_ID }} - --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} - --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 - --region ${{ env.E2E_TEST_AWS_REGION }} - --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} - --metric-namespace ${{ env.METRIC_NAMESPACE }} - --log-group ${{ env.LOG_GROUP_NAME }} - --service-name sample-application-${{ env.TESTING_ID }} - --remote-service-name sample-remote-application-${{ env.TESTING_ID }} - --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} - --instance-ami ${{ env.EC2_INSTANCE_AMI }} - --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} - --rollup' + --testing-id ${{ env.TESTING_ID }} + --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name sample-application-${{ env.TESTING_ID }} + --remote-service-name sample-remote-application-${{ env.TESTING_ID }} + --query-string "ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }}" + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' - name: Validate generated metrics id: metric-validation From 1eb1f9fad1862dac944ac5f9995bb22c94518b82 Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 19 Mar 2025 23:16:36 +0000 Subject: [PATCH 08/15] test --- .github/workflows/java-ec2-adot-sigv4-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/java-ec2-adot-sigv4-test.yml b/.github/workflows/java-ec2-adot-sigv4-test.yml index 0b325d1fa..3dba9cb1d 100644 --- a/.github/workflows/java-ec2-adot-sigv4-test.yml +++ b/.github/workflows/java-ec2-adot-sigv4-test.yml @@ -36,6 +36,7 @@ permissions: env: E2E_TEST_AWS_REGION: 'us-west-2' # Test uses us-west-2 in the us-east-1 account CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }} + METRIC_NAMESPACE: ApplicationSignals JAVA_VERSION: ${{ inputs.java-version }} CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }} E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }} # us-east-1 test account @@ -188,7 +189,7 @@ jobs: --log-group ${{ env.LOG_GROUP_NAME }} --service-name sample-application-${{ env.TESTING_ID }} --remote-service-name sample-remote-application-${{ env.TESTING_ID }} - --query-string "ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }}" + --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} --instance-ami ${{ env.EC2_INSTANCE_AMI }} --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} --rollup' From f3536ac681db1406255182ddeaad953e23879780 Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 19 Mar 2025 23:43:28 +0000 Subject: [PATCH 09/15] test --- .../workflows/java-ec2-adot-sigv4-test.yml | 70 +++++++++--------- .../ec2/adot-sigv4/client-call-trace.mustache | 74 +++++++++++-------- 2 files changed, 79 insertions(+), 65 deletions(-) diff --git a/.github/workflows/java-ec2-adot-sigv4-test.yml b/.github/workflows/java-ec2-adot-sigv4-test.yml index 3dba9cb1d..f70b9643d 100644 --- a/.github/workflows/java-ec2-adot-sigv4-test.yml +++ b/.github/workflows/java-ec2-adot-sigv4-test.yml @@ -176,41 +176,41 @@ jobs: max_retry: 3 sleep_time: 60 - # Validation for pulse telemetry data - - name: Validate generated EMF logs - id: log-validation - run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/log-validation.yml - --testing-id ${{ env.TESTING_ID }} - --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} - --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 - --region ${{ env.E2E_TEST_AWS_REGION }} - --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} - --metric-namespace ${{ env.METRIC_NAMESPACE }} - --log-group ${{ env.LOG_GROUP_NAME }} - --service-name sample-application-${{ env.TESTING_ID }} - --remote-service-name sample-remote-application-${{ env.TESTING_ID }} - --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} - --instance-ami ${{ env.EC2_INSTANCE_AMI }} - --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} - --rollup' - - - name: Validate generated metrics - id: metric-validation - if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() - run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/metric-validation.yml - --testing-id ${{ env.TESTING_ID }} - --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} - --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 - --region ${{ env.E2E_TEST_AWS_REGION }} - --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} - --metric-namespace ${{ env.METRIC_NAMESPACE }} - --log-group ${{ env.LOG_GROUP_NAME }} - --service-name sample-application-${{ env.TESTING_ID }} - --remote-service-name sample-remote-application-${{ env.TESTING_ID }} - --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} - --instance-ami ${{ env.EC2_INSTANCE_AMI }} - --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} - --rollup' + # # Validation for pulse telemetry data + # - name: Validate generated EMF logs + # id: log-validation + # run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/log-validation.yml + # --testing-id ${{ env.TESTING_ID }} + # --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + # --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 + # --region ${{ env.E2E_TEST_AWS_REGION }} + # --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} + # --metric-namespace ${{ env.METRIC_NAMESPACE }} + # --log-group ${{ env.LOG_GROUP_NAME }} + # --service-name sample-application-${{ env.TESTING_ID }} + # --remote-service-name sample-remote-application-${{ env.TESTING_ID }} + # --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + # --instance-ami ${{ env.EC2_INSTANCE_AMI }} + # --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + # --rollup' + + # - name: Validate generated metrics + # id: metric-validation + # if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() + # run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/metric-validation.yml + # --testing-id ${{ env.TESTING_ID }} + # --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + # --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 + # --region ${{ env.E2E_TEST_AWS_REGION }} + # --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} + # --metric-namespace ${{ env.METRIC_NAMESPACE }} + # --log-group ${{ env.LOG_GROUP_NAME }} + # --service-name sample-application-${{ env.TESTING_ID }} + # --remote-service-name sample-remote-application-${{ env.TESTING_ID }} + # --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + # --instance-ami ${{ env.EC2_INSTANCE_AMI }} + # --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + # --rollup' - name: Validate generated traces id: trace-validation diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache index 5a7774e4b..5681d1868 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache @@ -1,56 +1,70 @@ [{ "name": "^{{serviceName}}$", + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + } + }, "annotations": { "aws.local.service": "^{{serviceName}}$", "aws.local.operation": "^InternalOperation$", - "aws.local.environment": "^ec2:default$" + "aws.local.environment": "^ec2:default$", + "span.name": "^InternalOperation$", + "span.kind": "^SERVER$" }, "metadata": { - "default": { - "otel.resource.host.image.id": "^{{instanceAmi}}$", - "otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$" - } + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$" }, "subsegments": [ { - "name": "^local-root-client-call$", + "name": "^local-root-client-call:80$", "http": { - "request": { - "url": "^http://local-root-client-call$", - "method": "^GET$" - } + "request": { + "method": "^GET$" + } + }, + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" }, "annotations": { "aws.local.service": "^{{serviceName}}$", "aws.local.operation": "^InternalOperation$", - "aws.remote.service": "^local-root-client-call$", + "aws.remote.service": "^local-root-client-call:80$", "aws.remote.operation": "GET /", - "aws.local.environment": "^ec2:default$" + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^CLIENT$" }, "metadata": { - "default": { - "EC2.InstanceId": "^{{instanceId}}$", - "PlatformType": "^AWS::EC2$", - "aws.span.kind": "^LOCAL_ROOT$" - } + "service.name": "^{{serviceName}}$", + "url.full": "^http://local-root-client-call/$", + "http.request.method": "^GET$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$" }, "namespace": "^remote$" } ] }, { - "name": "^local-root-client-call$", - "http": { - "request": { - "url": "^http://local-root-client-call$", - "method": "^GET$" - }, - "response": { - "content_length": 0 - } - }, - "annotations": { - "aws.local.service": "^local-root-client-call$", - "aws.local.operation": "^GET /$" + "name": "^local-root-client-call:80$", + "http": { + "request": { + "url": "^http://local-root-client-call/$", + "method": "^GET$" } + }, + "annotations": { + "aws.local.service": "^local-root-client-call:80$", + "aws.local.operation": "^GET /$" + } }] \ No newline at end of file From a56ddb27f12cd350055e3cd07caac7fb571541e8 Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 19 Mar 2025 23:52:33 +0000 Subject: [PATCH 10/15] test --- .../outgoing-http-call-trace.mustache | 73 +++++++++---------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache index c1a91c841..3cbad2586 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache @@ -2,61 +2,54 @@ "name": "^{{serviceName}}$", "http": { "request": { - "url": "^{{endpoint}}/outgoing-http-call$", "method": "^GET$" - }, - "response": { - "status": "^200$" } }, "aws": { - "account_id": "^{{accountId}}$" + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" }, "annotations": { "aws.local.service": "^{{serviceName}}$", - "aws.local.operation": "^GET /outgoing-http-call$", - "aws.local.environment": "^ec2:default$" + "aws.local.operation": "^GET outgoing-http-call$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET outgoing-http-call$", + "span.kind": "^SERVER$" }, "metadata": { - "default": { - "EC2.InstanceId": "^{{instanceId}}$", - "PlatformType": "^AWS::EC2$", - "otel.resource.host.image.id": "^{{instanceAmi}}$", - "otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$", - "aws.span.kind": "^LOCAL_ROOT$" - } + "http.request.method": "^GET$", + "http.route": "^outgoing-http-call$", + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$", + "PlatformType": "^AWS::EC2$" }, "subsegments": [ { - "subsegments": [ - { - "name": "^www.amazon.com$", - "http": { - "request": { - "url": "^https://www.amazon.com$", - "method": "^GET$" - } - }, - "annotations": { - "aws.local.service": "^{{serviceName}}$", - "aws.local.operation": "^GET /outgoing-http-call$", - "aws.remote.service": "^www.amazon.com$", - "aws.remote.operation": "^GET /$", - "aws.local.environment": "^ec2:default$" - }, - "metadata": { - "default": { - "EC2.InstanceId": "^{{instanceId}}$", - "PlatformType": "^AWS::EC2$", - "aws.span.kind": "^CLIENT$" - } - }, - "namespace": "^remote$" + "name": "^aws.amazon.com:443$", + "http": { + "request": { + "url": "^https://aws.amazon.com/$", + "method": "^GET$" } - ] + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^aws.amazon.com:443$", + "aws.remote.operation": "^GET /$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^CLIENT$" + }, + "namespace": "^remote$" } ] }, { - "name": "^www.amazon.com$" + "name": "^aws.amazon.com:443$" }] \ No newline at end of file From c2046c70c87adccc5d087f91f90d6196057bf142 Mon Sep 17 00:00:00 2001 From: liustve Date: Thu, 20 Mar 2025 00:10:14 +0000 Subject: [PATCH 11/15] changed to python template --- terraform/java/ec2/adot-sigv4/main.tf | 4 - .../ec2/adot-sigv4/aws-sdk-call-log.mustache | 63 +++++-- .../adot-sigv4/aws-sdk-call-metric.mustache | 163 +----------------- .../adot-sigv4/aws-sdk-call-trace.mustache | 84 +++++---- .../ec2/adot-sigv4/client-call-log.mustache | 61 +++++-- .../ec2/adot-sigv4/client-call-trace.mustache | 13 +- .../outgoing-http-call-log.mustache | 64 +++++-- .../outgoing-http-call-metric.mustache | 42 ++--- .../outgoing-http-call-trace.mustache | 14 +- .../adot-sigv4/remote-service-log.mustache | 61 +++++-- .../adot-sigv4/remote-service-metric.mustache | 18 +- .../adot-sigv4/remote-service-trace.mustache | 105 +++++------ 12 files changed, 314 insertions(+), 378 deletions(-) diff --git a/terraform/java/ec2/adot-sigv4/main.tf b/terraform/java/ec2/adot-sigv4/main.tf index 5913b48fe..f712fba97 100644 --- a/terraform/java/ec2/adot-sigv4/main.tf +++ b/terraform/java/ec2/adot-sigv4/main.tf @@ -277,10 +277,6 @@ resource "null_resource" "traffic_generator_setup" { tmux send-keys -t traffic-generator "export ID=\"${var.test_id}\"" C-m tmux send-keys -t traffic-generator "npm start" C-m - sleep 60 - - cat nohup.out - EOF ] } diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-log.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-log.mustache index 5d820b066..a9c944359 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-log.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-log.mustache @@ -1,22 +1,49 @@ [{ - "EC2.InstanceId": "^{{instanceId}}$", - "Environment": "^ec2:default$", - "PlatformType": "^AWS::EC2$", - "Operation": "GET /aws-sdk-call", - "Version": "^1$", - "Telemetry.Source": "^LocalRootSpan$", - "Host": "^ip(-[0-9]{1,3}){4}.*$" + "name": "GET aws-sdk-call", + "kind": "SERVER", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET aws-sdk-call", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "http.route": "aws-sdk-call", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } }, { - "EC2.InstanceId": "^{{instanceId}}$", - "Environment": "^ec2:default$", - "PlatformType": "^AWS::EC2$", - "Operation": "GET /aws-sdk-call", - "Version": "^1$", - "RemoteService": "AWS::S3", - "RemoteOperation": "GetBucketLocation", - "RemoteResourceIdentifier": "^e2e-test-bucket-name-{{testingId}}$", - "RemoteResourceType": "^AWS::S3::Bucket$", - "Telemetry.Source": "^ClientSpan$", - "Host": "^ip(-[0-9]{1,3}){4}.*$" + "name": "S3.GetBucketLocation", + "kind": "CLIENT", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "UnmappedOperation", + "aws.remote.service": "AWS::S3", + "aws.remote.operation": "GetBucketLocation", + "aws.local.environment": "ec2:default", + "aws.s3.bucket": "e2e-test-bucket-name-{{testingId}}", + "aws.span.kind": "CLIENT", + "aws.region": "us-east-1", + "PlatformType": "AWS::EC2" + } }] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-metric.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-metric.mustache index 4ad5135e0..92e8104d3 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-metric.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-metric.mustache @@ -4,7 +4,7 @@ dimensions: - name: Operation - value: GET /aws-sdk-call + value: GET aws-sdk-call - name: Service value: {{serviceName}} @@ -18,7 +18,7 @@ dimensions: - name: Operation - value: GET /aws-sdk-call + value: UnmappedOperation - name: Service value: {{serviceName}} @@ -74,62 +74,13 @@ name: RemoteService value: AWS::S3 -- - metricName: Latency - namespace: {{metricNamespace}} - dimensions: - - - name: Operation - value: GET /aws-sdk-call - - - name: Service - value: {{serviceName}} - - - name: Environment - value: ec2:default - - - name: RemoteOperation - value: GetBucketLocation - - - name: RemoteService - value: AWS::S3 - - - name: RemoteResourceIdentifier - value: e2e-test-bucket-name-{{testingId}} - - - name: RemoteResourceType - value: AWS::S3::Bucket - -- - metricName: Latency - namespace: {{metricNamespace}} - dimensions: - - - name: Service - value: {{serviceName}} - - - name: Environment - value: ec2:default - - - name: RemoteOperation - value: GetBucketLocation - - - name: RemoteService - value: AWS::S3 - - - name: RemoteResourceIdentifier - value: e2e-test-bucket-name-{{testingId}} - - - name: RemoteResourceType - value: AWS::S3::Bucket - - metricName: Error namespace: {{metricNamespace}} dimensions: - name: Operation - value: GET /aws-sdk-call + value: GET aws-sdk-call - name: Service value: {{serviceName}} @@ -143,7 +94,7 @@ dimensions: - name: Operation - value: GET /aws-sdk-call + value: UnmappedOperation - name: Service value: {{serviceName}} @@ -199,62 +150,13 @@ name: RemoteService value: AWS::S3 -- - metricName: Error - namespace: {{metricNamespace}} - dimensions: - - - name: Operation - value: GET /aws-sdk-call - - - name: Service - value: {{serviceName}} - - - name: Environment - value: ec2:default - - - name: RemoteOperation - value: GetBucketLocation - - - name: RemoteService - value: AWS::S3 - - - name: RemoteResourceIdentifier - value: e2e-test-bucket-name-{{testingId}} - - - name: RemoteResourceType - value: AWS::S3::Bucket - -- - metricName: Error - namespace: {{metricNamespace}} - dimensions: - - - name: Service - value: {{serviceName}} - - - name: Environment - value: ec2:default - - - name: RemoteOperation - value: GetBucketLocation - - - name: RemoteService - value: AWS::S3 - - - name: RemoteResourceIdentifier - value: e2e-test-bucket-name-{{testingId}} - - - name: RemoteResourceType - value: AWS::S3::Bucket - - metricName: Fault namespace: {{metricNamespace}} dimensions: - name: Operation - value: GET /aws-sdk-call + value: GET aws-sdk-call - name: Service value: {{serviceName}} @@ -268,7 +170,7 @@ dimensions: - name: Operation - value: GET /aws-sdk-call + value: UnmappedOperation - name: Service value: {{serviceName}} @@ -322,55 +224,4 @@ value: GetBucketLocation - name: RemoteService - value: AWS::S3 - -- - metricName: Fault - namespace: {{metricNamespace}} - dimensions: - - - name: Operation - value: GET /aws-sdk-call - - - name: Service - value: {{serviceName}} - - - name: Environment - value: ec2:default - - - name: RemoteOperation - value: GetBucketLocation - - - name: RemoteService - value: AWS::S3 - - - name: RemoteResourceIdentifier - value: e2e-test-bucket-name-{{testingId}} - - - name: RemoteResourceType - value: AWS::S3::Bucket - -- - metricName: Fault - namespace: {{metricNamespace}} - dimensions: - - - name: Service - value: {{serviceName}} - - - name: Environment - value: ec2:default - - - name: RemoteOperation - value: GetBucketLocation - - - name: RemoteService - value: AWS::S3 - - - name: RemoteResourceIdentifier - value: e2e-test-bucket-name-{{testingId}} - - - name: RemoteResourceType - value: AWS::S3::Bucket - - + value: AWS::S3 \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-trace.mustache index 488ce397b..b38dccc35 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-trace.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-trace.mustache @@ -2,66 +2,64 @@ "name": "^{{serviceName}}$", "http": { "request": { - "url": "^{{endpoint}}/aws-sdk-call(?:\\?ip=(([0-9]{1,3}\\.){3}[0-9]{1,3})&testingId={{testingId}})?$", + "url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", "method": "^GET$" - }, - "response": { - "status": "^200$" } }, "aws": { - "account_id": "^{{accountId}}$" + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" }, "annotations": { "aws.local.service": "^{{serviceName}}$", - "aws.local.operation": "^GET /aws-sdk-call$", - "aws.local.environment": "^ec2:default$" + "aws.local.operation": "^GET aws-sdk-call$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET aws-sdk-call$", + "span.kind": "^SERVER$" }, "metadata": { - "default": { - "EC2.InstanceId": "^{{instanceId}}$", - "PlatformType": "^AWS::EC2$", - "otel.resource.host.image.id": "^{{instanceAmi}}$", - "otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$", - "aws.span.kind": "^LOCAL_ROOT$" - } + "http.url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "http.method": "^GET$", + "http.route": "^aws-sdk-call$", + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$", + "PlatformType": "^AWS::EC2$" }, "subsegments": [ { - "subsegments": [ - { - "name": "^S3$", - "http": { - "request": { - "url": "^https://e2e-test-bucket-name-{{testingId}}.s3.{{region}}.amazonaws.com\\?location$", - "method": "^GET$" - } - }, - "annotations": { - "aws.local.service": "^{{serviceName}}$", - "aws.local.operation": "^GET /aws-sdk-call$", - "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": "^ec2:default$" - }, - "metadata": { - "default": { - "EC2.InstanceId": "^{{instanceId}}$", - "PlatformType": "^AWS::EC2$", - "aws.span.kind": "^CLIENT$" - } - }, - "namespace": "^aws$" - } - ] + "name": "^S3$", + "aws": { + "bucket_name": "^e2e-test-bucket-name-{{testingId}}$", + "s3.bucket": "^e2e-test-bucket-name-{{testingId}}$", + "span.kind": "^CLIENT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^AWS::S3$", + "aws.remote.operation": "^GetBucketLocation$", + "aws.local.environment": "^ec2:default$", + "span.name": "^S3.GetBucketLocation$", + "span.kind": "^CLIENT$" + }, + "namespace": "^aws$" } ] }, { "name": "^S3$", "aws": { - "operation": "^GetBucketLocation$" + "bucket_name": "^e2e-test-bucket-name-{{testingId}}$", + "s3.bucket": "^e2e-test-bucket-name-{{testingId}}$", + "span.kind": "^CLIENT$" + }, + "annotations": { + "aws.local.service": "^AWS::S3$", + "aws.local.operation": "^GetBucketLocation$" } }] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-log.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-log.mustache index 25c72000a..991b4041d 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-log.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-log.mustache @@ -1,20 +1,49 @@ [{ - "EC2.InstanceId": "^{{instanceId}}$", - "Environment": "^ec2:default$", - "PlatformType": "^AWS::EC2$", - "Operation": "InternalOperation", - "Version": "^1$", - "Telemetry.Source": "^LocalRootSpan$", - "Host": "^ip(-[0-9]{1,3}){4}.*$" + "name": "GET client-call", + "kind": "SERVER", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET client-call", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "{{endpoint}}/client-call", + "http.route": "client-call", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } }, { - "EC2.InstanceId": "^{{instanceId}}$", - "Environment": "^ec2:default$", - "PlatformType": "^AWS::EC2$", - "Operation": "InternalOperation", - "Version": "^1$", - "RemoteService": "local-root-client-call", - "RemoteOperation": "GET /", - "Telemetry.Source": "^ClientSpan$", - "Host": "^ip(-[0-9]{1,3}){4}.*$" + "name": "GET", + "kind": "CLIENT", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "InternalOperation", + "aws.remote.service": "local-root-client-call", + "aws.remote.operation": "GET /", + "aws.local.environment": "ec2:default", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "http://local-root-client-call/", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } }] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache index 5681d1868..261cfbac2 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache @@ -21,9 +21,10 @@ }, "subsegments": [ { - "name": "^local-root-client-call:80$", + "name": "^local-root-client-call$", "http": { "request": { + "url": "^http://local-root-client-call/$", "method": "^GET$" } }, @@ -36,7 +37,7 @@ "annotations": { "aws.local.service": "^{{serviceName}}$", "aws.local.operation": "^InternalOperation$", - "aws.remote.service": "^local-root-client-call:80$", + "aws.remote.service": "^local-root-client-call$", "aws.remote.operation": "GET /", "aws.local.environment": "^ec2:default$", "span.name": "^GET$", @@ -44,8 +45,8 @@ }, "metadata": { "service.name": "^{{serviceName}}$", - "url.full": "^http://local-root-client-call/$", - "http.request.method": "^GET$", + "http.url": "^http://local-root-client-call/$", + "http.method": "^GET$", "cloud.provider": "^aws$", "cloud.account.id": "^{{accountId}}$", "cloud.region": "^{{region}}$", @@ -56,7 +57,7 @@ ] }, { - "name": "^local-root-client-call:80$", + "name": "^local-root-client-call$", "http": { "request": { "url": "^http://local-root-client-call/$", @@ -64,7 +65,7 @@ } }, "annotations": { - "aws.local.service": "^local-root-client-call:80$", + "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/ec2/adot-sigv4/outgoing-http-call-log.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-log.mustache index 60c38935c..48f9df70a 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-log.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-log.mustache @@ -1,21 +1,49 @@ [{ - "EC2.InstanceId": "^{{instanceId}}$", - "Environment": "^ec2:default$", - "PlatformType": "^AWS::EC2$", - "Operation": "GET /outgoing-http-call", - "Version": "^1$", - "Telemetry.Source": "^LocalRootSpan$", - "Host": "^ip(-[0-9]{1,3}){4}.*$" + "name": "GET outgoing-http-call", + "kind": "SERVER", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET outgoing-http-call", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "{{endpoint}}/outgoing-http-call", + "http.route": "outgoing-http-call", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } }, { - "EC2.InstanceId": "^{{instanceId}}$", - "Environment": "^ec2:default$", - "PlatformType": "^AWS::EC2$", - "Operation": "GET /outgoing-http-call", - "Version": "^1$", - "RemoteService": "www.amazon.com", - "RemoteOperation": "GET /", - "Telemetry.Source": "^ClientSpan$", - "Host": "^ip(-[0-9]{1,3}){4}.*$" -}] - + "name": "GET", + "kind": "CLIENT", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "UnmappedOperation", + "aws.remote.service": "www.amazon.com", + "aws.remote.operation": "GET /", + "aws.local.environment": "ec2:default", + "aws.span.kind": "CLIENT", + "http.url": "https://www.amazon.com/", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-metric.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-metric.mustache index bf4defe6b..f4ce2515b 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-metric.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-metric.mustache @@ -4,13 +4,13 @@ dimensions: - name: Operation - value: GET /outgoing-http-call + value: GET outgoing-http-call - name: Service value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - metricName: Latency @@ -18,13 +18,13 @@ dimensions: - name: Operation - value: GET /outgoing-http-call + value: UnmappedOperation - name: Service value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - name: RemoteOperation value: GET / @@ -41,7 +41,7 @@ value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - metricName: Latency @@ -52,7 +52,7 @@ value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - name: RemoteOperation value: GET / @@ -69,7 +69,7 @@ value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - name: RemoteService value: www.amazon.com @@ -80,13 +80,13 @@ dimensions: - name: Operation - value: GET /outgoing-http-call + value: GET outgoing-http-call - name: Service value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - metricName: Error @@ -94,13 +94,13 @@ dimensions: - name: Operation - value: GET /outgoing-http-call + value: UnmappedOperation - name: Service value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - name: RemoteOperation value: GET / @@ -117,7 +117,7 @@ value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - metricName: Error @@ -128,7 +128,7 @@ value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - name: RemoteOperation value: GET / @@ -145,7 +145,7 @@ value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - name: RemoteService value: www.amazon.com @@ -156,13 +156,13 @@ dimensions: - name: Operation - value: GET /outgoing-http-call + value: GET outgoing-http-call - name: Service value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - metricName: Fault @@ -170,13 +170,13 @@ dimensions: - name: Operation - value: GET /outgoing-http-call + value: UnmappedOperation - name: Service value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - name: RemoteOperation value: GET / @@ -193,7 +193,7 @@ value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - metricName: Fault @@ -204,7 +204,7 @@ value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - name: RemoteOperation value: GET / @@ -221,7 +221,7 @@ value: {{serviceName}} - name: Environment - value: generic:default + value: ec2:default - name: RemoteService value: www.amazon.com diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache index 3cbad2586..831649e19 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache @@ -2,6 +2,7 @@ "name": "^{{serviceName}}$", "http": { "request": { + "url": "^{{endpoint}}/outgoing-http-call$", "method": "^GET$" } }, @@ -19,7 +20,8 @@ "span.kind": "^SERVER$" }, "metadata": { - "http.request.method": "^GET$", + "http.url": "^{{endpoint}}/outgoing-http-call$", + "http.method": "^GET$", "http.route": "^outgoing-http-call$", "service.name": "^{{serviceName}}$", "cloud.provider": "^aws$", @@ -30,17 +32,17 @@ }, "subsegments": [ { - "name": "^aws.amazon.com:443$", + "name": "^www.amazon.com$", "http": { "request": { - "url": "^https://aws.amazon.com/$", + "url": "^https://www.amazon.com/$", "method": "^GET$" } }, "annotations": { "aws.local.service": "^{{serviceName}}$", "aws.local.operation": "^UnmappedOperation$", - "aws.remote.service": "^aws.amazon.com:443$", + "aws.remote.service": "^www.amazon.com$", "aws.remote.operation": "^GET /$", "aws.local.environment": "^ec2:default$", "span.name": "^GET$", @@ -51,5 +53,5 @@ ] }, { - "name": "^aws.amazon.com:443$" -}] \ No newline at end of file + "name": "^www.amazon.com$" +}] diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-log.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-log.mustache index cd457dc7b..8c342d820 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-log.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-log.mustache @@ -1,20 +1,49 @@ [{ - "EC2.InstanceId": "^{{instanceId}}$", - "Environment": "^ec2:default$", - "PlatformType": "^AWS::EC2$", - "Operation": "GET /remote-service", - "Version": "^1$", - "Telemetry.Source": "^LocalRootSpan$", - "Host": "^ip(-[0-9]{1,3}){4}.*$" + "name": "GET remote-service", + "kind": "SERVER", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET remote-service", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "{{endpoint}}/remote-service", + "http.route": "remote-service", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } }, { - "EC2.InstanceId": "^{{instanceId}}$", - "Environment": "^ec2:default$", - "PlatformType": "^AWS::EC2$", - "Operation": "GET /remote-service", - "Version": "^1$", - "RemoteService": "{{remoteServiceDeploymentName}}", - "RemoteOperation": "GET /healthcheck", - "Telemetry.Source": "^ClientSpan$", - "Host": "^ip(-[0-9]{1,3}){4}.*$" + "name": "GET", + "kind": "CLIENT", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "UnmappedOperation", + "aws.remote.service": "{{remoteServiceDeploymentName}}", + "aws.remote.operation": "GET /healthcheck", + "aws.local.environment": "ec2:default", + "aws.span.kind": "CLIENT", + "http.url": "http://{{remoteServiceDeploymentName}}/healthcheck", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } }] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-metric.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-metric.mustache index 4b1f0ad9c..0d3714f71 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-metric.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-metric.mustache @@ -4,7 +4,7 @@ dimensions: - name: Operation - value: GET /remote-service + value: GET remote-service - name: Service value: {{serviceName}} @@ -18,7 +18,7 @@ dimensions: - name: Operation - value: GET /remote-service + value: UnmappedOperation - name: Service value: {{serviceName}} @@ -41,7 +41,7 @@ value: ec2:default - name: Operation - value: GET /healthcheck + value: GET healthcheck - name: Service value: {{remoteServiceName}} @@ -113,7 +113,7 @@ dimensions: - name: Operation - value: GET /remote-service + value: GET remote-service - name: Service value: {{serviceName}} @@ -127,7 +127,7 @@ dimensions: - name: Operation - value: GET /remote-service + value: UnmappedOperation - name: Service value: {{serviceName}} @@ -150,7 +150,7 @@ value: ec2:default - name: Operation - value: GET /healthcheck + value: GET healthcheck - name: Service value: {{remoteServiceName}} @@ -222,7 +222,7 @@ dimensions: - name: Operation - value: GET /remote-service + value: GET remote-service - name: Service value: {{serviceName}} @@ -236,7 +236,7 @@ dimensions: - name: Operation - value: GET /remote-service + value: UnmappedOperation - name: Service value: {{serviceName}} @@ -259,7 +259,7 @@ value: ec2:default - name: Operation - value: GET /healthcheck + value: GET healthcheck - name: Service value: {{remoteServiceName}} diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-trace.mustache index 2ef1f4d74..e56772553 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-trace.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-trace.mustache @@ -2,7 +2,7 @@ "name": "^{{serviceName}}$", "http": { "request": { - "url": "^{{endpoint}}/remote-service(?:\\?ip=(([0-9]{1,3}\\.){3}[0-9]{1,3})&testingId={{testingId}})?$", + "url": "^{{endpoint}}/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", "method": "^GET$" }, "response": { @@ -10,50 +10,48 @@ } }, "aws": { - "account_id": "^{{accountId}}$" + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" }, "annotations": { "aws.local.service": "^{{serviceName}}$", - "aws.local.operation": "^GET /remote-service$", - "aws.local.environment": "^ec2:default$" + "aws.local.operation": "^GET remote-service$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET remote-service$", + "span.kind": "^SERVER$" }, "metadata": { - "default": { - "EC2.InstanceId": "^{{instanceId}}$", - "PlatformType": "^AWS::EC2$", - "otel.resource.host.image.id": "^{{instanceAmi}}$", - "otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$", - "aws.span.kind": "^LOCAL_ROOT$" - } + "http.url": "^{{endpoint}}/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "http.method": "^GET$", + "http.route": "^remote-service$", + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$", + "PlatformType": "^AWS::EC2$" }, "subsegments": [ { - "subsegments": [ - { - "name": "^{{remoteServiceDeploymentName}}$", - "http": { - "request": { - "url": "^http://(([0-9]{1,3}.){3}[0-9]{1,3}):8080/healthcheck$", - "method": "^GET$" - } - }, - "annotations": { - "aws.local.service": "^{{serviceName}}$", - "aws.local.operation": "^GET /remote-service$", - "aws.remote.service": "^{{remoteServiceDeploymentName}}$", - "aws.remote.operation": "^GET /healthcheck$", - "aws.local.environment": "^ec2:default$" - }, - "metadata": { - "default": { - "EC2.InstanceId": "^{{instanceId}}$", - "PlatformType": "^AWS::EC2$", - "aws.span.kind": "^CLIENT$" - } - }, - "namespace": "^remote$" + "name": "^{{remoteServiceDeploymentName}}$", + "http": { + "request": { + "url": "^http://{{remoteServiceDeploymentName}}/healthcheck$", + "method": "^GET$" } - ] + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^{{remoteServiceDeploymentName}}$", + "aws.remote.operation": "^GET /healthcheck$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^CLIENT$" + }, + "namespace": "^remote$" } ] }, @@ -61,37 +59,14 @@ "name": "^{{remoteServiceName}}$", "http": { "request": { - "url": "^http://(([0-9]{1,3}.){3}[0-9]{1,3}):8080/healthcheck$", + "url": "^http://{{remoteServiceDeploymentName}}/healthcheck$", "method": "^GET$" } }, "annotations": { "aws.local.service": "^{{remoteServiceName}}$", - "aws.local.operation": "^GET /healthcheck$", - "aws.local.environment": "^ec2:default$" - }, - "metadata": { - "default": { - "EC2.InstanceId": "^i-[A-Za-z0-9]{17}$", - "PlatformType": "^AWS::EC2$", - "otel.resource.host.image.id": "^{{instanceAmi}}$", - "otel.resource.host.type": "^([a-z0-9]+\\.[a-z0-9]+)$", - "aws.span.kind": "^LOCAL_ROOT$" - } - }, - "subsegments": [ - { - "name": "^RemoteServiceController.healthcheck$", - "annotations": { - "aws.local.operation": "^GET /healthcheck$", - "aws.local.environment": "^ec2:default$" - }, - "metadata": { - "default": { - "EC2.InstanceId": "^i-[A-Za-z0-9]{17}$", - "PlatformType": "^AWS::EC2$" - } - } - } - ] -}] \ No newline at end of file + "aws.local.operation": "^GET healthcheck$" + } +}] + + From 28476fc7d31bd6d04243582ce75bc90236a218f6 Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 26 Mar 2025 04:45:42 +0000 Subject: [PATCH 12/15] changed validation test --- .../workflows/dotnet-ec2-adot-sigv4-test.yml | 224 ++++++++++++ .github/workflows/dotnet-ec2-canary.yml | 43 --- .../workflows/dotnet-ec2-default-retry.yml | 62 ---- .github/workflows/dotnet-ec2-nuget-retry.yml | 57 --- .../workflows/dotnet-ec2-windows-retry.yml | 57 --- .github/workflows/dotnet-eks-canary.yml | 37 -- .github/workflows/dotnet-eks-retry.yml | 66 ---- .github/workflows/dotnet-k8s-canary.yml | 26 -- .github/workflows/dotnet-k8s-retry.yml | 61 ---- .../workflows/java-ec2-adot-sigv4-test.yml | 73 ++-- .github/workflows/java-ec2-canary.yml | 43 --- .github/workflows/java-ec2-default-retry.yml | 74 ---- .github/workflows/java-ecs-canary.yml | 28 -- .github/workflows/java-ecs-retry.yml | 62 ---- .github/workflows/java-eks-canary.yml | 33 -- .github/workflows/java-eks-retry.yml | 71 ---- .github/workflows/java-k8s-canary.yml | 27 -- .github/workflows/java-k8s-retry.yml | 66 ---- .../workflows/node-ec2-adot-sigv4-test.yml | 239 +++++++++++++ .github/workflows/node-ec2-canary.yml | 31 -- .github/workflows/node-ec2-default-retry.yml | 72 ---- .github/workflows/node-ecs-retry.yml | 57 --- .github/workflows/node-eks-canary.yml | 32 -- .github/workflows/node-eks-retry.yml | 66 ---- .github/workflows/node-k8s-canary.yml | 26 -- .github/workflows/node-k8s-retry.yml | 61 ---- .github/workflows/pr-build.yml | 1 + .../workflows/python-ec2-adot-sigv4-test.yml | 1 + .github/workflows/python-ec2-canary.yml | 43 --- .../workflows/python-ec2-default-retry.yml | 80 ----- .github/workflows/python-ecs-canary.yml | 28 -- .github/workflows/python-ecs-retry.yml | 62 ---- .github/workflows/python-eks-canary.yml | 34 -- .github/workflows/python-eks-retry.yml | 71 ---- .github/workflows/python-k8s-canary.yml | 25 -- .github/workflows/python-k8s-retry.yml | 66 ---- terraform/dotnet/ec2/adot-sigv4/main.tf | 315 +++++++++++++++++ terraform/dotnet/ec2/adot-sigv4/output.tf | 26 ++ terraform/dotnet/ec2/adot-sigv4/variables.tf | 42 +++ terraform/dotnet/k8s/deploy/main.tf | 5 +- terraform/dotnet/lambda/lambda/layer_arns.tf | 56 +-- terraform/java/ec2/adot-sigv4/main.tf | 6 + terraform/java/k8s/deploy/main.tf | 5 +- terraform/java/lambda/lambda/layer_arns.tf | 56 +-- terraform/node/ec2/adot-sigv4/main.tf | 332 ++++++++++++++++++ terraform/node/ec2/adot-sigv4/output.tf | 26 ++ terraform/node/ec2/adot-sigv4/variables.tf | 48 +++ terraform/node/k8s/deploy/main.tf | 5 +- terraform/node/lambda/lambda/layer_arns.tf | 56 +-- terraform/python/k8s/deploy/main.tf | 5 +- terraform/python/lambda/lambda/layer_arns.tf | 56 +-- .../PredefinedExpectedTemplate.java | 40 +++ .../ec2/adot-sigv4/aws-sdk-call-log.mustache | 51 +++ .../adot-sigv4/aws-sdk-call-metric.mustache | 227 ++++++++++++ .../adot-sigv4/aws-sdk-call-trace.mustache | 64 ++++ .../ec2/adot-sigv4/client-call-log.mustache | 48 +++ .../adot-sigv4/client-call-metric.mustache | 227 ++++++++++++ .../ec2/adot-sigv4/client-call-trace.mustache | 70 ++++ .../outgoing-http-call-log.mustache | 48 +++ .../outgoing-http-call-metric.mustache | 227 ++++++++++++ .../outgoing-http-call-trace.mustache | 55 +++ .../adot-sigv4/remote-service-log.mustache | 48 +++ .../adot-sigv4/remote-service-metric.mustache | 326 +++++++++++++++++ .../adot-sigv4/remote-service-trace.mustache | 67 ++++ .../ec2/adot-sigv4/aws-sdk-call-log.mustache | 18 +- .../adot-sigv4/aws-sdk-call-metric.mustache | 6 +- .../adot-sigv4/aws-sdk-call-trace.mustache | 22 +- .../ec2/adot-sigv4/client-call-log.mustache | 20 +- .../ec2/adot-sigv4/client-call-trace.mustache | 21 +- .../outgoing-http-call-log.mustache | 19 +- .../outgoing-http-call-metric.mustache | 6 +- .../outgoing-http-call-trace.mustache | 14 +- .../adot-sigv4/remote-service-log.mustache | 17 +- .../adot-sigv4/remote-service-metric.mustache | 12 +- .../adot-sigv4/remote-service-trace.mustache | 24 +- .../ec2/adot-sigv4/aws-sdk-call-log.mustache | 46 +++ .../adot-sigv4/aws-sdk-call-metric.mustache | 227 ++++++++++++ .../adot-sigv4/aws-sdk-call-trace.mustache | 65 ++++ .../ec2/adot-sigv4/client-call-log.mustache | 47 +++ .../adot-sigv4/client-call-metric.mustache | 227 ++++++++++++ .../ec2/adot-sigv4/client-call-trace.mustache | 72 ++++ .../outgoing-http-call-log.mustache | 47 +++ .../outgoing-http-call-metric.mustache | 227 ++++++++++++ .../outgoing-http-call-trace.mustache | 57 +++ .../adot-sigv4/remote-service-log.mustache | 47 +++ .../adot-sigv4/remote-service-metric.mustache | 326 +++++++++++++++++ .../adot-sigv4/remote-service-trace.mustache | 72 ++++ .../dotnet/ec2/adot-sigv4/log-validation.yml | 25 ++ .../ec2/adot-sigv4/metric-validation.yml | 25 ++ .../ec2/adot-sigv4/trace-validation.yml | 24 ++ .../java/ec2/adot-sigv4/log-validation.yml | 12 +- .../java/ec2/adot-sigv4/metric-validation.yml | 12 +- .../java/ec2/adot-sigv4/trace-validation.yml | 8 +- .../node/ec2/adot-sigv4/log-validation.yml | 24 ++ .../node/ec2/adot-sigv4/metric-validation.yml | 24 ++ .../node/ec2/adot-sigv4/trace-validation.yml | 24 ++ 96 files changed, 4632 insertions(+), 1827 deletions(-) create mode 100644 .github/workflows/dotnet-ec2-adot-sigv4-test.yml delete mode 100644 .github/workflows/dotnet-ec2-canary.yml delete mode 100644 .github/workflows/dotnet-ec2-default-retry.yml delete mode 100644 .github/workflows/dotnet-ec2-nuget-retry.yml delete mode 100644 .github/workflows/dotnet-ec2-windows-retry.yml delete mode 100644 .github/workflows/dotnet-eks-canary.yml delete mode 100644 .github/workflows/dotnet-eks-retry.yml delete mode 100644 .github/workflows/dotnet-k8s-canary.yml delete mode 100644 .github/workflows/dotnet-k8s-retry.yml delete mode 100644 .github/workflows/java-ec2-canary.yml delete mode 100644 .github/workflows/java-ec2-default-retry.yml delete mode 100644 .github/workflows/java-ecs-canary.yml delete mode 100644 .github/workflows/java-ecs-retry.yml delete mode 100644 .github/workflows/java-eks-canary.yml delete mode 100644 .github/workflows/java-eks-retry.yml delete mode 100644 .github/workflows/java-k8s-canary.yml delete mode 100644 .github/workflows/java-k8s-retry.yml create mode 100644 .github/workflows/node-ec2-adot-sigv4-test.yml delete mode 100644 .github/workflows/node-ec2-canary.yml delete mode 100644 .github/workflows/node-ec2-default-retry.yml delete mode 100644 .github/workflows/node-ecs-retry.yml delete mode 100644 .github/workflows/node-eks-canary.yml delete mode 100644 .github/workflows/node-eks-retry.yml delete mode 100644 .github/workflows/node-k8s-canary.yml delete mode 100644 .github/workflows/node-k8s-retry.yml delete mode 100644 .github/workflows/python-ec2-canary.yml delete mode 100644 .github/workflows/python-ec2-default-retry.yml delete mode 100644 .github/workflows/python-ecs-canary.yml delete mode 100644 .github/workflows/python-ecs-retry.yml delete mode 100644 .github/workflows/python-eks-canary.yml delete mode 100644 .github/workflows/python-eks-retry.yml delete mode 100644 .github/workflows/python-k8s-canary.yml delete mode 100644 .github/workflows/python-k8s-retry.yml create mode 100644 terraform/dotnet/ec2/adot-sigv4/main.tf create mode 100644 terraform/dotnet/ec2/adot-sigv4/output.tf create mode 100644 terraform/dotnet/ec2/adot-sigv4/variables.tf create mode 100644 terraform/node/ec2/adot-sigv4/main.tf create mode 100644 terraform/node/ec2/adot-sigv4/output.tf create mode 100644 terraform/node/ec2/adot-sigv4/variables.tf create mode 100644 validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-trace.mustache create mode 100644 validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/client-call-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/client-call-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/client-call-trace.mustache create mode 100644 validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-trace.mustache create mode 100644 validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-trace.mustache create mode 100644 validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-trace.mustache create mode 100644 validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/client-call-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/client-call-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/client-call-trace.mustache create mode 100644 validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-trace.mustache create mode 100644 validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/remote-service-log.mustache create mode 100644 validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/remote-service-metric.mustache create mode 100644 validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/remote-service-trace.mustache create mode 100644 validator/src/main/resources/validations/dotnet/ec2/adot-sigv4/log-validation.yml create mode 100644 validator/src/main/resources/validations/dotnet/ec2/adot-sigv4/metric-validation.yml create mode 100644 validator/src/main/resources/validations/dotnet/ec2/adot-sigv4/trace-validation.yml create mode 100644 validator/src/main/resources/validations/node/ec2/adot-sigv4/log-validation.yml create mode 100644 validator/src/main/resources/validations/node/ec2/adot-sigv4/metric-validation.yml create mode 100644 validator/src/main/resources/validations/node/ec2/adot-sigv4/trace-validation.yml diff --git a/.github/workflows/dotnet-ec2-adot-sigv4-test.yml b/.github/workflows/dotnet-ec2-adot-sigv4-test.yml new file mode 100644 index 000000000..5adb4b77f --- /dev/null +++ b/.github/workflows/dotnet-ec2-adot-sigv4-test.yml @@ -0,0 +1,224 @@ +## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +## SPDX-License-Identifier: Apache-2.0 + +# This is a reusable workflow for running the DotNet E2E Canary test for Application 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: DotNet EC2 ADOT SigV4 (Stand-Alone ADOT) Use Case +on: + workflow_call: + inputs: + caller-workflow-name: + required: true + type: string + dotnet-version: + description: "Currently support version 6.0, 8.0" + required: false + type: string + default: '8.0' + staging_distro_name: + required: false + default: 'aws-opentelemetry-distro' + type: string + +permissions: + id-token: write + contents: read + +env: + E2E_TEST_AWS_REGION: 'us-west-2' + E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }} + E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }} + DOTNET_VERSION: ${{ inputs.dotnet-version }} + SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-us-east-1/dotnet-sample-app-${{ inputs.dotnet-version }}.zip + METRIC_NAMESPACE: ApplicationSignals + LOG_GROUP_NAME: aws/spans + ADOT_DISTRO_NAME: ${{ inputs.staging_distro_name }} + TEST_RESOURCES_FOLDER: ${GITHUB_WORKSPACE} + +jobs: + dotnet-ec2-adot-sigv4: + runs-on: ubuntu-latest + steps: + - name: Check if the job started + id: job-started + run: echo "job-started=true" >> $GITHUB_OUTPUT + + - uses: actions/checkout@v4 + with: + repository: 'aws-observability/aws-application-signals-test-framework' + ref: ${{ inputs.caller-workflow-name == 'main-build' && 'main' || github.ref }} + fetch-depth: 0 + + - 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: Generate testing id + run: echo TESTING_ID="${{ github.run_id }}-${{ github.run_number }}-${RANDOM}" >> $GITHUB_ENV + + - 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: ${{ env.E2E_TEST_AWS_REGION }} + + - name: Set Get ADOT Distro command environment variable + run: | + if [ "${{ github.event.repository.name }}" = "aws-otel-dotnet-instrumentation" ]; then + # Get staging distro file from staging bucket + echo GET_ADOT_DISTRO_COMMAND="aws s3 cp s3://adot-autoinstrumentation-dotnet-staging/${{ env.ADOT_DISTRO_NAME }} ./${{ env.ADOT_DISTRO_NAME }} && unzip -d dotnet-distro ${{ env.ADOT_DISTRO_NAME }}" >> $GITHUB_ENV + else + # After Release will switch to latest tag instead of hard code version for canary purpose + echo GET_ADOT_DISTRO_COMMAND="wget -O aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip https://github.com/aws-observability/aws-otel-dotnet-instrumentation/releases/latest/download/aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip && unzip -d dotnet-distro aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip" >> $GITHUB_ENV + fi + + - 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/dotnet/ec2/adot-sigv4 && terraform init && terraform validate" + cleanup: "rm -rf .terraform && rm -rf .terraform.lock.hcl" + max_retry: 6 + sleep_time: 60 + + - name: Deploy sample app via terraform and wait for endpoint to come online + working-directory: terraform/dotnet/ec2/adot-sigv4 + run: | + # Attempt to deploy the sample app on an EC2 instance and wait for its endpoint to come online. + # There may be occasional failures due to transitivity issues, so try up to 2 times. + # deployment_failed of 0 indicates that both the terraform deployment and the endpoint are running, while 1 indicates + # that it failed at some point + retry_counter=0 + max_retry=2 + while [ $retry_counter -lt $max_retry ]; do + echo "Attempt $retry_counter" + deployment_failed=0 + terraform apply -auto-approve \ + -var="aws_region=${{ env.E2E_TEST_AWS_REGION }}" \ + -var="test_id=${{ env.TESTING_ID }}" \ + -var="sample_app_zip=${{ env.SAMPLE_APP_ZIP }}" \ + -var="get_adot_distro_command=${{ env.GET_ADOT_DISTRO_COMMAND }}" \ + -var="language_version=${{ env.DOTNET_VERSION }}" \ + || deployment_failed=$? + + if [ $deployment_failed -eq 1 ]; then + echo "Terraform deployment was unsuccessful. Will attempt to retry deployment." + fi + + # If the success is 1 then either the terraform deployment or the endpoint connection failed, so first destroy the + # resources created from terraform and try again. + if [ $deployment_failed -eq 1 ]; then + echo "Destroying terraform" + terraform destroy -auto-approve \ + -var="test_id=${{ env.TESTING_ID }}" + + retry_counter=$(($retry_counter+1)) + else + # If deployment succeeded, then exit the loop + break + fi + + if [ $retry_counter -eq $max_retry ]; then + echo "Max retry reached, failed to deploy terraform and connect to the endpoint. Exiting code" + exit 1 + fi + done + + - name: Get the sample app endpoint + working-directory: terraform/dotnet/ec2/adot-sigv4 + run: | + echo "EC2_INSTANCE_AMI=$(terraform output ec2_instance_ami)" >> $GITHUB_ENV + echo "REMOTE_SERVICE_IP=$(terraform output sample_app_remote_service_private_ip)" >> $GITHUB_ENV + echo "MAIN_SERVICE_INSTANCE_ID=$(terraform output main_service_instance_id)" >> $GITHUB_ENV + + - name: Initiate Gradlew Daemon + if: steps.initiate-gradlew == 'failure' + uses: ./.github/workflows/actions/execute_and_retry + continue-on-error: true + with: + command: "./gradlew" + cleanup: "./gradlew clean" + max_retry: 3 + sleep_time: 60 + + # Validation for pulse telemetry data + - name: Validate generated EMF logs + id: log-validation + run: ./gradlew validator:run --args='-c dotnet/ec2/adot-sigv4/log-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://localhost:8080 + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8081 + --region ${{ env.E2E_TEST_AWS_REGION }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name dotnet-sample-application-${{ env.TESTING_ID }} + --remote-service-name dotnet-sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' + + - name: Validate generated metrics + id: metric-validation + if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() + run: ./gradlew validator:run --args='-c dotnet/ec2/adot-sigv4/metric-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://localhost:8080 + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8081 + --region ${{ env.E2E_TEST_AWS_REGION }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name dotnet-sample-application-${{ env.TESTING_ID }} + --remote-service-name dotnet-sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' + + - name: Validate generated traces + id: trace-validation + if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled() + run: ./gradlew validator:run --args='-c dotnet/ec2/adot-sigv4/trace-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://localhost:8080 + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8081 + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name dotnet-sample-application-${{ env.TESTING_ID }} + --remote-service-name dotnet-sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' + + - name: Refresh AWS Credentials + if: always() + 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: ${{ env.E2E_TEST_AWS_REGION }} + + # Clean up Procedures + - name: Terraform destroy + if: always() + continue-on-error: true + working-directory: terraform/dotnet/ec2/adot-sigv4 + run: | + terraform destroy -auto-approve \ + -var="test_id=${{ env.TESTING_ID }}" \ No newline at end of file diff --git a/.github/workflows/dotnet-ec2-canary.yml b/.github/workflows/dotnet-ec2-canary.yml deleted file mode 100644 index 5349c06ab..000000000 --- a/.github/workflows/dotnet-ec2-canary.yml +++ /dev/null @@ -1,43 +0,0 @@ -## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -## SPDX-License-Identifier: Apache-2.0 - -## This workflow aims to run the Application Signals DotNet end-to-end tests as a canary to -## test the artifacts for Application Signals enablement. It will deploy a sample app and remote -## service on two EC2 instances, call the APIs, and validate the generated telemetry, -## including logs, metrics, and traces. -name: Dotnet EC2 Enablement Canary Testing -on: - workflow_dispatch: # be able to run the workflow on demand - schedule: - - cron: '2,27 * * * *' # run the workflow at 2nd and 27th minute of every hour - -permissions: - id-token: write - contents: read - -jobs: - default: - strategy: - fail-fast: false - matrix: - 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/dotnet-ec2-default-retry.yml - secrets: inherit - with: - aws-region: ${{ matrix.aws-region }} - caller-workflow-name: 'appsignals-dotnet-e2e-ec2-canary-test' - dotnet-version: '8.0' - - nuget: - strategy: - fail-fast: false - matrix: - aws-region: [ 'us-east-1'] - uses: ./.github/workflows/dotnet-ec2-nuget-retry.yml - secrets: inherit - with: - aws-region: ${{ matrix.aws-region }} - caller-workflow-name: 'appsignals-dotnet-e2e-ec2-nuget-canary-test' \ No newline at end of file diff --git a/.github/workflows/dotnet-ec2-default-retry.yml b/.github/workflows/dotnet-ec2-default-retry.yml deleted file mode 100644 index 604e3e142..000000000 --- a/.github/workflows/dotnet-ec2-default-retry.yml +++ /dev/null @@ -1,62 +0,0 @@ -## 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: Dotnet EC2 default Retry -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - dotnet-version: - required: true - type: string - -permissions: - id-token: write - contents: read - -jobs: - dotnet-ec2-default-attempt-1: - uses: ./.github/workflows/dotnet-ec2-default-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - dotnet-version: ${{ inputs.dotnet-version }} - - dotnet-ec2-default-attempt-2: - needs: [ dotnet-ec2-default-attempt-1 ] - if: ${{ needs.dotnet-ec2-default-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/dotnet-ec2-default-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - dotnet-version: ${{ inputs.dotnet-version }} - - publish-metric-attempt-1: - needs: [ dotnet-ec2-default-attempt-1, dotnet-ec2-default-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.dotnet-ec2-default-attempt-1.outputs.validation-result || needs.dotnet-ec2-default-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ dotnet-ec2-default-attempt-1, dotnet-ec2-default-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.dotnet-ec2-default-attempt-1.outputs.validation-result || needs.dotnet-ec2-default-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/dotnet-ec2-nuget-retry.yml b/.github/workflows/dotnet-ec2-nuget-retry.yml deleted file mode 100644 index 3db5e8b91..000000000 --- a/.github/workflows/dotnet-ec2-nuget-retry.yml +++ /dev/null @@ -1,57 +0,0 @@ -## 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: Dotnet EC2 default Retry -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - -permissions: - id-token: write - contents: read - -jobs: - dotnet-ec2-nuget-attempt-1: - uses: ./.github/workflows/dotnet-ec2-nuget-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - dotnet-ec2-nuget-attempt-2: - needs: [ dotnet-ec2-nuget-attempt-1 ] - if: ${{ needs.dotnet-ec2-nuget-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/dotnet-ec2-nuget-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - publish-metric-attempt-1: - needs: [ dotnet-ec2-nuget-attempt-1, dotnet-ec2-nuget-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.dotnet-ec2-nuget-attempt-1.outputs.validation-result || needs.dotnet-ec2-nuget-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ dotnet-ec2-nuget-attempt-1, dotnet-ec2-nuget-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.dotnet-ec2-nuget-attempt-1.outputs.validation-result || needs.dotnet-ec2-nuget-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/dotnet-ec2-windows-retry.yml b/.github/workflows/dotnet-ec2-windows-retry.yml deleted file mode 100644 index d2097b517..000000000 --- a/.github/workflows/dotnet-ec2-windows-retry.yml +++ /dev/null @@ -1,57 +0,0 @@ -## 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: Dotnet EC2 Windows Retry -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - -permissions: - id-token: write - contents: read - -jobs: - dotnet-ec2-windows-attempt-1: - uses: ./.github/workflows/dotnet-ec2-windows-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - dotnet-ec2-windows-attempt-2: - needs: [ dotnet-ec2-windows-attempt-1 ] - if: ${{ needs.dotnet-ec2-windows-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/dotnet-ec2-windows-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - publish-metric-attempt-1: - needs: [ dotnet-ec2-windows-attempt-1, dotnet-ec2-windows-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.dotnet-ec2-windows-attempt-1.outputs.validation-result || needs.dotnet-ec2-windows-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ dotnet-ec2-windows-attempt-1, dotnet-ec2-windows-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.dotnet-ec2-windows-attempt-1.outputs.validation-result || needs.dotnet-ec2-windows-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/dotnet-eks-canary.yml b/.github/workflows/dotnet-eks-canary.yml deleted file mode 100644 index dc005799c..000000000 --- a/.github/workflows/dotnet-eks-canary.yml +++ /dev/null @@ -1,37 +0,0 @@ -## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -## SPDX-License-Identifier: Apache-2.0 - -## This workflow aims to run the Application Signals DotNet end-to-end tests as a canary to -## test the artifacts for Application Signals enablement. It will deploy a sample app and remote -## service onto an EKS cluster, call the APIs, and validate the generated telemetry, -## including logs, metrics, and traces. -name: Dotnet EKS Enablement Canary Testing -on: - schedule: - - cron: '4,29 * * * *' # run the workflow at 4th and 29th minute of every hour - workflow_dispatch: # be able to run the workflow on demand - -concurrency: - group: ${{ github.workflow }} - cancel-in-progress: false - -permissions: - id-token: write - contents: read - - -jobs: - eks: - strategy: - fail-fast: false - matrix: - 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/dotnet-eks-retry.yml - secrets: inherit - with: - aws-region: ${{ matrix.aws-region }} - test-cluster-name: 'e2e-dotnet-canary-test' - caller-workflow-name: 'appsignals-dotnet-e2e-eks-canary-test' \ No newline at end of file diff --git a/.github/workflows/dotnet-eks-retry.yml b/.github/workflows/dotnet-eks-retry.yml deleted file mode 100644 index 5f19cbc61..000000000 --- a/.github/workflows/dotnet-eks-retry.yml +++ /dev/null @@ -1,66 +0,0 @@ -## 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: Dotnet EKS 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 - -concurrency: - group: 'dotnet-eks-${{ inputs.aws-region }}-${{ inputs.test-cluster-name }}' - cancel-in-progress: false - -permissions: - id-token: write - contents: read - -jobs: - dotnet-eks-attempt-1: - uses: ./.github/workflows/dotnet-eks-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - test-cluster-name: ${{ inputs.test-cluster-name }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - dotnet-eks-attempt-2: - needs: [ dotnet-eks-attempt-1 ] - if: ${{ needs.dotnet-eks-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/dotnet-eks-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - test-cluster-name: ${{ inputs.test-cluster-name }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - publish-metric-attempt-1: - needs: [ dotnet-eks-attempt-1, dotnet-eks-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.dotnet-eks-attempt-1.outputs.validation-result || needs.dotnet-eks-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ dotnet-eks-attempt-1, dotnet-eks-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.dotnet-eks-attempt-1.outputs.validation-result || needs.dotnet-eks-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/dotnet-k8s-canary.yml b/.github/workflows/dotnet-k8s-canary.yml deleted file mode 100644 index 0bcc39344..000000000 --- a/.github/workflows/dotnet-k8s-canary.yml +++ /dev/null @@ -1,26 +0,0 @@ -## 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 the CloudWatch Agent -## Operator and our sample app and remote service onto a native K8s cluster, call the -## APIs, and validate the generated telemetry, including logs, metrics, and traces. -## It will then clean up the cluster and EC2 instance it runs on for the next test run. -name: Dotnet K8s Enablement Canary Testing -on: - schedule: - - cron: '0,25 * * * *' # run the workflow at 0th and 25th minute of every hour - workflow_dispatch: # be able to run the workflow on demand - -permissions: - id-token: write - contents: read - -jobs: - k8s: - uses: ./.github/workflows/dotnet-k8s-retry.yml - secrets: inherit - with: - # To run in more regions, a cluster must be provisioned manually on EC2 instances in that region - aws-region: 'us-east-1' - caller-workflow-name: 'appsignals-e2e-dotnet-k8s-canary-test' \ No newline at end of file diff --git a/.github/workflows/dotnet-k8s-retry.yml b/.github/workflows/dotnet-k8s-retry.yml deleted file mode 100644 index c81b2efd2..000000000 --- a/.github/workflows/dotnet-k8s-retry.yml +++ /dev/null @@ -1,61 +0,0 @@ -## 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: Dotnet K8s Retry -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - -concurrency: - group: 'dotnet-k8s-${{ inputs.aws-region }}-${{ github.ref_name }}' - cancel-in-progress: false - -permissions: - id-token: write - contents: read - -jobs: - dotnet-k8s-attempt-1: - uses: ./.github/workflows/dotnet-k8s-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - dotnet-k8s-attempt-2: - needs: [ dotnet-k8s-attempt-1 ] - if: ${{ needs.dotnet-k8s-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/dotnet-k8s-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - publish-metric-attempt-1: - needs: [ dotnet-k8s-attempt-1, dotnet-k8s-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.dotnet-k8s-attempt-1.outputs.validation-result || needs.dotnet-k8s-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ dotnet-k8s-attempt-1, dotnet-k8s-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.dotnet-k8s-attempt-1.outputs.validation-result || needs.dotnet-k8s-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/java-ec2-adot-sigv4-test.yml b/.github/workflows/java-ec2-adot-sigv4-test.yml index f70b9643d..27decf17d 100644 --- a/.github/workflows/java-ec2-adot-sigv4-test.yml +++ b/.github/workflows/java-ec2-adot-sigv4-test.yml @@ -34,7 +34,8 @@ permissions: contents: read env: - E2E_TEST_AWS_REGION: 'us-west-2' # Test uses us-west-2 in the us-east-1 account + E2E_TEST_AWS_REGION: 'us-west-2' # Test uses us-west-2 in the us-east-1 accoun + MAIN_SERVICE_ADDRESS: 'localhost' CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }} METRIC_NAMESPACE: ApplicationSignals JAVA_VERSION: ${{ inputs.java-version }} @@ -176,41 +177,41 @@ jobs: max_retry: 3 sleep_time: 60 - # # Validation for pulse telemetry data - # - name: Validate generated EMF logs - # id: log-validation - # run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/log-validation.yml - # --testing-id ${{ env.TESTING_ID }} - # --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} - # --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 - # --region ${{ env.E2E_TEST_AWS_REGION }} - # --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} - # --metric-namespace ${{ env.METRIC_NAMESPACE }} - # --log-group ${{ env.LOG_GROUP_NAME }} - # --service-name sample-application-${{ env.TESTING_ID }} - # --remote-service-name sample-remote-application-${{ env.TESTING_ID }} - # --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} - # --instance-ami ${{ env.EC2_INSTANCE_AMI }} - # --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} - # --rollup' - - # - name: Validate generated metrics - # id: metric-validation - # if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() - # run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/metric-validation.yml - # --testing-id ${{ env.TESTING_ID }} - # --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} - # --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 - # --region ${{ env.E2E_TEST_AWS_REGION }} - # --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} - # --metric-namespace ${{ env.METRIC_NAMESPACE }} - # --log-group ${{ env.LOG_GROUP_NAME }} - # --service-name sample-application-${{ env.TESTING_ID }} - # --remote-service-name sample-remote-application-${{ env.TESTING_ID }} - # --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} - # --instance-ami ${{ env.EC2_INSTANCE_AMI }} - # --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} - # --rollup' + # Validation for pulse telemetry data + - name: Validate generated EMF logs + id: log-validation + run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/log-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name sample-application-${{ env.TESTING_ID }} + --remote-service-name sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' + + - name: Validate generated metrics + id: metric-validation + if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() + run: ./gradlew validator:run --args='-c java/ec2/adot-sigv4/metric-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8080 + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name sample-application-${{ env.TESTING_ID }} + --remote-service-name sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' - name: Validate generated traces id: trace-validation diff --git a/.github/workflows/java-ec2-canary.yml b/.github/workflows/java-ec2-canary.yml deleted file mode 100644 index 3a52bec42..000000000 --- a/.github/workflows/java-ec2-canary.yml +++ /dev/null @@ -1,43 +0,0 @@ -## 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 on two EC2 instances, call the APIs, and validate the generated telemetry, -## including logs, metrics, and traces. -name: Java EC2 Enablement Canary Testing -on: - schedule: - - cron: '6,31 * * * *' # run the workflow at 6th and 31th minute of every hour - workflow_dispatch: # be able to run the workflow on demand - -permissions: - id-token: write - contents: read - -jobs: - github: - strategy: - fail-fast: false - matrix: - 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-ec2-default-retry.yml - secrets: inherit - with: - aws-region: ${{ matrix.aws-region }} - caller-workflow-name: 'appsignals-e2e-ec2-canary-test' - java-version: '11' - cpu-architecture: 'x86_64' - - maven: - uses: ./.github/workflows/java-ec2-default-retry.yml - secrets: inherit - with: - aws-region: 'us-east-1' - caller-workflow-name: 'appsignals-e2e-ec2-maven-canary-test' - otel-source: 'maven' - java-version: '11' - cpu-architecture: 'x86_64' \ No newline at end of file diff --git a/.github/workflows/java-ec2-default-retry.yml b/.github/workflows/java-ec2-default-retry.yml deleted file mode 100644 index 77edc7aca..000000000 --- a/.github/workflows/java-ec2-default-retry.yml +++ /dev/null @@ -1,74 +0,0 @@ -## 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 EC2 default Retry -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - java-version: - required: true - type: string - cpu-architecture: - required: false - type: string - default: "x86_64" - otel-source: - required: false - type: string - default: 'github' - -permissions: - id-token: write - contents: read - -jobs: - java-ec2-default-attempt-1: - uses: ./.github/workflows/java-ec2-default-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - java-version: ${{ inputs.java-version }} - otel-source: ${{ inputs.otel-source }} - cpu-architecture: ${{ inputs.cpu-architecture }} - - java-ec2-default-attempt-2: - needs: [ java-ec2-default-attempt-1 ] - if: ${{ needs.java-ec2-default-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/java-ec2-default-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - java-version: ${{ inputs.java-version }} - otel-source: ${{ inputs.otel-source }} - cpu-architecture: ${{ inputs.cpu-architecture }} - - publish-metric-attempt-1: - needs: [ java-ec2-default-attempt-1, java-ec2-default-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-ec2-default-attempt-1.outputs.validation-result || needs.java-ec2-default-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ java-ec2-default-attempt-1, java-ec2-default-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-ec2-default-attempt-1.outputs.validation-result || needs.java-ec2-default-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/java-ecs-canary.yml b/.github/workflows/java-ecs-canary.yml deleted file mode 100644 index c8a76ea55..000000000 --- a/.github/workflows/java-ecs-canary.yml +++ /dev/null @@ -1,28 +0,0 @@ -## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -## SPDX-License-Identifier: Apache-2.0 - -## This workflow aims to run the Application Signals Java end-to-end tests as a canary to -## test the artifacts for Application Signals enablement. It will deploy a sample app onto an ECS cluster, -## call the APIs, and validate the generated telemetry, including logs, metrics, and traces. -name: Java ECS Enablement Canary Testing -on: - schedule: - - cron: '0,25 * * * *' # run the workflow at 0th and 25th minute of every hour - workflow_dispatch: # be able to run the workflow on demand - -permissions: - id-token: write - contents: read - -jobs: - ecs: - strategy: - fail-fast: false - matrix: - aws-region: ['us-east-1'] - uses: ./.github/workflows/java-ecs-retry.yml - secrets: inherit - with: - aws-region: ${{ matrix.aws-region }} - caller-workflow-name: 'appsignals-e2e-java-ecs-canary-test' - java-version: '11' \ No newline at end of file diff --git a/.github/workflows/java-ecs-retry.yml b/.github/workflows/java-ecs-retry.yml deleted file mode 100644 index 2c615a50e..000000000 --- a/.github/workflows/java-ecs-retry.yml +++ /dev/null @@ -1,62 +0,0 @@ -## 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 ECS Retry -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - java-version: - required: true - type: string - -permissions: - id-token: write - contents: read - -jobs: - java-ecs-attempt-1: - uses: ./.github/workflows/java-ecs-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - java-version: ${{ inputs.java-version }} - - java-ecs-attempt-2: - needs: [ java-ecs-attempt-1 ] - if: ${{ needs.java-ecs-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/java-ecs-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - java-version: ${{ inputs.java-version }} - - publish-metric-attempt-1: - needs: [ java-ecs-attempt-1, java-ecs-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-ecs-attempt-1.outputs.validation-result || needs.java-ecs-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ java-ecs-attempt-1, java-ecs-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-ecs-attempt-1.outputs.validation-result || needs.java-ecs-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/java-eks-canary.yml b/.github/workflows/java-eks-canary.yml deleted file mode 100644 index c76f65d93..000000000 --- a/.github/workflows/java-eks-canary.yml +++ /dev/null @@ -1,33 +0,0 @@ -## 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, call the APIs, and validate the generated telemetry, -## including logs, metrics, and traces. -name: Java EKS Enablement Canary Testing -on: - schedule: - - cron: '8,33 * * * *' # run the workflow at 8th and 33th 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: ['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-retry.yml - secrets: inherit - with: - aws-region: ${{ matrix.aws-region }} - test-cluster-name: 'e2e-canary-test' - caller-workflow-name: 'appsignals-e2e-eks-canary-test' - java-version: '11' diff --git a/.github/workflows/java-eks-retry.yml b/.github/workflows/java-eks-retry.yml deleted file mode 100644 index 9a0daba60..000000000 --- a/.github/workflows/java-eks-retry.yml +++ /dev/null @@ -1,71 +0,0 @@ -## 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 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-${{ inputs.aws-region }}-${{ inputs.test-cluster-name }}' - cancel-in-progress: false - -permissions: - id-token: write - contents: read - -jobs: - java-eks-attempt-1: - uses: ./.github/workflows/java-eks-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-attempt-2: - needs: [ java-eks-attempt-1 ] - if: ${{ needs.java-eks-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/java-eks-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-attempt-1, java-eks-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-attempt-1.outputs.validation-result || needs.java-eks-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ java-eks-attempt-1, java-eks-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-attempt-1.outputs.validation-result || needs.java-eks-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/java-k8s-canary.yml b/.github/workflows/java-k8s-canary.yml deleted file mode 100644 index f79592921..000000000 --- a/.github/workflows/java-k8s-canary.yml +++ /dev/null @@ -1,27 +0,0 @@ -## 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 the CloudWatch Agent -## Operator and our sample app and remote service onto a native K8s cluster, call the -## APIs, and validate the generated telemetry, including logs, metrics, and traces. -## It will then clean up the cluster and EC2 instance it runs on for the next test run. -name: Java K8s Enablement Canary Testing -on: - schedule: - - cron: '0,25 * * * *' # run the workflow at 0th and 25th minute of every hour - workflow_dispatch: # be able to run the workflow on demand - -permissions: - id-token: write - contents: read - -jobs: - k8s: - uses: ./.github/workflows/java-k8s-retry.yml - secrets: inherit - with: - # To run in more regions, a cluster must be provisioned manually on EC2 instances in that region - aws-region: 'us-east-1' - caller-workflow-name: 'appsignals-e2e-k8s-canary-test' - java-version: '11' \ No newline at end of file diff --git a/.github/workflows/java-k8s-retry.yml b/.github/workflows/java-k8s-retry.yml deleted file mode 100644 index fe85a14c5..000000000 --- a/.github/workflows/java-k8s-retry.yml +++ /dev/null @@ -1,66 +0,0 @@ -## 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 K8s Retry -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - java-version: - required: true - type: string - -concurrency: - group: 'java-k8s-${{ inputs.aws-region }}-${{ github.ref_name }}' - cancel-in-progress: false - -permissions: - id-token: write - contents: read - -jobs: - java-k8s-attempt-1: - uses: ./.github/workflows/java-k8s-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - java-version: ${{ inputs.java-version }} - - java-k8s-attempt-2: - needs: [ java-k8s-attempt-1 ] - if: ${{ needs.java-k8s-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/java-k8s-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - java-version: ${{ inputs.java-version }} - - publish-metric-attempt-1: - needs: [ java-k8s-attempt-1, java-k8s-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-k8s-attempt-1.outputs.validation-result || needs.java-k8s-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ java-k8s-attempt-1, java-k8s-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-k8s-attempt-1.outputs.validation-result || needs.java-k8s-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/node-ec2-adot-sigv4-test.yml b/.github/workflows/node-ec2-adot-sigv4-test.yml new file mode 100644 index 000000000..ea212c9d7 --- /dev/null +++ b/.github/workflows/node-ec2-adot-sigv4-test.yml @@ -0,0 +1,239 @@ +## 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: Node EC2 ADOT SigV4 Use Case +on: + workflow_call: + inputs: + caller-workflow-name: + required: true + type: string + node-version: + description: "Currently support version 14, 16, 18, 20, 22" + required: false + type: string + # 'none' means to use the node version come with the OS + default: 'none' + cpu-architecture: + description: "Permitted values: x86_64 or arm64" + required: false + type: string + default: "x86_64" + staging-instrumentation-name: + required: false + default: '@aws/aws-distro-opentelemetry-node-autoinstrumentation' + type: string + +permissions: + id-token: write + contents: read + +env: + E2E_TEST_AWS_REGION: 'us-west-2' + CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }} + NODE_VERSION: ${{ inputs.node-version }} + CPU_ARCHITECTURE: ${{ inputs.cpu-architecture }} + ADOT_INSTRUMENTATION_NAME: ${{ inputs.staging-instrumentation-name }} + 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/spans + TEST_RESOURCES_FOLDER: ${GITHUB_WORKSPACE} + +jobs: + node-ec2-adot-sigv4: + runs-on: ubuntu-latest + steps: + - name: Check if the job started + id: job-started + run: echo "job-started=true" >> $GITHUB_OUTPUT + + - name: Generate testing id + run: echo TESTING_ID="${{ github.run_id }}-${{ github.run_number }}-${RANDOM}" >> $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: 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: ${{ env.E2E_TEST_AWS_REGION }} + + - name: Set Get ADOT Instrumentation command environment variable + run: | + if [ "${{ github.event.repository.name }}" = "aws-otel-js-instrumentation" ]; then + echo GET_ADOT_INSTRUMENTATION_COMMAND="aws s3 cp s3://adot-autoinstrumentation-node-staging/${{ env.ADOT_INSTRUMENTATION_NAME }} ./${{ env.ADOT_INSTRUMENTATION_NAME }} --region us-east-1 && npm install ${{ env.ADOT_INSTRUMENTATION_NAME }}" >> $GITHUB_ENV + else + echo GET_ADOT_INSTRUMENTATION_COMMAND="npm install ${{ env.ADOT_INSTRUMENTATION_NAME }}" >> $GITHUB_ENV + fi + + - 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/node/ec2/adot-sigv4 && terraform init && terraform validate" + cleanup: "rm -rf .terraform && rm -rf .terraform.lock.hcl" + max_retry: 6 + sleep_time: 60 + + - name: Deploy sample app via terraform and wait for endpoint to come online + working-directory: terraform/node/ec2/adot-sigv4 + run: | + # Attempt to deploy the sample app on an EC2 instance and wait for its endpoint to come online. + # There may be occasional failures due to transitivity issues, so try up to 2 times. + # deployment_failed of 0 indicates that both the terraform deployment and the endpoint are running, while 1 indicates + # that it failed at some point + retry_counter=0 + max_retry=2 + while [ $retry_counter -lt $max_retry ]; do + echo "Attempt $retry_counter" + deployment_failed=0 + terraform apply -auto-approve \ + -var="aws_region=${{ env.E2E_TEST_AWS_REGION }}" \ + -var="test_id=${{ env.TESTING_ID }}" \ + -var="sample_app_zip=s3://aws-appsignals-sample-app-prod-us-east-1/node-sample-app.zip" \ + -var="get_adot_instrumentation_command=${{ env.GET_ADOT_INSTRUMENTATION_COMMAND }}" \ + -var="language_version=${{ env.NODE_VERSION }}" \ + -var="cpu_architecture=${{ env.CPU_ARCHITECTURE }}" \ + || deployment_failed=$? + + if [ $deployment_failed -eq 1 ]; then + echo "Terraform deployment was unsuccessful. Will attempt to retry deployment." + fi + + # If the success is 1 then either the terraform deployment or the endpoint connection failed, so first destroy the + # resources created from terraform and try again. + if [ $deployment_failed -eq 1 ]; then + echo "Destroying terraform" + terraform destroy -auto-approve \ + -var="test_id=${{ env.TESTING_ID }}" + + retry_counter=$(($retry_counter+1)) + else + # If deployment succeeded, then exit the loop + break + fi + + if [ $retry_counter -eq $max_retry ]; then + echo "Max retry reached, failed to deploy terraform and connect to the endpoint. Exiting code" + exit 1 + fi + done + + - name: Get the ec2 instance ami id + working-directory: terraform/node/ec2/adot-sigv4 + run: | + echo "EC2_INSTANCE_AMI=$(terraform output ec2_instance_ami)" >> $GITHUB_ENV + + - name: Get the sample app and EC2 instance information + working-directory: terraform/node/ec2/adot-sigv4 + run: | + echo "MAIN_SERVICE_ENDPOINT=localhost:8000" >> $GITHUB_ENV + echo "REMOTE_SERVICE_IP=$(terraform output sample_app_remote_service_private_ip)" >> $GITHUB_ENV + echo "MAIN_SERVICE_INSTANCE_ID=$(terraform output main_service_instance_id)" >> $GITHUB_ENV + + - name: Initiate Gradlew Daemon + if: steps.initiate-gradlew == 'failure' + 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 + + # Validation for pulse telemetry data + - name: Validate generated EMF logs + id: log-validation + run: ./gradlew validator:run --args='-c node/ec2/adot-sigv4/log-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8001 + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name node-sample-application-${{ env.TESTING_ID }} + --remote-service-name node-sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' + + - name: Validate generated metrics + id: metric-validation + if: (success() || steps.log-validation.outcome == 'failure') && !cancelled() + run: ./gradlew validator:run --args='-c node/ec2/adot-sigv4/metric-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8001 + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name node-sample-application-${{ env.TESTING_ID }} + --remote-service-name node-sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' + + - name: Validate generated traces + id: trace-validation + if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure') && !cancelled() + run: ./gradlew validator:run --args='-c node/ec2/adot-sigv4/trace-validation.yml + --testing-id ${{ env.TESTING_ID }} + --endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }} + --remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8001 + --region ${{ env.E2E_TEST_AWS_REGION }} + --account-id ${{ env.E2E_TEST_ACCOUNT_ID }} + --metric-namespace ${{ env.METRIC_NAMESPACE }} + --log-group ${{ env.LOG_GROUP_NAME }} + --service-name node-sample-application-${{ env.TESTING_ID }} + --remote-service-name node-sample-remote-application-${{ env.TESTING_ID }} + --query-string ip=${{ env.REMOTE_SERVICE_IP }}&testingId=${{ env.TESTING_ID }} + --instance-ami ${{ env.EC2_INSTANCE_AMI }} + --instance-id ${{ env.MAIN_SERVICE_INSTANCE_ID }} + --rollup' + + - name: Refresh AWS Credentials + if: ${{ always() }} + 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: ${{ env.E2E_TEST_AWS_REGION }} + + # Clean up Procedures + - name: Terraform destroy + if: always() + continue-on-error: true + working-directory: terraform/node/ec2/adot-sigv4 + run: | + terraform destroy -auto-approve \ + -var="test_id=${{ env.TESTING_ID }}" \ No newline at end of file diff --git a/.github/workflows/node-ec2-canary.yml b/.github/workflows/node-ec2-canary.yml deleted file mode 100644 index 9f2fe3160..000000000 --- a/.github/workflows/node-ec2-canary.yml +++ /dev/null @@ -1,31 +0,0 @@ -## 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 on two EC2 instances, call the APIs, and validate the generated telemetry, -## including logs, metrics, and traces. -name: Node EC2 Enablement Canary Testing -on: - schedule: - - cron: '10,35 * * * *' # run the workflow at 10th and 35th minute of every hour - workflow_dispatch: # be able to run the workflow on demand - -permissions: - id-token: write - contents: read - -jobs: - default: - strategy: - fail-fast: false - matrix: - 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/node-ec2-default-retry.yml - secrets: inherit - with: - aws-region: ${{ matrix.aws-region }} - caller-workflow-name: 'appsignals-node-e2e-ec2-canary-test' diff --git a/.github/workflows/node-ec2-default-retry.yml b/.github/workflows/node-ec2-default-retry.yml deleted file mode 100644 index a41a79c87..000000000 --- a/.github/workflows/node-ec2-default-retry.yml +++ /dev/null @@ -1,72 +0,0 @@ -## 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: Node EC2 default Retry -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - node-version: - description: "Currently support version 14, 16, 18, 20, 22" - required: false - type: string - # 'none' means to use the node version come with the OS - default: 'none' - cpu-architecture: - description: "Permitted values: x86_64 or arm64" - required: false - type: string - default: "x86_64" - -permissions: - id-token: write - contents: read - -jobs: - node-ec2-default-attempt-1: - uses: ./.github/workflows/node-ec2-default-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - node-version: ${{ inputs.node-version }} - cpu-architecture: ${{ inputs.cpu-architecture }} - - node-ec2-default-attempt-2: - needs: [ node-ec2-default-attempt-1 ] - if: ${{ needs.node-ec2-default-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/node-ec2-default-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - node-version: ${{ inputs.node-version }} - cpu-architecture: ${{ inputs.cpu-architecture }} - - publish-metric-attempt-1: - needs: [ node-ec2-default-attempt-1, node-ec2-default-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.node-ec2-default-attempt-1.outputs.validation-result || needs.node-ec2-default-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ node-ec2-default-attempt-1, node-ec2-default-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.node-ec2-default-attempt-1.outputs.validation-result || needs.node-ec2-default-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/node-ecs-retry.yml b/.github/workflows/node-ecs-retry.yml deleted file mode 100644 index 9f8a18f54..000000000 --- a/.github/workflows/node-ecs-retry.yml +++ /dev/null @@ -1,57 +0,0 @@ -## 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: Node ECS Retry -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - -permissions: - id-token: write - contents: read - -jobs: - node-ecs-attempt-1: - uses: ./.github/workflows/node-ecs-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - node-ecs-attempt-2: - needs: [ node-ecs-attempt-1 ] - if: ${{ needs.node-ecs-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/node-ecs-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - publish-metric-attempt-1: - needs: [ node-ecs-attempt-1, node-ecs-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.node-ecs-attempt-1.outputs.validation-result || needs.node-ecs-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ node-ecs-attempt-1, node-ecs-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.node-ecs-attempt-1.outputs.validation-result || needs.node-ecs-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/node-eks-canary.yml b/.github/workflows/node-eks-canary.yml deleted file mode 100644 index ba6b18245..000000000 --- a/.github/workflows/node-eks-canary.yml +++ /dev/null @@ -1,32 +0,0 @@ -## 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, call the APIs, and validate the generated telemetry, -## including logs, metrics, and traces. -name: Node EKS Enablement Canary Testing -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: ['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/node-eks-retry.yml - secrets: inherit - with: - aws-region: ${{ matrix.aws-region }} - test-cluster-name: 'e2e-node-canary-test' - caller-workflow-name: 'appsignals-node-e2e-eks-canary-test' diff --git a/.github/workflows/node-eks-retry.yml b/.github/workflows/node-eks-retry.yml deleted file mode 100644 index 0e5150b56..000000000 --- a/.github/workflows/node-eks-retry.yml +++ /dev/null @@ -1,66 +0,0 @@ -## 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: Node EKS 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 - -concurrency: - group: 'node-eks-${{ inputs.aws-region }}-${{ inputs.test-cluster-name }}' - cancel-in-progress: false - -permissions: - id-token: write - contents: read - -jobs: - node-eks-attempt-1: - uses: ./.github/workflows/node-eks-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - test-cluster-name: ${{ inputs.test-cluster-name }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - node-eks-attempt-2: - needs: [ node-eks-attempt-1 ] - if: ${{ needs.node-eks-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/node-eks-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - test-cluster-name: ${{ inputs.test-cluster-name }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - publish-metric-attempt-1: - needs: [ node-eks-attempt-1, node-eks-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.node-eks-attempt-1.outputs.validation-result || needs.node-eks-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ node-eks-attempt-1, node-eks-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.node-eks-attempt-1.outputs.validation-result || needs.node-eks-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/node-k8s-canary.yml b/.github/workflows/node-k8s-canary.yml deleted file mode 100644 index 4b11ec2a1..000000000 --- a/.github/workflows/node-k8s-canary.yml +++ /dev/null @@ -1,26 +0,0 @@ -## 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 the CloudWatch Agent -## Operator and our sample app and remote service onto a native K8s cluster, call the -## APIs, and validate the generated telemetry, including logs, metrics, and traces. -## It will then clean up the cluster and EC2 instance it runs on for the next test run. -name: Node K8s Enablement Canary Testing -on: - schedule: - - cron: '0,25 * * * *' # run the workflow at 0th and 25th minute of every hour - workflow_dispatch: # be able to run the workflow on demand - -permissions: - id-token: write - contents: read - -jobs: - k8s: - uses: ./.github/workflows/node-k8s-retry.yml - secrets: inherit - with: - # To run in more regions, a cluster must be provisioned manually on EC2 instances in that region - aws-region: 'us-east-1' - caller-workflow-name: 'appsignals-node-e2e-k8s-canary-test' diff --git a/.github/workflows/node-k8s-retry.yml b/.github/workflows/node-k8s-retry.yml deleted file mode 100644 index 868ca40df..000000000 --- a/.github/workflows/node-k8s-retry.yml +++ /dev/null @@ -1,61 +0,0 @@ -## 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: Node K8s Retry -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - -concurrency: - group: 'node-k8s-${{ inputs.aws-region }}-${{ github.ref_name }}' - cancel-in-progress: false - -permissions: - id-token: write - contents: read - -jobs: - node-k8s-attempt-1: - uses: ./.github/workflows/node-k8s-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - node-k8s-attempt-2: - needs: [ node-k8s-attempt-1 ] - if: ${{ needs.node-k8s-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/node-k8s-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - - publish-metric-attempt-1: - needs: [ node-k8s-attempt-1, node-k8s-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.node-k8s-attempt-1.outputs.validation-result || needs.node-k8s-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ node-k8s-attempt-1, node-k8s-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.node-k8s-attempt-1.outputs.validation-result || needs.node-k8s-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index f5a149112..88e823ba4 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -5,6 +5,7 @@ on: branches: - main + jobs: build: name: Gradle Build diff --git a/.github/workflows/python-ec2-adot-sigv4-test.yml b/.github/workflows/python-ec2-adot-sigv4-test.yml index 6febd034e..f550dd340 100644 --- a/.github/workflows/python-ec2-adot-sigv4-test.yml +++ b/.github/workflows/python-ec2-adot-sigv4-test.yml @@ -220,6 +220,7 @@ jobs: --rollup' - name: Refresh AWS Credentials + if: always() 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 }} diff --git a/.github/workflows/python-ec2-canary.yml b/.github/workflows/python-ec2-canary.yml deleted file mode 100644 index e79628def..000000000 --- a/.github/workflows/python-ec2-canary.yml +++ /dev/null @@ -1,43 +0,0 @@ -## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -## SPDX-License-Identifier: Apache-2.0 - -## This workflow aims to run the Application Signals Python end-to-end tests as a canary to -## test the artifacts for Application Signals enablement. It will deploy a sample app and remote -## service on two EC2 instances, call the APIs, and validate the generated telemetry, -## including logs, metrics, and traces. -name: Python EC2 Enablement Canary Testing -on: - schedule: - - cron: '16,41 * * * *' # run the workflow at 16th and 41th minute of every hour - workflow_dispatch: # be able to run the workflow on demand - -permissions: - id-token: write - contents: read - -jobs: - github: - strategy: - fail-fast: false - matrix: - 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/python-ec2-default-retry.yml - secrets: inherit - with: - aws-region: ${{ matrix.aws-region }} - caller-workflow-name: 'appsignals-python-e2e-ec2-canary-test' - python-version: '3.9' - cpu-architecture: 'x86_64' - - pypi: - uses: ./.github/workflows/python-ec2-default-retry.yml - secrets: inherit - with: - aws-region: 'us-east-1' - caller-workflow-name: 'appsignals-python-e2e-ec2-pypi-canary-test' - python-version: '3.9' - otel-source: 'pypi' - cpu-architecture: 'x86_64' diff --git a/.github/workflows/python-ec2-default-retry.yml b/.github/workflows/python-ec2-default-retry.yml deleted file mode 100644 index 92ad1d61b..000000000 --- a/.github/workflows/python-ec2-default-retry.yml +++ /dev/null @@ -1,80 +0,0 @@ -## 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: Python EC2 Default Retry -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - python-version: - required: true - type: string - staging-wheel-name: - required: false - default: 'aws-opentelemetry-distro' - type: string - cpu-architecture: - required: false - type: string - default: "x86_64" - otel-source: - required: false - type: string - default: 'github' - -permissions: - id-token: write - contents: read - -jobs: - python-ec2-default-attempt-1: - uses: ./.github/workflows/python-ec2-default-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - python-version: ${{ inputs.python-version }} - staging-wheel-name: ${{ inputs.staging-wheel-name }} - otel-source: ${{ inputs.otel-source }} - cpu-architecture: ${{ inputs.cpu-architecture }} - - python-ec2-default-attempt-2: - needs: [ python-ec2-default-attempt-1 ] - if: ${{ needs.python-ec2-default-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/python-ec2-default-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - python-version: ${{ inputs.python-version }} - staging-wheel-name: ${{ inputs.staging-wheel-name }} - otel-source: ${{ inputs.otel-source }} - cpu-architecture: ${{ inputs.cpu-architecture }} - - publish-metric-attempt-1: - needs: [ python-ec2-default-attempt-1, python-ec2-default-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.python-ec2-default-attempt-1.outputs.validation-result || needs.python-ec2-default-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ python-ec2-default-attempt-1, python-ec2-default-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.python-ec2-default-attempt-1.outputs.validation-result || needs.python-ec2-default-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/python-ecs-canary.yml b/.github/workflows/python-ecs-canary.yml deleted file mode 100644 index 9dcc4d8b5..000000000 --- a/.github/workflows/python-ecs-canary.yml +++ /dev/null @@ -1,28 +0,0 @@ -## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -## SPDX-License-Identifier: Apache-2.0 - -## This workflow aims to run the Application Signals Python end-to-end tests as a canary to -## test the artifacts for Application Signals enablement. It will deploy a sample app onto an ECS cluster, -## call the APIs, and validate the generated telemetry, including logs, metrics, and traces. -name: Python ECS Enablement Canary Testing -on: - schedule: - - cron: '0,25 * * * *' # run the workflow at 0th and 25th minute of every hour - workflow_dispatch: # be able to run the workflow on demand - -permissions: - id-token: write - contents: read - -jobs: - ecs: - strategy: - fail-fast: false - matrix: - aws-region: ['us-east-1'] - uses: ./.github/workflows/python-ecs-retry.yml - secrets: inherit - with: - aws-region: ${{ matrix.aws-region }} - caller-workflow-name: 'appsignals-e2e-python-ecs-canary-test' - python-version: '3.10' \ No newline at end of file diff --git a/.github/workflows/python-ecs-retry.yml b/.github/workflows/python-ecs-retry.yml deleted file mode 100644 index 5d3be66ec..000000000 --- a/.github/workflows/python-ecs-retry.yml +++ /dev/null @@ -1,62 +0,0 @@ -## 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: Python ECS Retry -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - python-version: - required: true - type: string - -permissions: - id-token: write - contents: read - -jobs: - python-ecs-attempt-1: - uses: ./.github/workflows/python-ecs-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - python-version: ${{ inputs.python-version }} - - python-ecs-attempt-2: - needs: [ python-ecs-attempt-1 ] - if: ${{ needs.python-ecs-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/python-ecs-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - python-version: ${{ inputs.python-version }} - - publish-metric-attempt-1: - needs: [ python-ecs-attempt-1, python-ecs-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.python-ecs-attempt-1.outputs.validation-result || needs.python-ecs-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ python-ecs-attempt-1, python-ecs-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.python-ecs-attempt-1.outputs.validation-result || needs.python-ecs-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/python-eks-canary.yml b/.github/workflows/python-eks-canary.yml deleted file mode 100644 index 203844e6e..000000000 --- a/.github/workflows/python-eks-canary.yml +++ /dev/null @@ -1,34 +0,0 @@ -## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -## SPDX-License-Identifier: Apache-2.0 - -## This workflow aims to run the Application Signals Python end-to-end tests as a canary to -## test the artifacts for Application Signals enablement. It will deploy a sample app and remote -## service onto an EKS cluster, call the APIs, and validate the generated telemetry, -## including logs, metrics, and traces. -name: Python EKS Enablement Canary Testing -on: - schedule: - - cron: '18,43 * * * *' # run the workflow at 18th and 43th 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: ['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/python-eks-retry.yml - secrets: inherit - with: - aws-region: ${{ matrix.aws-region }} - test-cluster-name: 'e2e-python-canary-test' - caller-workflow-name: 'appsignals-python-e2e-eks-canary-test' - python-version: '3.10' diff --git a/.github/workflows/python-eks-retry.yml b/.github/workflows/python-eks-retry.yml deleted file mode 100644 index de2dee909..000000000 --- a/.github/workflows/python-eks-retry.yml +++ /dev/null @@ -1,71 +0,0 @@ -## 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: Python EKS 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 - python-version: - required: true - type: string - -concurrency: - group: 'python-eks-${{ inputs.aws-region }}-${{ inputs.test-cluster-name }}' - cancel-in-progress: false - -permissions: - id-token: write - contents: read - -jobs: - python-eks-attempt-1: - uses: ./.github/workflows/python-eks-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - test-cluster-name: ${{ inputs.test-cluster-name }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - python-version: ${{ inputs.python-version }} - - python-eks-attempt-2: - needs: [ python-eks-attempt-1 ] - if: ${{ needs.python-eks-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/python-eks-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - test-cluster-name: ${{ inputs.test-cluster-name }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - python-version: ${{ inputs.python-version }} - - publish-metric-attempt-1: - needs: [ python-eks-attempt-1, python-eks-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.python-eks-attempt-1.outputs.validation-result || needs.python-eks-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ python-eks-attempt-1, python-eks-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.python-eks-attempt-1.outputs.validation-result || needs.python-eks-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/.github/workflows/python-k8s-canary.yml b/.github/workflows/python-k8s-canary.yml deleted file mode 100644 index 5d5395b69..000000000 --- a/.github/workflows/python-k8s-canary.yml +++ /dev/null @@ -1,25 +0,0 @@ -## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -## SPDX-License-Identifier: Apache-2.0 - -## Operator and our sample app and remote service onto a native K8s cluster, call the -## APIs, and validate the generated telemetry, including logs, metrics, and traces. -## It will then clean up the cluster and EC2 instance it runs on for the next test run. -name: Python K8s Enablement Canary Testing -on: - schedule: - - cron: '0,25 * * * *' # run the workflow at 0th and 25th minute of every hour - workflow_dispatch: # be able to run the workflow on demand - -permissions: - id-token: write - contents: read - -jobs: - k8s: - uses: ./.github/workflows/python-k8s-retry.yml - secrets: inherit - with: - # To run in more regions, a cluster must be provisioned manually on EC2 instances in that region - aws-region: 'us-east-1' - caller-workflow-name: 'appsignals-e2e-python-k8s-canary-test' - python-version: '3.10' \ No newline at end of file diff --git a/.github/workflows/python-k8s-retry.yml b/.github/workflows/python-k8s-retry.yml deleted file mode 100644 index 02db43d36..000000000 --- a/.github/workflows/python-k8s-retry.yml +++ /dev/null @@ -1,66 +0,0 @@ -## 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: Python K8s Retry -on: - workflow_call: - inputs: - aws-region: - required: true - type: string - caller-workflow-name: - required: true - type: string - python-version: - required: true - type: string - -concurrency: - group: 'python-k8s-${{ inputs.aws-region }}-${{ github.ref_name }}' - cancel-in-progress: false - -permissions: - id-token: write - contents: read - -jobs: - python-k8s-attempt-1: - uses: ./.github/workflows/python-k8s-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - python-version: ${{ inputs.python-version }} - - python-k8s-attempt-2: - needs: [ python-k8s-attempt-1 ] - if: ${{ needs.python-k8s-attempt-1.outputs.job-started != 'true' }} - uses: ./.github/workflows/python-k8s-test.yml - secrets: inherit - with: - aws-region: ${{ inputs.aws-region }} - caller-workflow-name: ${{ inputs.caller-workflow-name }} - python-version: ${{ inputs.python-version }} - - publish-metric-attempt-1: - needs: [ python-k8s-attempt-1, python-k8s-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.python-k8s-attempt-1.outputs.validation-result || needs.python-k8s-attempt-2.outputs.validation-result }} - - publish-metric-attempt-2: - needs: [ python-k8s-attempt-1, python-k8s-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.python-k8s-attempt-1.outputs.validation-result || needs.python-k8s-attempt-2.outputs.validation-result }} \ No newline at end of file diff --git a/terraform/dotnet/ec2/adot-sigv4/main.tf b/terraform/dotnet/ec2/adot-sigv4/main.tf new file mode 100644 index 000000000..cda6608f1 --- /dev/null +++ b/terraform/dotnet/ec2/adot-sigv4/main.tf @@ -0,0 +1,315 @@ +# ------------------------------------------------------------------------ +# 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" + } + } +} + +# Define the provider for AWS +provider "aws" {} + +resource "aws_default_vpc" "default" {} + +resource "tls_private_key" "ssh_key" { + algorithm = "RSA" + rsa_bits = 4096 +} + +resource "aws_key_pair" "aws_ssh_key" { + key_name = "instance_key-${var.test_id}" + public_key = tls_private_key.ssh_key.public_key_openssh +} + +locals { + ssh_key_name = aws_key_pair.aws_ssh_key.key_name + private_key_content = tls_private_key.ssh_key.private_key_pem +} + +data "aws_ami" "ami" { + owners = ["amazon"] + most_recent = true + filter { + name = "name" + values = ["al20*-ami-minimal-*-x86_64"] + } + filter { + name = "state" + values = ["available"] + } + filter { + name = "architecture" + values = ["x86_64"] + } + filter { + name = "image-type" + values = ["machine"] + } + + filter { + name = "root-device-name" + values = ["/dev/xvda"] + } + + filter { + name = "root-device-type" + values = ["ebs"] + } + + filter { + name = "virtualization-type" + values = ["hvm"] + } +} + +resource "aws_instance" "main_service_instance" { + ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier) + instance_type = "t3.small" + key_name = local.ssh_key_name + iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE" + vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id] + associate_public_ip_address = true + instance_initiated_shutdown_behavior = "terminate" + + metadata_options { + http_tokens = "required" + } + + root_block_device { + volume_size = 5 + } + + tags = { + Name = "main-service-${var.test_id}" + } +} + +resource "null_resource" "main_service_setup" { + connection { + type = "ssh" + user = var.user + private_key = local.private_key_content + host = aws_instance.main_service_instance.public_ip + } + + provisioner "remote-exec" { + inline = [ + <<-EOF + #!/bin/bash + + # Install DotNet and wget + sudo yum install -y wget + sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc + sudo wget -O /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/37/prod.repo + sudo dnf install -y dotnet-sdk-${var.language_version} + sudo yum install unzip -y + + # enable ec2 instance connect for debug + sudo yum install ec2-instance-connect -y + + # Get ADOT distro and unzip it + ${var.get_adot_distro_command} + + # Get and run the sample application with configuration + aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app.zip + unzip -o dotnet-sample-app.zip + + # Get Absolute Path + current_dir=$(pwd) + echo $current_dir + + # Export environment variables for instrumentation + cd ./asp_frontend_service + dotnet build + CORECLR_ENABLE_PROFILING=1 \ + CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} \ + CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so \ + DOTNET_ADDITIONAL_DEPS=$current_dir/dotnet-distro/AdditionalDeps \ + DOTNET_SHARED_STORE=$current_dir/dotnet-distro/store \ + DOTNET_STARTUP_HOOKS=$current_dir/dotnet-distro/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll \ + OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro \ + OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" \ + OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \ + OTEL_LOGS_EXPORTER=none \ + OTEL_METRICS_EXPORTER=none \ + OTEL_TRACES_EXPORTER=none \ + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray.${var.aws_region}.amazonaws.com/v1/traces \ + OTEL_AWS_SIG_V4_ENABLED=true \ + OTEL_TRACES_SAMPLER=always_on \ + OTEL_RESOURCE_ATTRIBUTES=service.name=dotnet-sample-application-${var.test_id} \ + ASPNETCORE_URLS=http://0.0.0.0:8080 \ + nohup dotnet bin/Debug/netcoreapp${var.language_version}/asp_frontend_service.dll &> nohup.out & + + # The application needs time to come up and reach a steady state, this should not take longer than 30 seconds + sleep 30 + + # Check if the application is up. If it is not up, then exit 1. + attempt_counter=0 + max_attempts=30 + until $(curl --output /dev/null --silent --fail $(echo "http://localhost:8080" | tr -d '"')); do + if [ $attempt_counter -eq $max_attempts ];then + echo "Failed to connect to endpoint. Will attempt to redeploy sample app." + deployment_failed=1 + break + fi + echo "Attempting to connect to the main endpoint. Tried $attempt_counter out of $max_attempts" + attempt_counter=$(($attempt_counter+1)) + sleep 10 + done + + EOF + ] + } + + depends_on = [aws_instance.main_service_instance] +} + +resource "aws_instance" "remote_service_instance" { + ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier) + instance_type = "t3.small" + key_name = local.ssh_key_name + iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE" + vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id] + associate_public_ip_address = true + instance_initiated_shutdown_behavior = "terminate" + + metadata_options { + http_tokens = "required" + } + + root_block_device { + volume_size = 5 + } + + tags = { + Name = "remote-service-${var.test_id}" + } +} + +resource "null_resource" "remote_service_setup" { + connection { + type = "ssh" + user = var.user + private_key = local.private_key_content + host = aws_instance.remote_service_instance.public_ip + } + + provisioner "remote-exec" { + inline = [ + <<-EOF + #!/bin/bash + + # Install DotNet and wget + sudo yum install -y wget + sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc + sudo wget -O /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/37/prod.repo + sudo dnf install -y dotnet-sdk-${var.language_version} + sudo yum install unzip -y + + # enable ec2 instance connect for debug + sudo yum install ec2-instance-connect -y + + # Get ADOT distro and unzip it + ${var.get_adot_distro_command} + + # Get and run the sample application with configuration + aws s3 cp ${var.sample_app_zip} ./dotnet-sample-app.zip + unzip -o dotnet-sample-app.zip + + # Get Absolute Path + current_dir=$(pwd) + echo $current_dir + + # Export environment variables for instrumentation + cd ./asp_remote_service + dotnet build + CORECLR_ENABLE_PROFILING=1 \ + CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} \ + CORECLR_PROFILER_PATH=$current_dir/dotnet-distro/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so \ + DOTNET_ADDITIONAL_DEPS=$current_dir/dotnet-distro/AdditionalDeps \ + DOTNET_SHARED_STORE=$current_dir/dotnet-distro/store \ + DOTNET_STARTUP_HOOKS=$current_dir/dotnet-distro/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll \ + OTEL_DOTNET_AUTO_HOME=$current_dir/dotnet-distro \ + OTEL_DOTNET_AUTO_PLUGINS="AWS.Distro.OpenTelemetry.AutoInstrumentation.Plugin, AWS.Distro.OpenTelemetry.AutoInstrumentation" \ + OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \ + OTEL_LOGS_EXPORTER=none \ + OTEL_METRICS_EXPORTER=none \ + OTEL_TRACES_EXPORTER=none \ + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray.${var.aws_region}.amazonaws.com/v1/traces \ + OTEL_AWS_SIG_V4_ENABLED=true \ + OTEL_TRACES_SAMPLER=always_on \ + OTEL_RESOURCE_ATTRIBUTES=service.name=dotnet-sample-remote-application-${var.test_id} \ + ASPNETCORE_URLS=http://0.0.0.0:8081 \ + nohup dotnet bin/Debug/netcoreapp${var.language_version}/asp_remote_service.dll &> nohup.out & + + # The application needs time to come up and reach a steady state, this should not take longer than 30 seconds + sleep 30 + + # Check if the application is up. If it is not up, then exit 1. + attempt_counter=0 + max_attempts=30 + until $(curl --output /dev/null --silent --fail $(echo "http://localhost:8081" | tr -d '"')); do + if [ $attempt_counter -eq $max_attempts ];then + echo "Failed to connect to endpoint. Will attempt to redeploy sample app." + deployment_failed=1 + break + fi + echo "Attempting to connect to the remote endpoint. Tried $attempt_counter out of $max_attempts" + attempt_counter=$(($attempt_counter+1)) + sleep 10 + done + + EOF + ] + } + + depends_on = [aws_instance.remote_service_instance] +} + +resource "null_resource" "traffic_generator_setup" { + connection { + type = "ssh" + user = var.user + private_key = local.private_key_content + host = aws_instance.main_service_instance.public_ip + } + + provisioner "remote-exec" { + inline = [ + <<-EOF + sudo yum install nodejs aws-cli unzip tmux -y + + # Bring in the traffic generator files to EC2 Instance + aws s3 cp s3://aws-appsignals-sample-app-prod-us-east-1/traffic-generator.zip ./traffic-generator.zip + unzip ./traffic-generator.zip -d ./ + + # Install the traffic generator dependencies + npm install + + tmux new -s traffic-generator -d + tmux send-keys -t traffic-generator "export MAIN_ENDPOINT=\"localhost:8080\"" C-m + tmux send-keys -t traffic-generator "export REMOTE_ENDPOINT=\"${aws_instance.remote_service_instance.private_ip}\"" C-m + tmux send-keys -t traffic-generator "export ID=\"${var.test_id}\"" C-m + tmux send-keys -t traffic-generator "npm start" C-m + + EOF + ] + } + + depends_on = [null_resource.main_service_setup, null_resource.remote_service_setup] +} diff --git a/terraform/dotnet/ec2/adot-sigv4/output.tf b/terraform/dotnet/ec2/adot-sigv4/output.tf new file mode 100644 index 000000000..be572868a --- /dev/null +++ b/terraform/dotnet/ec2/adot-sigv4/output.tf @@ -0,0 +1,26 @@ +# ------------------------------------------------------------------------ +# 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. +# ------------------------------------------------------------------------- + +output "sample_app_remote_service_private_ip" { + value = aws_instance.remote_service_instance.private_ip +} + +output "main_service_instance_id" { + value = aws_instance.main_service_instance.id +} + +output "ec2_instance_ami" { + value = data.aws_ami.ami.id +} \ No newline at end of file diff --git a/terraform/dotnet/ec2/adot-sigv4/variables.tf b/terraform/dotnet/ec2/adot-sigv4/variables.tf new file mode 100644 index 000000000..a0e19912d --- /dev/null +++ b/terraform/dotnet/ec2/adot-sigv4/variables.tf @@ -0,0 +1,42 @@ +# ------------------------------------------------------------------------ +# 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 "aws_region" { + default = "" +} + +variable "user" { + default = "ec2-user" +} + +variable "sample_app_zip" { + default = "s3:///" +} + +variable "get_adot_distro_command" { + default = "aws s3 cp s3:/// ./ && unzip " +} + +variable "canary_type" { + default = "dotnet-ec2-default" +} + +variable "language_version" { + default = "8.0" +} \ No newline at end of file diff --git a/terraform/dotnet/k8s/deploy/main.tf b/terraform/dotnet/k8s/deploy/main.tf index deecdb2d8..b8ac267f8 100644 --- a/terraform/dotnet/k8s/deploy/main.tf +++ b/terraform/dotnet/k8s/deploy/main.tf @@ -134,7 +134,10 @@ resource "null_resource" "deploy" { --docker-password="$${TOKEN}" yq eval '.spec.template.spec.imagePullSecrets += [{"name": "release-testing-ecr-secret"}]' -i dotnet-frontend-service-depl.yaml - yq eval '.spec.template.spec.imagePullSecrets += [{"name": "release-testing-ecr-secret"}]' -i dotnet-remote-service-depl.yaml + + service_part=$(yq eval 'select(.kind == "Service")' dotnet-remote-service-depl.yaml) + yq eval 'select(.kind == "Deployment") | .spec.template.spec.imagePullSecrets += {"name": "release-testing-ecr-secret"}' -i dotnet-remote-service-depl.yaml + echo -e "\n---\n$service_part" >> dotnet-remote-service-depl.yaml fi echo "LOG: Applying sample app deployment files" diff --git a/terraform/dotnet/lambda/lambda/layer_arns.tf b/terraform/dotnet/lambda/lambda/layer_arns.tf index 0955a4427..bcf1ddf94 100644 --- a/terraform/dotnet/lambda/lambda/layer_arns.tf +++ b/terraform/dotnet/lambda/lambda/layer_arns.tf @@ -1,32 +1,32 @@ locals { sdk_layer_arns = { - "af-south-1" = "arn:aws:lambda:af-south-1:904233096616:layer:AWSOpenTelemetryDistroDotNet:3" - "ap-east-1" = "arn:aws:lambda:ap-east-1:888577020596:layer:AWSOpenTelemetryDistroDotNet:3" - "ap-northeast-1" = "arn:aws:lambda:ap-northeast-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "ap-northeast-2" = "arn:aws:lambda:ap-northeast-2:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "ap-northeast-3" = "arn:aws:lambda:ap-northeast-3:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "ap-south-1" = "arn:aws:lambda:ap-south-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "ap-south-2" = "arn:aws:lambda:ap-south-2:796973505492:layer:AWSOpenTelemetryDistroDotNet:3" - "ap-southeast-1" = "arn:aws:lambda:ap-southeast-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "ap-southeast-2" = "arn:aws:lambda:ap-southeast-2:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "ap-southeast-3" = "arn:aws:lambda:ap-southeast-3:039612877180:layer:AWSOpenTelemetryDistroDotNet:3" - "ap-southeast-4" = "arn:aws:lambda:ap-southeast-4:713881805771:layer:AWSOpenTelemetryDistroDotNet:3" - "ca-central-1" = "arn:aws:lambda:ca-central-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "eu-central-1" = "arn:aws:lambda:eu-central-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "eu-central-2" = "arn:aws:lambda:eu-central-2:156041407956:layer:AWSOpenTelemetryDistroDotNet:3" - "eu-north-1" = "arn:aws:lambda:eu-north-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "eu-south-1" = "arn:aws:lambda:eu-south-1:257394471194:layer:AWSOpenTelemetryDistroDotNet:3" - "eu-south-2" = "arn:aws:lambda:eu-south-2:490004653786:layer:AWSOpenTelemetryDistroDotNet:3" - "eu-west-1" = "arn:aws:lambda:eu-west-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "eu-west-2" = "arn:aws:lambda:eu-west-2:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "eu-west-3" = "arn:aws:lambda:eu-west-3:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "il-central-1" = "arn:aws:lambda:il-central-1:746669239226:layer:AWSOpenTelemetryDistroDotNet:3" - "me-central-1" = "arn:aws:lambda:me-central-1:739275441131:layer:AWSOpenTelemetryDistroDotNet:3" - "me-south-1" = "arn:aws:lambda:me-south-1:980921751758:layer:AWSOpenTelemetryDistroDotNet:3" - "sa-east-1" = "arn:aws:lambda:sa-east-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "us-east-1" = "arn:aws:lambda:us-east-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" - "us-east-2" = "arn:aws:lambda:us-east-2:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "us-west-1" = "arn:aws:lambda:us-west-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" - "us-west-2" = "arn:aws:lambda:us-west-2:615299751070:layer:AWSOpenTelemetryDistroDotNet:3" + "af-south-1" = "arn:aws:lambda:af-south-1:904233096616:layer:AWSOpenTelemetryDistroDotNet:4" + "ap-east-1" = "arn:aws:lambda:ap-east-1:888577020596:layer:AWSOpenTelemetryDistroDotNet:4" + "ap-northeast-1" = "arn:aws:lambda:ap-northeast-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "ap-northeast-2" = "arn:aws:lambda:ap-northeast-2:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "ap-northeast-3" = "arn:aws:lambda:ap-northeast-3:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "ap-south-1" = "arn:aws:lambda:ap-south-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "ap-south-2" = "arn:aws:lambda:ap-south-2:796973505492:layer:AWSOpenTelemetryDistroDotNet:4" + "ap-southeast-1" = "arn:aws:lambda:ap-southeast-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "ap-southeast-2" = "arn:aws:lambda:ap-southeast-2:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "ap-southeast-3" = "arn:aws:lambda:ap-southeast-3:039612877180:layer:AWSOpenTelemetryDistroDotNet:4" + "ap-southeast-4" = "arn:aws:lambda:ap-southeast-4:713881805771:layer:AWSOpenTelemetryDistroDotNet:4" + "ca-central-1" = "arn:aws:lambda:ca-central-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "eu-central-1" = "arn:aws:lambda:eu-central-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "eu-central-2" = "arn:aws:lambda:eu-central-2:156041407956:layer:AWSOpenTelemetryDistroDotNet:4" + "eu-north-1" = "arn:aws:lambda:eu-north-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "eu-south-1" = "arn:aws:lambda:eu-south-1:257394471194:layer:AWSOpenTelemetryDistroDotNet:4" + "eu-south-2" = "arn:aws:lambda:eu-south-2:490004653786:layer:AWSOpenTelemetryDistroDotNet:4" + "eu-west-1" = "arn:aws:lambda:eu-west-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "eu-west-2" = "arn:aws:lambda:eu-west-2:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "eu-west-3" = "arn:aws:lambda:eu-west-3:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "il-central-1" = "arn:aws:lambda:il-central-1:746669239226:layer:AWSOpenTelemetryDistroDotNet:4" + "me-central-1" = "arn:aws:lambda:me-central-1:739275441131:layer:AWSOpenTelemetryDistroDotNet:4" + "me-south-1" = "arn:aws:lambda:me-south-1:980921751758:layer:AWSOpenTelemetryDistroDotNet:4" + "sa-east-1" = "arn:aws:lambda:sa-east-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "us-east-1" = "arn:aws:lambda:us-east-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:5" + "us-east-2" = "arn:aws:lambda:us-east-2:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "us-west-1" = "arn:aws:lambda:us-west-1:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" + "us-west-2" = "arn:aws:lambda:us-west-2:615299751070:layer:AWSOpenTelemetryDistroDotNet:4" } } diff --git a/terraform/java/ec2/adot-sigv4/main.tf b/terraform/java/ec2/adot-sigv4/main.tf index f712fba97..d1ced938a 100644 --- a/terraform/java/ec2/adot-sigv4/main.tf +++ b/terraform/java/ec2/adot-sigv4/main.tf @@ -122,6 +122,8 @@ resource "null_resource" "main_service_setup" { sudo yum install java-${var.language_version}-amazon-corretto -y fi + sudo yum install ec2-instance-connect -y + # Get ADOT ${var.get_adot_jar_command} @@ -130,6 +132,8 @@ resource "null_resource" "main_service_setup" { # OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED=true \ export JAVA_TOOL_OPTIONS=' -javaagent:/home/ec2-user/adot.jar' + export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=false + export OTEL_RESOURCE_PROVIDERS_AWS_ENABLED=true export OTEL_LOGS_EXPORT=none export OTEL_METRICS_EXPORTER=none export OTEL_TRACES_EXPORTER=otlp @@ -218,6 +222,8 @@ resource "null_resource" "remote_service_setup" { # OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED=true \ export JAVA_TOOL_OPTIONS=' -javaagent:/home/ec2-user/adot.jar' + export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=false + export OTEL_RESOURCE_PROVIDERS_AWS_ENABLED=true export OTEL_LOGS_EXPORT=none export OTEL_METRICS_EXPORTER=none export OTEL_TRACES_EXPORTER=otlp diff --git a/terraform/java/k8s/deploy/main.tf b/terraform/java/k8s/deploy/main.tf index 7b364ec87..cc0c78a73 100644 --- a/terraform/java/k8s/deploy/main.tf +++ b/terraform/java/k8s/deploy/main.tf @@ -135,7 +135,10 @@ resource "null_resource" "deploy" { --docker-password="$${TOKEN}" yq eval '.spec.template.spec.imagePullSecrets += [{"name": "release-testing-ecr-secret"}]' -i frontend-service-depl.yaml - yq eval '.spec.template.spec.imagePullSecrets += [{"name": "release-testing-ecr-secret"}]' -i remote-service-depl.yaml + + service_part=$(yq eval 'select(.kind == "Service")' remote-service-depl.yaml) + yq eval 'select(.kind == "Deployment") | .spec.template.spec.imagePullSecrets += {"name": "release-testing-ecr-secret"}' -i remote-service-depl.yaml + echo -e "\n---\n$service_part" >> remote-service-depl.yaml fi echo "LOG: Applying sample app deployment files" diff --git a/terraform/java/lambda/lambda/layer_arns.tf b/terraform/java/lambda/lambda/layer_arns.tf index 531c2b80d..3714065bf 100644 --- a/terraform/java/lambda/lambda/layer_arns.tf +++ b/terraform/java/lambda/lambda/layer_arns.tf @@ -1,32 +1,32 @@ locals { sdk_layer_arns = { - "af-south-1" = "arn:aws:lambda:af-south-1:904233096616:layer:AWSOpenTelemetryDistroJava:3" - "ap-east-1" = "arn:aws:lambda:ap-east-1:888577020596:layer:AWSOpenTelemetryDistroJava:3" - "ap-northeast-1" = "arn:aws:lambda:ap-northeast-1:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "ap-northeast-2" = "arn:aws:lambda:ap-northeast-2:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "ap-northeast-3" = "arn:aws:lambda:ap-northeast-3:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "ap-south-1" = "arn:aws:lambda:ap-south-1:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "ap-south-2" = "arn:aws:lambda:ap-south-2:796973505492:layer:AWSOpenTelemetryDistroJava:3" - "ap-southeast-1" = "arn:aws:lambda:ap-southeast-1:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "ap-southeast-2" = "arn:aws:lambda:ap-southeast-2:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "ap-southeast-3" = "arn:aws:lambda:ap-southeast-3:039612877180:layer:AWSOpenTelemetryDistroJava:3" - "ap-southeast-4" = "arn:aws:lambda:ap-southeast-4:713881805771:layer:AWSOpenTelemetryDistroJava:3" - "ca-central-1" = "arn:aws:lambda:ca-central-1:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "eu-central-1" = "arn:aws:lambda:eu-central-1:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "eu-central-2" = "arn:aws:lambda:eu-central-2:156041407956:layer:AWSOpenTelemetryDistroJava:3" - "eu-north-1" = "arn:aws:lambda:eu-north-1:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "eu-south-1" = "arn:aws:lambda:eu-south-1:257394471194:layer:AWSOpenTelemetryDistroJava:3" - "eu-south-2" = "arn:aws:lambda:eu-south-2:490004653786:layer:AWSOpenTelemetryDistroJava:3" - "eu-west-1" = "arn:aws:lambda:eu-west-1:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "eu-west-2" = "arn:aws:lambda:eu-west-2:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "eu-west-3" = "arn:aws:lambda:eu-west-3:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "il-central-1" = "arn:aws:lambda:il-central-1:746669239226:layer:AWSOpenTelemetryDistroJava:3" - "me-central-1" = "arn:aws:lambda:me-central-1:739275441131:layer:AWSOpenTelemetryDistroJava:3" - "me-south-1" = "arn:aws:lambda:me-south-1:980921751758:layer:AWSOpenTelemetryDistroJava:3" - "sa-east-1" = "arn:aws:lambda:sa-east-1:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "us-east-1" = "arn:aws:lambda:us-east-1:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "us-east-2" = "arn:aws:lambda:us-east-2:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "us-west-1" = "arn:aws:lambda:us-west-1:615299751070:layer:AWSOpenTelemetryDistroJava:3" - "us-west-2" = "arn:aws:lambda:us-west-2:615299751070:layer:AWSOpenTelemetryDistroJava:3" + "af-south-1" = "arn:aws:lambda:af-south-1:904233096616:layer:AWSOpenTelemetryDistroJava:4" + "ap-east-1" = "arn:aws:lambda:ap-east-1:888577020596:layer:AWSOpenTelemetryDistroJava:4" + "ap-northeast-1" = "arn:aws:lambda:ap-northeast-1:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "ap-northeast-2" = "arn:aws:lambda:ap-northeast-2:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "ap-northeast-3" = "arn:aws:lambda:ap-northeast-3:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "ap-south-1" = "arn:aws:lambda:ap-south-1:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "ap-south-2" = "arn:aws:lambda:ap-south-2:796973505492:layer:AWSOpenTelemetryDistroJava:4" + "ap-southeast-1" = "arn:aws:lambda:ap-southeast-1:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "ap-southeast-2" = "arn:aws:lambda:ap-southeast-2:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "ap-southeast-3" = "arn:aws:lambda:ap-southeast-3:039612877180:layer:AWSOpenTelemetryDistroJava:4" + "ap-southeast-4" = "arn:aws:lambda:ap-southeast-4:713881805771:layer:AWSOpenTelemetryDistroJava:4" + "ca-central-1" = "arn:aws:lambda:ca-central-1:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "eu-central-1" = "arn:aws:lambda:eu-central-1:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "eu-central-2" = "arn:aws:lambda:eu-central-2:156041407956:layer:AWSOpenTelemetryDistroJava:4" + "eu-north-1" = "arn:aws:lambda:eu-north-1:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "eu-south-1" = "arn:aws:lambda:eu-south-1:257394471194:layer:AWSOpenTelemetryDistroJava:4" + "eu-south-2" = "arn:aws:lambda:eu-south-2:490004653786:layer:AWSOpenTelemetryDistroJava:4" + "eu-west-1" = "arn:aws:lambda:eu-west-1:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "eu-west-2" = "arn:aws:lambda:eu-west-2:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "eu-west-3" = "arn:aws:lambda:eu-west-3:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "il-central-1" = "arn:aws:lambda:il-central-1:746669239226:layer:AWSOpenTelemetryDistroJava:4" + "me-central-1" = "arn:aws:lambda:me-central-1:739275441131:layer:AWSOpenTelemetryDistroJava:4" + "me-south-1" = "arn:aws:lambda:me-south-1:980921751758:layer:AWSOpenTelemetryDistroJava:4" + "sa-east-1" = "arn:aws:lambda:sa-east-1:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "us-east-1" = "arn:aws:lambda:us-east-1:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "us-east-2" = "arn:aws:lambda:us-east-2:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "us-west-1" = "arn:aws:lambda:us-west-1:615299751070:layer:AWSOpenTelemetryDistroJava:4" + "us-west-2" = "arn:aws:lambda:us-west-2:615299751070:layer:AWSOpenTelemetryDistroJava:4" } } diff --git a/terraform/node/ec2/adot-sigv4/main.tf b/terraform/node/ec2/adot-sigv4/main.tf new file mode 100644 index 000000000..66751e123 --- /dev/null +++ b/terraform/node/ec2/adot-sigv4/main.tf @@ -0,0 +1,332 @@ +# ------------------------------------------------------------------------ +# 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" + } + } +} + +# Define the provider for AWS +provider "aws" {} + +resource "aws_default_vpc" "default" {} + +resource "tls_private_key" "ssh_key" { + algorithm = "RSA" + rsa_bits = 4096 +} + +resource "aws_key_pair" "aws_ssh_key" { + key_name = "instance_key-${var.test_id}" + public_key = tls_private_key.ssh_key.public_key_openssh +} + +locals { + ssh_key_name = aws_key_pair.aws_ssh_key.key_name + private_key_content = tls_private_key.ssh_key.private_key_pem +} + +data "aws_ami" "ami" { + owners = ["amazon"] + most_recent = true + filter { + name = "name" + values = ["al20*-ami-minimal-*-${var.cpu_architecture}"] + } + filter { + name = "state" + values = ["available"] + } + filter { + name = "architecture" + values = ["${var.cpu_architecture}"] + } + filter { + name = "image-type" + values = ["machine"] + } + + filter { + name = "root-device-name" + values = ["/dev/xvda"] + } + + filter { + name = "root-device-type" + values = ["ebs"] + } + + filter { + name = "virtualization-type" + values = ["hvm"] + } +} + +resource "aws_instance" "main_service_instance" { + ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier) + instance_type = var.cpu_architecture == "arm64" ? "t4g.small" : "t3.small" + key_name = local.ssh_key_name + iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE" + vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id] + associate_public_ip_address = true + instance_initiated_shutdown_behavior = "terminate" + + metadata_options { + http_tokens = "required" + } + + root_block_device { + volume_size = 5 + } + + tags = { + Name = "main-service-${var.test_id}" + } +} + +resource "null_resource" "main_service_setup" { + connection { + type = "ssh" + user = var.user + private_key = local.private_key_content + host = aws_instance.main_service_instance.public_ip + } + + provisioner "remote-exec" { + inline = [ + <<-EOF + #!/bin/bash + + # Set up environment + sudo yum install unzip wget tmux aws-cli -y + + # Install nvm + wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + + # Install the specified Node.js version, or use the system's version if 'none' + if [[ "${var.language_version}" != "none" ]]; then + nvm install ${var.language_version} + nvm use ${var.language_version} + else + sudo yum install nodejs -y + echo "Using the default Node.js version provided by the OS" + fi + + echo "Node version in use: $(node -v)" + + # enable ec2 instance connect for debug + sudo yum install ec2-instance-connect -y + + # Get and run the sample application with configuration + aws s3 cp ${var.sample_app_zip} ./node-sample-app.zip + unzip -o node-sample-app.zip + + # Enter appropriate service folder + cd frontend-service + + # Install sample application + npm install + + # Get ADOT instrumentation and install it + ${var.get_adot_instrumentation_command} + + # Set up application tmux screen so it keeps running after closing the SSH connection + tmux new-session -d -s frontend + + # Export environment variables for instrumentation + # Note: We use OTEL_NODE_DISABLED_INSTRUMENTATIONS=fs,dns,express to avoid + # having to validate around the telemetry generated for middleware + tmux send-keys -t frontend 'export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=false' C-m + tmux send-keys -t frontend 'export OTEL_LOGS_EXPORTER=none' C-m + tmux send-keys -t frontend 'export OTEL_METRICS_EXPORTER=none' C-m + tmux send-keys -t frontend 'export OTEL_TRACES_EXPORTER=otlp' C-m + tmux send-keys -t frontend 'export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf' C-m + tmux send-keys -t frontend 'export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray.${var.aws_region}.amazonaws.com/v1/traces' C-m + tmux send-keys -t frontend 'export OTEL_NODE_DISABLED_INSTRUMENTATIONS=fs,dns,express' C-m + tmux send-keys -t frontend 'export OTEL_SERVICE_NAME=node-sample-application-${var.test_id}' C-m + tmux send-keys -t frontend 'export OTEL_TRACES_SAMPLER=always_on' C-m + tmux send-keys -t frontend 'node --require "@aws/aws-distro-opentelemetry-node-autoinstrumentation/register" index.js' C-m + + # Check if the application is up. If it is not up, then exit 1. + attempt_counter=0 + max_attempts=30 + until $(curl --output /dev/null --silent --head --fail --max-time 5 $(echo "http://localhost:8000/healthcheck" | tr -d '"')); do + if [ $attempt_counter -eq $max_attempts ];then + echo "Failed to connect to endpoint." + exit 1 + fi + echo "Attempting to connect to the main endpoint. Tried $attempt_counter out of $max_attempts" + attempt_counter=$(($attempt_counter+1)) + sleep 10 + done + + echo "Successfully connected to main endpoint" + + EOF + ] + } + + depends_on = [aws_instance.main_service_instance] +} + +resource "aws_instance" "remote_service_instance" { + ami = data.aws_ami.ami.id # Amazon Linux 2 (free tier) + instance_type = var.cpu_architecture == "arm64" ? "t4g.small" : "t3.small" + key_name = local.ssh_key_name + iam_instance_profile = "APP_SIGNALS_EC2_TEST_ROLE" + vpc_security_group_ids = [aws_default_vpc.default.default_security_group_id] + associate_public_ip_address = true + instance_initiated_shutdown_behavior = "terminate" + + metadata_options { + http_tokens = "required" + } + + root_block_device { + volume_size = 5 + } + + tags = { + Name = "remote-service-${var.test_id}" + } +} + +resource "null_resource" "remote_service_setup" { + connection { + type = "ssh" + user = var.user + private_key = local.private_key_content + host = aws_instance.remote_service_instance.public_ip + } + + provisioner "remote-exec" { + inline = [ + <<-EOF + #!/bin/bash + + # Set up environment + sudo yum install unzip wget tmux aws-cli -y + + # Install nvm + wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + + # Install the specified Node.js version, or use the system's version if 'none' + if [[ "${var.language_version}" != "none" ]]; then + nvm install ${var.language_version} + nvm use ${var.language_version} + else + sudo yum install nodejs -y + echo "Using the default Node.js version provided by the OS" + fi + + echo "Node version in use: $(node -v)" + + # enable ec2 instance connect for debug + sudo yum install ec2-instance-connect -y + + # Get and run the sample application with configuration + aws s3 cp ${var.sample_app_zip} ./node-sample-app.zip + unzip -o node-sample-app.zip + + # Enter appropriate service folder + cd remote-service + + # Install sample application + npm install + + # Get ADOT instrumentation and install it + ${var.get_adot_instrumentation_command} + + # Set up application tmux screen so it keeps running after closing the SSH connection + tmux new-session -d -s remote + + # Export environment variables for instrumentation + # Note: We use OTEL_NODE_DISABLED_INSTRUMENTATIONS=fs,dns,express to avoid + # having to validate around the telemetry generated for middleware + tmux send-keys -t remote 'export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=false' C-m + tmux send-keys -t remote 'export OTEL_LOGS_EXPORTER=none' C-m + tmux send-keys -t remote 'export OTEL_METRICS_EXPORTER=none' C-m + tmux send-keys -t remote 'export OTEL_TRACES_EXPORTER=otlp' C-m + tmux send-keys -t remote 'export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf' C-m + tmux send-keys -t remote 'export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray.${var.aws_region}.amazonaws.com/v1/traces' C-m + tmux send-keys -t remote 'export OTEL_NODE_DISABLED_INSTRUMENTATIONS=fs,dns,express' C-m + tmux send-keys -t remote 'export OTEL_SERVICE_NAME=node-sample-remote-application-${var.test_id}' C-m + tmux send-keys -t remote 'export OTEL_TRACES_SAMPLER=always_on' C-m + tmux send-keys -t remote 'node --require "@aws/aws-distro-opentelemetry-node-autoinstrumentation/register" index.js' C-m + + # The application needs time to come up and reach a steady state, this should not take longer than 30 seconds + # sleep 30 + + # Check if the application is up. If it is not up, then exit 1. + attempt_counter=0 + max_attempts=30 + until $(curl --output /dev/null --silent --head --fail --max-time 5 $(echo "http://localhost:8001/healthcheck" | tr -d '"')); do + if [ $attempt_counter -eq $max_attempts ];then + echo "Failed to connect to endpoint." + exit 1 + fi + echo "Attempting to connect to the remote endpoint. Tried $attempt_counter out of $max_attempts" + attempt_counter=$(($attempt_counter+1)) + sleep 10 + done + + echo "Successfully connected to remote endpoint" + + EOF + ] + } + + depends_on = [aws_instance.remote_service_instance] +} + +resource "null_resource" "traffic_generator_setup" { + connection { + type = "ssh" + user = var.user + private_key = local.private_key_content + host = aws_instance.main_service_instance.public_ip + } + + provisioner "remote-exec" { + inline = [ + <<-EOF + # Bring in the traffic generator files to EC2 Instance + aws s3 cp s3://aws-appsignals-sample-app-prod-us-east-1/traffic-generator.zip ./traffic-generator.zip + unzip ./traffic-generator.zip -d ./ + + # Install the traffic generator dependencies + npm install + + tmux new -s traffic-generator -d + tmux send-keys -t traffic-generator "export MAIN_ENDPOINT=\"localhost:8000\"" C-m + tmux send-keys -t traffic-generator "export REMOTE_ENDPOINT=\"${aws_instance.remote_service_instance.private_ip}\"" C-m + tmux send-keys -t traffic-generator "export ID=\"${var.test_id}\"" C-m + tmux send-keys -t traffic-generator "npm start" C-m + + echo "Completed traffic generator set up commands" + + EOF + ] + } + + depends_on = [null_resource.main_service_setup, null_resource.remote_service_setup] +} diff --git a/terraform/node/ec2/adot-sigv4/output.tf b/terraform/node/ec2/adot-sigv4/output.tf new file mode 100644 index 000000000..be572868a --- /dev/null +++ b/terraform/node/ec2/adot-sigv4/output.tf @@ -0,0 +1,26 @@ +# ------------------------------------------------------------------------ +# 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. +# ------------------------------------------------------------------------- + +output "sample_app_remote_service_private_ip" { + value = aws_instance.remote_service_instance.private_ip +} + +output "main_service_instance_id" { + value = aws_instance.main_service_instance.id +} + +output "ec2_instance_ami" { + value = data.aws_ami.ami.id +} \ No newline at end of file diff --git a/terraform/node/ec2/adot-sigv4/variables.tf b/terraform/node/ec2/adot-sigv4/variables.tf new file mode 100644 index 000000000..da3a28050 --- /dev/null +++ b/terraform/node/ec2/adot-sigv4/variables.tf @@ -0,0 +1,48 @@ +# ------------------------------------------------------------------------ +# 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 "aws_region" { + default = "" +} + +variable "user" { + default = "ec2-user" +} + +variable "cpu_architecture" { + default = "x86_64" # an alternative value is "arm64" +} + +variable "language_version" { + # none means to use the version packaged with the OS + # other alternatives are "14", "16", "18", "20", "22" + default = "none" +} + +variable "sample_app_zip" { + default = "s3:///" +} + +variable "get_adot_instrumentation_command" { + default = " && " +} + +variable "canary_type" { + default = "node-ec2-default" +} \ No newline at end of file diff --git a/terraform/node/k8s/deploy/main.tf b/terraform/node/k8s/deploy/main.tf index 4f15f99ba..4d4deb5dd 100644 --- a/terraform/node/k8s/deploy/main.tf +++ b/terraform/node/k8s/deploy/main.tf @@ -137,7 +137,10 @@ resource "null_resource" "deploy" { --docker-password="$${TOKEN}" yq eval '.spec.template.spec.imagePullSecrets += [{"name": "release-testing-ecr-secret"}]' -i frontend-service-depl.yaml - yq eval '.spec.template.spec.imagePullSecrets += [{"name": "release-testing-ecr-secret"}]' -i remote-service-depl.yaml + + service_part=$(yq eval 'select(.kind == "Service")' remote-service-depl.yaml) + yq eval 'select(.kind == "Deployment") | .spec.template.spec.imagePullSecrets += {"name": "release-testing-ecr-secret"}' -i remote-service-depl.yaml + echo -e "\n---\n$service_part" >> remote-service-depl.yaml fi echo "LOG: Applying sample app deployment files" diff --git a/terraform/node/lambda/lambda/layer_arns.tf b/terraform/node/lambda/lambda/layer_arns.tf index 25d5f44d3..83a592b2f 100644 --- a/terraform/node/lambda/lambda/layer_arns.tf +++ b/terraform/node/lambda/lambda/layer_arns.tf @@ -1,32 +1,32 @@ locals { sdk_layer_arns_amd64 = { - "af-south-1" = "arn:aws:lambda:af-south-1:904233096616:layer:AWSOpenTelemetryDistroJs:6" - "ap-east-1" = "arn:aws:lambda:ap-east-1:888577020596:layer:AWSOpenTelemetryDistroJs:6" - "ap-northeast-1" = "arn:aws:lambda:ap-northeast-1:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "ap-northeast-2" = "arn:aws:lambda:ap-northeast-2:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "ap-northeast-3" = "arn:aws:lambda:ap-northeast-3:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "ap-south-1" = "arn:aws:lambda:ap-south-1:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "ap-south-2" = "arn:aws:lambda:ap-south-2:796973505492:layer:AWSOpenTelemetryDistroJs:6" - "ap-southeast-1" = "arn:aws:lambda:ap-southeast-1:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "ap-southeast-2" = "arn:aws:lambda:ap-southeast-2:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "ap-southeast-3" = "arn:aws:lambda:ap-southeast-3:039612877180:layer:AWSOpenTelemetryDistroJs:6" - "ap-southeast-4" = "arn:aws:lambda:ap-southeast-4:713881805771:layer:AWSOpenTelemetryDistroJs:6" - "ca-central-1" = "arn:aws:lambda:ca-central-1:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "eu-central-1" = "arn:aws:lambda:eu-central-1:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "eu-central-2" = "arn:aws:lambda:eu-central-2:156041407956:layer:AWSOpenTelemetryDistroJs:6" - "eu-north-1" = "arn:aws:lambda:eu-north-1:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "eu-south-1" = "arn:aws:lambda:eu-south-1:257394471194:layer:AWSOpenTelemetryDistroJs:6" - "eu-south-2" = "arn:aws:lambda:eu-south-2:490004653786:layer:AWSOpenTelemetryDistroJs:6" - "eu-west-1" = "arn:aws:lambda:eu-west-1:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "eu-west-2" = "arn:aws:lambda:eu-west-2:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "eu-west-3" = "arn:aws:lambda:eu-west-3:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "il-central-1" = "arn:aws:lambda:il-central-1:746669239226:layer:AWSOpenTelemetryDistroJs:6" - "me-central-1" = "arn:aws:lambda:me-central-1:739275441131:layer:AWSOpenTelemetryDistroJs:6" - "me-south-1" = "arn:aws:lambda:me-south-1:980921751758:layer:AWSOpenTelemetryDistroJs:6" - "sa-east-1" = "arn:aws:lambda:sa-east-1:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "us-east-1" = "arn:aws:lambda:us-east-1:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "us-east-2" = "arn:aws:lambda:us-east-2:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "us-west-1" = "arn:aws:lambda:us-west-1:615299751070:layer:AWSOpenTelemetryDistroJs:6" - "us-west-2" = "arn:aws:lambda:us-west-2:615299751070:layer:AWSOpenTelemetryDistroJs:6" + "af-south-1" = "arn:aws:lambda:af-south-1:904233096616:layer:AWSOpenTelemetryDistroJs:7" + "ap-east-1" = "arn:aws:lambda:ap-east-1:888577020596:layer:AWSOpenTelemetryDistroJs:7" + "ap-northeast-1" = "arn:aws:lambda:ap-northeast-1:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "ap-northeast-2" = "arn:aws:lambda:ap-northeast-2:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "ap-northeast-3" = "arn:aws:lambda:ap-northeast-3:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "ap-south-1" = "arn:aws:lambda:ap-south-1:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "ap-south-2" = "arn:aws:lambda:ap-south-2:796973505492:layer:AWSOpenTelemetryDistroJs:7" + "ap-southeast-1" = "arn:aws:lambda:ap-southeast-1:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "ap-southeast-2" = "arn:aws:lambda:ap-southeast-2:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "ap-southeast-3" = "arn:aws:lambda:ap-southeast-3:039612877180:layer:AWSOpenTelemetryDistroJs:7" + "ap-southeast-4" = "arn:aws:lambda:ap-southeast-4:713881805771:layer:AWSOpenTelemetryDistroJs:7" + "ca-central-1" = "arn:aws:lambda:ca-central-1:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "eu-central-1" = "arn:aws:lambda:eu-central-1:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "eu-central-2" = "arn:aws:lambda:eu-central-2:156041407956:layer:AWSOpenTelemetryDistroJs:7" + "eu-north-1" = "arn:aws:lambda:eu-north-1:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "eu-south-1" = "arn:aws:lambda:eu-south-1:257394471194:layer:AWSOpenTelemetryDistroJs:7" + "eu-south-2" = "arn:aws:lambda:eu-south-2:490004653786:layer:AWSOpenTelemetryDistroJs:7" + "eu-west-1" = "arn:aws:lambda:eu-west-1:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "eu-west-2" = "arn:aws:lambda:eu-west-2:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "eu-west-3" = "arn:aws:lambda:eu-west-3:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "il-central-1" = "arn:aws:lambda:il-central-1:746669239226:layer:AWSOpenTelemetryDistroJs:7" + "me-central-1" = "arn:aws:lambda:me-central-1:739275441131:layer:AWSOpenTelemetryDistroJs:7" + "me-south-1" = "arn:aws:lambda:me-south-1:980921751758:layer:AWSOpenTelemetryDistroJs:7" + "sa-east-1" = "arn:aws:lambda:sa-east-1:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "us-east-1" = "arn:aws:lambda:us-east-1:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "us-east-2" = "arn:aws:lambda:us-east-2:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "us-west-1" = "arn:aws:lambda:us-west-1:615299751070:layer:AWSOpenTelemetryDistroJs:7" + "us-west-2" = "arn:aws:lambda:us-west-2:615299751070:layer:AWSOpenTelemetryDistroJs:7" } } diff --git a/terraform/python/k8s/deploy/main.tf b/terraform/python/k8s/deploy/main.tf index 6acdf9dfe..4b99ef51f 100644 --- a/terraform/python/k8s/deploy/main.tf +++ b/terraform/python/k8s/deploy/main.tf @@ -136,7 +136,10 @@ resource "null_resource" "deploy" { --docker-password="$${TOKEN}" yq eval '.spec.template.spec.imagePullSecrets += [{"name": "release-testing-ecr-secret"}]' -i python-frontend-service-depl.yaml - yq eval '.spec.template.spec.imagePullSecrets += [{"name": "release-testing-ecr-secret"}]' -i python-remote-service-depl.yaml + + service_part=$(yq eval 'select(.kind == "Service")' python-remote-service-depl.yaml) + yq eval 'select(.kind == "Deployment") | .spec.template.spec.imagePullSecrets += {"name": "release-testing-ecr-secret"}' -i python-remote-service-depl.yaml + echo -e "\n---\n$service_part" >> python-remote-service-depl.yaml fi echo "LOG: Applying sample app deployment files" diff --git a/terraform/python/lambda/lambda/layer_arns.tf b/terraform/python/lambda/lambda/layer_arns.tf index 383b55e69..6454de4f7 100644 --- a/terraform/python/lambda/lambda/layer_arns.tf +++ b/terraform/python/lambda/lambda/layer_arns.tf @@ -1,32 +1,32 @@ locals { sdk_layer_arns_amd64 = { - "af-south-1" = "arn:aws:lambda:af-south-1:904233096616:layer:AWSOpenTelemetryDistroPython:6" - "ap-east-1" = "arn:aws:lambda:ap-east-1:888577020596:layer:AWSOpenTelemetryDistroPython:6" - "ap-northeast-1" = "arn:aws:lambda:ap-northeast-1:615299751070:layer:AWSOpenTelemetryDistroPython:9" - "ap-northeast-2" = "arn:aws:lambda:ap-northeast-2:615299751070:layer:AWSOpenTelemetryDistroPython:9" - "ap-northeast-3" = "arn:aws:lambda:ap-northeast-3:615299751070:layer:AWSOpenTelemetryDistroPython:8" - "ap-south-1" = "arn:aws:lambda:ap-south-1:615299751070:layer:AWSOpenTelemetryDistroPython:9" - "ap-south-2" = "arn:aws:lambda:ap-south-2:796973505492:layer:AWSOpenTelemetryDistroPython:6" - "ap-southeast-1" = "arn:aws:lambda:ap-southeast-1:615299751070:layer:AWSOpenTelemetryDistroPython:8" - "ap-southeast-2" = "arn:aws:lambda:ap-southeast-2:615299751070:layer:AWSOpenTelemetryDistroPython:9" - "ap-southeast-3" = "arn:aws:lambda:ap-southeast-3:039612877180:layer:AWSOpenTelemetryDistroPython:6" - "ap-southeast-4" = "arn:aws:lambda:ap-southeast-4:713881805771:layer:AWSOpenTelemetryDistroPython:6" - "ca-central-1" = "arn:aws:lambda:ca-central-1:615299751070:layer:AWSOpenTelemetryDistroPython:9" - "eu-central-1" = "arn:aws:lambda:eu-central-1:615299751070:layer:AWSOpenTelemetryDistroPython:9" - "eu-central-2" = "arn:aws:lambda:eu-central-2:156041407956:layer:AWSOpenTelemetryDistroPython:6" - "eu-north-1" = "arn:aws:lambda:eu-north-1:615299751070:layer:AWSOpenTelemetryDistroPython:9" - "eu-south-1" = "arn:aws:lambda:eu-south-1:257394471194:layer:AWSOpenTelemetryDistroPython:6" - "eu-south-2" = "arn:aws:lambda:eu-south-2:490004653786:layer:AWSOpenTelemetryDistroPython:6" - "eu-west-1" = "arn:aws:lambda:eu-west-1:615299751070:layer:AWSOpenTelemetryDistroPython:9" - "eu-west-2" = "arn:aws:lambda:eu-west-2:615299751070:layer:AWSOpenTelemetryDistroPython:9" - "eu-west-3" = "arn:aws:lambda:eu-west-3:615299751070:layer:AWSOpenTelemetryDistroPython:9" - "il-central-1" = "arn:aws:lambda:il-central-1:746669239226:layer:AWSOpenTelemetryDistroPython:6" - "me-central-1" = "arn:aws:lambda:me-central-1:739275441131:layer:AWSOpenTelemetryDistroPython:6" - "me-south-1" = "arn:aws:lambda:me-south-1:980921751758:layer:AWSOpenTelemetryDistroPython:6" - "sa-east-1" = "arn:aws:lambda:sa-east-1:615299751070:layer:AWSOpenTelemetryDistroPython:9" - "us-east-1" = "arn:aws:lambda:us-east-1:615299751070:layer:AWSOpenTelemetryDistroPython:12" - "us-east-2" = "arn:aws:lambda:us-east-2:615299751070:layer:AWSOpenTelemetryDistroPython:9" - "us-west-1" = "arn:aws:lambda:us-west-1:615299751070:layer:AWSOpenTelemetryDistroPython:16" - "us-west-2" = "arn:aws:lambda:us-west-2:615299751070:layer:AWSOpenTelemetryDistroPython:16" + "af-south-1" = "arn:aws:lambda:af-south-1:904233096616:layer:AWSOpenTelemetryDistroPython:8" + "ap-east-1" = "arn:aws:lambda:ap-east-1:888577020596:layer:AWSOpenTelemetryDistroPython:8" + "ap-northeast-1" = "arn:aws:lambda:ap-northeast-1:615299751070:layer:AWSOpenTelemetryDistroPython:11" + "ap-northeast-2" = "arn:aws:lambda:ap-northeast-2:615299751070:layer:AWSOpenTelemetryDistroPython:11" + "ap-northeast-3" = "arn:aws:lambda:ap-northeast-3:615299751070:layer:AWSOpenTelemetryDistroPython:10" + "ap-south-1" = "arn:aws:lambda:ap-south-1:615299751070:layer:AWSOpenTelemetryDistroPython:11" + "ap-south-2" = "arn:aws:lambda:ap-south-2:796973505492:layer:AWSOpenTelemetryDistroPython:8" + "ap-southeast-1" = "arn:aws:lambda:ap-southeast-1:615299751070:layer:AWSOpenTelemetryDistroPython:10" + "ap-southeast-2" = "arn:aws:lambda:ap-southeast-2:615299751070:layer:AWSOpenTelemetryDistroPython:11" + "ap-southeast-3" = "arn:aws:lambda:ap-southeast-3:039612877180:layer:AWSOpenTelemetryDistroPython:8" + "ap-southeast-4" = "arn:aws:lambda:ap-southeast-4:713881805771:layer:AWSOpenTelemetryDistroPython:8" + "ca-central-1" = "arn:aws:lambda:ca-central-1:615299751070:layer:AWSOpenTelemetryDistroPython:11" + "eu-central-1" = "arn:aws:lambda:eu-central-1:615299751070:layer:AWSOpenTelemetryDistroPython:11" + "eu-central-2" = "arn:aws:lambda:eu-central-2:156041407956:layer:AWSOpenTelemetryDistroPython:8" + "eu-north-1" = "arn:aws:lambda:eu-north-1:615299751070:layer:AWSOpenTelemetryDistroPython:11" + "eu-south-1" = "arn:aws:lambda:eu-south-1:257394471194:layer:AWSOpenTelemetryDistroPython:8" + "eu-south-2" = "arn:aws:lambda:eu-south-2:490004653786:layer:AWSOpenTelemetryDistroPython:8" + "eu-west-1" = "arn:aws:lambda:eu-west-1:615299751070:layer:AWSOpenTelemetryDistroPython:11" + "eu-west-2" = "arn:aws:lambda:eu-west-2:615299751070:layer:AWSOpenTelemetryDistroPython:11" + "eu-west-3" = "arn:aws:lambda:eu-west-3:615299751070:layer:AWSOpenTelemetryDistroPython:11" + "il-central-1" = "arn:aws:lambda:il-central-1:746669239226:layer:AWSOpenTelemetryDistroPython:8" + "me-central-1" = "arn:aws:lambda:me-central-1:739275441131:layer:AWSOpenTelemetryDistroPython:8" + "me-south-1" = "arn:aws:lambda:me-south-1:980921751758:layer:AWSOpenTelemetryDistroPython:8" + "sa-east-1" = "arn:aws:lambda:sa-east-1:615299751070:layer:AWSOpenTelemetryDistroPython:11" + "us-east-1" = "arn:aws:lambda:us-east-1:615299751070:layer:AWSOpenTelemetryDistroPython:14" + "us-east-2" = "arn:aws:lambda:us-east-2:615299751070:layer:AWSOpenTelemetryDistroPython:11" + "us-west-1" = "arn:aws:lambda:us-west-1:615299751070:layer:AWSOpenTelemetryDistroPython:18" + "us-west-2" = "arn:aws:lambda:us-west-2:615299751070:layer:AWSOpenTelemetryDistroPython:18" } } 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 b68e05f94..e2476cc03 100644 --- a/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java +++ b/validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java @@ -323,6 +323,26 @@ public enum PredefinedExpectedTemplate implements FileConfig { DOTNET_EC2_ASG_CLIENT_CALL_METRIC("/expected-data-template/dotnet/ec2/asg/client-call-metric.mustache"), DOTNET_EC2_ASG_CLIENT_CALL_TRACE("/expected-data-template/dotnet/ec2/asg/client-call-trace.mustache"), + /** Python EC2 ADOT SigV4 (Stand Alone ADOT) Test Case Validations */ + DOTNET_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_LOG( + "/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-log.mustache"), + DOTNET_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_METRIC( + "/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-metric.mustache"), + DOTNET_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_TRACE( + "/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-trace.mustache"), + + DOTNET_EC2_ADOT_SIGV4_AWS_SDK_CALL_LOG("/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-log.mustache"), + DOTNET_EC2_ADOT_SIGV4_AWS_SDK_CALL_METRIC("/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-metric.mustache"), + DOTNET_EC2_ADOT_SIGV4_AWS_SDK_CALL_TRACE("/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-trace.mustache"), + + DOTNET_EC2_ADOT_SIGV4_REMOTE_SERVICE_LOG("/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-log.mustache"), + DOTNET_EC2_ADOT_SIGV4_REMOTE_SERVICE_METRIC("/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-metric.mustache"), + DOTNET_EC2_ADOT_SIGV4_REMOTE_SERVICE_TRACE("/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-trace.mustache"), + + DOTNET_EC2_ADOT_SIGV4_CLIENT_CALL_LOG("/expected-data-template/dotnet/ec2/adot-sigv4/client-call-log.mustache"), + DOTNET_EC2_ADOT_SIGV4_CLIENT_CALL_METRIC("/expected-data-template/dotnet/ec2/adot-sigv4/client-call-metric.mustache"), + DOTNET_EC2_ADOT_SIGV4_CLIENT_CALL_TRACE("/expected-data-template/dotnet/ec2/adot-sigv4/client-call-trace.mustache"), + /** DotNet K8s Test Case Validations */ DOTNET_K8S_OUTGOING_HTTP_CALL_LOG("/expected-data-template/dotnet/k8s/outgoing-http-call-log.mustache"), DOTNET_K8S_OUTGOING_HTTP_CALL_METRIC("/expected-data-template/dotnet/k8s/outgoing-http-call-metric.mustache"), @@ -426,6 +446,26 @@ public enum PredefinedExpectedTemplate implements FileConfig { NODE_K8S_CLIENT_CALL_METRIC("/expected-data-template/node/k8s/client-call-metric.mustache"), NODE_K8S_CLIENT_CALL_TRACE("/expected-data-template/node/k8s/client-call-trace.mustache"), + /** Python EC2 ADOT SigV4 (Stand Alone ADOT) Test Case Validations */ + NODE_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_LOG( + "/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-log.mustache"), + NODE_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_METRIC( + "/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-metric.mustache"), + NODE_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_TRACE( + "/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-trace.mustache"), + + NODE_EC2_ADOT_SIGV4_AWS_SDK_CALL_LOG("/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-log.mustache"), + NODE_EC2_ADOT_SIGV4_AWS_SDK_CALL_METRIC("/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-metric.mustache"), + NODE_EC2_ADOT_SIGV4_AWS_SDK_CALL_TRACE("/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-trace.mustache"), + + NODE_EC2_ADOT_SIGV4_REMOTE_SERVICE_LOG("/expected-data-template/node/ec2/adot-sigv4/remote-service-log.mustache"), + NODE_EC2_ADOT_SIGV4_REMOTE_SERVICE_METRIC("/expected-data-template/node/ec2/adot-sigv4/remote-service-metric.mustache"), + NODE_EC2_ADOT_SIGV4_REMOTE_SERVICE_TRACE("/expected-data-template/node/ec2/adot-sigv4/remote-service-trace.mustache"), + + NODE_EC2_ADOT_SIGV4_CLIENT_CALL_LOG("/expected-data-template/node/ec2/adot-sigv4/client-call-log.mustache"), + NODE_EC2_ADOT_SIGV4_CLIENT_CALL_METRIC("/expected-data-template/node/ec2/adot-sigv4/client-call-metric.mustache"), + NODE_EC2_ADOT_SIGV4_CLIENT_CALL_TRACE("/expected-data-template/node/ec2/adot-sigv4/client-call-trace.mustache"), + /** Node ECS Test Case Validations */ NODE_ECS_HC_CALL_LOG("/expected-data-template/node/ecs/hc-log.mustache"), NODE_ECS_HC_CALL_METRIC("/expected-data-template/node/ecs/hc-metric.mustache"), diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-log.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-log.mustache new file mode 100644 index 000000000..5a6963fb3 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-log.mustache @@ -0,0 +1,51 @@ +[{ + "name": "GET aws-sdk-call", + "kind": "SERVER", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET aws-sdk-call", + "aws.span.kind": "LOCAL_ROOT", + "url.query": "^\\?ip=Redacted&testingId=Redacted$", + "http.route": "aws-sdk-call", + "http.request.method": "GET", + "PlatformType": "AWS::EC2" + } +}, +{ + "name": "S3.GetBucketLocation", + "kind": "CLIENT", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "UnmappedOperation", + "aws.remote.service": "AWS::S3", + "aws.remote.operation": "GetBucketLocation", + "aws.local.environment": "ec2:default", + "aws.service": "S3", + "aws.operation": "GetBucketLocation", + "aws.s3.bucket": "{{testingId}}", + "aws.span.kind": "CLIENT", + "aws.region": "{{region}}", + "PlatformType": "AWS::EC2" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-metric.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-metric.mustache new file mode 100644 index 000000000..92e8104d3 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-metric.mustache @@ -0,0 +1,227 @@ +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-trace.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-trace.mustache new file mode 100644 index 000000000..a24e147d9 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/aws-sdk-call-trace.mustache @@ -0,0 +1,64 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "method": "^GET$" + } + }, + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET aws-sdk-call$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET aws-sdk-call$", + "span.kind": "^SERVER$" + }, + "metadata": { + "url.query": "^\\?ip=Redacted&testingId=Redacted$", + "http.request.method": "^GET$", + "http.route": "^aws-sdk-call$", + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$", + "PlatformType": "^AWS::EC2$" + }, + "subsegments": [ + { + "name": "^S3$", + "aws": { + "bucket_name": "^{{testingId}}$", + "s3.bucket": "^{{testingId}}$", + "span.kind": "^CLIENT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^AWS::S3$", + "aws.remote.operation": "^GetBucketLocation$", + "aws.local.environment": "^ec2:default$", + "span.name": "^S3.GetBucketLocation$", + "span.kind": "^CLIENT$" + }, + "namespace": "^aws$" + } + ] +}, +{ + "name": "^S3$", + "aws": { + "bucket_name": "^{{testingId}}$", + "s3.bucket": "^{{testingId}}$", + "span.kind": "^CLIENT$" + }, + "annotations": { + "aws.local.service": "^AWS::S3$", + "aws.local.operation": "^GetBucketLocation$" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/client-call-log.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/client-call-log.mustache new file mode 100644 index 000000000..ffbb712c5 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/client-call-log.mustache @@ -0,0 +1,48 @@ +[{ + "name": "GET client-call", + "kind": "SERVER", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET client-call", + "aws.span.kind": "LOCAL_ROOT", + "http.route": "client-call", + "http.request.method": "GET", + "PlatformType": "AWS::EC2" + } +}, +{ + "name": "GET", + "kind": "CLIENT", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "InternalOperation", + "aws.remote.service": "local-root-client-call:80", + "aws.remote.operation": "GET /", + "aws.local.environment": "ec2:default", + "aws.span.kind": "LOCAL_ROOT", + "url.full": "http://local-root-client-call/", + "http.request.method": "GET", + "PlatformType": "AWS::EC2" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/client-call-metric.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/client-call-metric.mustache new file mode 100644 index 000000000..85ed2565c --- /dev/null +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/client-call-metric.mustache @@ -0,0 +1,227 @@ +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call:80 + - + name: RemoteOperation + value: GET / + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call:80 + - + name: RemoteOperation + value: GET / + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call:80 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call:80 + - + name: RemoteOperation + value: GET / + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call:80 + - + name: RemoteOperation + value: GET / + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call:80 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call:80 + - + name: RemoteOperation + value: GET / + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call:80 + - + name: RemoteOperation + value: GET / + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call:80 \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/client-call-trace.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/client-call-trace.mustache new file mode 100644 index 000000000..5681d1868 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/client-call-trace.mustache @@ -0,0 +1,70 @@ +[{ + "name": "^{{serviceName}}$", + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^InternalOperation$", + "aws.local.environment": "^ec2:default$", + "span.name": "^InternalOperation$", + "span.kind": "^SERVER$" + }, + "metadata": { + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$" + }, + "subsegments": [ + { + "name": "^local-root-client-call:80$", + "http": { + "request": { + "method": "^GET$" + } + }, + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^InternalOperation$", + "aws.remote.service": "^local-root-client-call:80$", + "aws.remote.operation": "GET /", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^CLIENT$" + }, + "metadata": { + "service.name": "^{{serviceName}}$", + "url.full": "^http://local-root-client-call/$", + "http.request.method": "^GET$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$" + }, + "namespace": "^remote$" + } + ] +}, +{ + "name": "^local-root-client-call:80$", + "http": { + "request": { + "url": "^http://local-root-client-call/$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^local-root-client-call:80$", + "aws.local.operation": "^GET /$" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-log.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-log.mustache new file mode 100644 index 000000000..7836783f4 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-log.mustache @@ -0,0 +1,48 @@ +[{ + "name": "GET outgoing-http-call", + "kind": "SERVER", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET outgoing-http-call", + "aws.span.kind": "LOCAL_ROOT", + "http.route": "outgoing-http-call", + "http.request.method": "GET", + "PlatformType": "AWS::EC2" + } +}, +{ + "name": "GET", + "kind": "CLIENT", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "UnmappedOperation", + "aws.remote.service": "aws.amazon.com:443", + "aws.remote.operation": "GET /", + "aws.local.environment": "ec2:default", + "aws.span.kind": "CLIENT", + "url.full": "https://aws.amazon.com/", + "http.request.method": "GET", + "PlatformType": "AWS::EC2" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-metric.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-metric.mustache new file mode 100644 index 000000000..b8dae9528 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/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: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: aws.amazon.com:443 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: aws.amazon.com:443 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: aws.amazon.com:443 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET outgoing-http-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: aws.amazon.com:443 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: aws.amazon.com:443 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: aws.amazon.com:443 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET outgoing-http-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: aws.amazon.com:443 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: aws.amazon.com:443 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: aws.amazon.com:443 diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-trace.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-trace.mustache new file mode 100644 index 000000000..d9f44e2b4 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/outgoing-http-call-trace.mustache @@ -0,0 +1,55 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "method": "^GET$" + } + }, + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET outgoing-http-call$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET outgoing-http-call$", + "span.kind": "^SERVER$" + }, + "metadata": { + "http.request.method": "^GET$", + "http.route": "^outgoing-http-call$", + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$", + "PlatformType": "^AWS::EC2$" + }, + "subsegments": [ + { + "name": "^aws.amazon.com:443$", + "http": { + "request": { + "url": "^https://aws.amazon.com/$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^aws.amazon.com:443$", + "aws.remote.operation": "^GET /$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^CLIENT$" + }, + "namespace": "^remote$" + } + ] +}, +{ + "name": "^aws.amazon.com:443$" +}] diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-log.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-log.mustache new file mode 100644 index 000000000..9f84036e7 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-log.mustache @@ -0,0 +1,48 @@ +[{ + "name": "GET remote-service", + "kind": "SERVER", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET remote-service", + "aws.span.kind": "LOCAL_ROOT", + "http.route": "remote-service", + "http.request.method": "GET", + "PlatformType": "AWS::EC2" + } +}, +{ + "name": "GET", + "kind": "CLIENT", + "resource": { + "attributes": { + "aws.local.service": "{{serviceName}}", + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "UnmappedOperation", + "aws.remote.service": "{{remoteServiceDeploymentName}}", + "aws.remote.operation": "GET /healthcheck", + "aws.local.environment": "ec2:default", + "aws.span.kind": "CLIENT", + "url.full": "http://{{remoteServiceDeploymentName}}/healthcheck", + "http.request.method": "GET", + "PlatformType": "AWS::EC2" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-metric.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-metric.mustache new file mode 100644 index 000000000..0d3714f71 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/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: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: ec2:default + - + name: Operation + value: GET healthcheck + - + name: Service + value: {{remoteServiceName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: ec2:default + - + name: Operation + value: GET healthcheck + - + name: Service + value: {{remoteServiceName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: ec2:default + - + name: Operation + value: GET healthcheck + - + name: Service + value: {{remoteServiceName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceDeploymentName}} diff --git a/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-trace.mustache b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-trace.mustache new file mode 100644 index 000000000..1e304d6c1 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/dotnet/ec2/adot-sigv4/remote-service-trace.mustache @@ -0,0 +1,67 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "method": "^GET$" + } + }, + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET remote-service$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET remote-service$", + "span.kind": "^SERVER$" + }, + "metadata": { + "url.query": "^\\?ip=Redacted&testingId=Redacted$", + "http.request.method": "^GET$", + "http.route": "^remote-service$", + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$", + "PlatformType": "^AWS::EC2$" + }, + "subsegments": [ + { + "name": "^{{remoteServiceDeploymentName}}$", + "http": { + "request": { + "url": "^http://{{remoteServiceDeploymentName}}/healthcheck$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^{{remoteServiceDeploymentName}}$", + "aws.remote.operation": "^GET /healthcheck$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^CLIENT$" + }, + "namespace": "^remote$" + } + ] +}, +{ + "name": "^{{remoteServiceName}}$", + "http": { + "request": { + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{remoteServiceName}}$", + "aws.local.operation": "^GET healthcheck$" + } +}] + + diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-log.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-log.mustache index a9c944359..53af6d5e7 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-log.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-log.mustache @@ -1,9 +1,8 @@ [{ - "name": "GET aws-sdk-call", + "name": "GET /aws-sdk-call", "kind": "SERVER", "resource": { "attributes": { - "aws.local.service": "{{serviceName}}", "service.name": "{{serviceName}}", "cloud.provider": "aws", "cloud.region": "{{region}}", @@ -14,11 +13,14 @@ "attributes": { "aws.local.service": "{{serviceName}}", "aws.local.environment": "ec2:default", - "aws.local.operation": "GET aws-sdk-call", + "aws.local.operation": "GET /aws-sdk-call", "aws.span.kind": "LOCAL_ROOT", - "http.url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", - "http.route": "aws-sdk-call", - "http.method": "GET", + "url.scheme": "^http$", + "server.address": "^localhost$", + "url.path": "^/aws-sdk-call$", + "url.query": "^ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "http.route": "/aws-sdk-call", + "http.request.method": "GET", "PlatformType": "AWS::EC2" } }, @@ -27,7 +29,6 @@ "kind": "CLIENT", "resource": { "attributes": { - "aws.local.service": "{{serviceName}}", "service.name": "{{serviceName}}", "cloud.provider": "aws", "cloud.region": "{{region}}", @@ -41,9 +42,8 @@ "aws.remote.service": "AWS::S3", "aws.remote.operation": "GetBucketLocation", "aws.local.environment": "ec2:default", - "aws.s3.bucket": "e2e-test-bucket-name-{{testingId}}", + "aws.bucket.name": "e2e-test-bucket-name-{{testingId}}", "aws.span.kind": "CLIENT", - "aws.region": "us-east-1", "PlatformType": "AWS::EC2" } }] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-metric.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-metric.mustache index 92e8104d3..3c6f6e117 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-metric.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-metric.mustache @@ -4,7 +4,7 @@ dimensions: - name: Operation - value: GET aws-sdk-call + value: GET /aws-sdk-call - name: Service value: {{serviceName}} @@ -80,7 +80,7 @@ dimensions: - name: Operation - value: GET aws-sdk-call + value: GET /aws-sdk-call - name: Service value: {{serviceName}} @@ -156,7 +156,7 @@ dimensions: - name: Operation - value: GET aws-sdk-call + value: GET /aws-sdk-call - name: Service value: {{serviceName}} diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-trace.mustache index b38dccc35..0cf377434 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-trace.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/aws-sdk-call-trace.mustache @@ -2,27 +2,29 @@ "name": "^{{serviceName}}$", "http": { "request": { - "url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", "method": "^GET$" } }, "aws": { "ec2": { - "instance_id": "^{{instanceId}}$" - }, + "instance_id": "^{{instanceId}}$" + }, "span.kind": "^LOCAL_ROOT$" }, "annotations": { "aws.local.service": "^{{serviceName}}$", - "aws.local.operation": "^GET aws-sdk-call$", + "aws.local.operation": "^GET /aws-sdk-call$", "aws.local.environment": "^ec2:default$", - "span.name": "^GET aws-sdk-call$", + "span.name": "^GET /aws-sdk-call$", "span.kind": "^SERVER$" }, "metadata": { - "http.url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", - "http.method": "^GET$", - "http.route": "^aws-sdk-call$", + "url.path": "/aws-sdk-call", + "url.scheme": "^http$", + "url.query": "ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}?", + "server.address": "^localhost$", + "http.request.method": "^GET$", + "http.route": "^/aws-sdk-call$", "service.name": "^{{serviceName}}$", "cloud.provider": "^aws$", "cloud.account.id": "^{{accountId}}$", @@ -35,7 +37,7 @@ "name": "^S3$", "aws": { "bucket_name": "^e2e-test-bucket-name-{{testingId}}$", - "s3.bucket": "^e2e-test-bucket-name-{{testingId}}$", + "bucket.name": "^e2e-test-bucket-name-{{testingId}}$", "span.kind": "^CLIENT$" }, "annotations": { @@ -55,7 +57,7 @@ "name": "^S3$", "aws": { "bucket_name": "^e2e-test-bucket-name-{{testingId}}$", - "s3.bucket": "^e2e-test-bucket-name-{{testingId}}$", + "bucket.name": "^e2e-test-bucket-name-{{testingId}}$", "span.kind": "^CLIENT$" }, "annotations": { diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-log.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-log.mustache index 991b4041d..6ce302b81 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-log.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-log.mustache @@ -1,9 +1,8 @@ [{ - "name": "GET client-call", + "name": "GET /client-call", "kind": "SERVER", "resource": { "attributes": { - "aws.local.service": "{{serviceName}}", "service.name": "{{serviceName}}", "cloud.provider": "aws", "cloud.region": "{{region}}", @@ -14,11 +13,13 @@ "attributes": { "aws.local.service": "{{serviceName}}", "aws.local.environment": "ec2:default", - "aws.local.operation": "GET client-call", + "aws.local.operation": "GET /client-call", "aws.span.kind": "LOCAL_ROOT", - "http.url": "{{endpoint}}/client-call", - "http.route": "client-call", - "http.method": "GET", + "url.scheme": "http", + "server.address": "localhost", + "url.path": "/client-call", + "http.route": "/client-call", + "http.request.method": "GET", "PlatformType": "AWS::EC2" } }, @@ -27,7 +28,6 @@ "kind": "CLIENT", "resource": { "attributes": { - "aws.local.service": "{{serviceName}}", "service.name": "{{serviceName}}", "cloud.provider": "aws", "cloud.region": "{{region}}", @@ -42,8 +42,8 @@ "aws.remote.operation": "GET /", "aws.local.environment": "ec2:default", "aws.span.kind": "LOCAL_ROOT", - "http.url": "http://local-root-client-call/", - "http.method": "GET", + "url.full": "http://local-root-client-call", + "http.request.method": "GET", "PlatformType": "AWS::EC2" } -}] \ No newline at end of file +}] diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache index 261cfbac2..88c9b511c 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/client-call-trace.mustache @@ -1,10 +1,5 @@ [{ "name": "^{{serviceName}}$", - "aws": { - "ec2": { - "instance_id": "^{{instanceId}}$" - } - }, "annotations": { "aws.local.service": "^{{serviceName}}$", "aws.local.operation": "^InternalOperation$", @@ -24,14 +19,14 @@ "name": "^local-root-client-call$", "http": { "request": { - "url": "^http://local-root-client-call/$", + "url": "^http://local-root-client-call$", "method": "^GET$" } }, "aws": { "ec2": { - "instance_id": "^{{instanceId}}$" - }, + "instance_id": "^{{instanceId}}$" + }, "span.kind": "^LOCAL_ROOT$" }, "annotations": { @@ -44,13 +39,13 @@ "span.kind": "^CLIENT$" }, "metadata": { - "service.name": "^{{serviceName}}$", - "http.url": "^http://local-root-client-call/$", - "http.method": "^GET$", "cloud.provider": "^aws$", "cloud.account.id": "^{{accountId}}$", "cloud.region": "^{{region}}$", - "cloud.platform": "^aws_ec2$" + "cloud.platform": "^aws_ec2$", + "service.name": "^{{serviceName}}$", + "url.full": "^http://local-root-client-call$", + "http.request.method": "^GET$" }, "namespace": "^remote$" } @@ -60,7 +55,7 @@ "name": "^local-root-client-call$", "http": { "request": { - "url": "^http://local-root-client-call/$", + "url": "^http://local-root-client-call$", "method": "^GET$" } }, diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-log.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-log.mustache index 48f9df70a..67bee3b3b 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-log.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-log.mustache @@ -1,9 +1,8 @@ [{ - "name": "GET outgoing-http-call", + "name": "GET /outgoing-http-call", "kind": "SERVER", "resource": { "attributes": { - "aws.local.service": "{{serviceName}}", "service.name": "{{serviceName}}", "cloud.provider": "aws", "cloud.region": "{{region}}", @@ -14,11 +13,13 @@ "attributes": { "aws.local.service": "{{serviceName}}", "aws.local.environment": "ec2:default", - "aws.local.operation": "GET outgoing-http-call", + "aws.local.operation": "GET /outgoing-http-call", "aws.span.kind": "LOCAL_ROOT", - "http.url": "{{endpoint}}/outgoing-http-call", - "http.route": "outgoing-http-call", - "http.method": "GET", + "url.scheme": "^http$", + "url.path": "^/outgoing-http-call$", + "server.address": "^localhost$", + "http.route": "/outgoing-http-call", + "http.request.method": "GET", "PlatformType": "AWS::EC2" } }, @@ -27,7 +28,6 @@ "kind": "CLIENT", "resource": { "attributes": { - "aws.local.service": "{{serviceName}}", "service.name": "{{serviceName}}", "cloud.provider": "aws", "cloud.region": "{{region}}", @@ -42,8 +42,9 @@ "aws.remote.operation": "GET /", "aws.local.environment": "ec2:default", "aws.span.kind": "CLIENT", - "http.url": "https://www.amazon.com/", - "http.method": "GET", + "url.full": "https://www.amazon.com", + "server.address": "www.amazon.com", + "http.request.method": "GET", "PlatformType": "AWS::EC2" } }] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-metric.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-metric.mustache index f4ce2515b..46db31804 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-metric.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-metric.mustache @@ -4,7 +4,7 @@ dimensions: - name: Operation - value: GET outgoing-http-call + value: GET /outgoing-http-call - name: Service value: {{serviceName}} @@ -80,7 +80,7 @@ dimensions: - name: Operation - value: GET outgoing-http-call + value: GET /outgoing-http-call - name: Service value: {{serviceName}} @@ -156,7 +156,7 @@ dimensions: - name: Operation - value: GET outgoing-http-call + value: GET /outgoing-http-call - name: Service value: {{serviceName}} diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache index 831649e19..4207b787e 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/outgoing-http-call-trace.mustache @@ -2,7 +2,6 @@ "name": "^{{serviceName}}$", "http": { "request": { - "url": "^{{endpoint}}/outgoing-http-call$", "method": "^GET$" } }, @@ -14,15 +13,16 @@ }, "annotations": { "aws.local.service": "^{{serviceName}}$", - "aws.local.operation": "^GET outgoing-http-call$", + "aws.local.operation": "^GET /outgoing-http-call$", "aws.local.environment": "^ec2:default$", - "span.name": "^GET outgoing-http-call$", + "span.name": "^GET /outgoing-http-call$", "span.kind": "^SERVER$" }, "metadata": { - "http.url": "^{{endpoint}}/outgoing-http-call$", - "http.method": "^GET$", - "http.route": "^outgoing-http-call$", + "server.address": "localhost", + "url.path": "^/outgoing-http-call$", + "http.request.method": "^GET$", + "http.route": "^/outgoing-http-call$", "service.name": "^{{serviceName}}$", "cloud.provider": "^aws$", "cloud.account.id": "^{{accountId}}$", @@ -35,7 +35,7 @@ "name": "^www.amazon.com$", "http": { "request": { - "url": "^https://www.amazon.com/$", + "url": "^https://www.amazon.com$", "method": "^GET$" } }, diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-log.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-log.mustache index 8c342d820..eb88357c4 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-log.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-log.mustache @@ -1,9 +1,8 @@ [{ - "name": "GET remote-service", + "name": "GET /remote-service", "kind": "SERVER", "resource": { "attributes": { - "aws.local.service": "{{serviceName}}", "service.name": "{{serviceName}}", "cloud.provider": "aws", "cloud.region": "{{region}}", @@ -14,11 +13,14 @@ "attributes": { "aws.local.service": "{{serviceName}}", "aws.local.environment": "ec2:default", - "aws.local.operation": "GET remote-service", + "aws.local.operation": "GET /remote-service", "aws.span.kind": "LOCAL_ROOT", - "http.url": "{{endpoint}}/remote-service", + "url.scheme": "http", + "server.address": "^localhost$", + "url.path": "^/remote-service$", + "url.query": "^ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", "http.route": "remote-service", - "http.method": "GET", + "http.request.method": "GET", "PlatformType": "AWS::EC2" } }, @@ -27,7 +29,6 @@ "kind": "CLIENT", "resource": { "attributes": { - "aws.local.service": "{{serviceName}}", "service.name": "{{serviceName}}", "cloud.provider": "aws", "cloud.region": "{{region}}", @@ -42,8 +43,8 @@ "aws.remote.operation": "GET /healthcheck", "aws.local.environment": "ec2:default", "aws.span.kind": "CLIENT", - "http.url": "http://{{remoteServiceDeploymentName}}/healthcheck", - "http.method": "GET", + "url.full": "http://{{remoteServiceDeploymentName}}/healthcheck", + "http.request.method": "GET", "PlatformType": "AWS::EC2" } }] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-metric.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-metric.mustache index 0d3714f71..69f1f649e 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-metric.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-metric.mustache @@ -4,7 +4,7 @@ dimensions: - name: Operation - value: GET remote-service + value: GET /remote-service - name: Service value: {{serviceName}} @@ -41,7 +41,7 @@ value: ec2:default - name: Operation - value: GET healthcheck + value: GET /healthcheck - name: Service value: {{remoteServiceName}} @@ -113,7 +113,7 @@ dimensions: - name: Operation - value: GET remote-service + value: GET /remote-service - name: Service value: {{serviceName}} @@ -150,7 +150,7 @@ value: ec2:default - name: Operation - value: GET healthcheck + value: GET /healthcheck - name: Service value: {{remoteServiceName}} @@ -222,7 +222,7 @@ dimensions: - name: Operation - value: GET remote-service + value: GET /remote-service - name: Service value: {{serviceName}} @@ -259,7 +259,7 @@ value: ec2:default - name: Operation - value: GET healthcheck + value: GET /healthcheck - name: Service value: {{remoteServiceName}} diff --git a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-trace.mustache b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-trace.mustache index e56772553..699c9e2ce 100644 --- a/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-trace.mustache +++ b/validator/src/main/resources/expected-data-template/java/ec2/adot-sigv4/remote-service-trace.mustache @@ -2,7 +2,6 @@ "name": "^{{serviceName}}$", "http": { "request": { - "url": "^{{endpoint}}/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", "method": "^GET$" }, "response": { @@ -11,21 +10,26 @@ }, "aws": { "ec2": { - "instance_id": "^{{instanceId}}$" - }, + "instance_id": "^{{instanceId}}$" + }, "span.kind": "^LOCAL_ROOT$" }, "annotations": { "aws.local.service": "^{{serviceName}}$", - "aws.local.operation": "^GET remote-service$", + "aws.local.operation": "^GET /remote-service$", "aws.local.environment": "^ec2:default$", - "span.name": "^GET remote-service$", + "span.name": "^GET /remote-service$", "span.kind": "^SERVER$" }, "metadata": { - "http.url": "^{{endpoint}}/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", - "http.method": "^GET$", - "http.route": "^remote-service$", + "url.query": "^ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "url.scheme": "^http$", + "url.path": "^/remote-service$", + "server.address": "^localhost$", + "server.port": "^8080$", + "server.address": "^localhost$", + "http.request.method": "^GET$", + "http.route": "^/remote-service$", "service.name": "^{{serviceName}}$", "cloud.provider": "^aws$", "cloud.account.id": "^{{accountId}}$", @@ -59,14 +63,14 @@ "name": "^{{remoteServiceName}}$", "http": { "request": { - "url": "^http://{{remoteServiceDeploymentName}}/healthcheck$", "method": "^GET$" } }, "annotations": { "aws.local.service": "^{{remoteServiceName}}$", - "aws.local.operation": "^GET healthcheck$" + "aws.local.operation": "^GET /healthcheck$" } + }] diff --git a/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-log.mustache b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-log.mustache new file mode 100644 index 000000000..737ed588a --- /dev/null +++ b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-log.mustache @@ -0,0 +1,46 @@ +[{ + "name": "GET", + "kind": "SERVER", + "resource": { + "attributes": { + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET /aws-sdk-call", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "http.target": "^/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}, +{ + "name": "S3.GetBucketLocation", + "kind": "CLIENT", + "resource": { + "attributes": { + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "UnmappedOperation", + "aws.remote.service": "AWS::S3", + "aws.remote.operation": "GetBucketLocation", + "aws.local.environment": "ec2:default", + "aws.s3.bucket": "e2e-test-bucket-name-{{testingId}}", + "aws.span.kind": "CLIENT", + "PlatformType": "AWS::EC2" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-metric.mustache b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-metric.mustache new file mode 100644 index 000000000..3c6f6e117 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-metric.mustache @@ -0,0 +1,227 @@ +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /aws-sdk-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: AWS::S3 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GetBucketLocation + - + name: RemoteService + value: AWS::S3 \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-trace.mustache b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-trace.mustache new file mode 100644 index 000000000..7a118cda5 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/aws-sdk-call-trace.mustache @@ -0,0 +1,65 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "method": "^GET$" + } + }, + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET /aws-sdk-call$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^SERVER$" + }, + "metadata": { + "http.url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "http.method": "^GET$", + "http.target": "^/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$", + "PlatformType": "^AWS::EC2$" + }, + "subsegments": [ + { + "name": "^S3$", + "aws": { + "bucket_name": "^e2e-test-bucket-name-{{testingId}}$", + "s3.bucket": "^e2e-test-bucket-name-{{testingId}}$", + "span.kind": "^CLIENT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^AWS::S3$", + "aws.remote.operation": "^GetBucketLocation$", + "aws.local.environment": "^ec2:default$", + "span.name": "^S3.GetBucketLocation$", + "span.kind": "^CLIENT$" + }, + "namespace": "^aws$" + } + ] +}, +{ + "name": "^S3$", + "aws": { + "bucket_name": "^e2e-test-bucket-name-{{testingId}}$", + "s3.bucket": "^e2e-test-bucket-name-{{testingId}}$", + "span.kind": "^CLIENT$" + }, + "annotations": { + "aws.local.service": "^AWS::S3$", + "aws.local.operation": "^GetBucketLocation$" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/client-call-log.mustache b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/client-call-log.mustache new file mode 100644 index 000000000..a40cb433e --- /dev/null +++ b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/client-call-log.mustache @@ -0,0 +1,47 @@ +[{ + "name": "GET", + "kind": "SERVER", + "resource": { + "attributes": { + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET /client-call", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "{{endpoint}}/client-call", + "http.target": "/client-call", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}, +{ + "name": "GET", + "kind": "CLIENT", + "resource": { + "attributes": { + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "InternalOperation", + "aws.remote.service": "local-root-client-call", + "aws.remote.operation": "GET /", + "aws.local.environment": "ec2:default", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "http://local-root-client-call/", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/client-call-metric.mustache b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/client-call-metric.mustache new file mode 100644 index 000000000..86fa8bbf5 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/client-call-metric.mustache @@ -0,0 +1,227 @@ +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Operation + value: InternalOperation + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call + - + name: RemoteOperation + value: GET / + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: local-root-client-call \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/client-call-trace.mustache b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/client-call-trace.mustache new file mode 100644 index 000000000..e9400ed51 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/client-call-trace.mustache @@ -0,0 +1,72 @@ +[{ + "name": "^{{serviceName}}$", + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^InternalOperation$", + "aws.local.environment": "^ec2:default$", + "span.name": "^InternalOperation$", + "span.kind": "^SERVER$" + }, + "metadata": { + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$" + }, + "subsegments": [ + { + "name": "^local-root-client-call$", + "http": { + "request": { + "url": "^http://local-root-client-call/$", + "method": "^GET$" + } + }, + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^InternalOperation$", + "aws.remote.service": "^local-root-client-call$", + "aws.remote.operation": "GET /", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^CLIENT$" + }, + "metadata": { + "service.name": "^{{serviceName}}$", + "http.url": "^http://local-root-client-call/$", + "http.method": "^GET$", + "http.target": "^/$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$" + }, + "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/node/ec2/adot-sigv4/outgoing-http-call-log.mustache b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-log.mustache new file mode 100644 index 000000000..b09d77a48 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-log.mustache @@ -0,0 +1,47 @@ +[{ + "name": "GET", + "kind": "SERVER", + "resource": { + "attributes": { + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET /outgoing-http-call", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "{{endpoint}}/outgoing-http-call", + "http.target": "/outgoing-http-call", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}, +{ + "name": "GET", + "kind": "CLIENT", + "resource": { + "attributes": { + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "UnmappedOperation", + "aws.remote.service": "www.amazon.com:80", + "aws.remote.operation": "GET /", + "aws.local.environment": "ec2:default", + "aws.span.kind": "CLIENT", + "http.url": "^http://www.amazon.com/$", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-metric.mustache b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-metric.mustache new file mode 100644 index 000000000..db02e6f01 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/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: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com:80 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com:80 + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: www.amazon.com:80 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /outgoing-http-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com:80 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com:80 + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: www.amazon.com:80 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /outgoing-http-call + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com:80 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET / + - + name: RemoteService + value: www.amazon.com:80 + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: www.amazon.com:80 diff --git a/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-trace.mustache b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-trace.mustache new file mode 100644 index 000000000..dc4272a80 --- /dev/null +++ b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/outgoing-http-call-trace.mustache @@ -0,0 +1,57 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "url": "^{{endpoint}}/outgoing-http-call$", + "method": "^GET$" + } + }, + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET /outgoing-http-call$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^SERVER$" + }, + "metadata": { + "http.url": "^{{endpoint}}/outgoing-http-call$", + "http.method": "^GET$", + "http.target": "^/outgoing-http-call$", + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$", + "PlatformType": "^AWS::EC2$" + }, + "subsegments": [ + { + "name": "^www.amazon.com:80$", + "http": { + "request": { + "url": "^http://www.amazon.com/$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^www.amazon.com:80$", + "aws.remote.operation": "^GET /$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^CLIENT$" + }, + "namespace": "^remote$" + } + ] +}, +{ + "name": "^www.amazon.com:80$" +}] diff --git a/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/remote-service-log.mustache b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/remote-service-log.mustache new file mode 100644 index 000000000..b87320d0b --- /dev/null +++ b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/remote-service-log.mustache @@ -0,0 +1,47 @@ +[{ + "name": "GET", + "kind": "SERVER", + "resource": { + "attributes": { + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.environment": "ec2:default", + "aws.local.operation": "GET /remote-service", + "aws.span.kind": "LOCAL_ROOT", + "http.url": "^{{endpoint}}/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "http.target": "^/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}, +{ + "name": "GET", + "kind": "CLIENT", + "resource": { + "attributes": { + "service.name": "{{serviceName}}", + "cloud.provider": "aws", + "cloud.region": "{{region}}", + "cloud.account.id": "{{accountId}}", + "cloud.platform": "aws_ec2" + } + }, + "attributes": { + "aws.local.service": "{{serviceName}}", + "aws.local.operation": "UnmappedOperation", + "aws.remote.service": "{{remoteServiceDeploymentName}}", + "aws.remote.operation": "GET /healthcheck", + "aws.local.environment": "ec2:default", + "aws.span.kind": "CLIENT", + "http.url": "http://{{remoteServiceDeploymentName}}/healthcheck", + "http.method": "GET", + "PlatformType": "AWS::EC2" + } +}] \ No newline at end of file diff --git a/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/remote-service-metric.mustache b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/remote-service-metric.mustache new file mode 100644 index 000000000..69f1f649e --- /dev/null +++ b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/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: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: ec2:default + - + name: Operation + value: GET /healthcheck + - + name: Service + value: {{remoteServiceName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceName}} + - + name: Environment + value: ec2:default + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Latency + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: ec2:default + - + name: Operation + value: GET /healthcheck + - + name: Service + value: {{remoteServiceName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceName}} + - + name: Environment + value: ec2:default + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Error + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: GET /remote-service + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Operation + value: UnmappedOperation + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Environment + value: ec2:default + - + name: Operation + value: GET /healthcheck + - + name: Service + value: {{remoteServiceName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{remoteServiceName}} + - + name: Environment + value: ec2:default + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: Service + value: {{serviceName}} + - + name: Environment + value: ec2:default + - + name: RemoteOperation + value: GET /healthcheck + - + name: RemoteService + value: {{remoteServiceDeploymentName}} + +- + metricName: Fault + namespace: {{metricNamespace}} + dimensions: + - + name: RemoteService + value: {{remoteServiceDeploymentName}} diff --git a/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/remote-service-trace.mustache b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/remote-service-trace.mustache new file mode 100644 index 000000000..7b1a2a8db --- /dev/null +++ b/validator/src/main/resources/expected-data-template/node/ec2/adot-sigv4/remote-service-trace.mustache @@ -0,0 +1,72 @@ +[{ + "name": "^{{serviceName}}$", + "http": { + "request": { + "url": "^{{endpoint}}/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "method": "^GET$" + }, + "response": { + "status": "^200$" + } + }, + "aws": { + "ec2": { + "instance_id": "^{{instanceId}}$" + }, + "span.kind": "^LOCAL_ROOT$" + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^GET /remote-service$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^SERVER$" + }, + "metadata": { + "http.url": "^{{endpoint}}/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "http.method": "^GET$", + "http.target": "^/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$", + "service.name": "^{{serviceName}}$", + "cloud.provider": "^aws$", + "cloud.account.id": "^{{accountId}}$", + "cloud.region": "^{{region}}$", + "cloud.platform": "^aws_ec2$", + "PlatformType": "^AWS::EC2$" + }, + "subsegments": [ + { + "name": "^{{remoteServiceDeploymentName}}$", + "http": { + "request": { + "url": "^http://{{remoteServiceDeploymentName}}/healthcheck$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{serviceName}}$", + "aws.local.operation": "^UnmappedOperation$", + "aws.remote.service": "^{{remoteServiceDeploymentName}}$", + "aws.remote.operation": "^GET /healthcheck$", + "aws.local.environment": "^ec2:default$", + "span.name": "^GET$", + "span.kind": "^CLIENT$" + }, + "namespace": "^remote$" + } + ] +}, +{ + "name": "^{{remoteServiceName}}$", + "http": { + "request": { + "url": "^http://{{remoteServiceDeploymentName}}/healthcheck$", + "method": "^GET$" + } + }, + "annotations": { + "aws.local.service": "^{{remoteServiceName}}$", + "aws.local.operation": "^GET /healthcheck$" + } +}] + + diff --git a/validator/src/main/resources/validations/dotnet/ec2/adot-sigv4/log-validation.yml b/validator/src/main/resources/validations/dotnet/ec2/adot-sigv4/log-validation.yml new file mode 100644 index 000000000..3e5056845 --- /dev/null +++ b/validator/src/main/resources/validations/dotnet/ec2/adot-sigv4/log-validation.yml @@ -0,0 +1,25 @@ +- + validationType: "cw-log" + httpPath: "outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedLogStructureTemplate: "DOTNET_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_LOG" +- + validationType: "cw-log" + httpPath: "aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedLogStructureTemplate: "DOTNET_EC2_ADOT_SIGV4_AWS_SDK_CALL_LOG" +- + validationType: "cw-log" + httpPath: "remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedLogStructureTemplate: "DOTNET_EC2_ADOT_SIGV4_REMOTE_SERVICE_LOG" +- + validationType: "cw-log" + httpPath: "client-call" + httpMethod: "get" + callingType: "http" + expectedLogStructureTemplate: "DOTNET_EC2_ADOT_SIGV4_CLIENT_CALL_LOG" + diff --git a/validator/src/main/resources/validations/dotnet/ec2/adot-sigv4/metric-validation.yml b/validator/src/main/resources/validations/dotnet/ec2/adot-sigv4/metric-validation.yml new file mode 100644 index 000000000..c8e0e770a --- /dev/null +++ b/validator/src/main/resources/validations/dotnet/ec2/adot-sigv4/metric-validation.yml @@ -0,0 +1,25 @@ +- + validationType: "cw-metric" + httpPath: "outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedMetricTemplate: "DOTNET_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_METRIC" +- + validationType: "cw-metric" + httpPath: "aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedMetricTemplate: "DOTNET_EC2_ADOT_SIGV4_AWS_SDK_CALL_METRIC" +- + validationType: "cw-metric" + httpPath: "remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedMetricTemplate: "DOTNET_EC2_ADOT_SIGV4_REMOTE_SERVICE_METRIC" +- + validationType: "cw-metric" + httpPath: "client-call" + httpMethod: "get" + callingType: "http" + expectedMetricTemplate: "DOTNET_EC2_ADOT_SIGV4_CLIENT_CALL_METRIC" + diff --git a/validator/src/main/resources/validations/dotnet/ec2/adot-sigv4/trace-validation.yml b/validator/src/main/resources/validations/dotnet/ec2/adot-sigv4/trace-validation.yml new file mode 100644 index 000000000..a0b601a2a --- /dev/null +++ b/validator/src/main/resources/validations/dotnet/ec2/adot-sigv4/trace-validation.yml @@ -0,0 +1,24 @@ +- + validationType: "trace" + httpPath: "outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedTraceTemplate: "DOTNET_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_TRACE" +- + validationType: "trace" + httpPath: "aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedTraceTemplate: "DOTNET_EC2_ADOT_SIGV4_AWS_SDK_CALL_TRACE" +- + validationType: "trace" + httpPath: "remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedTraceTemplate: "DOTNET_EC2_ADOT_SIGV4_REMOTE_SERVICE_TRACE" +- + validationType: "trace" + httpPath: "client-call" + httpMethod: "get" + callingType: "http" + expectedTraceTemplate: "DOTNET_EC2_ADOT_SIGV4_CLIENT_CALL_TRACE" \ No newline at end of file diff --git a/validator/src/main/resources/validations/java/ec2/adot-sigv4/log-validation.yml b/validator/src/main/resources/validations/java/ec2/adot-sigv4/log-validation.yml index 6c51bbf97..7e0d2d2f8 100644 --- a/validator/src/main/resources/validations/java/ec2/adot-sigv4/log-validation.yml +++ b/validator/src/main/resources/validations/java/ec2/adot-sigv4/log-validation.yml @@ -3,26 +3,22 @@ httpPath: "/outgoing-http-call" httpMethod: "get" callingType: "http" - expectedLogStructureTemplate: "JAVA_EC2_DEFAULT_OUTGOING_HTTP_CALL_LOG" + expectedLogStructureTemplate: "JAVA_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_LOG" - validationType: "cw-log" httpPath: "/aws-sdk-call" httpMethod: "get" callingType: "http-with-query" - expectedLogStructureTemplate: "JAVA_EC2_DEFAULT_AWS_SDK_CALL_LOG" + expectedLogStructureTemplate: "JAVA_EC2_ADOT_SIGV4_AWS_SDK_CALL_LOG" - validationType: "cw-log" httpPath: "/remote-service" httpMethod: "get" callingType: "http-with-query" - expectedLogStructureTemplate: "JAVA_EC2_DEFAULT_REMOTE_SERVICE_LOG" + expectedLogStructureTemplate: "JAVA_EC2_ADOT_SIGV4_REMOTE_SERVICE_LOG" - validationType: "cw-log" httpPath: "/client-call" httpMethod: "get" callingType: "http" - expectedLogStructureTemplate: "JAVA_EC2_DEFAULT_CLIENT_CALL_LOG" -- - validationType: "cw-log" - callingType: "none" - expectedLogStructureTemplate: "JAVA_RUNTIME_METRIC_LOG" \ No newline at end of file + expectedLogStructureTemplate: "JAVA_EC2_ADOT_SIGV4_CLIENT_CALL_LOG" diff --git a/validator/src/main/resources/validations/java/ec2/adot-sigv4/metric-validation.yml b/validator/src/main/resources/validations/java/ec2/adot-sigv4/metric-validation.yml index 92ee0d4f5..a99e409f4 100644 --- a/validator/src/main/resources/validations/java/ec2/adot-sigv4/metric-validation.yml +++ b/validator/src/main/resources/validations/java/ec2/adot-sigv4/metric-validation.yml @@ -3,26 +3,22 @@ httpPath: "/outgoing-http-call" httpMethod: "get" callingType: "http" - expectedMetricTemplate: "JAVA_EC2_DEFAULT_OUTGOING_HTTP_CALL_METRIC" + expectedMetricTemplate: "JAVA_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_METRIC" - validationType: "cw-metric" httpPath: "/aws-sdk-call" httpMethod: "get" callingType: "http-with-query" - expectedMetricTemplate: "JAVA_EC2_DEFAULT_AWS_SDK_CALL_METRIC" + expectedMetricTemplate: "JAVA_EC2_ADOT_SIGV4_AWS_SDK_CALL_METRIC" - validationType: "cw-metric" httpPath: "/remote-service" httpMethod: "get" callingType: "http-with-query" - expectedMetricTemplate: "JAVA_EC2_DEFAULT_REMOTE_SERVICE_METRIC" + expectedMetricTemplate: "JAVA_EC2_ADOT_SIGV4_REMOTE_SERVICE_METRIC" - validationType: "cw-metric" httpPath: "/client-call" httpMethod: "get" callingType: "http" - expectedMetricTemplate: "JAVA_EC2_DEFAULT_CLIENT_CALL_METRIC" -- - validationType: "cw-metric" - callingType: "none" - expectedMetricTemplate: "JAVA_RUNTIME_METRIC" \ No newline at end of file + expectedMetricTemplate: "JAVA_EC2_ADOT_SIGV4_CLIENT_CALL_METRIC" \ No newline at end of file diff --git a/validator/src/main/resources/validations/java/ec2/adot-sigv4/trace-validation.yml b/validator/src/main/resources/validations/java/ec2/adot-sigv4/trace-validation.yml index 15e685a31..44971c1a9 100644 --- a/validator/src/main/resources/validations/java/ec2/adot-sigv4/trace-validation.yml +++ b/validator/src/main/resources/validations/java/ec2/adot-sigv4/trace-validation.yml @@ -3,22 +3,22 @@ httpPath: "/outgoing-http-call" httpMethod: "get" callingType: "http" - expectedTraceTemplate: "JAVA_EC2_DEFAULT_OUTGOING_HTTP_CALL_TRACE" + expectedTraceTemplate: "JAVA_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_TRACE" - validationType: "trace" httpPath: "/aws-sdk-call" httpMethod: "get" callingType: "http-with-query" - expectedTraceTemplate: "JAVA_EC2_DEFAULT_AWS_SDK_CALL_TRACE" + expectedTraceTemplate: "JAVA_EC2_ADOT_SIGV4_AWS_SDK_CALL_TRACE" - validationType: "trace" httpPath: "/remote-service" httpMethod: "get" callingType: "http-with-query" - expectedTraceTemplate: "JAVA_EC2_DEFAULT_REMOTE_SERVICE_TRACE" + expectedTraceTemplate: "JAVA_EC2_ADOT_SIGV4_REMOTE_SERVICE_TRACE" - validationType: "trace" httpPath: "/client-call" httpMethod: "get" callingType: "http" - expectedTraceTemplate: "JAVA_EC2_DEFAULT_CLIENT_CALL_TRACE" \ No newline at end of file + expectedTraceTemplate: "JAVA_EC2_ADOT_SIGV4_CLIENT_CALL_TRACE" \ No newline at end of file diff --git a/validator/src/main/resources/validations/node/ec2/adot-sigv4/log-validation.yml b/validator/src/main/resources/validations/node/ec2/adot-sigv4/log-validation.yml new file mode 100644 index 000000000..e9e7abc43 --- /dev/null +++ b/validator/src/main/resources/validations/node/ec2/adot-sigv4/log-validation.yml @@ -0,0 +1,24 @@ +- + validationType: "cw-log" + httpPath: "outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedLogStructureTemplate: "NODE_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_LOG" +- + validationType: "cw-log" + httpPath: "aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedLogStructureTemplate: "NODE_EC2_ADOT_SIGV4_AWS_SDK_CALL_LOG" +- + validationType: "cw-log" + httpPath: "remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedLogStructureTemplate: "NODE_EC2_ADOT_SIGV4_REMOTE_SERVICE_LOG" +- + validationType: "cw-log" + httpPath: "client-call" + httpMethod: "get" + callingType: "http" + expectedLogStructureTemplate: "NODE_EC2_ADOT_SIGV4_CLIENT_CALL_LOG" \ No newline at end of file diff --git a/validator/src/main/resources/validations/node/ec2/adot-sigv4/metric-validation.yml b/validator/src/main/resources/validations/node/ec2/adot-sigv4/metric-validation.yml new file mode 100644 index 000000000..667d3f4b1 --- /dev/null +++ b/validator/src/main/resources/validations/node/ec2/adot-sigv4/metric-validation.yml @@ -0,0 +1,24 @@ +- + validationType: "cw-metric" + httpPath: "outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedMetricTemplate: "NODE_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_METRIC" +- + validationType: "cw-metric" + httpPath: "aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedMetricTemplate: "NODE_EC2_ADOT_SIGV4_AWS_SDK_CALL_METRIC" +- + validationType: "cw-metric" + httpPath: "remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedMetricTemplate: "NODE_EC2_ADOT_SIGV4_REMOTE_SERVICE_METRIC" +- + validationType: "cw-metric" + httpPath: "client-call" + httpMethod: "get" + callingType: "http" + expectedMetricTemplate: "NODE_EC2_ADOT_SIGV4_CLIENT_CALL_METRIC" \ No newline at end of file diff --git a/validator/src/main/resources/validations/node/ec2/adot-sigv4/trace-validation.yml b/validator/src/main/resources/validations/node/ec2/adot-sigv4/trace-validation.yml new file mode 100644 index 000000000..a9461f7f4 --- /dev/null +++ b/validator/src/main/resources/validations/node/ec2/adot-sigv4/trace-validation.yml @@ -0,0 +1,24 @@ +- + validationType: "trace" + httpPath: "/outgoing-http-call" + httpMethod: "get" + callingType: "http" + expectedTraceTemplate: "NODE_EC2_ADOT_SIGV4_OUTGOING_HTTP_CALL_TRACE" +- + validationType: "trace" + httpPath: "/aws-sdk-call" + httpMethod: "get" + callingType: "http-with-query" + expectedTraceTemplate: "NODE_EC2_ADOT_SIGV4_AWS_SDK_CALL_TRACE" +- + validationType: "trace" + httpPath: "/remote-service" + httpMethod: "get" + callingType: "http-with-query" + expectedTraceTemplate: "NODE_EC2_ADOT_SIGV4_REMOTE_SERVICE_TRACE" +- + validationType: "trace" + httpPath: "/client-call" + httpMethod: "get" + callingType: "http" + expectedTraceTemplate: "NODE_EC2_ADOT_SIGV4_CLIENT_CALL_TRACE" \ No newline at end of file From 05135d9ad71d94e862ec68a480f81eeb02b27a3c Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 26 Mar 2025 04:59:48 +0000 Subject: [PATCH 13/15] removed temp test.yml --- .../workflows/java-ec2-adot-sigv4-test.yml | 12 +++---- .github/workflows/test.yml | 35 ------------------- 2 files changed, 6 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/java-ec2-adot-sigv4-test.yml b/.github/workflows/java-ec2-adot-sigv4-test.yml index 27decf17d..1cf749209 100644 --- a/.github/workflows/java-ec2-adot-sigv4-test.yml +++ b/.github/workflows/java-ec2-adot-sigv4-test.yml @@ -86,13 +86,13 @@ jobs: aws-region: ${{ env.E2E_TEST_AWS_REGION }} # TODO: Reintroduce ability to test latest public release - # if [ "${{ github.event.repository.name }}" = "aws-otel-java-instrumentation" ]; then - # echo GET_ADOT_JAR_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/aws-opentelemetry-agent.jar ./adot.jar" >> $GITHUB_ENV - # else - # echo GET_ADOT_JAR_COMMAND="wget -O adot.jar https://github.com/aws-observability/aws-otel-java-instrumentation/releases/latest/download/aws-opentelemetry-agent.jar" >> $GITHUB_ENV - # fi - name: Set ADOT getter command environment variable - run: echo GET_ADOT_JAR_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/aws-opentelemetry-agent.jar ./adot.jar --region us-east-1" >> $GITHUB_ENV + run: + if [ "${{ github.event.repository.name }}" = "aws-otel-java-instrumentation" ]; then + echo GET_ADOT_JAR_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/aws-opentelemetry-agent.jar ./adot.jar" >> $GITHUB_ENV + else + echo GET_ADOT_JAR_COMMAND="wget -O adot.jar https://github.com/aws-observability/aws-otel-java-instrumentation/releases/latest/download/aws-opentelemetry-agent.jar" >> $GITHUB_ENV + fi - name: Set up terraform uses: ./.github/workflows/actions/execute_and_retry diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 408081e79..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,35 +0,0 @@ -## 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: Test -on: - push: - branches: - - java-sigv4 - -permissions: - id-token: write - contents: read - -jobs: - # Runs in us-west-1 using us-east-1 account - java-ec2-adot-sigv4: - uses: ./.github/workflows/java-ec2-adot-sigv4-test.yml - secrets: inherit - with: - caller-workflow-name: 'test' - java-version: 11 - cpu-architecture: x86_64 - - # publish-metric: - # needs: [ java-ec2-adot-sigv4 ] - # 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-ec2-default-attempt-1.outputs.validation-result || needs.java-ec2-default-attempt-2.outputs.validation-result }} \ No newline at end of file From fe35389167b099d557a92ceb48b29839e506e585 Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 26 Mar 2025 05:03:24 +0000 Subject: [PATCH 14/15] formatting --- .github/workflows/pr-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 88e823ba4..f5a149112 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -5,7 +5,6 @@ on: branches: - main - jobs: build: name: Gradle Build From 79a5518c9324f407775bc6f784464747362464f2 Mon Sep 17 00:00:00 2001 From: liustve Date: Wed, 26 Mar 2025 16:25:25 +0000 Subject: [PATCH 15/15] removed unused environment variable --- .github/workflows/java-ec2-adot-sigv4-test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/java-ec2-adot-sigv4-test.yml b/.github/workflows/java-ec2-adot-sigv4-test.yml index 1cf749209..011bfc7bb 100644 --- a/.github/workflows/java-ec2-adot-sigv4-test.yml +++ b/.github/workflows/java-ec2-adot-sigv4-test.yml @@ -35,7 +35,6 @@ permissions: env: E2E_TEST_AWS_REGION: 'us-west-2' # Test uses us-west-2 in the us-east-1 accoun - MAIN_SERVICE_ADDRESS: 'localhost' CALLER_WORKFLOW_NAME: ${{ inputs.caller-workflow-name }} METRIC_NAMESPACE: ApplicationSignals JAVA_VERSION: ${{ inputs.java-version }} @@ -85,7 +84,6 @@ jobs: role-to-assume: arn:aws:iam::${{ env.E2E_TEST_ACCOUNT_ID }}:role/${{ env.E2E_TEST_ROLE_NAME }} aws-region: ${{ env.E2E_TEST_AWS_REGION }} - # TODO: Reintroduce ability to test latest public release - name: Set ADOT getter command environment variable run: if [ "${{ github.event.repository.name }}" = "aws-otel-java-instrumentation" ]; then