fix(openfeature): subscribe to FFE on first RC request#18275
Draft
leoromanovsky wants to merge 1 commit into
Draft
fix(openfeature): subscribe to FFE on first RC request#18275leoromanovsky wants to merge 1 commit into
leoromanovsky wants to merge 1 commit into
Conversation
Codeowners resolved as |
|
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.
Motivation
When the Agent is already running, and a Python tracer starts with the OpenFeature provider enabled, the tracer must request
FFE_FLAGSin its first Remote Configuration request. That first request is important because the Agent can use the new-client request to fetch the backend configuration; ifFFE_FLAGSonly 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/configrequest did not include theFFE_FLAGSproduct or theFFE_FLAG_CONFIGURATION_RULEScapability.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 existingregister_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_ENABLEDis set, it also registers the OpenFeatureFFE_FLAGScallback 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_FLAGSand advertisesFFE_FLAG_CONFIGURATION_RULESbefore the poller can make its first request.Additional Notes
Related system-tests PR: DataDog/system-tests#7023