From 499339f4a777e39ac24f73cb1c60857ec4f2d258 Mon Sep 17 00:00:00 2001 From: DarcyRaynerDD Date: Wed, 27 May 2020 10:21:10 -0400 Subject: [PATCH 1/4] Set version to 2.18.0 --- datadog_lambda/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From a12e9539347ac30bd5e90f6727e786b3bd099bbe Mon Sep 17 00:00:00 2001 From: DarcyRaynerDD Date: Wed, 27 May 2020 10:29:17 -0400 Subject: [PATCH 2/4] Update README --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 5b21c5e2..a8f75664 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 the your handler location. +2. If using the layer, 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 From 28f8d7d3b85410c97348050bfe12e7bcdafea101 Mon Sep 17 00:00:00 2001 From: DarcyRaynerDD Date: Wed, 27 May 2020 13:21:21 -0400 Subject: [PATCH 3/4] Fix handler location --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a8f75664..c37e842a 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ Datadog needs to be able to read headers from the incoming Lambda event. To do t We provide a swap in replacement handler, with zero required code changes. -1. Set the environment variable `DD_LAMBDA_HANDLER` to the your handler location. +1. Set the environment variable `DD_LAMBDA_HANDLER` to your regular handler location, eg. `myfunc.handler`. 2. If using the layer, set your handler to `datadog_lambda.handler.handler`. ### Manual Wrap From 6fb7a0e4da51d74971185c5b6c4ace4d36e8764b Mon Sep 17 00:00:00 2001 From: DarcyRaynerDD Date: Wed, 27 May 2020 16:54:43 -0400 Subject: [PATCH 4/4] Fix mistake in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c37e842a..e03f72b7 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ Datadog needs to be able to read headers from the incoming Lambda event. To do t 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. If using the layer, set your handler to `datadog_lambda.handler.handler`. +2. Set your handler to `datadog_lambda.handler.handler`. ### Manual Wrap