Skip to content

feat(openfeature): add shared agentless EVP fallback - #6574

Open
leoromanovsky wants to merge 7 commits into
masterfrom
leo.romanovsky/fflsdk-184-ruby-evp
Open

leoromanovsky wants to merge 7 commits into
masterfrom
leo.romanovsky/fflsdk-184-ruby-evp

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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 and 403/429/5xx switch future batches only.

Risk

Reverting before release restores Agent-only delivery and the previous writer lifecycle. Direct intake refuses redirects and keeps API keys direct-only; shutdown changes also affect Remote Configuration, rejecting late evaluations and limiting exposure joins to three seconds, so undelivered events can be dropped.

Details

Delivery and shutdown decisions

Discovery prefers an Agent or relay that forwards EVP origin metadata, then authenticated direct intake. When direct delivery is not configured, the library can still send through an older Agent's advertised EVP endpoint. 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 to flush before waiting for exposure shutdown. Exposure shutdown allows up to one additional second for forced termination. The shared transport deadline applies only to agentless delivery; the writer lifecycle changes also affect Remote Configuration.

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.

flowchart LR
  E[Exposure writer] --> S[Shared selector]
  F[Flag evaluation writer] --> S
  S -->|compatible metadata| A[Local EVP v4 or v2]
  S -->|fallback with credentials| D[HTTPS intake]
  S -->|no direct credentials and advertised EVP| A
Loading
Cross-SDK references

Java's earlier delivery implementation was removed by #12844; the open #12978 restores delivery through the SDK bridge. Merged .NET #9351 applies fallback to flag evaluations as well as exposures, with independent transport instances for each signal. Ruby deliberately shares one component-owned selector so both writers reuse discovery and subsequent fallback decisions.

Validation and limits

Native OpenFeature suites pass on Ruby 3.1 minimum/latest (1082/1082 examples) and Ruby 4.0 minimum/latest (1082/1086 examples), with zero failures. Changed-file RuboCop passes. Full Steep passes.

Nine mutation controls detect restored defects in older-Agent fallback, URI compatibility, warning emission and suppression, shutdown overlap and late events, discovery serialization, untraced headers, and empty proxy hostnames. A synthetic TCP receiver taking 2.25 seconds fails under the previous one-/two-second limits and succeeds under five seconds. An actual URI 0.12.2 probe verifies credential decoding for event proxies and custom configuration URLs.

The earlier system-test receipt targets ff41edc95fd4ea4fa59bd4793a6bfe5c76d923e1; it was not rerun for this update. Native and synthetic checks do not establish production intake or deployment readiness.

@leoromanovsky leoromanovsky added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Oct 27, 2026
@linear-code

linear-code Bot commented Oct 27, 2026

Copy link
Copy Markdown

FFLSDK-184

@dd-octo-sts dd-octo-sts Bot added the openfeature A new component that provider an ability to configure feature flags label Oct 27, 2026
@dd-octo-sts

dd-octo-sts Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Typing analysis

Note: Ignored files are excluded from the next sections.

Untyped methods

This PR introduces 7 partially typed methods. It increases the percentage of typed methods from 73.41% to 73.47% (+0.06%).

Partially typed methods (+7-0) ❌ Introduced:
sig/datadog/open_feature/transport/agentless.rbs:37
└── def send_exposures: (Hash[Symbol, untyped]) -> Response
sig/datadog/open_feature/transport/agentless.rbs:39
└── def send_flag_evaluations: (Hash[String, untyped]) -> Response
sig/datadog/open_feature/transport/agentless.rbs:47
└── def send_batch: (String, Hash[Symbol, untyped] | Hash[String, untyped]) -> Response
sig/datadog/open_feature/transport/agentless.rbs:53
└── def compatible_route: (Hash[String, untyped]?) -> String?
sig/datadog/open_feature/transport/agentless.rbs:55
└── def local_route: (Hash[String, untyped]?) -> String?
sig/datadog/open_feature/transport/http_client.rbs:31
└── def read_info: (Net::HTTPResponse) -> Hash[String, untyped]?
sig/datadog/open_feature/transport/response.rbs:13
└── def initialize: (?code: Integer?, ?info: Hash[String, untyped]?, ?pre_send: bool) -> void

Untyped other declarations

This PR introduces 1 partially typed other declaration. It increases the percentage of typed other declarations from 87.0% to 87.09% (+0.09%).

Partially typed other declarations (+1-0) ❌ Introduced:
sig/datadog/open_feature/transport/response.rbs:9
└── attr_reader info: Hash[String, untyped]?

If you believe a method or an attribute is rightfully untyped or partially typed, you can add # untyped:accept on the line before the definition to remove it from the stats.

@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 2 Pipeline jobs failed

Test for memory leaks | test-memcheck — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

Check Pull Request CI Status | all-jobs-are-green

View more details · View in GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 93.01%
• Overall Coverage: 94.21% (+1.15%)

Useful? React with 👍 / 👎

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

@leoromanovsky
leoromanovsky marked this pull request as ready for review October 27, 2026 03:02
@leoromanovsky
leoromanovsky requested review from a team as code owners October 27, 2026 03:02
@leoromanovsky
leoromanovsky requested review from anmarchenko and removed request for a team October 27, 2026 03:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T03:10:16.277741Z ff41edc Draft marked ready
🔒 Security Review ✅ Completed 2026-10-27T03:07:52.671084Z ff41edc Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-prod-us1-4 datadog-prod-us1-4 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.

Bits Code Review: FAIL

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.

Open Bits AI session

🤖 Bits Code Review · Commit ff41edc

@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: 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".

@greghuels
greghuels removed their request for review October 27, 2026 10:33
@buraizu buraizu self-assigned this Oct 27, 2026
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 buraizu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread docs/GettingStarted.md Resolved
Comment thread docs/GettingStarted.md Resolved
Comment thread unreleased/20261027015119.json Resolved
Comment thread docs/GettingStarted.md Resolved
Address review feedback with user-focused delivery guidance, precise fallback and reconfiguration behavior, and clearer release wording.

Environment: Datadog workspace
@leoromanovsky
leoromanovsky requested a review from buraizu October 27, 2026 23:57
Comment thread lib/datadog/open_feature/component.rb Resolved
Comment thread docs/GettingStarted.md Resolved
@leoromanovsky

leoromanovsky commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

FFE reviewer selection

Reviewers: @vjfridge, @sameerank

Why: Agentless and serverless delivery — The PR adds a shared agentless event transport. Reviewers come from the matched pod.

🤖 Automated selection.

Selection details

Initiative: 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.

  • @vjfridge — primary (agentless-delivery): Matched pod member. Existing review coverage preserved.
  • @sameerank — core (agentless-delivery): Matched pod member. Existing review coverage preserved.

The PR author was excluded. Existing reviewers and teams were preserved.

Debug or fix a problem

Workflow run · Bits Code session

  • Wrong project or pod? Clarify this PR’s purpose, or correct the reviewer registry and publish the change. Sheet edits take effect after publication.
  • Need another reviewer now? Request them in GitHub. This workflow only adds requests and keeps existing reviewers.
  • Stuck beyond five minutes or failed? Inspect the run’s failed step and available Bits session. After fixing the cause, rerun the workflow with this PR URL and dry_run=false. Unchanged completed runs are skipped. If the receipt says needs_reconciliation or a write outcome is uncertain, ask the workflow owner to reconcile GitHub and the receipt before retrying; do not delete the lock blindly.
  • Report a problem: Comment on the reviewer-routing skill PR with this PR URL, the workflow run link, and the expected initiative or reviewer correction.
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: lib/datadog/open_feature/transport/agentless.rb, lib/datadog/open_feature/transport/http_client.rb, lib/datadog/open_feature/transport/response.rb, lib/datadog/open_feature/component.rb, lib/datadog/open_feature/exposures/worker.rb, lib/datadog/open_feature/flag_evaluation/writer.rb, lib/datadog/open_feature/agentless/transport.rb

Evaluated head: 040f61acd2218abb320e2a916f5a21b10a25b686

Registry revision: revision:efde5129-b144-41ab-b630-1adf6ad22901

Pinned skill source: 7e3283c602f6b18a7e3e623eecb52d3a9c091a2e

Instructions: workflow-injected snapshot (no plugin loaded)

Instruction snapshot SHA-256: 52ed8cb68675dde1a47addaefe4a9500891c24014abf7dade6dfe38cf836c1d2

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
@leoromanovsky
leoromanovsky requested a review from aarsilv October 28, 2026 20:35

This branch has not been deployed

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

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos openfeature A new component that provider an ability to configure feature flags

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants