Skip to content

fix(openfeature): subscribe to FFE on first RC request#18275

Draft
leoromanovsky wants to merge 1 commit into
mainfrom
leo.romanovsky/ffl-2339-python-early-ffe-rc
Draft

fix(openfeature): subscribe to FFE on first RC request#18275
leoromanovsky wants to merge 1 commit into
mainfrom
leo.romanovsky/ffl-2339-python-early-ffe-rc

Conversation

@leoromanovsky
Copy link
Copy Markdown
Contributor

@leoromanovsky leoromanovsky commented May 27, 2026

Motivation

When the Agent is already running, and a Python tracer starts with the OpenFeature provider enabled, the tracer must request FFE_FLAGS in its first Remote Configuration request. That first request is important because the Agent can use the new-client request to fetch the backend configuration; if FFE_FLAGS only appears on a later poll, the application can continue serving default flag values during startup.

The shared system-test coverage in DataDog/system-tests#7023 exposed this for Python: the first /v0.7/config request did not include the FFE_FLAGS product or the FFE_FLAG_CONFIGURATION_RULES capability.

The customer impact here is a delay in their tracer/openfeature client in having available values.

Changes and Decisions

This changes Remote Configuration startup so registering a callback does not start the poller before the product has been added to the payload. Instead, enable_product() adds the product first and then starts the poller. That preserves the existing register_callback(); enable_product() call pattern while making the first payload reflect the enabled product.

The Remote Configuration product now batches its built-in products before starting the poller. When DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED is set, it also registers the OpenFeature FFE_FLAGS callback in that same early batch. The normal OpenFeature product startup still registers the same callback later; registration is idempotent, so this keeps the provider path unchanged and ensures the first Remote Configuration request succeeds.

The regression test makes the startup behavior explicit by patching the poller start call and capturing the payload that would be used for the first request. With OpenFeature disabled, the captured payload includes the normal Remote Configuration products and no FFE subscription. With OpenFeature enabled, the captured payload includes FFE_FLAGS and advertises FFE_FLAG_CONFIGURATION_RULES before the poller can make its first request.

Additional Notes

Related system-tests PR: DataDog/system-tests#7023

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

Codeowners resolved as

ddtrace/internal/openfeature/_remoteconfiguration.py                    @DataDog/feature-flagging-and-experimentation-sdk
ddtrace/internal/remoteconfig/products/client.py                        @DataDog/remote-config @DataDog/apm-core-python
ddtrace/internal/remoteconfig/worker.py                                 @DataDog/remote-config @DataDog/apm-core-python
releasenotes/notes/fix-openfeature-first-remote-config-request-9f0b7a6c1d2e3f45.yaml  @DataDog/apm-python
tests/internal/remoteconfig/test_remoteconfig.py                        @DataDog/remote-config @DataDog/apm-core-python

@datadog-prod-us1-6
Copy link
Copy Markdown

datadog-prod-us1-6 Bot commented May 27, 2026

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 8 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-py | build linux serverless: [amd64, cp315-cp315, v113741238-d2b8243-manylinux2014_x86_64, 1]   View in Datadog   GitLab

🔄 Retry job. This looks flaky and may succeed on retry. 0/327 nodes are available for scheduling due to insufficient memory, CPU, and node affinity issues.

DataDog/apm-reliability/dd-trace-py | build linux serverless: [amd64, cp315-cp315, v113741491-d2b8243-musllinux_1_2_x86_64, 1]   View in Datadog   GitLab

🔄 Retry job. This looks flaky and may succeed on retry. Job could not be scheduled due to insufficient resources and node constraints: 1 node with insufficient memory, node affinity/selector mismatch, untolerated taints, and insufficient CPU.

DataDog/apm-reliability/dd-trace-py | build linux serverless: [arm64, cp315-cp315, v113741589-d2b8243-musllinux_1_2_aarch64, 1]   View in Datadog   GitLab

🔄 Retry job. This looks flaky and may succeed on retry. Failed to create pod sandbox due to inability to allocate IP via local cilium agent: no IPs currently available on the node.

View all 8 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 03ab8ff | Docs | Datadog PR Page | Give us feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant