Using Kong
In this guide, we will install http-mirror plugin to mirror traffic via Kong Gateway to HyperTest.
Brief Steps
Install kong-plugin-http-mirror via luarocks (or clone plugin repository from here and get the .lua files)
Migrate plugin from base plugin module (few changes in handler.lua)
Add kong-plugin-http-mirror plugin in kong configuration file
Restart Kong
Add kong-plugin-http-mirror plugin to your service
Getting Started:
Get Plugin
1. Install kong-plugin-http-mirror plugin via luarocks
2. Migrate from BasePlugin module
Go to the folder where the plugin's lua files are created.
It should be something like /usr/local/share/lua/<version>/kong/plugins/kong-plugin-http-mirror/
Do the following changes to migrate plugin from base plugin module as it is now deprecated and removed in Kong Gateway
Or Just replace the content of handler.lua with below content
Install Plugin in Kong
Add the kong-plugin-http-mirror
plugin in kong.conf configuration for each kong node.
The file is by default located in /etc/kong/kong.conf.default or /etc/kong/kong.conf.
If you are working on default file. Make a copy via below and edit it and use that to start kong
If you are manually adding the plugin with lua files, then also give the path to kong plugin directory in lua_package_path variable
If the plugin kong-plugin-http-mirror
is located on the file system and the handler file is in the following directory:
The location of the kong
directory is /usr/local/share/lua/5.1/
, so the proper path setup would be:
Restart Kong
Restart Kong using above edited conf file
Verify Plugin is installed in Kong
verify the plugins has been added to kong
Add Plugin to Service
Add kong-plugin-http-mirror
to your service via REST call
Now traffic coming to this app is being mirrored to HyperTest.
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.
Last updated