AWS Lambda Function URLs make it even easier to create AWS Lambda functions that can be accessed and triggered by using HTTP/S requests, which is key for building serverless applications that are connected to and invoked from the web. Starting today, you can generate a URL in one click that points to a specified Lambda function. Then, any HTTP/S request that a Function URL receives will trigger the Lambda function it’s assigned to. Visibility into Function URLs is vital for monitoring your serverless applications since Function URL latency and 500 errors returned from Function URLs impact your customers.
Datadog is proud to partner with AWS for the release of Function URLs by providing end-to-end visibility into requests to functions triggered by URLs, as well as into key Function URL metrics. In this post, we’ll look at how Function URLs work and how you can use Datadog to get deep insight into their health and performance.
Function URLs are useful for when you want to quickly connect your Lambda functions to the web. Whereas API Gateway provides tooling for managing RESTful Lambda resources and more complex APIs, Function URLs allow you to simplify operations and deliver value to your customers more quickly. If you later decide you want to use API Gateway’s API management features—such as API versioning and custom authorization—you can easily migrate from Function URLs to API Gateway because their request payloads use the same format and contain matching fields.
Having real-time visibility into your Function URLs is critical because any duration between receiving an HTTP/S request and the resulting Lambda invocation adds to customer-facing latency. You need to be able to measure, alert on, and set SLOs by using telemetry closest to the customer experience.
Additionally, while Function URLs are assigned to one Lambda function, each Lambda function may have multiple associated Function URLs. This means that if a Lambda function experiences an issue, you need to be able to identify which URLs were impacted.
Next, we’ll look at how Datadog:
- supports instrumenting Function URLs so you can see end-to-end requests of functions triggered by URLs in real time
- collects and visualizes Function URL metrics so you can get visibility into the performance of your URLs
After instrumenting your Lambda functions, Datadog APM automatically includes Function URL spans in your request traces without any further configuration. This feature enables you to see at a glance which URLs—and therefore which end users—are affected by any issues that may occur. For example, you can see if there’s a significant delay between when a specific Function URL receives an HTTP/S request and when its associated Lambda function begins to execute. This delay could indicate that a cold start is increasing latency and that you should consider enabling provisioned concurrency.
Function URL spans also visualize errors so that you can quickly see, for instance, if your customers are running into
5xx errors, enabling you to immediately start troubleshooting.
Datadog collects and visualizes Function URL metrics, such as latency and counts of total requests and errors. These metrics enable you to monitor your Function URLs alongside telemetry from your Lambda functions and other AWS services you may be collecting through our AWS integration, giving you a complete view of your serverless environment. For example, you can add Function URL metrics to the AWS Lambda dashboard to easily correlate Function URL errors to Lambda function performance.
Datadog automatically tags your Function URL metrics by the AWS Lambda function they trigger, so if any Function URL experiences an issue, you can see which function may be impacted.
In the screenshot above, for instance, a time series graph shows counts of Function URL
4xx errors grouped by Lambda function.
Datadog enables you to monitor Function URL performance alongside telemetry from other serverless AWS services, such as Lambda and API Gateway, in addition to over 500 other technologies. To include Function URL data in your Lambda traces, make sure that you’re using the latest version of Datadog’s Lambda libraries. If you aren’t already using Datadog, sign up today for a 14-day free trial.