Cloud-native API Gateway lets you replicate live route traffic to a designated service for simulation testing and troubleshooting.
Background information
Simulating real traffic in a test environment is difficult. Traffic replication solves this by copying live requests at the gateway ingress and forwarding them to a test service, enabling you to validate new features or reproduce defects with real production traffic.
Example scenario
In this example, Route1 replicates 100% of its traffic to Service2. The following figure shows the architecture:
Configure a traffic replication policy
-
You can configure a traffic replication policy from either of the following entry points:
API outside an instance
-
Log on to the Cloud-native API Gateway console. In the navigation pane on the left, click API. In the top navigation bar, select a region.
-
Click the target API name. From the instance drop-down list, select the target instance or select All instances. Click the HTTP API tab.
-
In the Routes, click the target route.
API inside an instance
-
Log on to the Cloud-native API Gateway console. In the navigation pane on the left, click Instances. In the top navigation bar, select a region.
-
On the Instances page, click the target gateway instance ID. In the left-side navigation pane, click API, then click the target API.
-
In the Route List, click the target route.
-
-
Click the Configure Policy tab. Then, in the Inbound Processing section, click Add Policy/Plugin.
-
Click the Mirror Traffic card. In the Add Policy: Mirror Traffic panel, configure the parameters and click Add.
Parameter
Description
Enable
Enables or disables the traffic replication policy.
Destination Service
Destination service that receives replicated traffic.
NoteOnly HTTP/HTTPS services are supported.
Port
Port of the destination service. Select Dynamic Port if service ports change dynamically.
NoteDynamic Port is not available for multi-port services.
Traffic Mirror Percentage
Percentage of traffic to replicate. Valid values: 0 to 100.
NoteFor example, a value of 50 replicates 50% of route traffic to the destination service.
Verify the result
Go to the page of the gateway instance. Select Service1 and Service2 to compare QPS data. Identical QPS trends confirm that traffic was successfully replicated.