A common use case with VGS is to collect and alias data in an in an inbound route, so that an API receives aliased data. Then, the API would send that aliased data to a different upstream using an outbound route. In this case, the inbound request is made first, and the outbound request is made second. However, the dashboard logs will show the outbound request first, before the inbound request is logged.
The reason for this is that VGS logs requests in the dashboard when the request has been completed. In this case, the inbound request is made first, followed by the outbound request, but the outbound request gets it's response from the upstream and completes the request first, and then as the API receives the response from the outbound proxy, it responds to the initial inbound request, completing the inbound request. In this case, the series events will be as follows:
- A request is sent to your API via the inbound proxy.
- The API makes a request to a 3rd-party upstream via the outbound proxy.
- The 3rd party upstream responds to your API's request via the outbound proxy.
- The dashboard logs the completed outbound proxy request.
- The API responds to the initial request via the inbound proxy.
- The dashboard logs in the completed inbound proxy request.
This is why you may see requests logged in the dashboard not necessarily in the order they were sent in. Additionally, this is why you will not see a request made through the proxy in the dashboard, if no response has been sent.