Hypertest Docs
HyperTestKnowledge Base
  • Quick Set-up
    • Install HyperTest
    • Deploy your application
    • Mirror Traffic
      • Using Kubernetes
      • Using Amazon ECS
      • Using Docker
      • Using Nginx
      • Using Goreplay
        • ElasticBeanStalk Script for Goreplay
      • Using Apache
      • Using IIS
      • Using Istio
      • Using Kong
      • Using HAProxy
      • Others
  • HyperTest Overview
    • Introduction
    • Architecture
  • Detailed Setup Guide
    • Detailed Setup Guide
      • Installation
        • Linux VM
        • Kubernetes Cluster
          • Hardware Requirements
          • Cluster Setup
            • EKS
              • Existing Application Load Balancer
              • Calculate Setup Cost for EKS Cluster
            • GCP
            • AKS
            • Self Managed
              • Microk8s with EKS-D
          • HyperTest Installation
      • Mirror Traffic
      • Configure HyperTest
      • Automate Starting a Test
        • CI Integration
          • GitHub Checks Integration
            • Mandatory checks
          • Gitlab Integration
          • Bitbucket Integration
          • Jenkins Pipeline
            • Jenkins Plugins for PR events
  • Upgrade HyperTest
    • Upgrade HyperTest
      • Linux VM
      • Kubernetes Cluster
  • User Guides
    • Usage Guide
      • Install and Configure HyperTest
        • Install HyperTest
        • Configure Base DNS
        • Add New Service
      • Tests Runs and Analysis
        • View Test Cases
        • Start New Test Run
        • Understand Your Test Run Analysis
        • Prioritize Your Error Types
        • Track Bugs
        • Ignore Errors/Desired Changes
        • View/Download Report
        • View Consolidated Dashboard Reports
        • Sign-off Reports
        • Reduce Execution Time
        • Deduplication Rules
      • Troubleshooting and FAQs
    • Best Practices Guide
      • Cost Optimization
    • Dashboard Tour
      • Dashboard
      • All Sessions
      • Regression Report
      • Notifications
      • First Test Run
      • Interactions
      • Custom Analysis
      • Configuration
    • User Management
      • Create Admin User
      • Roles, Groups & Users
      • Enabling User Signup
    • Other Guides
      • Basic Nginx Auth for Linux HT
  • Middleware
  • Advanced Features
    • Import test cases from Postman
  • Change Log
  • Troubleshooting
  • FAQs
    • Setup
    • General
    • Regression Report
  • Glossary
    • Session
Powered by GitBook
On this page
  • Brief Steps:
  • 1. Required Parameters to run Goreplay:
  • 2. Create new revision with JSON
  • 2. Create the new revision via Old UI
  • 3. Update Service to latest task definition
  • Debug mirroring setup via Goreplay
  1. Quick Set-up
  2. Mirror Traffic

Using Amazon ECS

PreviousUsing KubernetesNextUsing Docker

Last updated 2 years ago

In this guide, we will be using to mirror the traffic to HyperTest. Goreplay will be added as a container in your deployment.

Update your service's task definition and add Goreplay as another container in it.

Brief Steps:

  1. Create a new revision of task definition

  2. Change the network mode to host so containers can talk to each other

  3. Add container with details - Name, image and Env Variables

  4. Create revision

  5. Update service to latest task definition

Change of network mode to Host is necessary for containers to be on same network

1. Required Parameters to run Goreplay:

  1. APPLICATION_PORT: <port on which your app is running>

  2. HYPERTEST_LOGGER_URL: <hypertest-vm-ip>:<hypertest-logger-port> or <hypertest_service_logger_ingress_url>

  3. HT_ENV: <your env name> # for eg: test, staging, etc

2. Create new revision with JSON

  • Go to the task definition

  • Select the latest version

  • Create new revision with JSON from latest one

Add the following json lines for sidecar container inside containerDefinitions

        {
            "name": "goreplay",
            "image": "public.ecr.aws/hypertestco/goreplay:0.16.1-24-02-2023",
            "cpu": 0,
            "portMappings": [],
            "essential": false,
            "environment": [
                {
                    "name": "APPLICATION_PORT",
                    "value": "<your-application-port>"
                },
                {
                    "name": "HT_ENV",
                    "value": "<your env name>"
                },
                {
                    "name": "HYPERTEST_LOGGER_URL",
                    "value": "<hypertest-logger-url  #for eg: 1.2.3.4:8000>"
                }
            ],
            "mountPoints": [],
            "volumesFrom": []
        }

Change your network mode to "host"

2. Create the new revision via Old UI

  • Go to the task definition

  • Select the latest version

  • Create new revision from latest one

  • Select Network mode as Host

  • Scroll down and click on Add Container

  • A dialog box will open for container details, enter the below one for the same

  • New Container Details:

    • Container name - goreplay

    • Image: public.ecr.aws/hypertestco/goreplay:0.16.1-24-02-2023

    • Memory Limit: Soft Limit: 300MB

    • Scroll down to ENVIRONMENT header and add below env variables:

    • APPLICATION_PORT: <your-application-port>

    • HYPERTEST_LOGGER_URL: <hypertest-logger-url>" #for eg: 1.2.3.4:8000

    • HT_ENV: <your env name> # for eg: test, staging etc\

  • Scroll down and add container

  • Now the container window is closed, then scroll to end and click on create on create the new revision from bottom right.

3. Update Service to latest task definition

  • Go to your service in cluster

  • Stop already running task

  • Click on update from right side

  • Select the latest revision of task definition

  • Keep on Clicking on Next Step and update service in end

  • After successful update, verify from tasks details that there are two containers running

To Verify the mirroring setup, hit any api on the application and check for request in "last mirrored requests" section or Session page in HyperTest.

Debug mirroring setup via Goreplay

To debug if goreplay is receiving the traffic from your application, we will output the incoming traffic to stdout, so we can see if Goreplay is receiving requests.

Steps:

  1. Exec into the goreplay container using below command:

kubectl exec -it <pod-name> -c goreplay sh

2. Run the following command:

sh debug-goreplay.sh

Now hit any api on your application and verify if Goreplay is able to receive it.

Goreplay
sidecar
ECS