diff --git a/README.md b/README.md index 5b21c5e2..e03f72b7 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/datadog_lambda/__init__.py b/datadog_lambda/__init__.py index e5cad7fb..40614d4e 100644 --- a/datadog_lambda/__init__.py +++ b/datadog_lambda/__init__.py @@ -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