feat(openfeature): add agentless configuration polling - #5222
gh-worker-dd-mergequeue-cf854d[bot] merged 35 commits into
Conversation
…e fields and accessors
…edence and settings
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 78c4c8d | Docs | View more details | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9383635a9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…/dd-trace-go into pavlo.khrebto/FFL-2695/agentless-poller
BenchmarksBenchmark execution time: 2026-09-08 08:27:29 Comparing candidate commit 78c4c8d in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 335 metrics, 0 unstable metrics, 1 flaky benchmarks without significant changes.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 610c0e7d52
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…/dd-trace-go into pavlo.khrebto/FFL-2695/agentless-poller
…e and endpoint (#5218) ### What does this PR do? Lays the groundwork for Agentless Feature Flags delivery (polling configuration directly from Datadog over HTTPS instead of via the Agent's Remote Config): five new `DD_FEATURE_FLAGS_*` environment variables, `internal/config` fields/accessors for them, the source-precedence resolution logic (`internal/openfeature.ResolveSettings`/`RemoteConfigSourceSelected`), and Agentless endpoint URL resolution (`openfeature.buildAgentlessEndpoint`, managed vs. custom). No behavior change yet — nothing is wired up to the provider or issues any network requests. This is Phase 1 of a multi-PR rollout; the poll loop, JSON:API envelope parsing, and provider wiring/activation follow in subsequent PRs. ### Stack 1. #5218 — settings, source precedence, endpoint (this PR) 2. #5222 — JSON:API parser, poll loop 3. #5223 — provider wiring, activation, lifecycle, RC gating 4. #5226 — init outcomes, provider events ### Motivation dd-trace-go is one of the last server SDKs to support Agentless Feature Flags delivery (Python, Node, and Java have shipped it; .NET is in review; Ruby is also pending). Agentless removes the Agent as a dependency and becomes the default delivery mechanism. FFL-2695. ### Reviewer's Checklist - [x] Changed code has unit tests for its functionality at or near 100% coverage. - [x] [System-Tests](https://github.com/DataDog/system-tests/) covering this feature have been added and enabled with the va.b.c-dev version tag: DataDog/system-tests#7580 - [ ] There is a benchmark for any new code, or changes to existing code. - [ ] If this interacts with the agent in a new way, a system test has been added. - [x] New code is free of linting errors. You can check this by running `make lint` locally. - [x] New code doesn't break existing tests. You can check this by running `make test` locally. - [ ] Add an appropriate team label so this PR gets put in the right place for the release notes. - [x] All generated files are up to date. You can check this by running `make generate` locally. - [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally. Unsure? Have a question? Request a review! Co-authored-by: pavlo.khrebto <pavlo.khrebto@datadoghq.com>
…bto/FFL-2695/agentless-poller
…ss delivery (#5223) ### What does this PR do? Wires up the provider itself, stacked on #5222 (poll loop/parser): `NewDatadogProvider` now resolves the delivery source and branches to Remote Config, Agentless, or a `NoopProvider`, replacing the old `DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED`-gated check. Adds the Agentless activation critical section (`startWithAgentless`) with a `shutdownCalled` re-check so a poller can never be registered after `Shutdown` — that would otherwise leak a billable poller for the process lifetime. Reorders `ShutdownWithContext` so teardown runs without holding the provider's lock (needed because `agentless.Stop` joins the poll goroutine, which itself calls `updateConfiguration` and takes the same lock). Gates the tracer's eager Remote Config subscribe on the resolved source (`ddtrace/tracer/remote_config.go`). Also fixes a real pre-existing bug found by a new concurrency test: concurrent `Init` calls could double-start a writer and panic; `Init` is now idempotent. Updates `openfeature/doc.go` with the new environment variables and the delivery-source model. ### Stack 1. #5218 — settings, source precedence, endpoint 2. #5222 — JSON:API parser, poll loop 3. #5223 — provider wiring, activation, lifecycle, RC gating (this PR) 4. #5226 — init outcomes, provider events ### Motivation Continuation of Agentless Feature Flags delivery (FFL-2695); see #5218 for the overall context. ### Reviewer's Checklist - [x] Changed code has unit tests for its functionality at or near 100% coverage. - [x] [System-Tests](https://github.com/DataDog/system-tests/) covering this feature have been added and enabled with the va.b.c-dev version tag: see DataDog/system-tests#7580 (referenced from #5218). - [ ] There is a benchmark for any new code, or changes to existing code. - [ ] If this interacts with the agent in a new way, a system test has been added. - [x] New code is free of linting errors. You can check this by running `make lint` locally. - [x] New code doesn't break existing tests. You can check this by running `make test` locally. - [ ] Add an appropriate team label so this PR gets put in the right place for the release notes. - [x] All generated files are up to date. You can check this by running `make generate` locally. - [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally. Unsure? Have a question? Request a review! Co-authored-by: kakkoyun <kakkoyun@users.noreply.github.com> Co-authored-by: leo.romanovsky <leo.romanovsky@datadoghq.com>
…5226) ### What does this PR do? Final PR in the Agentless Feature Flags delivery series (stacked on #5223). Adds `DD_EXPERIMENTAL_FLAGGING_PROVIDER_INITIALIZATION_TIMEOUT_MS` (default 10s) replacing the hardcoded 30s init timeout, and implements the three `InitWithContext` outcomes: a permanent delivery failure returns a `*openfeature.ProviderInitError` immediately, configuration already present returns `nil`, and a timeout with delivery still running returns `nil` + a warning instead of the raw `ctx.Err()` (a deliberate change from the old Remote-Config-only behavior — see below). Adds `openfeature/events.go`: `EventChannel()` returns the same stored channel on every call (required by the SDK's listener), emitting `ProviderReady` once on the first configuration, `ProviderConfigChange` on later ones, and `ProviderStale` when configuration goes nil (e.g. an empty Remote Config set) so evaluation status reflects reality. `ProviderReady` is guaranteed to survive a full event buffer via a non-blocking drain-and-retry. ### Stack 1. #5218 — settings, source precedence, endpoint 2. #5222 — JSON:API parser, poll loop 3. #5223 — provider wiring, activation, lifecycle, RC gating 4. #5226 — init outcomes, provider events (this PR) ### Motivation Completes Agentless Feature Flags delivery (FFL-2695); see #5218 for the overall context. **Behavior change to flag for cross-language sign-off:** on an `Init` timeout with delivery still running, the provider now returns `nil` instead of `ctx.Err()`. Go's `ErrorState` doesn't block flag evaluation, so the only customer-visible difference is the reported status/event — but this could affect a health check that inspected the old error return. ### Reviewer's Checklist - [x] Changed code has unit tests for its functionality at or near 100% coverage. - [x] [System-Tests](https://github.com/DataDog/system-tests/) covering this feature have been added and enabled with the va.b.c-dev version tag: see DataDog/system-tests#7580 (referenced from #5218). - [ ] There is a benchmark for any new code, or changes to existing code. - [ ] If this interacts with the agent in a new way, a system test has been added. - [x] New code is free of linting errors. You can check this by running `make lint` locally. - [x] New code doesn't break existing tests. You can check this by running `make test` locally. - [ ] Add an appropriate team label so this PR gets put in the right place for the release notes. - [x] All generated files are up to date. You can check this by running `make generate` locally. - [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally. Unsure? Have a question? Request a review! Co-authored-by: leoromanovsky <leo.romanovsky@datadoghq.com>
What does this PR do?
Adds the Agentless configuration delivery mechanism itself, stacked on #5218 (source
resolution/endpoint): a JSON:API envelope parser for the Universal Flags Configuration payload
(
openfeature/jsonapi.go), and the poll loop that fetches it (openfeature/agentless_source.go) —per-poll retries with backoff, ETag/304 handling with last-known-good semantics, gzip decoding, and
per-category log-once for persistent failures. Includes an
httptest.Server-based fake backendmirroring the system-tests mock (
utils/mocked_backend/ffe.py) covering the full behavior matrix:ETag not advanced on parse failure, retry-within-poll, non-retryable failures, no-overlap between
polls, and no log line ever containing the endpoint URL.
Still not wired up to the provider — nothing issues a request until Phase 3 lands.
Stack
Motivation
Continuation of Agentless Feature Flags delivery (FFL-2695); see #5218 for the overall context.
Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.Unsure? Have a question? Request a review!