AWS Lambda extensions run within the Lambda execution environment, alongside your Lambda function code. Datadog partnered with AWS to create the Datadog Lambda extension, a lightweight version of the Datadog Agent that submits custom metrics, enhanced metrics, traces, and logs.
There are some key differences between the Lambda extension and the Forwarder, as well as certain situations where you may find it advantageous to use one over the other. This page describes the various reasons you may or may not choose to migrate from the Forwarder to the Lambda extension.
The Lambda extension only supports sending Lambda function telemetry for specific runtimes. The Forwarder is required to collect and add metadata to other AWS service logs, including those from API Gateway, AppSync, and Lambda@Edge.
|Runtime||Extension support||Forwarder support|
The Lambda extension has full feature parity with the Forwarder for Python, Node.js, and Go runtimes. The Lambda extension can submit Lambda logs, Lambda traces generated by
dd-trace (not X-Ray), real-time enhanced Lambda metrics, and custom metrics generated by Lambda functions.
The Datadog Lambda Extension offers the following advantages over the Datadog Forwarder:
The extension adds overhead to your Lambda functions, compared to functions that have zero instrumentation. The added overhead affects your AWS bill and Lambda concurrency, and could cause worse cold starts. The majority of the added duration does not affect your function’s performance. Based on Datadog’s latest benchmarking results, the cost overhead is always lower (or about the same when reporting data from remote regions) when using the Lambda extension versus the Forwarder.