title: What to prefer AWS XRAY or CloudTrail for analysing user request travelling through Amazon API Gateway
body: <p>I am preparing for AWS exam and I found some documentation about AWS CloudTrail and AWS X-RAY where it creates confusion on their usage requirement.</p>
  
  <p>I have came across following question where requirement was to trace and analyse the user request as it travels through Amazon API Gateway APIs to underlying services.
  <a href="https://i.stack.imgur.com/VPbwv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VPbwv.png" alt="enter image description here"></a></p>
  
  <p>As per my understanding, we can use CludTrail to <strong>trace</strong> and <strong>analyse</strong> the user request. But the correct answer was AWS XRAY. </p>
  
  <p>The documents which have referred mentions that, we can use AWS CloudTrail logs for <strong>tracing,Security Analysis, Resource Change Tracking and Compliance/Auditing</strong>. On the other hand, we can use AWS X-RAY to <strong>analyse and debug applications running on distributed micro service architecture</strong>.</p>
  
  <p>XRAY and CloudTrail usage both have the term <strong>Analyse</strong> and <strong>trace</strong>. So it is quite confusing to which service should we choose under such requirement to trace and analyse the user request</p>