Cloud-native gateways let you configure traffic mirroring for routes, which copies production traffic to a specified service for simulation testing and troubleshooting.
Background
Simulating real production requests in a test environment is challenging due to the complexity of modern network environments. Traffic mirroring addresses this by copying production requests at the traffic entry point and sending them to a test environment. This lets you use real production traffic to test new features or identify defects.
Use cases
For example, assume you configure a traffic mirroring policy for Route1 that mirrors 100% of the traffic to Service2. The following diagram illustrates the architecture.
Procedure
-
Log on to the MSE console. In the top navigation bar, select a region.
-
In the left-side navigation pane, choose Cloud-native Gateway > Gateways. On the Gateways page, click the ID of the gateway.
-
In the left-side navigation pane, click Routes. Then, click the Routes tab.
-
In the Actions column of the route that you want to modify, click Policies.
-
On the Policies tab, click Traffic Mirror.
-
Configure the parameters for the traffic mirroring rule, and then click Determine.
Parameter
Description
Destination Service
The service that receives mirrored traffic.
NoteThe Destination Service supports only the HTTP and HTTPS protocols.
Port Number
The port of the destination service. You can also select Dynamic Port.
NoteThe Dynamic Port option is for services where the port changes dynamically. This option does not support services with multiple ports.
Traffic Mirror Percentage (%)
The percentage of traffic to mirror. Valid values: 0 to 100.
NoteFor example, if you set this parameter to 50, 50% of the traffic for the current route is mirrored to the destination service.
Enable
Enables or disables the traffic mirroring policy for the route.
Verify the result
Go to Observation Analysis > Business Monitoring > Canary Release Comparison Dashboard for the target gateway. Select the services that correspond to Service1 and Service2, and observe the QPS data on the dashboard. If the QPS trends for Service1 and Service2 are similar, this indicates that traffic from Service1 is successfully mirrored to Service2.