Repository navigation
feat: route feature flag config through the extension when DD_API_KEY is unset - #890
Open
purple4reina wants to merge 4 commits into
Open
purple4reina wants to merge 4 commits into
purple4reina wants to merge 4 commits into
Conversation
… is unset When the extension is present and DD_API_KEY and DD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_BASE_URL are both unset, set the base URL to http://127.0.0.1:8126 before ddtrace loads, so customers who use DD_API_KEY_SECRET_ARN (or SSM/KMS) get feature flags through the extension. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
More details
The configuration guards preserve existing API-key and custom-URL paths while enabling extension routing when both settings are empty or unset. Extension and tracer compatibility was not exercised end to end.
🤖 Bits Code Review · Commit b26e43d
Contributor
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 20 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: dd8ad51 | Docs | View more details | Give us feedback! |
Evict all datadog_lambda submodules, not only config, so modules that config imports (e.g. datadog_lambda.extension) also run under the ddtrace blocker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 17, 2026
clifordshelton
approved these changes
Nov 17, 2026
clifordshelton
left a comment
There was a problem hiding this comment.
Looks good 👍. Thanks Rey! Left just two non-blocking nits.
Co-authored-by: clifordshelton <cliford.shelton@datadoghq.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Jira: SVLS-10161
What does this PR do?
Before ddtrace loads, sets
DD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_BASE_URL=http://127.0.0.1:8126only when all of these are true:/opt/extensions/datadog-agentexists).DD_API_KEYis unset or empty.DD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_BASE_URL(unset or empty).In every other case the wrapper changes nothing.
Motivation
dd-trace-py's feature flag provider reads only
DD_API_KEY. Customers who keep the key inDD_API_KEY_SECRET_ARN,DD_API_KEY_SSM_NAMEorDD_KMS_API_KEYgetPROVIDER_NOT_READYon every flag check (IR-63040). DataDog/datadog-lambda-extension#1510 adds a route on the extension's trace agent that fetches flag config with the key the extension resolved. The tracer uses that route only when this variable is set.Why these conditions
DD_API_KEYunset: the wrapper cannot tell which extension version is installed. An extension without the #1510 route returns404, and the tracer does not fall back to the CDN. With this condition, nothing that works today can break:DD_API_KEYusers keep going straight to the CDN, and customers withoutDD_API_KEYare already broken today.DD_API_KEY is requirederror.Gotchas reviewers should know about
DD_API_KEYget404instead ofDD_API_KEY is required. Flags fail either way, but the log message changes and is less obvious. This can be merged before v104; it only helps after customers upgrade the extension.datadog_lambda: if the customer's handler loads ddtrace's feature flag module beforedatadog_lambda, ddtrace has already read its config, so the variable has no effect. This is the same as the other defaults inconfig.py.403, and the provider logs it and does not retry. Before, the failure was the missingDD_API_KEY. Now it shows up as a403in the tracer and an error in the extension logs.DD_APM_RECEIVER_PORTapplies only to its test-mode binary), soDD_TRACE_AGENT_URLandDD_TRACE_AGENT_PORTare not used.404), the same as an old extension.DD_FEATURE_FLAGS_CONFIGURATION_SOURCE=remote_configorDD_FEATURE_FLAGS_ENABLED=false: the base URL applies only to the agentless source, so the variable has no effect.Testing Guidelines
Unit tests run
datadog_lambda.configwith each combination of extension present or absent,DD_API_KEYset, empty or unset, and a preset base URL.confignow importsdatadog_lambda.extension, so the test that checks importingconfigdoes not import ddtrace now also evicts the cacheddatadog_lambdasubmodules. Before, it did not re-runextension.pyand would miss a ddtrace import there.Types of Changes
Check all that apply
🤖 Generated with Claude Code