buger / goreplay

GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.
https://goreplay.org
Other
18.63k stars 26 forks source link

What happens to 5xx requests? #1090

Closed vBitza closed 2 years ago

vBitza commented 2 years ago

Hi, now this might sound like a dumb question but I couldn't find the answer in the docs. What happens to 5xx requests?

To give a little bit more context, we're using the goreplay to intercept some requests which go out to a service and replay them to another one. The first service was declared EOL but we still want to keep the replaying part, so my idea was to just keep sending the requests to localhost or some random address (not to the initial API) just so the flow of intercepting and replaying works. However it seems that the requests are either no longer intercepted or something else happens in the middle. The 3th service no longer has access to the requests.

I think the requests are probably get a 502 response (bad gateway) as they don't end up to a HTTP server, I wonder what happens to goreplay then.

buger commented 2 years ago

Sorry for the delay!

So basically for EOL service, you already removed its servers, but still still want to replay "legacy" traffic to the new service? In this case users who send requests to legacy server, they will get some invalid response, and it is ok with you, right?

It should record 50X issues without the issues. It listen on network interface, so whenever comes to network, should be possible to record. You can try to do some simple debugging and for example use tcpdump to check if traffic is even coming to the machine where goreplay is installed. Maybe this 502 errors coming from the load ballancer and do not reach your server at all?

Thanks!


Latest forum discussions:

vBitza commented 2 years ago

Hi, there was no LoadBalancer between the services, the traffic was Server to Server directly.

Anyway the question was dumb indeed and the solution to it was simple, instead of sending the requests to Server 1 to be intercepted by GoReplay which sends them to Server 2 we just moved the requests directly to Server 2. At the time of raising the question however I was trying to "fix" the issue without any changes at all in the codebase but really there were only a few changes that needed to be done so no point in reinventing the wheel. 😅

On the topic of the 5xx requests however, I didn't do a tcpdump debugging to see exactly what happens but it might be a nice addition to the docs if you ever have the time to do it an write a few lines about it. Maybe someone else might look for the same answer in the future. Also worth noting that in our case the GoReplay was on Server 1 and intercepted the outgoing traffic.

Thank you for your time and have a nice day! 👍