Monitoring Lambda function URLs - Amazon Lambda
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Monitoring Lambda function URLs

You can use Amazon CloudTrail and Amazon CloudWatch to monitor your function URLs.

Monitoring function URLs with CloudTrail

For function URLs, Lambda automatically supports logging the following API operations as events in CloudTrail log files:

Each log entry contains information about the caller identity, when the request was made, and other details. You can see all events within the last 90 days by viewing your CloudTrail Event history. To retain records past 90 days, you can create a trail. For more information, see Using Amazon Lambda with Amazon CloudTrail.

By default, CloudTrail doesn't log InvokeFunctionUrl requests, which are considered data events. However, you can turn on data event logging in CloudTrail. For more information, see Logging data events for trails in the Amazon CloudTrail User Guide.

CloudWatch metrics for function URLs

Lambda sends aggregated metrics about function URL requests to CloudWatch. With these metrics, you can monitor your function URLs, build dashboards, and configure alarms in the CloudWatch console.

Function URLs support the following invocation metrics. We recommend viewing these metrics with the Sum statistic.

  • UrlRequestCount – The number of requests made to this function URL.

  • Url4xxCount – The number of requests that returned a 4XX HTTP status code. 4XX series codes indicate client-side errors, such as bad requests.

  • Url5xxCount – The number of requests that returned a 5XX HTTP status code. 5XX series codes indicate server-side errors, such as function errors and timeouts.

Function URLs also support the following performance metric. We recommend viewing this metric with the Average or Max statistics.

  • UrlRequestLatency – The time between when the function URL receives a request and when the function URL returns a response.

Each of these invocation and performance metrics supports the following dimensions:

  • FunctionName – View aggregate metrics for function URLs assigned to a function's $LATEST unpublished version, or to any of the function's aliases. For example, hello-world-function.

  • Resource – View metrics for a specific function URL. This is defined by a function name, along with either the function's $LATEST unpublished version or one of the function's aliases. For example, hello-world-function:$LATEST.

  • ExecutedVersion – View metrics for a specific function URL based on the executed version. You can use this dimension primarily to track the function URL assigned to the $LATEST unpublished version.