Slash AWS Lambda Observability Costs with Serverless Framework’s Axiom Integration

Aug 26, 2024

Hidden costs in AWS Lambda deployments can quickly add up, particularly from logs, metrics, and traces. These expenses often catch teams by surprise, impacting budgets and operational efficiency.

That’s where Axiom comes in—a standout observability solution that combines a sleek user experience with competitive pricing and an impressive free tier offering 500GB/month of data ingestion.

We’re excited to introduce Axiom’s integration with the Serverless Framework. With a simple, one-line configuration in your serverless.yml file, you can easily enhance your monitoring capabilities without breaking the bank.

Cost Comparison

Switching from AWS CloudWatch to Axiom can lead to substantial cost savings due to the significant price difference between the two services:

  • Axiom: $0.15/GB of ingested data
  • AWS CloudWatch: $0.50/GB of ingested data

For example, when managing 5 TB of daily log data, Axiom’s pricing results in a total daily cost of $750 and a monthly cost of $22,500. In contrast, AWS CloudWatch costs $2,650 daily and $79,500 monthly for the same amount of data. This means that by choosing Axiom, companies can save $57,000 per month, which equates to a 70% reduction in costs compared to using CloudWatch.

These savings not only free up budget for other initiatives but also come with the added benefit of Axiom’s more powerful and user-friendly platform for managing and analyzing logs, offering deeper insights and faster problem resolution.

Set Up Axiom with the Serverless Framework

Create an Axiom account (Axiom offers a very generous free tier).

Create or join an organization in Axiom–but skip the step to create a Dataset in the Axiom onboarding process, as it will be done automatically and designed per best practices by the Serverless Framework. Instead, click the setting icon in the Dashboard, select API Tokens on the left, and select New API Token.

Enter a name, choose “None” for Expiration, then click the Advanced tab to select the permissions your token should have. 

Assign the Ingest, Query,Dashboards, Datasets, and Monitors permissions.

Set the AXIOM_TOKEN environment variable in your CI/CD pipeline or locally. The value should be the API token you created in Axiom.

export AXIOM_TOKEN=your-axiom-access-token

In your serverless.yml file, add the observability property to the stages block, and use axiom as the provider. Here is the easiest way to configure Axiom across all Stages within your serverless application.

Deploy your Service with the Serverless Framework, invoke your AWS Lambda functions, and you'll instantly see logs in the Axiom dashboard.

There are many more configuration options for sophisticated set-ups, such as:

  • Stage-specific Axiom setup
  • Custom dataset naming
  • Selective function logging
  • Support for additional CloudWatch Log Groups

Consult our documentation for more information on these options.

After deployment with the Serverless Framework, and once your AWS Lambda functions are invoked, Axiom automatically detects AWS Lambda data and creates a custom dashboard out-of-the-box. This allows users to immediately visualize and monitor the performance and health of their AWS Lambda functions. Axiom’s intuitive query capabilities, powered by APL (Axiom Processing Language), further enhance the ability to perform complex searches and filter logs, providing in-depth analysis and faster insights to quickly identify and resolve issues in serverless environments.

For teams currently using AWS CloudWatch, the Axiom integration is designed to be non-disruptive. It manages the necessary AWS resources, allowing you to focus on deriving insights from your logs.

Conclusion

The Axiom integration for Serverless Framework offers a powerful solution to mitigate the often-overlooked costs of AWS Lambda observability. It provides a cost-effective, powerful and elegant alternative without compromising on essential features or performance.

Best,
The Serverless Team

Subscribe to our newsletter to get the latest product updates, tips, and best practices!

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.