Skip to content

Commit 75d6c07

Browse files
authored
Update README.md
1 parent 2af972a commit 75d6c07

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,39 +63,43 @@ functions:
6363
6464
## Environment Variables
6565
66-
The Datadog API Key must be defined as one of the following environment variables via [AWS CLI](https://docs.aws.amazon.com/lambda/latest/dg/env_variables.html) or [Serverless Framework](https://serverless-stack.com/chapters/serverless-environment-variables.html):
66+
### DD_FLUSH_TO_LOG
67+
68+
Set to `true` (recommended) to send custom metrics asynchronously (with no added latency to your Lambda function executions) through CloudWatch Logs with the help of [Datadog Forwarder](https://github.com/DataDog/datadog-serverless-functions/tree/master/aws/logs_monitoring).
69+
70+
If set to `false`, you also need to set `DD_API_KEY` and `DD_SITE`.
71+
72+
### DD_API_KEY
73+
74+
If `DD_FLUSH_TO_LOG` is set to false (not recommended), the Datadog API Key must be defined as one of the following environment variables:
6775

6876
- DD_API_KEY - the Datadog API Key in plain-text, NOT recommended
6977
- DD_KMS_API_KEY - the KMS-encrypted API Key, requires the `kms:Decrypt` permission
7078
- DD_API_KEY_SECRET_ARN - the Secret ARN to fetch API Key from the Secrets Manager, requires the `secretsmanager:GetSecretValue` permission (and `kms:Decrypt` if using a customer managed CMK)
7179

72-
You can also supply or override the API key at runtime:
80+
You can also supply or override the API key at runtime (not recommended):
7381

7482
```python
7583
# Override DD API Key after importing datadog_lambda packages
7684
from datadog import api
7785
api._api_key = "MY_API_KEY"
7886
```
7987

80-
Set the following Datadog environment variable to `datadoghq.eu` to send your data to the Datadog EU site.
81-
82-
- DD_SITE
88+
### DD_SITE
8389

84-
If your Lambda function powers a performance-critical task (e.g., a consumer-facing API). You can avoid the added latencies of metric-submitting API calls, by setting the following Datadog environment variable to `True`. Custom metrics will be submitted asynchronously through CloudWatch Logs and [the Datadog log forwarder](https://github.com/DataDog/datadog-serverless-functions/tree/master/aws/logs_monitoring).
90+
If `DD_FLUSH_TO_LOG` is set to false (not recommended), and your data need to be sent to the Datadog EU site, you must set `DD_SITE` to `datadoghq.eu`.
8591

86-
- DD_FLUSH_TO_LOG
92+
### DD_LOGS_INJECTION
8793

8894
Inject Datadog trace id into logs for [correlation](https://docs.datadoghq.com/tracing/connect_logs_and_traces/?tab=python). Defaults to true.
8995

90-
- DD_LOGS_INJECTION
91-
92-
To debug the Datadog Lambda Layer, set the environment variable below to `DEBUG`.
96+
### DD_LOG_LEVEL
9397

94-
- DD_LOG_LEVEL
98+
Set to `debug` enable debug los from the Datadog Lambda Layer.
9599

96-
To increment `aws.lambda.enhanced.invocations` and `aws.lambda.enhanced.errors` Datadog Lambda integration metrics set this environment variable to `true`:
100+
### DD_ENHANCED_METRICS
97101

98-
- DD_ENHANCED_METRICS
102+
Generate enhanced Datadog Lambda integration metrics, such as, `aws.lambda.enhanced.invocations` and `aws.lambda.enhanced.errors`. Defaults to true.
99103

100104
## Basic Usage
101105

0 commit comments

Comments
 (0)