Skip to content

Commit a12e953

Browse files
committed
Update README
1 parent 499339f commit a12e953

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ functions:
6666
DD_FLUSH_TO_LOG: true
6767
```
6868
69+
Alternatively, consider using [serverless-plugin-datadog](https://github.com/DataDog/serverless-plugin-datadog). The plugin can take care of adding lambda layers to your functions, and wrapping your handlers.
70+
6971
## Environment Variables
7072
7173
### DD_FLUSH_TO_LOG
@@ -106,8 +108,29 @@ Set to `debug` enable debug los from the Datadog Lambda Layer.
106108

107109
Generate enhanced Datadog Lambda integration metrics, such as, `aws.lambda.enhanced.invocations` and `aws.lambda.enhanced.errors`. Defaults to true.
108110

111+
### DD_LAMBDA_HANDLER
112+
113+
For use with the [redirected handler](#Redirected-Handler) method. Location of your original lambda handler.
114+
115+
### DD_TRACE_ENABLED
116+
117+
When used with the [redirected handler](#Redirected-Handler) method, will auto initialize the tracer when set to true.
118+
109119
## Basic Usage
110120

121+
Datadog needs to be able to read headers from the incoming Lambda event. To do this, you must wrap your handler function with our library. We provide some easy ways of wrapping your handlers.
122+
123+
### Redirected Handler
124+
125+
We provide a swap in replacement handler, with zero required code changes.
126+
127+
1. Set the environment variable `DD_LAMBDA_HANDLER` to the your handler location.
128+
2. If using the layer, set your handler to `datadog_lambda.handler.handler`.
129+
130+
### Manual Wrap
131+
132+
You might find it more convenient to wrap your handlers manually.
133+
111134
```python
112135
import requests
113136
from datadog_lambda.wrapper import datadog_lambda_wrapper

0 commit comments

Comments
 (0)