Skip to main content

Overview

Rotel Lambda Extension is an advanced AWS Lambda extension layer, built on top of Rotel—a lightweight, high-performance and low overhead OpenTelemetry Collector perfectly suited for resource-constrained environments. By minimizing binary size, reducing cold start latency, and lowering memory overhead, this extension optimizes performance and cost efficiency in AWS Lambda deployments.

The Rotel Lambda Extension integrates with the Lambda TelemetryAPI to collect function logs and extension logs and will export them to the configured exporter. This can reduce your Lambda observability costs if you combine it with disabling CloudWatch Logs.

Using

Choose the Lambda layer that matches your Lambda runtime architecture (alpha versions shown). The {version} field of the ARN should match the integer value from the latest release, so the version for v12-alpha would be 12.

ArchitectureARNVersion
x86-64/amd64arn:aws:lambda:{region}:418653438961:layer:rotel-extension-amd64-alpha:{version}Version
arm64arn:aws:lambda:{region}:418653438961:layer:rotel-extension-arm64-alpha:{version}Version

The layer is deployed in the following AWS regions (if you don't see yours, let us know!):

  • us-east-2, us-west-2
  • eu-central-1, eu-north-1, eu-west-3
  • ca-central-1
  • ap-southeast-2, ap-northeast-2
  • ap-south-1
  • sa-east-1

The layer supports the Amazon Linux 2023 Lambda runtime (provided.al2023).

Disabling CloudWatch Logs

By default, AWS Lambda will send all Lambda logs to Amazon CloudWatch. To reduce costs, you may want to disable those logs if you are forwarding your logs to an external logging provider.

  1. Open the AWS Console and navigate to AWS Lambda
  2. Navigate to your Lambda function
  3. Select Configuration -> Permissions
  4. Click the execution role under "Role Name" to pop over to the IAM console
  5. Edit the role in the IAM console and remove any logs:* actions
    • if you are using a custom policy, edit the policy to remove logs:* actions
    • if you are using an AWS Managed policy, like AWSLambdaBasicExecutionRole, remove it from the role
  6. Save the role and your next execution should not send logs to CloudWatch

Examples

These are example repos demonstrating how to use the Rotel Lambda Extension.

  • Node.js Auto Instrumentation: This uses the Node.js auto instrumentation layer to instrument a Node.js app and emit metrics, logs and traces to Honeycomb.
  • Python + Clickhouse: Python application with manual OpenTelemetry instrumentation, sending OpenTelemetry traces and logs to Clickhouse. All Lambda logs are converted to OTel and immediately sent to Clickhouse, so this can avoid expensive Cloudwatch log costs. This example uses the JSON data type by default to improve the query support for OTel key/value attributes.