-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
datadog lambda docs
- Loading branch information
Showing
2 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
Author: | ||
- Xinyang YU | ||
Author Profile: | ||
- https://linkedin.com/in/xinyang-yu | ||
tags: | ||
- Datadog | ||
Creation Date: 2023-12-18, 14:20 | ||
Last Date: 2023-12-18T15:40:17+08:00 | ||
References: | ||
--- | ||
## Abstract | ||
--- | ||
- The following is the architecture | ||
[<img src="https://datadog-docs.imgix.net/images/serverless/serverless_custom_metrics.5c2b598d14c340160ea6a2a0a360af1e.png?fit=max&auto=format">](https://datadog-docs.imgix.net/images/serverless/serverless_custom_metrics.5c2b598d14c340160ea6a2a0a360af1e.png?fit=max&auto=format) | ||
|
||
>[!info] Understand messages generated Datadog | ||
>Datadog gives insights to the lambda functions it is monitoring. [Here](https://docs.datadoghq.com/serverless/guide/serverless_warnings/#generated-warnings) is a list of insights it can generate, and the 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](https://docs.datadoghq.com/serverless/aws_lambda/installation/) for more information. | ||
|
||
Make sure you have the following completed before moving on: | ||
- [ ] [[Datadog Integration#AWS Integration]] | ||
|
||
There are mainly 3 things we need to do, and we can automate the process with this [Terraform Template](https://docs.datadoghq.com/serverless/aws_lambda/installation/python/?tab=terraform#installation) | ||
- [ ] [[#Add Datadog Lambda Extension]] | ||
- [ ] [[#Add Datadog Lambda Library]] | ||
- [ ] [[#Fine tune with Environment Variables]] | ||
|
||
>[!attention] Lambda Handler | ||
>We need to modify the lambda handler for certain languages like Python. Please visit [official guide](https://docs.datadoghq.com/serverless/aws_lambda/installation/python/?tab=terraform#installation) for more information | ||
### Add Datadog Lambda Extension | ||
- This serves as the [[Datadog#Agent]] | ||
- We can add it in as a [Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/chapter-layers.html) | ||
- Refer to [2. Install the Datadog Lambda Extension](https://docs.datadoghq.com/serverless/aws_lambda/installation/python/?tab=custom#installation) for more implementation details | ||
|
||
|
||
|
||
### Add Datadog Lambda Library | ||
- This serves as [[Datadog ddtrace]] | ||
- We can add it in as a [Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/chapter-layers.html) | ||
- Refer to [1. Install the Datadog Lambda library (Option A)](https://docs.datadoghq.com/serverless/aws_lambda/installation/python/?tab=custom#installation) | ||
|
||
|
||
### 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 | | ||
|
||
|
||
|
||
## References | ||
--- | ||
- [Official Lambda Setup Guide](https://docs.datadoghq.com/serverless/aws_lambda/installation/) | ||
- [Official Datadog Lambda Integration Architecture](https://docs.datadoghq.com/serverless/aws_lambda) | ||
- [Official Datadog Warning List](https://docs.datadoghq.com/serverless/guide/serverless_warnings/#generated-warnings) | ||
- [Official Datadog Security Monitoring for Lambda](https://docs.datadoghq.com/serverless/aws_lambda/securing_functions) |