Correlating Logs, Metrics & Traces

At this point in the module, you should be on the Trace Details page for a specific trace as shown below. If you are not at this point, please revisit section 3.2.

  1. Take a look at the Trace Map.

This shows a map of the services across which the trace traversed through.


  1. Scroll down to the section titled Logs. You will find all the log data from the different services captured at the moment this trace was recorded. In this example, you will be able to see log data captured by an ECS Service along with log data recorded by the Lambda function, all at the same time.

This gives great insights into the scenario you are investigating.

With ServiceLens, as you just saw, not only are you able to view the service interaction data through X-Ray traces and get insights into service metric information automatically through dashboards, but you also get insights into the context of various microservices through application logs captured the moment the trace was recorded.


  1. Click the View in CloudWatch Logs Insights button to navigate to the CloudWatch Logs Insights page.

This selects all the log groups that are involved in the mix and writes the query that will fetch the log data.

  1. Click on Run query to execute the query and analyze log data there.

This concludes the ServiceLens module.