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

CloudWatch Metrics via Kinesis

Invocations, duration, errors, throttles, concurrent executions (standard CloudWatch metrics)

All Lambda functions — automatic once Kinesis Firehose is configured

Low (no per-function changes)

Lambda Extension Layer

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)

CloudTrail Data Events

API-level audit events (Lambda:Invoke, CreateFunction, UpdateFunctionCode, etc.)

Security auditing, compliance, change tracking

Low (one-time CloudTrail config)

Prerequisites

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

Invocations

Number of times the function was invoked

Duration

Time taken for the function to execute (ms)

Errors

Number of invocations that resulted in an error

Throttles

Number of invocations throttled due to concurrency limits

ConcurrentExecutions

Number of function instances running concurrently

IteratorAge

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"
bash

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
  }"
bash

Replace <kloudfuse-api-key> with your Kloudfuse API key and <kloudfuse-ingester-host> with your ingester hostname.

Variable Description

DD_API_KEY

Kloudfuse API key for authentication

DD_DD_URL

Kloudfuse metrics/logs ingestion endpoint

DD_APM_DD_URL

Kloudfuse APM/tracing ingestion endpoint

DD_ENHANCED_METRICS

Enable enhanced Lambda metrics (billed as custom metrics in Datadog; free in Kloudfuse)

DD_TRACE_ENABLED

Enable APM distributed tracing

DD_FLUSH_TO_LOG

Set to false to send telemetry via the extension (recommended)

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"]
        }
      ]
    }
  ]'
bash

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

  1. In the Kloudfuse UI, click the Metrics tab and select Explorer from the drop-down.

  2. In the metric search field, type aws.lambda to list all ingested Lambda metrics. You should see one time series per Lambda function for each metric.

  3. Common Lambda metrics to confirm:

    CloudWatch metric Kloudfuse metric name

    AWS/Lambda Invocations

    aws.lambda.invocations

    AWS/Lambda Duration

    aws.lambda.duration

    AWS/Lambda Errors

    aws.lambda.errors

    AWS/Lambda Throttles

    aws.lambda.throttles

  4. 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:

  1. Check the function logs in CloudWatch for lines beginning with [dd.lambda.layer] — these confirm the extension is running.

  2. In the Kloudfuse UI, click the Metrics tab and select Explorer. Search for aws.lambda.enhanced to confirm enhanced metrics are flowing. Enhanced metrics have the aws.lambda.enhanced.* prefix and are only present when the extension layer is active.

  3. 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):

  1. In the Kloudfuse UI, click the Logs tab and select Search from the drop-down.

  2. Set the time picker to the last 15 minutes.

  3. In the search bar, click Advanced Search and enter:

    eventSource="lambda.amazonaws.com"
    fuseql

    Each Lambda invocation recorded by CloudTrail appears as a log record.

  4. To confirm only Invoke API calls:

    eventSource="lambda.amazonaws.com" and eventName="Invoke"
    fuseql
  5. To count invocations by function name:

    eventSource="lambda.amazonaws.com" and eventName="Invoke" | count by requestParameters.functionName
    fuseql