From 6384d35a38690a08b8724228223168165df4d98b Mon Sep 17 00:00:00 2001 From: Zarir Hamza Date: Wed, 15 Apr 2026 11:59:23 -0400 Subject: [PATCH] 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 (DataDog/dd-trace-py#17550) which skips the shared memory allocation entirely when in_aws_lambda() is detected. Integration test snapshots will need regenerating since ddtrace startup behavior changes slightly when RC is disabled from the start vs disabled later by the ASM Lambda guard. 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"