Skip to content

Commit 6384d35

Browse files
committed
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
1 parent 354a074 commit 6384d35

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

datadog_lambda/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ def _reset(self):
141141
"enabled" if config.fips_mode_enabled else "not enabled",
142142
)
143143

144+
# Remote configuration relies on /dev/shm which is unavailable in Lambda.
145+
# Disable it before ddtrace loads to avoid the shared-memory warning.
146+
if "DD_REMOTE_CONFIGURATION_ENABLED" not in os.environ:
147+
os.environ["DD_REMOTE_CONFIGURATION_ENABLED"] = "false"
148+
144149
# disable css to prevent double counting in lambda
145150
os.environ["DD_TRACE_STATS_COMPUTATION_ENABLED"] = "false"
146151

0 commit comments

Comments
 (0)