edmunds / shadowreader

Serverless load testing for replaying website traffic. Powered by AWS Lambda.
Apache License 2.0
158 stars 13 forks source link

Feedback / suggestions / comments welcome! #56

Open ysawa0 opened 5 years ago

owenville commented 5 years ago

I've got a use case that Shadowreader would be delightful for: load testing resources through an AWS API Gateway, by mirroring traffic from one stage to another stage.

We have two resource "lanes", each receiving traffic from the same API Gateway endpoint via Stages (one stage per lane.) The primary stage typically routes traffic to the primary lane, but occasionally we route primary stage traffic to the secondary lane while updating the primary lane.

We'd get value out of mirroring primary stage traffic to the secondary stage in (near) real time, such as testing resized/updated resources in the secondary lane with real production traffic and observing the relative performance in (near) real time.

ysawa0 commented 5 years ago

I have looked into this a bit before and I believe it should be possible as API Gateway access logs can now be sent to CloudWatch:

https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html

One note is that there would need to be a process (Lambda) to tail the CW logs and ship them to S3 so that ShadowReader can parse and replay them.

dskrvk commented 5 years ago

I went through the documentation, and looks like this only works for GET requests with no body. My team would like to use this for an API that uses different HTTP verbs, some of which have bodies. I know ELB doesn't capture request body, so this might require a different approach.