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

Add Datadog Lambda Library

Fine tune with Environment Variables

Below is a table of commonly used environment variables:

Variable NameDescriptionOptional
DD_API_KEYGives the permissions to pipe monitoring data to DatadogNo
DD_SITEThe Datadog endpoint we want to pipe the monitoring data toNo
DD_TRACE_ENABLEDIf we want to enable Trace or notYes
DD_ENVLogical grouping name of monitoring data on the Datadog dashboardYes
DD_SERVICELogical grouping name of monitoring data on the Datadog dashboardYes
DD_SERVERLESS_APPSEC_ENABLEDIf we want to enable Security Signals on the Lambda functionYes
DD_LAMBDA_HANDLERRequired for Python and NodeJS Lambda, refer to official guide for more informationYes/No

References