fix: disable remote configuration by default in Lambda#795
Closed
zarirhamza wants to merge 3 commits intomainfrom
Closed
fix: disable remote configuration by default in Lambda#795zarirhamza wants to merge 3 commits intomainfrom
zarirhamza wants to merge 3 commits intomainfrom
Conversation
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
This was referenced Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Disables remote configuration by default before ddtrace loads, preventing the
Unable to create shared memorywarning on Lambda cold starts.Resolves #785
Context
Remote configuration in ddtrace relies on
/dev/shmfor shared memory viamultiprocessing.Array. AWS Lambda does not provide/dev/shm, so the allocation fails withFileNotFoundErrorand logs a warning on every cold start — even whenDD_REMOTE_CONFIGURATION_ENABLED=falseis explicitly set — because the shared memory allocation happens at import time before the config flag is checked.This started occurring with ddtrace v4.5.0 due to the single RC subscriber refactor which changed
PublisherSubscriberConnectorcreation from lazy (per-product registration) to eager (at module import time).Changes
datadog_lambda/config.py: SetDD_REMOTE_CONFIGURATION_ENABLED=falsein the environment before ddtrace is imported, following the same pattern already used forDD_TRACE_STATS_COMPUTATION_ENABLEDandDD_INSTRUMENTATION_TELEMETRY_ENABLED. Respects explicit user overrides — only sets the default if the env var is not already present.Primary Fix
The primary fix is in dd-trace-py: DataDog/dd-trace-py#17550 — adds an
in_aws_lambda()check inPublisherSubscriberConnector.__init__to skip the shared memory allocation entirely when running in Lambda.This PR is a defense-in-depth companion that:
ddconfig._remote_config_enabledisFalsefrom the start (preventing features like Dynamic Instrumentation from force-enabling RC in Lambda)enable()d, even if the dd-trace-py fix is not yet deployedTest Plan
DD_REMOTE_CONFIGURATION_ENABLEDdefaults to"false"when not explicitly setDD_REMOTE_CONFIGURATION_ENABLED=trueoverrides the defaultUnable to create shared memorywarning in Lambda cold start logs