Skip to content

feat(openfeature): add agentless configuration polling - #5222

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 35 commits into
mainfrom
pavlo.khrebto/FFL-2695/agentless-poller
Sep 8, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 35 commits into
mainfrom
pavlo.khrebto/FFL-2695/agentless-poller

Conversation

@pavlokhrebto

@pavlokhrebto pavlokhrebto commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

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 backend
mirroring 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

  1. feat(openfeature): resolve agentless feature-flag configuration source and endpoint #5218 — settings, source precedence, endpoint
  2. feat(openfeature): add agentless configuration polling #5222 — JSON:API parser, poll loop (this PR)
  3. feat(openfeature): wire provider activation and lifecycle for agentless delivery #5223 — provider wiring, activation, lifecycle, RC gating
  4. feat(openfeature): add init outcomes and provider lifecycle events #5226 — init outcomes, provider events

Motivation

Continuation of Agentless Feature Flags delivery (FFL-2695); see #5218 for the overall context.

Reviewer's Checklist

Unsure? Have a question? Request a review!

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Tests

✅ All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 88.29%
• Overall Coverage: 69.98% (+13.30%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 78c4c8d | Docs | View more details | Give us feedback!

@pavlokhrebto pavlokhrebto changed the title Pavlo.khrebto/ffl 2695/agentless poller feat(openfeature): add agentless configuration polling Aug 20, 2026
@pavlokhrebto
pavlokhrebto marked this pull request as ready for review August 20, 2026 18:19
@pavlokhrebto
pavlokhrebto requested a review from a team as a code owner August 20, 2026 18:19
@pavlokhrebto
pavlokhrebto requested review from leoromanovsky and typotter and removed request for a team August 20, 2026 18:19

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread openfeature/agentless_source.go
Comment thread openfeature/agentless_source.go Outdated
Comment thread openfeature/agentless_source.go Outdated
Comment thread openfeature/agentless_source.go Outdated
@pavlokhrebto
pavlokhrebto marked this pull request as draft August 20, 2026 19:19
@pr-commenter

pr-commenter Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-09-08 08:27:29

Comparing candidate commit 78c4c8d in PR branch pavlo.khrebto/FFL-2695/agentless-poller with baseline commit 0dcbf18 in branch main.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 335 metrics, 0 unstable metrics, 1 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

Known flaky benchmarks without significant changes:

  • scenario:BenchmarkOTLPTraceWriterFlush

@pavlokhrebto
pavlokhrebto marked this pull request as ready for review August 21, 2026 05:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread openfeature/agentless_source.go
Comment thread openfeature/agentless_source_httptest_test.go

@darccio darccio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Sep 8, 2026
…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>
Base automatically changed from pavlo.khrebto/FFL-2695/agentless to main September 8, 2026 07:53
@gh-worker-ownership-write-b05516
gh-worker-ownership-write-b05516 Bot removed the request for review from a team September 8, 2026 07:54
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 1bbdefa into main Sep 8, 2026
192 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the pavlo.khrebto/FFL-2695/agentless-poller branch September 8, 2026 09:44
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Sep 10, 2026
…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>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Sep 10, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants