Frontend to Backend Tracing

Tracking a request from front end to API and back

If your frontend sends requests to your backend using API Gateway, you can easily track and pinpoint an individual request.

How does it work?

Each request is tracked independently across AWS services. So an individual request to your API generates two request identifiers (request IDs): one for the API Gateway request and another for the Lambda invocation request. See AWS Compute Blog for details.

To enable you to quickly diagnose problems, Lumigo correlates the two request IDs by automatically adding the same execution tag to them both. You can then query for the API Gateway request and immediately identify the corresponding backend request and analyze it.

When should I track a frontend request?

Some common use cases are:

  • Gain faster visibility into a customer-facing flow or issue without having detailed knowledge of every detail of your backend or being dependent on other developers.

  • Ask your support team to add the x-amzn-requestid to support tickets to improve communication and time-to-resolution.

How to track an API request with Lumigo

Step 1 - Use your browser to retrieve the x-amzn-requestId value:

For example, when using Google Chrome:

  1. Open the XHR tab (under Developer tools > Network)
  2. Trigger the desired API call (refresh the page, click on a button, etc.)
  3. Locate the API call response and copy the x-amzn-requestId value.
935

retrieve x-amzn-requestId

Step 2 - Run the following Explore query in Lumigo:

execution_tags.value: "<x-amzn-requestId>"
2690

Explore query used to find the relevant backend transaction.

Step 3 - Click on the result to debug and analyze the transaction

2690

πŸ“˜

Tracer Version

To get the best results from this feature, make sure your Lumigo tracer version is up to date.

Need help? Contact our support here.