From 068410f6a26d10946083f0d82c0a030381e3d4de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 16 Oct 2024 16:33:12 +0200 Subject: [PATCH] add parameter DdLogLevel to DataDog Forwarder Lambda template to control DD_LOG_LEVEL environment variable --- aws/logs_monitoring/README.md | 3 +++ aws/logs_monitoring/template.yaml | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/aws/logs_monitoring/README.md b/aws/logs_monitoring/README.md index 0d51cb0e..4d1bc201 100644 --- a/aws/logs_monitoring/README.md +++ b/aws/logs_monitoring/README.md @@ -424,6 +424,9 @@ To test different patterns against your logs, turn on [debug logs](#troubleshoot ### Advanced (optional) +`DdLogLevel` +: Control log level for the Datadog Forwarder Lambda function + `DdFetchLambdaTags` : Let the Forwarder fetch Lambda tags using GetResources API calls and apply them to logs, metrics, and traces. If set to true, permission `tag:GetResources` will be automatically added to the Lambda execution IAM role. diff --git a/aws/logs_monitoring/template.yaml b/aws/logs_monitoring/template.yaml index c2802348..946b809d 100644 --- a/aws/logs_monitoring/template.yaml +++ b/aws/logs_monitoring/template.yaml @@ -70,6 +70,11 @@ Parameters: Type: String Default: "" Description: Add custom tags to forwarded logs, comma-delimited string, no trailing comma, e.g., env:prod,stack:classic + DdLogLevel: + Type: String + Default: "INFO" + AllowedValues: ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] + Description: Control log level for the Datadog Forwarder Lambda function DdFetchLambdaTags: Type: String Default: true @@ -406,6 +411,7 @@ Resources: - !Ref DdTags - !Ref AWS::NoValue DD_TAGS_CACHE_TTL_SECONDS: !Ref TagsCacheTTLSeconds + DD_LOG_LEVEL: !Ref DdLogLevel DD_FETCH_LAMBDA_TAGS: !If - SetDdFetchLambdaTags - !Ref DdFetchLambdaTags @@ -967,6 +973,7 @@ Metadata: - Label: default: Advanced (Optional) Parameters: + - DdLogLevel - DdFetchLambdaTags - DdFetchLogGroupTags - DdFetchStepFunctionsTags