From 12362a59fdb858ccae964795a5b9b27578846146 Mon Sep 17 00:00:00 2001 From: Zarir Hamza Date: Wed, 15 Apr 2026 11:34:59 -0400 Subject: [PATCH 1/3] fix: disable remote configuration by default in Lambda Remote configuration relies on /dev/shm for shared memory, which is unavailable in AWS Lambda. Set DD_REMOTE_CONFIGURATION_ENABLED=false before ddtrace loads (following the same pattern used for DD_TRACE_STATS_COMPUTATION_ENABLED and DD_INSTRUMENTATION_TELEMETRY_ENABLED) so the tracer knows RC is disabled from the start. This is a defense-in-depth companion to the primary fix in dd-trace-py which skips the shared memory allocation entirely when in_aws_lambda() is detected. Resolves: #785 --- datadog_lambda/config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/datadog_lambda/config.py b/datadog_lambda/config.py index 4458bd9a..ce4924af 100644 --- a/datadog_lambda/config.py +++ b/datadog_lambda/config.py @@ -141,6 +141,11 @@ def _reset(self): "enabled" if config.fips_mode_enabled else "not enabled", ) +# Remote configuration relies on /dev/shm which is unavailable in Lambda. +# Disable it before ddtrace loads to avoid the shared-memory warning. +if "DD_REMOTE_CONFIGURATION_ENABLED" not in os.environ: + os.environ["DD_REMOTE_CONFIGURATION_ENABLED"] = "false" + # disable css to prevent double counting in lambda os.environ["DD_TRACE_STATS_COMPUTATION_ENABLED"] = "false" From d7739b143e08b227aa44a2e21f04f4a8037680c0 Mon Sep 17 00:00:00 2001 From: Zarir Hamza Date: Wed, 15 Apr 2026 11:52:50 -0400 Subject: [PATCH 2/3] Revert "fix: disable remote configuration by default in Lambda" This reverts commit 12362a59fdb858ccae964795a5b9b27578846146. --- datadog_lambda/config.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/datadog_lambda/config.py b/datadog_lambda/config.py index ce4924af..4458bd9a 100644 --- a/datadog_lambda/config.py +++ b/datadog_lambda/config.py @@ -141,11 +141,6 @@ def _reset(self): "enabled" if config.fips_mode_enabled else "not enabled", ) -# Remote configuration relies on /dev/shm which is unavailable in Lambda. -# Disable it before ddtrace loads to avoid the shared-memory warning. -if "DD_REMOTE_CONFIGURATION_ENABLED" not in os.environ: - os.environ["DD_REMOTE_CONFIGURATION_ENABLED"] = "false" - # disable css to prevent double counting in lambda os.environ["DD_TRACE_STATS_COMPUTATION_ENABLED"] = "false" From 27986b79bd2de1fc574c5e6125289fc8e46d4eec Mon Sep 17 00:00:00 2001 From: Zarir Hamza Date: Wed, 15 Apr 2026 11:53:46 -0400 Subject: [PATCH 3/3] Reapply "fix: disable remote configuration by default in Lambda" This reverts commit d7739b143e08b227aa44a2e21f04f4a8037680c0. --- datadog_lambda/config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/datadog_lambda/config.py b/datadog_lambda/config.py index 4458bd9a..ce4924af 100644 --- a/datadog_lambda/config.py +++ b/datadog_lambda/config.py @@ -141,6 +141,11 @@ def _reset(self): "enabled" if config.fips_mode_enabled else "not enabled", ) +# Remote configuration relies on /dev/shm which is unavailable in Lambda. +# Disable it before ddtrace loads to avoid the shared-memory warning. +if "DD_REMOTE_CONFIGURATION_ENABLED" not in os.environ: + os.environ["DD_REMOTE_CONFIGURATION_ENABLED"] = "false" + # disable css to prevent double counting in lambda os.environ["DD_TRACE_STATS_COMPUTATION_ENABLED"] = "false"