Skip to content

Commit f54fb61

Browse files
authored
Update README.md
1 parent b66d531 commit f54fb61

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@ Once [installed](#installation), you should be able to view enhanced metrics for
3636

3737
Check out the official documentation on [Datadog Lambda enhanced metrics](https://docs.datadoghq.com/integrations/amazon_lambda/?tab=python#real-time-enhanced-lambda-metrics).
3838

39+
## Advanced Configurations
40+
41+
### Handler Wrapper
42+
43+
In order to instrument individual invocations, the Datadog Lambda library needs to wrap around your Lambda handler function. This is usually achieved by setting your function's handler to the Datadog handler function (`datadog_lambda.handler.handler`) and setting the environment variable `DD_LAMBDA_HANDLER` with your original handler function to be called by the Datadog handler.
44+
45+
If this method doesn't work for you, instead of setting the handler and the `DD_LAMBDA_HANDLER` environment variable, you can apply the Datadog Lambda library wrapper in your function code like below:
46+
47+
```python
48+
from datadog_lambda.wrapper import datadog_lambda_wrapper
49+
50+
@datadog_lambda_wrapper
51+
def my_lambda_handle(event, context):
52+
# your function code
53+
```
54+
3955
## Environment Variables
4056

4157
### DD_FLUSH_TO_LOG

0 commit comments

Comments
 (0)