AWS Lambda Integration
Kloudfuse supports three methods for collecting telemetry from AWS Lambda functions. You can use one method or combine them depending on how much visibility you need.
Overview
Integration Options
| Method | What it collects | Best for | Setup effort |
|---|---|---|---|
Invocations, duration, errors, throttles, concurrent executions (standard CloudWatch metrics) |
All Lambda functions — automatic once Kinesis Firehose is configured |
Low (no per-function changes) |
|
Enhanced metrics, custom metrics, APM traces, and logs directly from function code |
Functions where you need APM, custom instrumentation, or enhanced Lambda metrics |
Medium (add layer + environment variables per function) |
|
API-level audit events (Lambda:Invoke, |
Security auditing, compliance, change tracking |
Low (one-time CloudTrail config) |
Prerequisites
-
For CloudWatch Metrics: a working Kinesis Firehose metrics stream. See AWS CloudWatch Metrics Integration.
-
For the Extension Layer: access to the Lambda function configuration in AWS.
-
For CloudTrail Data Events: a CloudTrail trail with CloudWatch Logs integration. See AWS CloudTrail Events Integration.
Option 1: CloudWatch Metrics (Automatic)
If you have already configured the CloudWatch Metrics integration with Kinesis Firehose, Lambda metrics are ingested automatically — no per-function configuration is required.
The AWS/Lambda namespace includes the following metrics:
| Metric | Description |
|---|---|
|
Number of times the function was invoked |
|
Time taken for the function to execute (ms) |
|
Number of invocations that resulted in an error |
|
Number of invocations throttled due to concurrency limits |
|
Number of function instances running concurrently |
|
For stream-triggered functions: age of the last record processed (ms) |
To verify Lambda metrics are appearing, see Verify the Integration.
To enable Lambda configuration enrichment (attaches function tags and runtime metadata to metrics), continue to Configure Lambda Enrichment.
Option 2: Lambda Extension Layer
The Datadog Extension Layer runs as a Lambda extension inside your function’s execution environment. It collects enhanced metrics, custom metrics emitted by your function code, APM traces, and function logs, then forwards them directly to Kloudfuse.
Add Extension Layers
Add both the Datadog Agent extension and the Lambda Insights extension to your function.
Replace <region> with your AWS region and <arch> with amd64 or arm64.
# Datadog Agent Extension
aws lambda update-function-configuration \
--function-name my-function \
--layers \
"arn:aws:lambda:<region>:464622532012:layer:Datadog-Extension:33" \
"arn:aws:lambda:<region>:580247275435:layer:LambdaInsightsExtension:21"
Configure Environment Variables
aws lambda update-function-configuration \
--function-name my-function \
--environment "Variables={
DD_API_KEY=<kloudfuse-api-key>,
DD_DD_URL=https://<kloudfuse-ingester-host>,
DD_APM_DD_URL=https://<kloudfuse-ingester-host>,
DD_SITE=datadoghq.com,
DD_FLUSH_TO_LOG=false,
DD_LAMBDA_HANDLER=<your-original-handler>,
DD_ENHANCED_METRICS=true,
DD_TRACE_ENABLED=true
}"
Replace <kloudfuse-api-key> with your Kloudfuse API key and <kloudfuse-ingester-host> with your ingester hostname.
| Variable | Description |
|---|---|
|
Kloudfuse API key for authentication |
|
Kloudfuse metrics/logs ingestion endpoint |
|
Kloudfuse APM/tracing ingestion endpoint |
|
Enable enhanced Lambda metrics (billed as custom metrics in Datadog; free in Kloudfuse) |
|
Enable APM distributed tracing |
|
Set to |
Configure Lambda Enrichment in Kloudfuse
See Configure Kloudfuse for AWS Enrichment for the full Helm configuration, including AWS credential options, Lambda scraping settings, and the Helm upgrade command.
Option 3: CloudTrail Data Events
CloudTrail data events capture API calls made to Lambda — for example, every time a function is invoked, created, or updated. This is useful for audit trails and compliance, not for performance monitoring.
To enable Lambda data events on a CloudTrail trail:
aws cloudtrail put-event-selectors \
--trail-name kloudfuse-trail \
--event-selectors '[
{
"ReadWriteType": "All",
"IncludeManagementEvents": true,
"DataResources": [
{
"Type": "AWS::Lambda::Function",
"Values": ["arn:aws:lambda"]
}
]
}
]'
This captures events for all Lambda functions in the account.
To limit to a specific function, replace "arn:aws:lambda" with the full function ARN.
Once configured, Lambda data events flow through the CloudTrail pipeline described in AWS CloudTrail Events Integration.
Configure Lambda Enrichment
Lambda enrichment is covered under Configure Lambda Enrichment in Kloudfuse above. Enrichment attaches function-level metadata to all Lambda metrics, regardless of which collection method you use.
Verify the Integration
Verify CloudWatch Metrics
-
In the Kloudfuse UI, click the Metrics tab and select Explorer from the drop-down.
-
In the metric search field, type
aws.lambdato list all ingested Lambda metrics. You should see one time series per Lambda function for each metric. -
Common Lambda metrics to confirm:
CloudWatch metric Kloudfuse metric name AWS/Lambda Invocations
aws.lambda.invocationsAWS/Lambda Duration
aws.lambda.durationAWS/Lambda Errors
aws.lambda.errorsAWS/Lambda Throttles
aws.lambda.throttles -
Set the time range to the last 15 minutes and confirm charts are non-empty after invoking a function.
Verify the Extension Layer
After invoking a function with the extension layer installed:
-
Check the function logs in CloudWatch for lines beginning with
[dd.lambda.layer]— these confirm the extension is running. -
In the Kloudfuse UI, click the Metrics tab and select Explorer. Search for
aws.lambda.enhancedto confirm enhanced metrics are flowing. Enhanced metrics have theaws.lambda.enhanced.*prefix and are only present when the extension layer is active. -
For APM traces, click the APM tab and filter by the function name.
Verify CloudTrail Data Events
If you have enabled Lambda data events in CloudTrail (see AWS CloudTrail Events Integration):
-
In the Kloudfuse UI, click the Logs tab and select Search from the drop-down.
-
Set the time picker to the last 15 minutes.
-
In the search bar, click Advanced Search and enter:
eventSource="lambda.amazonaws.com"fuseqlEach Lambda invocation recorded by CloudTrail appears as a log record.
-
To confirm only
InvokeAPI calls:eventSource="lambda.amazonaws.com" and eventName="Invoke"fuseql -
To count invocations by function name:
eventSource="lambda.amazonaws.com" and eventName="Invoke" | count by requestParameters.functionNamefuseql