Skip to content

v2.18.0 #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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