{"id":558,"date":"2021-11-10T13:59:03","date_gmt":"2021-11-10T13:59:03","guid":{"rendered":"http:\/\/18.141.20.153\/?p=558"},"modified":"2025-08-20T11:56:31","modified_gmt":"2025-08-20T11:56:31","slug":"how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray","status":"publish","type":"post","link":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/","title":{"rendered":"How to analyze, debug and trace AWS Lambda function using AWS X-Ray?"},"content":{"rendered":"<span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">9<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>\n<p><img src=\"https:\/\/lh3.googleusercontent.com\/s6AT3wfiz1TsDxhJqyzV8sZPU9xsgtIGDTbpT7_foSwQ2vG_9LOxCfYjT8LmqWx2SHAcHDUjZ4375X-wAC8o_MIhtXYbQHilG-J6t9IfGAC6YBXeplq4DIIJ6b_Vc9uDJ7i1X-Um\" style=\"width: 1600px;\"><\/p>\n\n\n\n<p class=\"has-text-align-justify\">AWS X-Ray helps developers to analyze and debug production and distributed applications. It helps developers in understanding how applications and their underlying services are performing to identify and troubleshoot the root cause of performance issues and errors. In this blog, we will explore how we can make use of AWS X-Ray to monitor, trace and debug Lambda functions eliminating the need for manual intervention of each execution. We will test the trace map for both\u200a\u2014\u200athe successful and failed executions of the Lambda function. Let\u2019s explore!<\/p>\n\n\n\n<p><strong>In this blog, we will cover:<\/strong><\/p>\n\n\n\n<ul><li>What is AWS X-Ray?<\/li><li>AWS X-Ray components<\/li><li>Features of AWS X-Ray<\/li><li>Companies using AWS X-Ray<\/li><li>Hands-on\u200a<\/li><li>Conclusion<\/li><\/ul>\n\n\n\n<h2><strong>What is AWS X-Ray?<\/strong><\/h2>\n\n\n\n<p class=\"has-text-align-justify\">Debugging applications is the most critical part of the software development process. Developers always require some good tools which can help in debugging applications. AWS X-Ray is the developer\u2019s buddy and helps developers analyze and debug applications using distributed tracing. Using X-Ray developers can pinpoint and understand the root causes of issues, errors, and bottlenecks of the applications.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">With X-Ray, developers can identify which part of the application is causing the issue and see the details of the requests being made to the app such as their latency, errors, HTTP response status, etc. Developers can easily understand where mistakes are occurring thanks to X-visual Ray&#8217;s map of the application&#8217;s architecture. Apps running on EC2 or in containers via the EC2 container service are straightforward to analyze with X-Ray. It can also determine the impact of faults on the application&#8217;s users. It can display the application&#8217;s service call graph.<\/p>\n\n\n\n<p><img src=\"https:\/\/lh5.googleusercontent.com\/lKC3L4R5pH4S5Dj5L_LsJnVaAsKsnR8WVb0DDzZT81uRnhafbyFRX9uM1x-s1GByhdcr2vbXlqbHmSli-OrYToxyZ22FvHCZ1c_eBFSPgtXTmOgjn4rnQxwlZm_RPgNGaoXihk10\" style=\"width: 1600px;\"><\/p>\n\n\n\n<p class=\"has-text-align-justify\">As shown in the above image, <a href=\"https:\/\/aws.amazon.com\/xray\/\" target=\"_blank\" rel=\"noreferrer noopener\">AWS X-Ray<\/a> has two main components X-ray SDK and X-ray daemon. There are X-ray SDKs for Java,.NET and Node.js. It allows you to get up and running quickly without having to manually direct your application code to log request metadata. The X-ray daemon collects metrics generated by the SDK and runs on your instances, whether they&#8217;re on-premises, in AWS, or even in a Lambda function. It operates as a local buffer and gets data from the SDK over UDP.<\/p>\n\n\n\n<p class=\"has-text-align-justify\"><strong>The X-Ray SDK provides:<\/strong><\/p>\n\n\n\n<ul><li><strong>Interceptors<\/strong>\u200a\u2014\u200atrace incoming HTTP requests<\/li><li><strong>Client handlers<\/strong>\u200a\u2014\u200acall other AWS services<\/li><li>HTTP client \u2014 calls to other HTTP web services, both internal and external<\/li><\/ul>\n\n\n\n<p class=\"has-text-align-justify\">The SDK also includes functionality like instrumenting SQL database calls, automatic AWS SDK client instrumentation, and more.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">X-Ray creates a detailed service graph using trace data from AWS resources that support cloud applications.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">As shown in the below image, the service graph shows the client, front-end service, and backend services that front-end service calls to process requests and persist data.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">The service graph can be used by developers to discover bottlenecks, latency spikes, and other issues that need to be addressed in order to improve the performance of their applications.<\/p>\n\n\n\n<p><img src=\"https:\/\/lh3.googleusercontent.com\/FJTUkzyF9rHkviFMpg6aMDxFKAJO_T5SxrzdFui4jOygBxa3Qn6OqTRnRpDAdnLZp9BaXQcvaUHBZw71zNxrlWgNbklqukE-jHWnXfQcKNG2kZI4CQhB3_U0PalR5PHnYyNnXsBu\" style=\"width: 1600px;\"><\/p>\n\n\n\n<p class=\"has-text-align-justify\">Consider the situation where you are pushing data into DocumentDB and it\u2019s not scaling quickly, which is getting you throttled and you want to figure out the requests that are getting throttled. It is very easy to do.&nbsp;<\/p>\n\n\n\n<p class=\"has-text-align-justify\">You have a Trace ID or a series of them, and you can add &#8220;throttled&#8221; in brackets on the DocumentDB service or in the name of your document, and it will find all of the throttled traces. These traces can be associated with a variety of metadata.<\/p>\n\n\n\n<h2><strong>AWS X-Ray components<\/strong><\/h2>\n\n\n\n<p><strong><img src=\"https:\/\/lh3.googleusercontent.com\/6a7FMQONHi9ygPAwfH1hjGO73NsdgaHIhFaUf2tcw0qXiSYI7Hkr1tdaof2PJEdcQvZFz-q46OEnYO-M5mU_OeifB1z1X19-ThvOBy757nFwxXAVKxoII0rnGTG8O3eZ3oylpLCo\" style=\"width: 1600px;\"><\/strong><\/p>\n\n\n\n<h2><strong>Features of AWS X-Ray<\/strong><\/h2>\n\n\n\n<p><strong><img src=\"https:\/\/lh5.googleusercontent.com\/W0l_lRnAsvpyEYhQzCyOf2ThGL91rzZ7OGVF6xcO_6EQ9aMJXvxXjx5O4CX17g--fltkFB_niWbU8OjlAH-qJGf-KqCBkJvuAD3ls6KodU-QMpr4Prapq3CznXXb_R_BmLdfWw0l\" style=\"width: 1600px;\"><\/strong><\/p>\n\n\n\n<h2><strong>Companies using AWS X-Ray<\/strong><\/h2>\n\n\n\n<p><strong><img src=\"https:\/\/lh6.googleusercontent.com\/kHtvPVIq6ogfUWnOo_eGKaVbtvqpgbaSbWT2H5MuUcYtqGsszWNxDXkwIgEOwGHMCxI0eTMwFknegmZ8yLhjWj3XoI0zrzHj_GOB7zac5QSBksl5q8ae_CiF0f7UUVhhFQHXK46m\" style=\"width: 1600px;\"><\/strong><\/p>\n\n\n\n<h2><strong>Hands-on<\/strong><\/h2>\n\n\n\n<p class=\"has-text-align-justify\">In this hands-on, we will implement the execution of a Lambda Function by monitoring and tracing its execution using AWS X-Ray.<\/p>\n\n\n\n<p><strong>To implement this, we will do the following:<\/strong><\/p>\n\n\n\n<ol><li>Sign in to your AWS console.<\/li><li>Create a Lambda function that is to be monitored by AWS X-Ray.<\/li><li>Enable Active Tracing for your Lambda Function.<\/li><li>Create a test event for your Lambda Function.<\/li><li>Test your Lambda Function using the test event.<\/li><li>Navigate to the AWS X-Ray console and wait for a few minutes for the service to compute a traced map.<\/li><li>View the traces for further details.<\/li><li>Create a test scenario for a failed execution and repeat the steps.<\/li><\/ol>\n\n\n\n<p class=\"has-text-align-justify\">The following image represents the flow of the implementation<\/p>\n\n\n\n<p><img src=\"https:\/\/lh4.googleusercontent.com\/p0EPAUG1jLEUZ7HYSAjYq-SgiceT8FizyJM8autbSJhkt3PjhFIusiBTdJQxcCFY7O3bAmim2NXJYllsgHi94ficg83xJMTQS_JnsHfEqjVJ4lMjGPYrUqQ8zF2g9Iko3oWziEL_\" style=\"width: 1600px;\"><\/p>\n\n\n\n<p>Login to your AWS console and navigate to the AWS Lambda console. Click on \u2018Functions\u2019 mentioned in the left navigation pane.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh5.googleusercontent.com\/bMw-PRf4s7914HbY_feztMEbBZFvfZdUoLDs2i6y7miDG1t6hTcf0spBQhpnGcOSXVuQQanl96DY4P0tu3XjiTVXYDPyhRh_gwP032dwZzqOvuIO1jjwxq6DDeTAv4FPFg9uAFaD\" alt=\"AWS X-Ray\" width=\"840\" height=\"399\"\/><\/figure>\n\n\n\n<p>Click on \u2018Create Function\u2019. Select \u2018Author from scratch\u2019, enter the function name, select the runtime as \u2018Python 3.7\u2019.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh6.googleusercontent.com\/WwVd6wGgdkkzq-dV9LcBqKkg3n9lSsVPcwv-pWIYYDpg9IBwfzJrbT4di5DcJZD8NghMt0uX1tUFAZUelfcq4SJ3RVBF_T_S_kRPTnigwRCiwFdPjXc3PmTy0yeOrADDUNXjbD9n\" alt=\"\" width=\"838\" height=\"471\"\/><\/figure>\n\n\n\n<p>Scroll down and under the Execution role, select \u2018Create a new role with Basic Lambda Permissions\u2019. Once done, click on \u2018Create Function\u2019.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/GLgVOrnJh1sbZZUUfoRM9snq4mUjHFgXe5gLhJ5zsk4wkt2IhDukmUJ31assUVIO34Fk_QIzBbg4teJPK5JEXDDHZx9xaESnPttVJtTIizD2xFXJ-M8MPB2wpW6smPlNfGUJwV1M\" alt=\"AWS X-Ray\" width=\"839\" height=\"472\"\/><\/figure>\n\n\n\n<p>Upon clicking on \u2018Create function\u2019, you will be navigated to the function console with the success message.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/SWVwaBS64BRGY8hBIlvEAtsFF0PdsX2r4XgvA-LcQjDzKTo5XpeZBcgUjh9G1lEb74_QmpLGvYvBXxsqimtbOmBWBj71f4hPQIiJ_A9tKRKkL7aIAaEk4SR7e-OnJBE817NzO1qd\" alt=\"AWS X-Ray\" width=\"839\" height=\"472\"\/><\/figure>\n\n\n\n<p>Now scroll down to the function code in the editor pane and click on \u2018lambda_function.py\u2019.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/W7INO3fCN39YBruxDRqddF5QDSoaVm-eqa2XWaKy_gzuXnJxdbiTMiNI8ZAwtKX6FcThS_6UFw0pw7GZoomKllGGbJUBSaeifbhgQGhxnMOZTlKFvY25GFA6IKgAPJhcN4D7mE_C\" alt=\"AWS X-Ray\" width=\"838\" height=\"471\"\/><\/figure>\n\n\n\n<p>You will see some sample code in the editor pane for the same function.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/3Mjk6gykShv5Jgl486t3JkN3gisSH9p0_3Gx2z7wZbRfCYgKTcuiFdBUIydhrWXnTIfNxG2fT6VvKHNpmEnh6edkgIkQn2xGzu8CRvFs1_y0UoflJQHk2dHQ1DNNzcVXgQpKvq5L\" alt=\"\" width=\"840\" height=\"473\"\/><\/figure>\n\n\n\n<p>Now scroll down to the Monitoring tools section on the Lambda dashboard and click on edit.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/eqawFC3KavC9kM-OMipMRCuff6SkVkQESdtrlusek4-fXnGP9_m3zASZtObxbzgQCJrEFSs0vL1IOfVranDGE53N4CIBZF5GUZZ9_l3CGdCyzr58g25wJP7JlF4gIDaOQ13TRhot\" alt=\"AWS X-Ray\" width=\"839\" height=\"472\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">You will be navigated to the Edit monitoring tools dashboard. Enable the switch on the left of Active Tracing under the AWS X-Ray section.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/p2yCc8qU0jZ1OC07Uz8O34Mm5WGibSNn-m3hMXViJZFkhAF0myRbPzkU-r0g4b1obIWHg8EkX5g4JIinjR7LCmb1aU4AYVl_D7v7-BVeEtxadriZcUeebkcqo-NtJ-ILPRufOtfY\" alt=\"\" width=\"840\" height=\"473\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Scroll down and click on Save to let AWS X-Ray monitor and trace the actions you perform on the Lambda function.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh5.googleusercontent.com\/HkNR0PHaHfji71TAn7oW1vL_3Kt6m-gBF5jsM3tFjZXyllIvIRIXBkSWx0WQY7EtrWIrhClxsxjll1W7gpzqVJRa7lP7wih5ZBHbUBZ49_p_pq42vZntD1msQJSJRpXO_9HcJ9PD\" alt=\"AWS X-Ray\" width=\"840\" height=\"473\"\/><\/figure>\n\n\n\n<p>You will notice the \u2018Active tracing\u2019 option switched to Enabled.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/cbv-ThZNd4Tr2akjQKI7JVRJWPiXtWELkcWL_2-yKJhE2tegH6n_N_5Sep2nezSRf5hDYClQZ10bT1qIIo5wVrvoBiKwwnHu_WDC6Ecq76XZsc6pipJPVtDCuBvTYiQ4sHzsiCDA\" alt=\"AWS X-Ray\" width=\"839\" height=\"472\"\/><\/figure>\n\n\n\n<p>Now navigate back to the top of the Lambda Dashboard and click on Test.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/-lIPzBKjG3zszkL6pJX-EIkGjVZYOZz31tL9YGWEPqvs0DyuNZgV9Yag2SMJaUlSmUNeGErug9czFT6aShJ6WzH7xypuTseJHJUitHpuM0HFT2TelYx02ZArnw_vO_TKXqcqQl_l\" alt=\"\" width=\"839\" height=\"472\"\/><\/figure>\n\n\n\n<p>A modal to set the configuration for the test event appears. Enter a name for the test event.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh6.googleusercontent.com\/TTDDmh8CNBHt7tCOEa6IwqtaxPCdkF1-WA60VMrP77iTzNPPNbXqpBswZ-52WkgLkM10OYPSxVDTZ3yzIB3Tz4O5BQWekwUc4Ka6--O_hGlpbx7W_gJMN-Y7MTh6EFn6nFHt1ocj\" alt=\"AWS X-Ray\" width=\"839\" height=\"472\"\/><\/figure>\n\n\n\n<p>Scroll down and click on Create.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/fuRObL1HAn54f83zgBJIH4H0Kjjpv4Pb-CrsOu0NoSJZq2SyFOl73nZckhFHtQQXLSMrJRiD-WboMX-Hk1DtlleN0QTpAate57ABNBGcmR8-ATAOG5kJdEq4qgMMXravYhEEFwnN\" alt=\"\" width=\"838\" height=\"471\"\/><\/figure>\n\n\n\n<p>Now navigate back to the editor pane of the lambda function.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/QOrJaLegdap1hVTy9J-tbo0yCpo-a_ph2OUslePxi0Ev71sS2Aunxfn1rmD7-_jJpeFFNyFdqB0Etl48gaOS7akvB7bWfByvawuCO7zBASkBi6fNDO2u-5Q7Wv12FjxnaBBNdH_y\" alt=\"AWS X-Ray\" width=\"838\" height=\"471\"\/><\/figure>\n\n\n\n<p>On the top, search for X-Ray.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/wcOgUdth7bkEUC-LGFE6JOHbTXT093tZkGX7YfswNmgvVAv3FeU_Ess3K_q6Vd9mNpnPKhLT-nQcTJRwkENFmWaXwEjwS7yeZo_Q7bmgyP0r_ei6KVemUkXIJ1VobWvGzibIyxhc\" alt=\"\" width=\"838\" height=\"470\"\/><\/figure>\n\n\n\n<p>Right-click on the service and click on the Open link in the new tab.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/U8NMftEKvvRxD8dhtQuo1CIwSzxqKqkDzLGgLNN3Cb5Ui9aPrp7yagsVRHgvbmQYO8K9JQBxZ8tzAkLPikGdFS_8iJZquXUV6MC52YJdFI9Vub4V0UWRnsi0QCVJh2xPEV1tncJi\" alt=\"AWS X-Ray\" width=\"840\" height=\"471\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">You will be navigated to the AWS X-Ray dashboard. Click on \u2018Service map\u2019 in the left navigation pane. You won\u2019t see any data since you haven\u2019t performed any action on your lambda function yet.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh5.googleusercontent.com\/_xAN2egYRTDgI458y0sUSMbdzzqtgUyrI453mOF6ihqAuXFnZYwq8yUI2HBu4giHWyjMRQBOjQGpI-Ei1tJlhvuOdPClAg7lixyPewUK_aF-Sobkrld7bJgSf-bMEdNfjw7AdqOI\" alt=\"AWS X-Ray\" width=\"839\" height=\"471\"\/><\/figure>\n\n\n\n<p>Navigate back to the Lambda functions editor pane and click on \u2018Test\u2019.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/lvsH2wMTTE5GFGmxMRuUp4mNrgg98UJR5PmvTua44HcE-wDidAbixX7ih_u_C4KOEq_K0Zvy7rQmzK0yjZsi8jYL0jgumovpJu6vmR2qcFesI_icTMEWN5AUxhUPbI-2ONjpQZPE\" alt=\"\" width=\"841\" height=\"472\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">You will see the Execution results in a new tab. Now, hit on \u2018Test\u2019 multiple times so that AWS X-Ray can trace your actions and form a computing map.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/hHRwIoNHq1nh-bOVjG2SelN2-2qrxNKPGEkyFhNAO2JCUMTROEwxD0l5KzfbRzrBFYrmxKb6K_nlKoWpA6PMGSWWpt9RHAxjzN9mrVGVIS17-OtWcevRT78FdRN8D6frmyrcgiNd\" alt=\"\" width=\"841\" height=\"472\"\/><\/figure>\n\n\n\n<p>Navigate back to the AWS X-Ray dashboard. Wait for a few minutes and hit Refresh.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/M3Hpc3kWkfozJ1qDpnvU0q6CjDUvl62DhUkNJzCxVkn02UhIQjGWORILjl6_3qNkMIkw6vRqHmD2_KsvdFr2dEMibiDYNC59pI6AVnGqDD7vi6WQxDQ-IIqP6ocff9KhCMW8gSup\" alt=\"\" width=\"840\" height=\"471\"\/><\/figure>\n\n\n\n<p>After a few minutes, you will see a Computing map on the screen with a loader.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh5.googleusercontent.com\/VYEKekRP412mXvUQcUGNcyAXNuNGfmT-UBw1HUxCCmt5f8_WFn9qwHSVTmUio5JK6MU_-89IkG6BJVnVnKdlDO7J7AncwDHxHUZ2SrOZM6ZtfqKd5HS3xaqinc0tj4X5mdh0Bt1h\" alt=\"\" width=\"839\" height=\"471\"\/><\/figure>\n\n\n\n<p>Once loaded, you will see the traced map on the dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh6.googleusercontent.com\/9V3GAyv1foRnHvfx4VNnS-Hg9cj6r0GL3wjDJNrlFLOYpyVJOFNPcqBKS1swpV2-E_bcOB8nNwuQ-qdvUj5O9-eOMWVB-AO44aL10peMVyWsLuItZIJDGvv0Di3rIp_KZ1BAixCa\" alt=\"AWS X-Ray\" width=\"838\" height=\"470\"\/><\/figure>\n\n\n\n<p>On the bottom right of the screen, to see the services icons, enable the Service icons option.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/fWaHDsbVAI9d_ZyDxRVArk6wrXScyblhUX5_lw9c8KTbfUoc27L9YzQAeOrXffDiPxe_yIgnp_mMcVmSegB0YimN87F6mPhMtUPWb3TRwc2LKqwFPxXzxlBNA9GA9Uo63mX29z48\" alt=\"\" width=\"839\" height=\"471\"\/><\/figure>\n\n\n\n<p>You can also search for the service for which you have enabled active tracing as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh6.googleusercontent.com\/gP7Jwaq_ydxrkFxYweeY2MbZj1AbAKEfhyR8-r06dNZ91hqW9JD2hrME1putW7rprYRS-bdUSforatcUQ7z24awRVH3lVJNWdgqPPnwJ4lPLuJa1LL0T6i8dBArz3_gvpHory4ID\" alt=\"AWS X-Ray\" width=\"840\" height=\"471\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">To see further trace details, click on the service on the map. On the arrows, you will see the success\/error rate. As you can see below, the success rate is 100% for the function execution.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh6.googleusercontent.com\/cd2oNsoUeNM5cK4hhR4WtJ7tYimXInPVQzv4FALF6_dgBMitgodjcFPQKdkaJFi7wH8wZkhdnP6ASaJexSEaCyn8pzAAik4pTs0p5LMA6teLWXjROKz8yQtKy7yr2V4Rbu_bsnoC\" alt=\"\" width=\"841\" height=\"472\"\/><\/figure>\n\n\n\n<p>The further details for the Lambda function.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/tGXgWdHSKY3E7YXXpw-0A_n858R4v7hnSA7ts-q7UFfQB5LGbmEou2sfX3M17doPyKnzYR3VSmnNQqS0PYhGYPgeIX0gHoQso6hFuZn3Kn_r-55uh80vXY0RMnt6CAW0bD8mlk_E\" alt=\"\" width=\"839\" height=\"471\"\/><\/figure>\n\n\n\n<p>Now, scroll down on the \u2018Service details\u2019 modal and click on View traces.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/B5fC68T_t48-BEj7FkYXc6UaGT1LOJ_rfeKISdRPqsocFFkbERkQVVRsiP1UhbkQyqghG26tUhREcYfCoZ9-jG6HPavDL-T_5Ex8UCo419-TUzU--e02xNVd-0z8TXc1LSjWcDkV\" alt=\"AWS X-Ray\" width=\"839\" height=\"471\"\/><\/figure>\n\n\n\n<p>You will see the execution results in the Trace list for your lambda function.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/rA4z6MS2nE1mse3FLzmRjw81MIyhZHZjI-0P9PF5kgxXiUIcpqkhhH3AA7X7vBTuxZ0r1mx6XllfiSd8a5iW5Cqa3aqKDf8XMdPQMnAGpOpQBQk1AsPL8gOWwZUBV4CHHK-R8dju\" alt=\"\" width=\"838\" height=\"470\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Now, to get the details of the latest execution, under the Trace list, click on the arrow on the right of it to filter and get the latest execution.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/J9g6gZo8XuTjFq3UK5lg6sh5UAmlSU5AHNz2n-krkh7DUjxgKzdfHSny0S8rtZbQGmEH_MVZwVNSqHMjO8D_DcuBwOH6mybkJzkepBhH-7Bdk1qaXCnU347TNQgTtmXQ1F1jcHgl\" alt=\"AWS X-Ray\" width=\"838\" height=\"471\"\/><\/figure>\n\n\n\n<p>Now click on the ID of the latest execution from the Trace list section.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh5.googleusercontent.com\/wVbDC4pHK9E412j_LyHv2O4nQY9S9FZSrU6OhpZMpikeaDDxrsP6jDFCH0bkDIdop6bq_no8f_gUOvDTOb_qCoKgUzJTiV8hmHDjyMv91pY8QoFsACFwwjk1Rrw3j73iXJAilpmk\" alt=\"\" width=\"841\" height=\"472\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Below you can see the further details for your lambda function. Under the Trace map, you can view the response rate as well if you click on the function in the trace map.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh6.googleusercontent.com\/wqryKjlwbKFKdazLMO78xd4svbqbOlxH17EGjT3gi2zVcD_bNyzlxzhlzCfJGTmwXf-49vITBGmpdgqbZRQX2xE_4gsjxMMMkoXhGLiZH_2rTdJDGqKJtpXM8LVqwBimP1D_2D65\" alt=\"\" width=\"838\" height=\"470\"\/><\/figure>\n\n\n\n<p>To view the response in JSON format, click on the Raw data tab.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/4w59b0IoIHFqEPgNkAojfJ8zQvEONx68YHt5PuBWI0uTujxpxn8hwzeviX3lTkzhO9x7Irejr3pPxzYXq3maSpsQrbhzrWTVWHffO_j3sYk5zu3o3SU3xYuVIR-kfU-YePXSWhii\" alt=\"AWS X-Ray\" width=\"839\" height=\"471\"\/><\/figure>\n\n\n\n<p>Let\u2019s test a negative scenario. Navigate back to the Lambda Function. Alter the function as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh5.googleusercontent.com\/lG9S3SkZSlpue82OJUwT2jQq6aZ7oEbD8YVEvkDDoA4UU0Rhzh4OWYZNTp4LNTxIKKF17N-XEF9Znp8u1hr9Ph0gLtzt-szmwN2llIXK1-Es1V6hiynQeywVfhx9aiNu0ey0BRwn\" alt=\"\" width=\"840\" height=\"471\"\/><\/figure>\n\n\n\n<p>Once done, click on Deploy to deploy the function and click on Test.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh6.googleusercontent.com\/COTRy4cHO1rgXLkZXK4P6ErTe6Nq-UjBJ3TMn7RfmALdOwfJFAalPOH-bB4NLTBayHsNy8dQnqFCPmObP-5gbV9NJX-IVQ-f4le_nEFYiqV-fCjATwTIvaFBKW4BjSdp6GHI0hPH\" alt=\"\" width=\"839\" height=\"471\"\/><\/figure>\n\n\n\n<p>You will see that the execution will fail.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh6.googleusercontent.com\/CxKRgfWcEK3j2XQBDAx44g8QJlVP1W4tnie1bj9pH0CttRZcqErHHLjbVf-xrvpeFN-DwdAkQd4iAov8nXn9B3S950nsrUndhphDNDVi3y5UkMY7w7sxADvhQWdx_hKmyV_YIya4\" alt=\"AWS X-Ray\" width=\"838\" height=\"470\"\/><\/figure>\n\n\n\n<p>Now, navigate back to the AWS X-Ray dashboard and hit on Refresh.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh5.googleusercontent.com\/ZAYDFg0-NtvRue5gE1ksyBFF-7cCzwGoAgjX1X9Xz4lZY6nyktd4k6jmreLGBgQ-e4kFJsUOX3ETW3KXjzvAwQ61ZUmTXbjllPDSYO4t6iqVwXxY3dNLY1VaZWGDdxkQu2Yp-N4V\" alt=\"\" width=\"838\" height=\"470\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Under the Service map, the color changes for the Lambda function. Select it and scroll down in the Service details modal. In the Service details modal, you will see that the Error rate shows 100% now. Click on View traces.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/_6eIWk4VmXXcUw_Z6vpqA-kyH_E4n3o-XMIz_gmChHONlm_1ENWPAwB1CBteqXazRU3h1rkcaiHgzCYT4HXbLW419Tllgtd2-MX45cWL9S7O5HZNgB4PF1oToO2L0ar1QeYZM8nK\" alt=\"\" width=\"839\" height=\"471\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">On this dashboard, you can see all the details for the execution of your Lambda function. In the details pane below, you will see the status shown as a warning sign.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/zrFzXWumPXBk0zlx6Yy39hYdXQqVSGGCyG9MjkOs2k6yFQLN2gMT-oQobUhQHwnwuIiOpRPmAyHmRWRY1nEO2P76q_lPMjIm1QJbLkxaa9oShrgrGDZ5qnn4HlJxp-zo9EuOesAf\" alt=\"\" width=\"840\" height=\"471\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">When you hover over the warning sign, you will see a message \u2018Error (Click for details)\u2019 as shown below. Click on it to see further details.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh6.googleusercontent.com\/0_zPHIxtdYZSRSAWWYktqft8HPJv-Ozo8XaGm5p6VtBqIpQAOl7OfO_KVdfmwcIxBcNDefyE1Os1W8qkGQVd-T-2IR9lO0yp21BPEmCj86bW0WlcoSzxBDMGk1DPJ1UCxnrp0MGD\" alt=\"\" width=\"839\" height=\"471\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">A modal will appear with the details for your Lambda function execution. Under Errors &amp; Faults, you will see the Error\u2019s value as true.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh5.googleusercontent.com\/gntgwHcB9YONEDG1GrRzcEMXhLVUAss_4Blg0z1XUHkwZFvi3O351r3vmZfMdKlgDOI5aRdYVWZZP6DRdU1_ORCYyHqYLenLI4kgSvxFqB1G4fOfMSibZmPwPO_kUZJTzcDZ-DV0\" alt=\"AWS X-Ray\" width=\"839\" height=\"471\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">This is how AWS X-Ray can monitor and trace all the actions you perform on your Lambda Function and provide each and every minute detail for the same.<\/p>\n\n\n\n<h2><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p class=\"has-text-align-justify\">In this blog, you have seen how to use AWS X-Ray to instrument your lambda function. Using AWS X-Ray, you can easily monitor, trace and debug your lambda functions without the burden of monitoring your executions or debugging your lambda functions manually. We will discuss more of AWS X-Ray and its other implementations in our upcoming blog. Stay tuned to keep getting all updates about our upcoming new blogs on AWS and relevant technologies.<\/p>\n\n\n\n<p>Meanwhile \u2026<\/p>\n\n\n\n<p><strong>Keep Exploring -&gt; Keep Learning -&gt; Keep Mastering<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-justify\">This blog is part of our effort towards building a knowledgeable and kick-ass tech community. At<a href=\"https:\/\/www.workfall.com\/\"> Workfall<\/a>, we strive to provide the best tech and pay opportunities to AWS-certified talents. If you\u2019re looking to work with global clients, build kick-ass products while making big bucks doing so, give it a shot at<a href=\"https:\/\/www.workfall.com\/partner\/\"> workfall.com\/partner<\/a> today.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">9<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span> AWS X-Ray helps developers to analyze and debug production and distributed applications. It helps developers in understanding how applications and their underlying services are performing to identify and troubleshoot the root cause of performance issues and errors. In this blog, we will explore how we can make use of AWS X-Ray to monitor, trace and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":560,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[2],"tags":[3,4,188,102,57,42,6],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to analyze, debug and trace AWS Lambda function using AWS X-Ray? - The Workfall Blog<\/title>\n<meta name=\"description\" content=\"AWS X-Ray is the developer\u2019s buddy and helps developers analyze and debug applications using distributed tracing.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to analyze, debug and trace AWS Lambda function using AWS X-Ray? - The Workfall Blog\" \/>\n<meta property=\"og:description\" content=\"AWS X-Ray is the developer\u2019s buddy and helps developers analyze and debug applications using distributed tracing.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/\" \/>\n<meta property=\"og:site_name\" content=\"The Workfall Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/workfall\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-10T13:59:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-20T11:56:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/11\/X-Ray.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@workfall\" \/>\n<meta name=\"twitter:site\" content=\"@workfall\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Workfall\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"17 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#organization\",\"name\":\"Workfall - Hire #Kickass Coders On Demand\",\"url\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/\",\"sameAs\":[\"https:\/\/www.instagram.com\/workfall\/\",\"https:\/\/www.linkedin.com\/company\/workfall\/\",\"https:\/\/facebook.com\/workfall\",\"https:\/\/twitter.com\/workfall\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400\",\"contentUrl\":\"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400\",\"width\":400,\"height\":400,\"caption\":\"Workfall - Hire #Kickass Coders On Demand\"},\"image\":{\"@id\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#website\",\"url\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/\",\"name\":\"The Workfall Blog\",\"description\":\"#Tech #Remote #Jobs\",\"publisher\":{\"@id\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#primaryimage\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/X-Ray.png\",\"contentUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/X-Ray.png\",\"width\":1200,\"height\":628,\"caption\":\"AWS X-Ray - Workfall\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#webpage\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/\",\"name\":\"How to analyze, debug and trace AWS Lambda function using AWS X-Ray? - The Workfall Blog\",\"isPartOf\":{\"@id\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#primaryimage\"},\"datePublished\":\"2021-11-10T13:59:03+00:00\",\"dateModified\":\"2025-08-20T11:56:31+00:00\",\"description\":\"AWS X-Ray is the developer\u2019s buddy and helps developers analyze and debug applications using distributed tracing.\",\"breadcrumb\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to analyze, debug and trace AWS Lambda function using AWS X-Ray?\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#webpage\"},\"author\":{\"@id\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a\"},\"headline\":\"How to analyze, debug and trace AWS Lambda function using AWS X-Ray?\",\"datePublished\":\"2021-11-10T13:59:03+00:00\",\"dateModified\":\"2025-08-20T11:56:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#webpage\"},\"wordCount\":1592,\"publisher\":{\"@id\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/X-Ray.png\",\"keywords\":[\"AWS\",\"Cloud\",\"debug\",\"DevOps\",\"lambda\",\"serverless\",\"workfall\"],\"articleSection\":[\"AWS Cloud Computing\"],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a\",\"name\":\"Workfall\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png\",\"contentUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png\",\"caption\":\"Workfall\"},\"sameAs\":[\"https:\/\/www.workfall.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to analyze, debug and trace AWS Lambda function using AWS X-Ray? - The Workfall Blog","description":"AWS X-Ray is the developer\u2019s buddy and helps developers analyze and debug applications using distributed tracing.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/","og_locale":"en_US","og_type":"article","og_title":"How to analyze, debug and trace AWS Lambda function using AWS X-Ray? - The Workfall Blog","og_description":"AWS X-Ray is the developer\u2019s buddy and helps developers analyze and debug applications using distributed tracing.","og_url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/","og_site_name":"The Workfall Blog","article_publisher":"https:\/\/facebook.com\/workfall","article_published_time":"2021-11-10T13:59:03+00:00","article_modified_time":"2025-08-20T11:56:31+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/11\/X-Ray.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_creator":"@workfall","twitter_site":"@workfall","twitter_misc":{"Written by":"Workfall","Est. reading time":"17 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#organization","name":"Workfall - Hire #Kickass Coders On Demand","url":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/","sameAs":["https:\/\/www.instagram.com\/workfall\/","https:\/\/www.linkedin.com\/company\/workfall\/","https:\/\/facebook.com\/workfall","https:\/\/twitter.com\/workfall"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400","contentUrl":"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400","width":400,"height":400,"caption":"Workfall - Hire #Kickass Coders On Demand"},"image":{"@id":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#website","url":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/","name":"The Workfall Blog","description":"#Tech #Remote #Jobs","publisher":{"@id":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#primaryimage","url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/X-Ray.png","contentUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/X-Ray.png","width":1200,"height":628,"caption":"AWS X-Ray - Workfall"},{"@type":"WebPage","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#webpage","url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/","name":"How to analyze, debug and trace AWS Lambda function using AWS X-Ray? - The Workfall Blog","isPartOf":{"@id":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#primaryimage"},"datePublished":"2021-11-10T13:59:03+00:00","dateModified":"2025-08-20T11:56:31+00:00","description":"AWS X-Ray is the developer\u2019s buddy and helps developers analyze and debug applications using distributed tracing.","breadcrumb":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/"},{"@type":"ListItem","position":2,"name":"How to analyze, debug and trace AWS Lambda function using AWS X-Ray?"}]},{"@type":"Article","@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#article","isPartOf":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#webpage"},"author":{"@id":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a"},"headline":"How to analyze, debug and trace AWS Lambda function using AWS X-Ray?","datePublished":"2021-11-10T13:59:03+00:00","dateModified":"2025-08-20T11:56:31+00:00","mainEntityOfPage":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#webpage"},"wordCount":1592,"publisher":{"@id":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#organization"},"image":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-analyze-debug-and-trace-aws-lambda-function-using-aws-x-ray\/#primaryimage"},"thumbnailUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/X-Ray.png","keywords":["AWS","Cloud","debug","DevOps","lambda","serverless","workfall"],"articleSection":["AWS Cloud Computing"],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a","name":"Workfall","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ec2-18-141-20-153.ap-southeast-1.compute.amazonaws.com\/learning\/blog\/#\/schema\/person\/image\/","url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png","contentUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png","caption":"Workfall"},"sameAs":["https:\/\/www.workfall.com"]}]}},"jetpack_featured_media_url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/X-Ray.png","jetpack-related-posts":[{"id":483,"url":"https:\/\/learning.workfall.com\/learning\/blog\/why-developers-and-businesses-should-go-with-the-serverless-architecture\/","url_meta":{"origin":558,"position":0},"title":"Why Developers and Businesses Should go With Serverless Architecture?","date":"November 10, 2021","format":false,"excerpt":"In today\u2019s competitive market, faster time to market and scalability are the two major measures of a good application. In this blog, we will discuss how SERVERLESS architecture can be a good choice for quick and scalable application development.\u00a0 In this blog, you will get answers to the following questions\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"Serverless Services on AWS","src":"https:\/\/i0.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/serverless.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":461,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-trigger-lambda-function-using-amazon-cloudwatch-events-and-configure-cloudwatch-alarm-to-get-email-notifications-using-amazon-snspart-2\/","url_meta":{"origin":558,"position":1},"title":"How to trigger Lambda function using Amazon CloudWatch events and configure CloudWatch alarm to get email notifications using Amazon SNS(Part 2)?","date":"November 9, 2021","format":false,"excerpt":"Modern applications such as those running on microservices architectures generate large volumes of data in the form of metrics, logs, and events. Amazon CloudWatch enables you to collect, access, and correlate this data on a single platform from across all your AWS resources, applications, and services that run on AWS.\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"How to trigger Lambda Function using Amazon CloudWatch Events?","src":"https:\/\/i0.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/cloudwatch2.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":416,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-do-event-driven-programming-using-aws-lambda-with-amazon-kinesis-streams\/","url_meta":{"origin":558,"position":2},"title":"How to do event-driven programming using AWS Lambda with Amazon Kinesis Streams?","date":"November 3, 2021","format":false,"excerpt":"Amazon Kinesis is an AWS-managed service that processes streaming data at a massive scale. Using Amazon Kinesis, data could be easily sent to various sources like S3, DynamoDB, Redshift, and Lambda. Kinesis is used to process hundreds of terabytes of data per hour. AWS LAMBDA works as an event-driven computing\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"Amazon Kinesis Streams","src":"https:\/\/i2.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/Kinesis.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":520,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-build-a-serverless-workflow-with-aws-step-functions-part-1\/","url_meta":{"origin":558,"position":3},"title":"How to build a Serverless Workflow with AWS Step Functions (Part 1)?","date":"November 10, 2021","format":false,"excerpt":"AWS Step Functions is a serverless orchestration solution that enables you to effortlessly coordinate several Lambda functions into customizable workflows that are simple to debug and modify. To see the full implementation of How to Build a Serverless Workflow with AWS Step Functions, refer to part 2 of the blog\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"AWS Step Functions - Workfall","src":"https:\/\/i2.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/StepFunction01.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":310,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-can-we-use-amazon-comprehend-with-aws-lambda-and-amazon-lex-for-sentiment-analysispart-2\/","url_meta":{"origin":558,"position":4},"title":"How can we use Amazon Comprehend with AWS Lambda and Amazon Lex for Sentiment Analysis?","date":"November 1, 2021","format":false,"excerpt":"In our previous blog, How can we use Amazon Comprehend with AWS Lambda and Amazon Lex for Sentiment Analysis(Part 1)? we have discussed NLP, Amazon Comprehend as one of the best NLP services, its features, benefits, use cases, etc. In this blog, we will demonstrate how to configure Amazon Comprehend\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"How to use AWS Comprehend for Sentiment Analysis","src":"https:\/\/i2.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/comprehend.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":504,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-use-aws-textract-to-extract-data-from-any-image-pdf\/","url_meta":{"origin":558,"position":5},"title":"How to use Amazon Textract to extract data from any Image & PDF?","date":"November 10, 2021","format":false,"excerpt":"Amazon Textract is a highly scalable machine learning service that collects printed text, handwriting, and other information from scanned documents automatically.\u00a0\u00a0\u00a0 Using Amazon Textract, you can easily extract text and data from images and any scanned documents that go beyond simple optical character recognition (OCR) to extract data from tables\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"How to use AWS Textract to extract data from any Image & PDF","src":"https:\/\/i0.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/Textract.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/558"}],"collection":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/comments?post=558"}],"version-history":[{"count":8,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/558\/revisions"}],"predecessor-version":[{"id":1842,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/558\/revisions\/1842"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/media\/560"}],"wp:attachment":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/media?parent=558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/categories?post=558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/tags?post=558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}