
The Axiom Lambda Extension is an open-source project and welcomes your contributions. For more information, see the GitHub repository.
Prerequisites
- Create an Axiom account.
- Create a dataset in Axiom where you send your data.
- Create an API token in Axiom with permissions to update the dataset you have created.
Setup
- Install the Axiom Lambda extension.
- Ensure everything works properly in Axiom.
- Turn off the permissions for Amazon CloudWatch.
Installation
To install the Axiom Lambda Extension, choose one of the following methods:Install with AWS CLI
1
Add the extension as a layer with the AWS CLI:
- Replace
AWS_REGION
with the AWS Region to send the request to. For example,us-west-1
. - Replace
ARCH
with the system architecture type. For example,arm64
. - Replace
VERSION
with the latest version number specified on the GitHub Releases page. For example,11
.
2
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.
Replace
API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.Replace DATASET_NAME
with the name of the Axiom dataset where you send your data.Replace AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.Install with Terraform
Choose one of the following to install the Axiom Lambda Extension with Terraform:- Use plain Terraform code
Example with plain Terraform code
Example with plain Terraform code
Replace
AWS_REGION
with the AWS Region to send the request to. For example, us-west-1
.
Replace ARCH
with the system architecture type. For example, arm64
.
Replace VERSION
with the latest version number specified on the GitHub Releases page. For example, 11
.Replace API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.Replace DATASET_NAME
with the name of the Axiom dataset where you send your data.Replace AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.- Use the AWS Lambda Terraform module
Example with AWS Lambda Terraform module
Example with AWS Lambda Terraform module
Replace
AWS_REGION
with the AWS Region to send the request to. For example, us-west-1
.
Replace ARCH
with the system architecture type. For example, arm64
.
Replace VERSION
with the latest version number specified on the GitHub Releases page. For example, 11
.Replace API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.Replace DATASET_NAME
with the name of the Axiom dataset where you send your data.Replace AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.Install with AWS Lambda function UI
1
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.
Replace
AWS_REGION
with the AWS Region to send the request to. For example, us-west-1
.
Replace ARCH
with the system architecture type. For example, arm64
.
Replace VERSION
with the latest version number specified on the GitHub Releases page. For example, 11
.2
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.
Replace
API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.Replace DATASET_NAME
with the name of the Axiom dataset where you send your data.Turn off Amazon CloudWatch logging
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:- In the AWS Lambda function UI, go to Configuration > Permissions.
- In the Execution role section, click the role related to Amazon CloudWatch Logs.
- In the Permissions tab, select the role, and then click Remove.
Requirements for log level fields
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
Troubleshooting
- Ensure the Axiom API token has permission to ingest data into the dataset.
- Check the function logs on the AWS console. The Axiom Lambda Extension logs any errors with setup or ingest.
PANIC_ON_API_ERR
environment variable to true
. This means that the Axiom Lambda Extension crashes if it can’t connect to Axiom.