Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Replay Testing or Traffic Mirroring to compare how 2 different services handle the same request. (Question) #2643

Open
vruss opened this issue Oct 29, 2024 · 1 comment

Comments

@vruss
Copy link

vruss commented Oct 29, 2024

Hello, I am making this issue as more of a help wanted on if it's possible to do what I am required to do using your library.


As a developer,
I want to perform API Replay Testing by capturing and replaying real-world traffic from the old service to a new service or Mirror the traffic in real time,
so that I can ensure the new service produces consistent responses and maintains compatibility with all clients.

Acceptance Criteria:

  1. Traffic Capture:

    • Capture real API traffic from the old service, including headers, request payloads, and responses, using a reverse proxy.
  2. Traffic Replay:

    • Reuse the captured traffic and replay the same requests against the new service.
  3. Response Comparison:

    • Compare responses between the old and new services for:
      • HTTP status codes
      • Response body structure and content
      • HTTP headers
    • Implement automated comparison logic to detect and log any discrepancies.
    • Account for non-deterministic fields (e.g., timestamps, unique IDs) in the comparison process.

Is it possible to do these things using a Middleware? Since this kind of replay testing / mirroring is not unique I'm curious if it there already exists a finished solution for this.

@MihaZupan
Copy link
Member

In short, no such functionality currently exists in the library, but you should be able to build such functionality on top of it.
See #105 and #2075 for more discussions around this & things to watch out for.

It should be relatively straightforward if you're only dealing with simple GET requests, otherwise you run into a lot more things to consider.

Traffic Capture / Traffic Replay

Do you mean mirroring of only live traffic?

There are existing tools that let you capture/persist networking traffic to replay later, have you tried using something like that?

if it there already exists a finished solution for this.

None that I can point you at, but maybe someone from the community can share how they've approached it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants