This page explains how to send Lambda function logs and platform events to Axiom.
Use the Axiom Lambda Extension to send logs and platform events of your Lambda function to Axiom.
Alternatively, you can use the AWS Distro for OpenTelemetry to send Lambda function logs and platform events to Axiom. For more information, see AWS Lambda Using OTel.
Axiom detects the extension and provides you with quick filters and a dashboard. For more information on how this enriches your Axiom organization, see AWS Lambda app.
To determine the best method to send data from different AWS services, see Send data from AWS to Axiom.
The Axiom Lambda Extension is an open-source project and welcomes your contributions. For more information, see the GitHub repository.
The last step is important because after you install the Axiom Lambda extension, the Lambda service still sends logs to Amazon CloudWatch Logs. You need to manually turn off Amazon CloudWatch logging.
To install the Axiom Lambda Extension, choose one of the following methods:
Add the extension as a layer with the AWS CLI:
AWS_REGION
with the AWS Region to send the request to. For example, us-west-1
.ARCH
with the system architecture type. For example, arm64
.VERSION
with the latest version number specified on the GitHub Releases page. For example, 11
.Add the Axiom dataset name and API token to the list of environment variables. For more information on setting environment variables, see the AWS documentation.
API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.DATASET_NAME
with the name of the Axiom dataset where you want to send data.You have installed the Axiom Lambda Extension. Go to the Axiom UI and ensure your dataset receives events properly.
Choose one of the following to install the Axiom Lambda Extension with Terraform:
Example with plain Terraform code
AWS_REGION
with the AWS Region to send the request to. For example, us-west-1
.ARCH
with the system architecture type. For example, arm64
.VERSION
with the latest version number specified on the GitHub Releases page. For example, 11
.API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.DATASET_NAME
with the name of the Axiom dataset where you want to send data.Example with AWS Lambda Terraform module
AWS_REGION
with the AWS Region to send the request to. For example, us-west-1
.ARCH
with the system architecture type. For example, arm64
.VERSION
with the latest version number specified on the GitHub Releases page. For example, 11
.API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.DATASET_NAME
with the name of the Axiom dataset where you want to send data.You have installed the Axiom Lambda Extension. Go to the Axiom UI and ensure your dataset receives events properly.
Add a new layer to your Lambda function with the following ARN (Amazon Resource Name). For more information on adding layers to your function, see the AWS documentation.
AWS_REGION
with the AWS Region to send the request to. For example, us-west-1
.ARCH
with the system architecture type. For example, arm64
.VERSION
with the latest version number specified on the GitHub Releases page. For example, 11
.Add the Axiom dataset name and API token to the list of environment variables. For more information on setting environment variables, see the AWS documentation.
API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.DATASET_NAME
with the name of the Axiom dataset where you want to send data.You have installed the Axiom Lambda Extension. Go to the Axiom UI and ensure your dataset receives events properly.
After you install the Axiom Lambda extension, the Lambda service still sends logs to CloudWatch Logs. You need to manually turn off Amazon CloudWatch logging.
To turn off Amazon CloudWatch logging, deny the Lambda function access to Amazon CloudWatch by editing the permissions:
The Stream and Query tabs allow you to easily detect warnings and errors in your logs by highlighting the severity of log entries in different colors. As a prerequisite, specify the log level in the data you send to Axiom. For Open Telemetry logs, specify the log level in the following fields:
record.error
record.level
record.severity
type
For testing purposes, set the PANIC_ON_API_ERR
environment variable to true
. This means that the Axiom Lambda Extension crashes if it can’t connect to Axiom.
This page explains how to send Lambda function logs and platform events to Axiom.
Use the Axiom Lambda Extension to send logs and platform events of your Lambda function to Axiom.
Alternatively, you can use the AWS Distro for OpenTelemetry to send Lambda function logs and platform events to Axiom. For more information, see AWS Lambda Using OTel.
Axiom detects the extension and provides you with quick filters and a dashboard. For more information on how this enriches your Axiom organization, see AWS Lambda app.
To determine the best method to send data from different AWS services, see Send data from AWS to Axiom.
The Axiom Lambda Extension is an open-source project and welcomes your contributions. For more information, see the GitHub repository.
The last step is important because after you install the Axiom Lambda extension, the Lambda service still sends logs to Amazon CloudWatch Logs. You need to manually turn off Amazon CloudWatch logging.
To install the Axiom Lambda Extension, choose one of the following methods:
Add the extension as a layer with the AWS CLI:
AWS_REGION
with the AWS Region to send the request to. For example, us-west-1
.ARCH
with the system architecture type. For example, arm64
.VERSION
with the latest version number specified on the GitHub Releases page. For example, 11
.Add the Axiom dataset name and API token to the list of environment variables. For more information on setting environment variables, see the AWS documentation.
API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.DATASET_NAME
with the name of the Axiom dataset where you want to send data.You have installed the Axiom Lambda Extension. Go to the Axiom UI and ensure your dataset receives events properly.
Choose one of the following to install the Axiom Lambda Extension with Terraform:
Example with plain Terraform code
AWS_REGION
with the AWS Region to send the request to. For example, us-west-1
.ARCH
with the system architecture type. For example, arm64
.VERSION
with the latest version number specified on the GitHub Releases page. For example, 11
.API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.DATASET_NAME
with the name of the Axiom dataset where you want to send data.Example with AWS Lambda Terraform module
AWS_REGION
with the AWS Region to send the request to. For example, us-west-1
.ARCH
with the system architecture type. For example, arm64
.VERSION
with the latest version number specified on the GitHub Releases page. For example, 11
.API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.DATASET_NAME
with the name of the Axiom dataset where you want to send data.You have installed the Axiom Lambda Extension. Go to the Axiom UI and ensure your dataset receives events properly.
Add a new layer to your Lambda function with the following ARN (Amazon Resource Name). For more information on adding layers to your function, see the AWS documentation.
AWS_REGION
with the AWS Region to send the request to. For example, us-west-1
.ARCH
with the system architecture type. For example, arm64
.VERSION
with the latest version number specified on the GitHub Releases page. For example, 11
.Add the Axiom dataset name and API token to the list of environment variables. For more information on setting environment variables, see the AWS documentation.
API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.DATASET_NAME
with the name of the Axiom dataset where you want to send data.You have installed the Axiom Lambda Extension. Go to the Axiom UI and ensure your dataset receives events properly.
After you install the Axiom Lambda extension, the Lambda service still sends logs to CloudWatch Logs. You need to manually turn off Amazon CloudWatch logging.
To turn off Amazon CloudWatch logging, deny the Lambda function access to Amazon CloudWatch by editing the permissions:
The Stream and Query tabs allow you to easily detect warnings and errors in your logs by highlighting the severity of log entries in different colors. As a prerequisite, specify the log level in the data you send to Axiom. For Open Telemetry logs, specify the log level in the following fields:
record.error
record.level
record.severity
type
For testing purposes, set the PANIC_ON_API_ERR
environment variable to true
. This means that the Axiom Lambda Extension crashes if it can’t connect to Axiom.