Why does the dashboard appear to log some requests first, when they were made after another?

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:

  1. A request is sent to your API via the inbound proxy.
  2. The API makes a request to a 3rd-party upstream via the outbound proxy.
  3. The 3rd party upstream responds to your API's request via the outbound proxy.
  4. The dashboard logs the completed outbound proxy request.
  5. The API responds to the initial request via the inbound proxy.
  6. 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.

Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.