Repository navigation
feat(openfeature): add shared agentless EVP fallback - #6574
leoromanovsky wants to merge 11 commits into
Conversation
Typing analysisNote: Ignored files are excluded from the next sections. Untyped methodsThis PR introduces 7 partially typed methods, and clears 1 partially typed method. It increases the percentage of typed methods from 73.69% to 73.75% (+0.06%). Partially typed methods (+7-1)❌ Introduced:Untyped other declarationsThis PR introduces 1 partially typed other declaration. It increases the percentage of typed other declarations from 86.94% to 87.02% (+0.08%). Partially typed other declarations (+1-0)❌ Introduced:If you believe a method or an attribute is rightfully untyped or partially typed, you can add |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: b8c93df | Docs | View more details | Give us feedback! |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
An empty HTTPS proxy environment variable causes direct exposure and flag-evaluation batches to be dropped. The localized suggestion handles empty values while preserving configured proxies and no_proxy exclusions.
🤖 Bits Code Review · Commit ff41edc
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff41edc95f
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Preserve bounded delivery shutdown, fork isolation, and shared transport construction alongside the new Feature Flags diagnostics. Replace the timed shutdown test sleep with deterministic synchronization.
buraizu
left a comment
There was a problem hiding this comment.
Thanks for the PR! I've posted a few edit requests for the new docs content, but let me know if you have any questions or feedback.
Address review feedback with user-focused delivery guidance, precise fallback and reconfiguration behavior, and clearer release wording. Environment: Datadog workspace
FFE reviewer selectionReviewers: @vjfridge, @sameerank Why: Agentless and serverless delivery — The PR adds a shared agentless event transport. Reviewers come from the matched pod. 🤖 Automated selection. Selection detailsInitiative: project / deployment-modes Why this match: The PR adds a shared agentless event transport. It discovers a local EVP endpoint and falls back to direct HTTPS intake, so exposure and flag-evaluation events reach Datadog without a persistent Agent. This is the evaluation/exposure event egress that deployment-modes covers. The component wires this transport into both writers when the configuration source is agentless. The shutdown changes bound the agentless delivery deadlines and drain the writers. They are part of that delivery path and do not change OpenFeature provider lifecycle or evaluation metadata contracts, so the openfeature-architecture area is not added.
The PR author was excluded. Existing reviewers and teams were preserved. Debug or fix a problemWorkflow run · Bits Code session
Evidence and run details✅ Complete — reviewer coverage verified. The workflow checked pending requests or submitted reviews on the evaluated head. Generated asynchronously by the FFE reviewer-routing workflow. Changed paths: Evaluated head: Registry revision: Pinned skill source: Instructions: workflow-injected snapshot (no plugin loaded) Instruction snapshot SHA-256: |
Preserve older-Agent delivery without direct credentials, decode proxy and configuration URL credentials across supported URI versions, and warn when no event route is available. Start evaluation shutdown before waiting for exposures and use five-second discovery and delivery budgets. Add deterministic regressions and clarify Agent and proxy requirements. Environment: Datadog workspace
There was a problem hiding this comment.
More details
Agentless Feature Flags share local EVP discovery and sticky HTTPS fallback for both event writers, with bounded shutdown; Remote Configuration remains Agent-only. The empty-proxy delivery bug is fixed, and no review findings remain open; this follow-up did not execute tests or validate production intake.
🤖 Bits Code Review · Commit a3cc55b
| protected | ||
|
|
||
| def after_fork | ||
| self.buffer = Buffer.new(@buffer_limit) |
There was a problem hiding this comment.
🤖 Comment from Codex working with @sameerank:
[P2] Keep teardown terminal across this fork reset
graceful_shutdown closes the buffer, but it does not set enabled = false until the blocking stop returns. If the first enqueue in a child races with teardown in that child, start if forked? can reach this after_fork, replace the closed buffer with an open one, and start another worker. A deterministic fork/thread regression returned true from that enqueue, sent one exposure after shutdown had returned, and left the replacement worker running.
Please record a terminal stop-requested state before closing or waiting, re-check it around the fork restart, and keep any replacement child buffer closed when teardown has begun. If restart creates a thread during the race, stop it after leaving the async lifecycle lock.
Executed validation
The baseline regression failed with 1,491 examples and one failure. A candidate fix with the lifecycle checks above, an ordinary post-fork positive control, and the separate first-delivery regression passed both OpenFeature dependency appraisals: 2,984 aggregate examples and zero failures.
| def enqueue(event) | ||
| return false unless enabled? | ||
|
|
||
| start if forked? |
There was a problem hiding this comment.
🤖 Comment from Codex working with @sameerank:
[P2] Wake the restarted poller after the first child enqueue
This starts the restarted poller before the first child event is pushed. The poller can observe the new buffer while it is empty and enter its 30-second interval wait; the later buffer.push(event) does not signal that wait. A deterministic barrier around this ordering left the child event undelivered after 200 ms, and the existing shutdown path can hide the delay by waking the poller.
Please remember whether this enqueue performed the fork restart and, after its push succeeds, signal that restarted poller. Limiting the signal to this first post-fork path preserves ordinary batching behavior.
Executed validation
The baseline regression failed with 1,492 examples and one timeout. The candidate wakeup, together with the shutdown-race fix and a normal post-fork positive control, passed both OpenFeature dependency appraisals: 2,984 aggregate examples and zero failures.
|
|
||
| Feature Flags respects `DD_TRACE_DEBUG` and outputs debugging diagnostics when it is enabled. | ||
|
|
||
| #### Event delivery with agentless configuration |
There was a problem hiding this comment.
Not a blocker or anything - but is it maybe time to extract FFE documentation into a separate .md file?
| end | ||
|
|
||
| def work_pending? | ||
| !buffer.empty? |
Why
Ruby applications using agentless Feature Flags configuration still depend on a local Agent to deliver exposures and flag evaluations. These signals need to reach Datadog when that receiver is unavailable.
What
Both writers share local EVP discovery and sticky HTTPS intake fallback, while Remote Configuration retains its existing transport. Current batches replay only after 404/405 or proven pre-transmission failures; ambiguous failures switch future batches, while 403/429/5xx retain local delivery.
Risk
Merge after required CI passes; revert before release to restore Agent-only delivery. API keys stay off local requests; exposure shutdown waits six seconds for agentless delivery, or the flush interval plus five seconds for Remote Configuration.
Details
Delivery and shutdown decisions
Discovery prefers an Agent or relay that forwards EVP origin metadata, then authenticated direct intake. Without direct credentials, an older Agent's advertised EVP endpoint remains usable. Direct intake refuses redirects.
Discovery and requests each allow five seconds, clipped to the remaining agentless shutdown deadline. This is not a five-second bound on the entire component shutdown. The component signals the flag-evaluation writer before waiting for exposures. Forced termination can add one second after the exposure wait. Shutdown rejects late events, including after fork.
The configured Agent URL path prefix remains supported for local discovery and event delivery when its endpoint matches the resolved Agent settings. Traces and Remote Configuration retain their existing fixed paths.
Cross-SDK references
Related delivery work: Java #12844 and #12978, and .NET #9351. Ruby shares one selector so both writers reuse discovery and fallback decisions.
Test coverage and local validation
Regression tests cover rejected-response routing, pre-transmission classification, shutdown after fork, and socket closure during stalled TLS without garbage collection. OpenFeature suites pass on Ruby 3.4 and 4.0 with latest/minimum dependencies: 1493/1489 examples per Ruby, zero failures. Full Steep and changed-file RuboCop pass.
Validation
DataDog/dd-trace-rb@b8c93df58c3eb7945dd536b60cac71741deeacddDataDog/system-tests@3948230151ab3881e8f7b79c6e3d51cbebf1f118DataDog/dd-trace-rb@b8c93df58c3eb7945dd536b60cac71741deeacddDataDog/system-tests@454958979d69b523f4042837dcec762c0683ea24