Repository navigation
feat: route feature flag config through the extension when DD_API_KEY is unset - #173
Open
purple4reina wants to merge 1 commit into
Open
purple4reina wants to merge 1 commit into
purple4reina wants to merge 1 commit into
Conversation
… is unset Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 17, 2026
There was a problem hiding this comment.
More details
The extension fallback preserves existing routing for API-key users and explicit URL overrides. Runtime behavior remains unverified because required test dependencies were missing.
🤖 Bits Code Review · Commit ab635f1
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 17 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: ab635f1 | Docs | View more details | Give us feedback! |
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
Same change for Python and Node: DataDog/datadog-lambda-python#890, DataDog/datadog-lambda-js#867
What does this PR do?
In
Datadog::Lambda.configure_apm, beforeDatadog.configure, setsDD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_BASE_URL=http://127.0.0.1:8126only when all of these are true:/opt/extensions/datadog-agentexists, viaDatadog::Utils.extension_running?).DD_API_KEYis unset, empty or whitespace.DD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_BASE_URL(unset, empty or whitespace).In every other case the wrapper changes nothing.
Motivation
dd-trace-rb's feature flag provider needs
DD_API_KEYin the process environment. 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 without it are already broken. dd-trace-rb reads onlyDD_API_KEY(no alias) and strips it, so whitespace counts as unset.requires DD_API_KEYwarning.Additional Notes
Gotchas reviewers should know about:
Datadog.configuresetting:c.feature_flags.agentless.base_urldoes not exist before datadog 2.44.0 and would raiseNoMethodErrorin the configure block. Older gems ignore the env var.configure_apmapplies it. Like the other defaults there, customers who callDatadog.configurethemselves withoutconfigure_apmget nothing.OpenFeature::SDK.configure { |c| c.set_provider(...) }), and caches it. If the customer creates the provider before callingconfigure_apm, the variable has no effect.datadog ~> 2.40when it is built, so layer v3.31.0 and later bundle 2.44 or newer. An olderdatadogin the customer's bundle ignores the variable.DD_API_KEYget404instead of theDD_API_KEYwarning. Flags fail either way; only the log message changes. This can be merged before v104.403, and the provider logs it and does not retry.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 in
test/datadog/lambda.spec.rbcallconfigure_apmwith the extension present or absent,DD_API_KEYset, empty or whitespace, a secret ARN only, and a base URL the customer already set.Types of changes
Check all that apply
🤖 Generated with Claude Code