Altostra is now available on Datadog Integrations
We teamed up with Datadog so our users can automatically send application logs from Altostra straight to Datadog without code changes.
May 27 2021 · 3 min read
Importance of observability
For serverless applications in particular and distributed applications in general, the ability to see what’s happening in your application is critical. Without it, you have only a partial picture of what’s happening at any given moment. That’s why you should have observability for your application from the start and maintain it throughout the application’s life.
Commonly, observability is left out at the start of applications’ development life—it makes prototyping faster. Later, as you add more functions, observability remains neglected until you need that data. By then, it’s too late.
Throw in various environments, like dev, QA, staging, production, and multiple deployments to multiple regions, and you have a real challenge on your hands.
In this article, we’ll focus on the log aggregation facet of observability. For a distributed application, like any serverless application, it’s essential to get the logs flowing to a central location from the start. So that you can search, analyze, debug and cross-reference them when problems pop up.
Automate and forget
The best solution is to automate and standardize the log aggregation configuration for all functions in each environment. That way, developers don’t need to worry about it and are free to focus on business code and infrastructure.
Altostra provides integrations to 3rd party observability services that you can configure per environment. It automates log aggregation for every deployment to those environments.
Integrating with Datadog
Datadog is a monitoring platform with a wide variety of integrations and analytic capabilities. A significant feature of Datadog is log aggregation. It allows you to quickly parse, search, analyze, debug, and do much more with your application logs.
Integrating your Datadog accounts with Altostra enables you to make your deployed Stacks send their Lambda function logs to Datadog.
Setting up the integration
First, you need to obtain an API key for your Datadog account that you’ll use to set up the integration in Altostra:
- Go to Datadog Integrations > APIs > API Keys.
- Create a new API key.
Next, you need to set up the integration in Altostra:
- Go to Altostra Account Settings > Integrations > Observability.
- Click Connect on the Datadog integration.
- Enter a Name and the API Key you created earlier.
- Click Connect to create the integration.
You can create multiple integrations to use for different environments, like development, QA, staging, production, or whatever suits your needs.
Using the integration
Once you create a Datadog integration, it becomes available to use in your environment settings.
When you deploy projects to an environment configured with the Datadog integration, Altostra automatically adds the necessary resources and configuration to send all logs produced by your Lambda functions to your Datadog account.
To configure an Altostra environment to send logs to Datadog:
- Go to Altostra Environments and click the environment you wish to configure.
- Switch to the Settings tab.
- Select the Datadog integration you’ve set up earlier under Log Shipping.
- Click Save Changes.
See your Lambda logs in Datadog
Let’s create a new project using the Simple CRUD Service template and deploy it to the environment we configured with the Datadog integration.
Next, we deploy a new Stack to the Demo-Dev environment:
When the deployment completes, we can find the API endpoint URL in the Endpoints tab:
For our demo purposes, we’ll just call an endpoint using
curl, which will invoke a Lambda function, which in turn will log an entry:
$ curl https://ssvklt20k7.execute-api.us-east-1.amazonaws.com/Prod/resource
Altostra Dashboard on Datadog
You can find the Altostra dashboard on Datadog under Dashboards.
Let’s see the logs from our Lambda function’s invocation:
Want to give it a try? We provide a free-forever plan for developers. Create your free account today at https://app.altostra.com.
Want to stay up to date with the latest Altostra news? Join our community on Discord.