From 6c1083687e2fc8e438b683a7435ae6071a1252ee Mon Sep 17 00:00:00 2001 From: enricop89 Date: Thu, 19 Dec 2024 13:33:31 +0100 Subject: [PATCH 1/6] add payload request/response support --- README.md | 6 +++++- src/env.ts | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f9aba31..a6d267ac 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,9 @@ To further configure your plugin, use the following custom parameters in your `s | `enableASM` | Enable [Datadog Application Security Management (ASM)][19] on the Lambda function. Requires the Datadog extension to be present (using `addExtension` or manually added) and `enableDDTracing`. Defaults to `false`. | | `enableDDLogs` | Enable Datadog log collection using the Lambda Extension. Defaults to `true`. Note: This setting has no effect on logs sent by the Datadog Forwarder. | | `monitors` | When defined, the Datadog plugin configures monitors for the deployed function. Requires setting `DATADOG_API_KEY` and `DATADOG_APP_KEY` in your environment. To learn how to define monitors, see [To Enable and Configure a Recommended Serverless Monitor](#to-enable-and-configure-a-recommended-serverless-monitor). | -| `captureLambdaPayload` | [Captures incoming and outgoing AWS Lambda payloads][17] in the Datadog APM spans for Lambda invocations. Defaults to `false`. | +| `captureLambdaPayload` | [Captures incoming and outgoing AWS Lambda payloads][17] in the Datadog APM spans for Lambda invocations. Defaults to `false`. +| `captureCloudRequestPayload` | [Captures request data exchanged between your application and AWS services][20] in the Datadog APM spans. Values: `all`. To [protect sensitive data][21], use JSON Path syntax.. Defaults to `false`. +| `captureCloudResponsePayload` | [Captures response data exchanged between your application and AWS services][20] in the Datadog APM spans.Values: `all`. To [protect sensitive data][21], use JSON Path syntax.`""`. | | `enableSourceCodeIntegration` | Enable [Datadog Source Code Integration][18] for the function. Defaults to `true`. | | `uploadGitMetadata` | Enable Git metadata uploading for the function, as a part of source code integration. Set this to false if you have the Datadog Github Integration installed, as it renders Git metadata uploading unnecessary. Defaults to `true`. | | `subscribeToAccessLogs` | Enable automatic subscription of the Datadog Forwarder to API Gateway access log groups. Requires setting `forwarderArn`. Defaults to `true`. | @@ -263,3 +265,5 @@ This product includes software developed at Datadog ( Date: Thu, 19 Dec 2024 15:57:46 +0100 Subject: [PATCH 2/6] add integration test variables --- ...correct_extension_apigateway_snapshot.json | 24 ++++++++++++++++ .../correct_extension_snapshot.json | 28 +++++++++++++++++++ .../correct_forwarder_snapshot.json | 28 +++++++++++++++++-- 3 files changed, 78 insertions(+), 2 deletions(-) diff --git a/integration_tests/correct_extension_apigateway_snapshot.json b/integration_tests/correct_extension_apigateway_snapshot.json index e6d81d7b..f3756a56 100644 --- a/integration_tests/correct_extension_apigateway_snapshot.json +++ b/integration_tests/correct_extension_apigateway_snapshot.json @@ -262,6 +262,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev", "DD_LAMBDA_HANDLER": "py_handler.hello" @@ -312,6 +314,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev", "DD_LAMBDA_HANDLER": "py_handler.hello" @@ -362,6 +366,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev", "DD_LAMBDA_HANDLER": "py_handler.hello" @@ -412,6 +418,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev", "DD_LAMBDA_HANDLER": "js_handler.hello" @@ -462,6 +470,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev", "DD_LAMBDA_HANDLER": "js_handler.hello" @@ -512,6 +522,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev", "DD_LAMBDA_HANDLER": "js_handler.hello" @@ -562,6 +574,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" @@ -612,6 +626,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" @@ -662,6 +678,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" @@ -712,6 +730,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" @@ -762,6 +782,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" } @@ -810,6 +832,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" } diff --git a/integration_tests/correct_extension_snapshot.json b/integration_tests/correct_extension_snapshot.json index cdffa95a..57bf736a 100644 --- a/integration_tests/correct_extension_snapshot.json +++ b/integration_tests/correct_extension_snapshot.json @@ -297,6 +297,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev", "DD_LAMBDA_HANDLER": "py_handler.hello" @@ -349,6 +351,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev", "DD_LAMBDA_HANDLER": "py_handler.hello" @@ -401,6 +405,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev", "DD_LAMBDA_HANDLER": "py_handler.hello" @@ -453,6 +459,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev", "DD_LAMBDA_HANDLER": "js_handler.hello" @@ -505,6 +513,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev", "DD_LAMBDA_HANDLER": "js_handler.hello" @@ -557,6 +567,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev", "DD_LAMBDA_HANDLER": "js_handler.hello" @@ -642,6 +654,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" @@ -697,6 +711,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" @@ -749,6 +765,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" @@ -804,6 +822,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" @@ -856,6 +876,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" @@ -908,6 +930,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" @@ -960,6 +984,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" } @@ -1010,6 +1036,8 @@ "DD_LOGS_INJECTION": false, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_SERVICE": "dd-sls-plugin-integration-test", "DD_ENV": "dev" } diff --git a/integration_tests/correct_forwarder_snapshot.json b/integration_tests/correct_forwarder_snapshot.json index 5de68a01..3761bc65 100644 --- a/integration_tests/correct_forwarder_snapshot.json +++ b/integration_tests/correct_forwarder_snapshot.json @@ -506,6 +506,8 @@ "DD_LOGS_INJECTION": true, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_LAMBDA_HANDLER": "py_handler.hello" } }, @@ -561,6 +563,8 @@ "DD_LOGS_INJECTION": true, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_LAMBDA_HANDLER": "py_handler.hello" } }, @@ -616,6 +620,8 @@ "DD_LOGS_INJECTION": true, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_LAMBDA_HANDLER": "py_handler.hello" } }, @@ -671,6 +677,8 @@ "DD_LOGS_INJECTION": true, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_LAMBDA_HANDLER": "js_handler.hello" } }, @@ -726,6 +734,8 @@ "DD_LOGS_INJECTION": true, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_LAMBDA_HANDLER": "js_handler.hello" } }, @@ -781,6 +791,8 @@ "DD_LOGS_INJECTION": true, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "DD_LAMBDA_HANDLER": "js_handler.hello" } }, @@ -886,6 +898,8 @@ "DD_LOGS_INJECTION": true, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper" } }, @@ -938,6 +952,8 @@ "DD_LOGS_INJECTION": true, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper" } }, @@ -990,6 +1006,8 @@ "DD_LOGS_INJECTION": true, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper" } }, @@ -1042,6 +1060,8 @@ "DD_LOGS_INJECTION": true, "DD_SERVERLESS_LOGS_ENABLED": true, "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "", "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper" } }, @@ -1093,7 +1113,9 @@ "DD_MERGE_XRAY_TRACES": false, "DD_LOGS_INJECTION": true, "DD_SERVERLESS_LOGS_ENABLED": true, - "DD_CAPTURE_LAMBDA_PAYLOAD": false + "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "" } }, "Role": { @@ -1144,7 +1166,9 @@ "DD_MERGE_XRAY_TRACES": false, "DD_LOGS_INJECTION": true, "DD_SERVERLESS_LOGS_ENABLED": true, - "DD_CAPTURE_LAMBDA_PAYLOAD": false + "DD_CAPTURE_LAMBDA_PAYLOAD": false, + "DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING": "", + "DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING": "" } }, "Role": { From 2e324378076e2ea77ed604b71183c0d1531bf3b5 Mon Sep 17 00:00:00 2001 From: enricop89 Date: Fri, 20 Dec 2024 10:33:21 +0100 Subject: [PATCH 3/6] Fix readme file and typos --- README.md | 8 +++++--- src/env.ts | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a6d267ac..ff9ddbc2 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,11 @@ To further configure your plugin, use the following custom parameters in your `s | `enableASM` | Enable [Datadog Application Security Management (ASM)][19] on the Lambda function. Requires the Datadog extension to be present (using `addExtension` or manually added) and `enableDDTracing`. Defaults to `false`. | | `enableDDLogs` | Enable Datadog log collection using the Lambda Extension. Defaults to `true`. Note: This setting has no effect on logs sent by the Datadog Forwarder. | | `monitors` | When defined, the Datadog plugin configures monitors for the deployed function. Requires setting `DATADOG_API_KEY` and `DATADOG_APP_KEY` in your environment. To learn how to define monitors, see [To Enable and Configure a Recommended Serverless Monitor](#to-enable-and-configure-a-recommended-serverless-monitor). | -| `captureLambdaPayload` | [Captures incoming and outgoing AWS Lambda payloads][17] in the Datadog APM spans for Lambda invocations. Defaults to `false`. -| `captureCloudRequestPayload` | [Captures request data exchanged between your application and AWS services][20] in the Datadog APM spans. Values: `all`. To [protect sensitive data][21], use JSON Path syntax.. Defaults to `false`. -| `captureCloudResponsePayload` | [Captures response data exchanged between your application and AWS services][20] in the Datadog APM spans.Values: `all`. To [protect sensitive data][21], use JSON Path syntax.`""`. | +| `captureLambdaPayload` | [Captures incoming and outgoing AWS Lambda payloads][17] in the Datadog APM spans for Lambda invocations. Defaults to `false`. +| +| `captureCloudRequestPayload` | | `captureCloudRequestPayload` | When using an AWS SDK client within your lambda function, captures [request data exchanged between it and AWS services][20] in the Datadog APM spans. Values: `all`. To [protect sensitive data][21], use JSON Path syntax. Defaults to `""`. | +| +| `captureCloudResponsePayload` | When using an AWS SDK client within your lambda function, [captures response data exchanged between it and AWS services][20] in the Datadog APM spans.Values: `all`. To [protect sensitive data][21], use JSON Path syntax. Defaults to `""`. | | | `enableSourceCodeIntegration` | Enable [Datadog Source Code Integration][18] for the function. Defaults to `true`. | | `uploadGitMetadata` | Enable Git metadata uploading for the function, as a part of source code integration. Set this to false if you have the Datadog Github Integration installed, as it renders Git metadata uploading unnecessary. Defaults to `true`. | | `subscribeToAccessLogs` | Enable automatic subscription of the Datadog Forwarder to API Gateway access log groups. Requires setting `forwarderArn`. Defaults to `true`. | diff --git a/src/env.ts b/src/env.ts index 75baaef7..ba17cc4e 100644 --- a/src/env.ts +++ b/src/env.ts @@ -28,9 +28,9 @@ export interface Configuration { apiKMSKey?: string; // Whether to capture and store the payload and response of a lambda invocation captureLambdaPayload?: boolean; - // Wheter to capture and store the AWS Payload requests services + // Whether to capture and store the AWS Payload requests services captureCloudRequestPayload?: string; - // Wheter to capture and store the AWS Payload response services + // Whether to capture and store the AWS Payload response services captureCloudResponsePayload?: string; // Which Datadog site to send to (for example, datadoghq.com or datadoghq.eu) site: string; From 204d6cb76387caba9671d9f7a7adc076f9c5b6cf Mon Sep 17 00:00:00 2001 From: enricop89 Date: Fri, 20 Dec 2024 12:52:31 +0100 Subject: [PATCH 4/6] fix typos --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ff9ddbc2..6067e41e 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,9 @@ To further configure your plugin, use the following custom parameters in your `s | `enableDDLogs` | Enable Datadog log collection using the Lambda Extension. Defaults to `true`. Note: This setting has no effect on logs sent by the Datadog Forwarder. | | `monitors` | When defined, the Datadog plugin configures monitors for the deployed function. Requires setting `DATADOG_API_KEY` and `DATADOG_APP_KEY` in your environment. To learn how to define monitors, see [To Enable and Configure a Recommended Serverless Monitor](#to-enable-and-configure-a-recommended-serverless-monitor). | | `captureLambdaPayload` | [Captures incoming and outgoing AWS Lambda payloads][17] in the Datadog APM spans for Lambda invocations. Defaults to `false`. -| -| `captureCloudRequestPayload` | | `captureCloudRequestPayload` | When using an AWS SDK client within your lambda function, captures [request data exchanged between it and AWS services][20] in the Datadog APM spans. Values: `all`. To [protect sensitive data][21], use JSON Path syntax. Defaults to `""`. | -| -| `captureCloudResponsePayload` | When using an AWS SDK client within your lambda function, [captures response data exchanged between it and AWS services][20] in the Datadog APM spans.Values: `all`. To [protect sensitive data][21], use JSON Path syntax. Defaults to `""`. | | + | +| `captureCloudRequestPayload` | When using an AWS SDK client within your lambda function, [captures request data exchanged between it and AWS services][20] in the Datadog APM spans. Values: `all`. To [protect sensitive data][21], use JSON Path syntax. Defaults to `""`. | +| `captureCloudResponsePayload` | When using an AWS SDK client within your lambda function, [captures response data exchanged between it and AWS services][20] in the Datadog APM spans.Values: `all`. To [protect sensitive data][21], use JSON Path syntax. Defaults to `""`. | | `enableSourceCodeIntegration` | Enable [Datadog Source Code Integration][18] for the function. Defaults to `true`. | | `uploadGitMetadata` | Enable Git metadata uploading for the function, as a part of source code integration. Set this to false if you have the Datadog Github Integration installed, as it renders Git metadata uploading unnecessary. Defaults to `true`. | | `subscribeToAccessLogs` | Enable automatic subscription of the Datadog Forwarder to API Gateway access log groups. Requires setting `forwarderArn`. Defaults to `true`. | @@ -268,4 +267,4 @@ This product includes software developed at Datadog ( Date: Fri, 20 Dec 2024 12:56:45 +0100 Subject: [PATCH 5/6] Fix table indentation --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6067e41e..834e52c9 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,9 @@ To further configure your plugin, use the following custom parameters in your `s | `enableASM` | Enable [Datadog Application Security Management (ASM)][19] on the Lambda function. Requires the Datadog extension to be present (using `addExtension` or manually added) and `enableDDTracing`. Defaults to `false`. | | `enableDDLogs` | Enable Datadog log collection using the Lambda Extension. Defaults to `true`. Note: This setting has no effect on logs sent by the Datadog Forwarder. | | `monitors` | When defined, the Datadog plugin configures monitors for the deployed function. Requires setting `DATADOG_API_KEY` and `DATADOG_APP_KEY` in your environment. To learn how to define monitors, see [To Enable and Configure a Recommended Serverless Monitor](#to-enable-and-configure-a-recommended-serverless-monitor). | -| `captureLambdaPayload` | [Captures incoming and outgoing AWS Lambda payloads][17] in the Datadog APM spans for Lambda invocations. Defaults to `false`. - | -| `captureCloudRequestPayload` | When using an AWS SDK client within your lambda function, [captures request data exchanged between it and AWS services][20] in the Datadog APM spans. Values: `all`. To [protect sensitive data][21], use JSON Path syntax. Defaults to `""`. | -| `captureCloudResponsePayload` | When using an AWS SDK client within your lambda function, [captures response data exchanged between it and AWS services][20] in the Datadog APM spans.Values: `all`. To [protect sensitive data][21], use JSON Path syntax. Defaults to `""`. | +| `captureLambdaPayload` | [Captures incoming and outgoing AWS Lambda payloads][17] in the Datadog APM spans for Lambda invocations. Defaults to `false`. | +| `captureCloudRequestPayload` | When using an AWS SDK client within your lambda function, [captures request data exchanged between it and AWS services][20] in the Datadog APM spans. Values: `all`. To [protect sensitive data][21], use JSON Path syntax. Defaults to `""`. | +| `captureCloudResponsePayload` | When using an AWS SDK client within your lambda function, [captures response data exchanged between it and AWS services][20] in the Datadog APM spans.Values: `all`. To [protect sensitive data][21], use JSON Path syntax. Defaults to `""`. | | `enableSourceCodeIntegration` | Enable [Datadog Source Code Integration][18] for the function. Defaults to `true`. | | `uploadGitMetadata` | Enable Git metadata uploading for the function, as a part of source code integration. Set this to false if you have the Datadog Github Integration installed, as it renders Git metadata uploading unnecessary. Defaults to `true`. | | `subscribeToAccessLogs` | Enable automatic subscription of the Datadog Forwarder to API Gateway access log groups. Requires setting `forwarderArn`. Defaults to `true`. | @@ -69,6 +68,7 @@ To further configure your plugin, use the following custom parameters in your `s | `enableStepFunctionsTracing` | Enable automatic subscription of the Datadog Forwarder to Step Function log groups and Step Functions tracing. If no Step Function log groups are configured, then they are automatically created. Requires setting `forwarderArn`. Defaults to `false`. | | `propagateUpstreamTrace` | When set to `true`, downstream Stepfunction invocation traces merge with upstream Stepfunction invocations. Defaults to `false`. | | `redirectHandlers` | Optionally disable handler redirection if set to `false`. This should only be set to `false` when APM is fully disabled. Defaults to `true`. | + To use any of these parameters, add a `custom` > `datadog` section to your `serverless.yml` similar to this example: ```yaml From 9c151f4965d6b789ab97ac314642e7cd9134905b Mon Sep 17 00:00:00 2001 From: enricop89 Date: Fri, 20 Dec 2024 12:59:58 +0100 Subject: [PATCH 6/6] missing space --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 834e52c9..70781e0f 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ To further configure your plugin, use the following custom parameters in your `s | `monitors` | When defined, the Datadog plugin configures monitors for the deployed function. Requires setting `DATADOG_API_KEY` and `DATADOG_APP_KEY` in your environment. To learn how to define monitors, see [To Enable and Configure a Recommended Serverless Monitor](#to-enable-and-configure-a-recommended-serverless-monitor). | | `captureLambdaPayload` | [Captures incoming and outgoing AWS Lambda payloads][17] in the Datadog APM spans for Lambda invocations. Defaults to `false`. | | `captureCloudRequestPayload` | When using an AWS SDK client within your lambda function, [captures request data exchanged between it and AWS services][20] in the Datadog APM spans. Values: `all`. To [protect sensitive data][21], use JSON Path syntax. Defaults to `""`. | -| `captureCloudResponsePayload` | When using an AWS SDK client within your lambda function, [captures response data exchanged between it and AWS services][20] in the Datadog APM spans.Values: `all`. To [protect sensitive data][21], use JSON Path syntax. Defaults to `""`. | +| `captureCloudResponsePayload` | When using an AWS SDK client within your lambda function, [captures response data exchanged between it and AWS services][20] in the Datadog APM spans. Values: `all`. To [protect sensitive data][21], use JSON Path syntax. Defaults to `""`. | | `enableSourceCodeIntegration` | Enable [Datadog Source Code Integration][18] for the function. Defaults to `true`. | | `uploadGitMetadata` | Enable Git metadata uploading for the function, as a part of source code integration. Set this to false if you have the Datadog Github Integration installed, as it renders Git metadata uploading unnecessary. Defaults to `true`. | | `subscribeToAccessLogs` | Enable automatic subscription of the Datadog Forwarder to API Gateway access log groups. Requires setting `forwarderArn`. Defaults to `true`. |