Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 2.29 KB

lambda-monitoring.md

File metadata and controls

28 lines (17 loc) · 2.29 KB

Monitoring and troubleshooting Lambda applications

Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch. To help you monitor your code when it runs, Lambda automatically tracks the number of requests, the invocation duration per request, and the number of requests that result in an error. Lambda also publishes the associated CloudWatch metrics. You can leverage these metrics to set CloudWatch custom alarms.

The Lambda console provides a built-in monitoring dashboard for each of your functions and applications.

To monitor a function

  1. Open the Functions page on the Lambda console.

  2. Choose a function.

  3. Choose Monitoring.

Pricing
CloudWatch has a perpetual free tier. Beyond the free tier threshold, CloudWatch charges for metrics, dashboards, alarms, logs, and insights. For more information, see Amazon CloudWatch pricing.

Each time your function is invoked, Lambda records metrics for the request, the function's response, and the overall state of the function. You can use metrics to set alarms that are triggered when function performance degrades, or when you are close to hitting concurrency limits in the current AWS Region.

To debug and validate that your code is working as expected, you can output logs with the standard logging functionality for your programming language. The Lambda runtime uploads your function's log output to CloudWatch Logs. You can view logs in the CloudWatch Logs console, in the Lambda console, or from the command line.

In addition to monitoring logs and metrics in CloudWatch, you can use AWS X-Ray to trace and debug requests served by your application. For more information, see Using AWS Lambda with AWS X-Ray.

Topics