Traffic mirroring plugin for Kong gateway or any alternatives?

Hello all, especially @hbagdi and @hisham, I just wanna get some updates about the traffic mirroring plugin for Kong Gateway. How is it going and if it’s not yet implemented, is there any way to actually do the test with Kong from your perspective and suggestion?

Anyways, I’ve done tons of research about it and could only find this relevant repo kong-plugin-http-mirror/kong/plugins/http-mirror at master · tarepanda1024/kong-plugin-http-mirror · GitHub. This repo is published 2 years ago but I don’t see any use of it yet… and since I’m not so familiar with Lua, I’m not sure if this is something that we can “temporarily” use for traffic mirroring of Kong?

1 Like

I have successfully tested traffic mirror with this plugin. https://github.com/nhp0712/kong-plugin-http-mirror. I had to modify some parts of it in order to make it work. However, it’s now currently mirroring a single or multiple endpoints at once, so it currently doesn’t support load balancing.

Anyways, many thanks to the creator tarepanda1024 and contributor lgazo.

what part you modified, i use that ,but didn’t work

The modified part was in mirror.lua - Added path into “request” in order to execute afterwards.

thanks a lot for your reply, i debug it before, i found it return 400 bad request, the traffic didn’t mirror success, you mean in this local request = {
method = ngx.req.get_method(),
headers = ngx.req.get_headers(),
query = ngx.req.get_uri_args(),
path = ngx.var.uri
} ?

Yes, that’s right. It worked fine to me in the last version of Kong in the past. I’m not sure if the newer version is still compatible with it

path = ngx.var.uri, it’s already here, or what details you changed?