feat(openfeature): add agentless Feature Flagging configuration source#9402
feat(openfeature): add agentless Feature Flagging configuration source#9402leoromanovsky wants to merge 6 commits into
Conversation
Overall package sizeSelf size: 6.79 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.1 | 122.62 kB | 438.86 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9402 +/- ##
========================================
Coverage 96.90% 96.91%
========================================
Files 923 925 +2
Lines 123011 123546 +535
Branches 21249 21286 +37
========================================
+ Hits 119209 119732 +523
- Misses 3802 3814 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-07-16 13:28:30 Comparing candidate commit ce6b6c9 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2313 metrics, 45 unstable metrics.
|
NOTE TO REVIEWERS
This draft supersedes #9397. The implementation is unchanged in scope, but the history is rewritten into four narrative review units and includes the latest cross-SDK contract corrections.
Commit Guide
a59b02f6817d53ac78c62eb1f84ca363424DD_SITE=datad0g.comto the staging UFC CDN contract.What does this PR do?
Adds a no-Agent Feature Flagging configuration path to
dd-trace-js: load Universal Flag Configuration from the Datadog UFC CDN and evaluate flags locally through the existing OpenFeature provider.Motivation
Node.js server and serverless applications need to use Feature Flagging without depending on a local Datadog Agent. Agentless CDN delivery becomes the default source, while Agent Remote Configuration remains available through explicit opt-in.
Changes
DD_FEATURE_FLAGS_CONFIGURATION_SOURCEwithagentlessas the default,remote_configas explicit opt-in, andofflinereserved for a future startup-bytes API.https://ufc-server.ff-cdn.<DD_SITE>/api/v2/feature-flagging/config/rules-based/server?dd_env=<DD_ENV>.DD_SITE=datad0g.comas the staging managed CDN site and regression-tests the exact derived URL.DD-API-KEY.data.type = universal-flag-configuration, then passesdata.attributesto the existing evaluator.If-None-Match,304, bounded jittered retries, request timeouts, no overlap, last-known-good preservation, and shutdown cancellation.FFE_FLAGSRemote Configuration subscription only whenremote_configis explicitly selected.Decisions
Agentless is the default. An unset, empty, whitespace-only, or case-variant source value resolves to
agentless. Agent Remote Configuration must be selected withremote_config.Staging uses the same managed contract.
DD_SITE=datad0g.comderiveshttps://ufc-server.ff-cdn.datad0g.com/api/v2/feature-flagging/config/rules-based/server?dd_env=<DD_ENV>; staging is not hidden behind a custom endpoint.Managed delivery is strict JSON:API. The Datadog-managed CDN response must contain a
universal-flag-configurationresource and UFC fields underdata.attributes. A malformed response never replaces the last-known-good configuration.Custom URLs are exact when they include a path. A configured origin receives the standard rules-based path; a configured URL with a non-root path is used as the exact endpoint. Raw UFC is accepted only for explicitly configured custom endpoints for controlled compatibility.
There is no SDK payload-size cap. Valid managed JSON:API payloads larger than 500 KB are accepted.
ETags describe accepted configurations. A
200response advances the ETag only after parsing and local application succeed. An accepted200without a non-blank ETag clears the previous ETag.GovCloud managed delivery exits to defaults. With
DD_SITE=ddog-gov.comand no custom URL, no configuration source is started. The provider remains usable and returns caller defaults. An explicitly configured custom endpoint is still allowed.No custom headers. Agentless requests expose no custom-header configuration surface.
No emission changes. This PR only loads UFC and evaluates locally. It does not add or modify exposure emission, aggregate-evaluation emission, span enrichment, or evaluation metrics.
Offline remains reserved. No startup-bytes API or offline source is introduced here.
Delivery Architecture
flowchart TD Gate{Flagging provider enabled?} Select{Configuration source} Gate -- no --> Disabled[Provider not started] Gate -- yes --> Select Select -- unset or agentless --> Gov{Managed GovCloud?} Gov -- yes --> Defaults[No source<br/>caller defaults] Gov -- no --> URL{Custom URL?} URL -- no --> CDN[Datadog UFC CDN<br/>strict JSON:API] URL -- yes --> Custom[Custom endpoint<br/>JSON:API or raw UFC] CDN --> Poller[Authenticated poller<br/>ETag, retry, timeout, LKG] Custom --> Poller Poller --> UFC[Existing UFC pipeline] Select -- remote_config --> Agent[Datadog Agent RC<br/>FFE_FLAGS] Agent --> UFC Select -- offline --> Reserved[Reserved<br/>no source] UFC --> Evaluator[OpenFeature local evaluator] Evaluator --> Result[Application result] Defaults --> ResultPoll Lifecycle
sequenceDiagram participant App participant Source as Node agentless source participant CDN as UFC endpoint participant Evaluator as Local evaluator App->>Source: start Source->>CDN: GET .../server?dd_env=<env> Note over Source,CDN: DD-API-KEY CDN-->>Source: 200 JSON:API + optional ETag Source->>Evaluator: setConfiguration(data.attributes) Evaluator-->>App: local flag result loop fixed delay after completion Source->>CDN: GET with accepted If-None-Match alt unchanged CDN-->>Source: 304 else changed CDN-->>Source: 200 + configuration Source->>Evaluator: apply accepted configuration else retryable failure CDN-->>Source: timeout, 429, or 5xx Source->>CDN: bounded jittered retries end end App->>Source: close Source-->>Source: cancel request and timersManaged JSON:API Contract
{ "data": { "id": "1", "type": "universal-flag-configuration", "attributes": { "createdAt": "2026-07-15T19:57:07.219869778Z", "environment": { "name": "Staging" }, "flags": {} } } }Only
data.attributesis supplied to the existing UFC evaluator.Customer Usage Examples
Default Datadog-managed CDN delivery:
Datadog staging CDN delivery:
Application code for either managed site:
Explicit Agent Remote Configuration delivery:
Custom agentless endpoint:
GovCloud managed behavior:
System Test Evidence
Using DataDog/system-tests#7315 with the Node.js manifest locally enabled:
The suite covers source selection, managed
dd_envURL validation, JSON:API delivery, authentication, ETags and304, malformed/cold/warm recovery, timeout and retry behavior, last-known-good preservation, and non-overlapping polls.Additional Notes
The supporting system-tests contract is tracked in DataDog/system-tests#7315.