Skip to content

Commit

Permalink
Merge pull request #62 from DataDog/darcy.rayner/v2.18.0
Browse files Browse the repository at this point in the history
v2.18.0
  • Loading branch information
DarcyRaynerDD authored May 27, 2020
2 parents d0f88d9 + 6fb7a0e commit 2f667ea
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ functions:
DD_FLUSH_TO_LOG: true
```
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.
## Environment Variables
### DD_FLUSH_TO_LOG
Expand Down Expand Up @@ -106,8 +108,29 @@ Set to `debug` enable debug los from the Datadog Lambda Layer.

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

### DD_LAMBDA_HANDLER

For use with the [redirected handler](#Redirected-Handler) method. Location of your original lambda handler.

### DD_TRACE_ENABLED

When used with the [redirected handler](#Redirected-Handler) method, will auto initialize the tracer when set to true.

## Basic Usage

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.

### Redirected Handler

We provide a swap in replacement handler, with zero required code changes.

1. Set the environment variable `DD_LAMBDA_HANDLER` to your regular handler location, eg. `myfunc.handler`.
2. Set your handler to `datadog_lambda.handler.handler`.

### Manual Wrap

You might find it more convenient to wrap your handlers manually.

```python
import requests
from datadog_lambda.wrapper import datadog_lambda_wrapper
Expand Down
2 changes: 1 addition & 1 deletion datadog_lambda/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The minor version corresponds to the Lambda layer version.
# E.g.,, version 0.5.0 gets packaged into layer version 5.
__version__ = "2.17.0"
__version__ = "2.18.0"


import os
Expand Down

0 comments on commit 2f667ea

Please sign in to comment.