Abstract
The following is the architecture
Understand messages generated by Datadog
Datadog gives insights to the lambda functions it is monitoring. Here is a list of insights it can generate, and the corresponding meanings
Setup Example
We are using Python for the example. But the same setup process applies to other languages. You can refer to the Official Guilde for more information.
Make sure you have the following completed before moving on:
There are mainly 3 things we need to do, and we can automate the process with this Terraform Template
Add Datadog Lambda Extension
- This serves as the Agent
- We can add it in as a Lambda Layer
- Refer to 2. Install the Datadog Lambda Extension for more implementation details
Add Datadog Lambda Library
- This serves as Datadog ddtrace
- We can add it in as a Lambda Layer
- Refer to 1. Install the Datadog Lambda library (Option A)
Fine tune with Environment Variables
Below is a table of commonly used environment variables:
Variable Name | Description | Optional |
---|---|---|
DD_API_KEY | Gives the permissions to pipe monitoring data to Datadog | No |
DD_SITE | The Datadog endpoint we want to pipe the monitoring data to | No |
DD_TRACE_ENABLED | If we want to enable Trace or not | Yes |
DD_ENV | Logical grouping name of monitoring data on the Datadog dashboard | Yes |
DD_SERVICE | Logical grouping name of monitoring data on the Datadog dashboard | Yes |
DD_SERVERLESS_APPSEC_ENABLED | If we want to enable Security Signals on the Lambda function | Yes |
DD_LAMBDA_HANDLER | Required for Python and NodeJS Lambda, refer to official guide for more information | Yes/No |