Skip to content

feat(openfeature): add direct flagevaluation fallback - #12204

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 21 commits into
masterfrom
agent/java-direct-flagevaluation-egress
Aug 18, 2026
Merged

feat(openfeature): add direct flagevaluation fallback#12204
gh-worker-dd-mergequeue-cf854d[bot] merged 21 commits into
masterfrom
agent/java-direct-flagevaluation-egress

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Motivation

The base PR gives exposure events direct EVP capability. Agentless Feature Flags also need direct EVP capability for aggregate flagevaluation events when no compatible local receiver exists.

flowchart TD
    A[Agentless Feature Flags] --> E[Exposure writer from PR 12195]
    A --> F[Flagevaluation writer in this PR]
    E --> ER{Compatible local EVP route?}
    F --> FR{Compatible local EVP route?}
    ER -->|Yes| L[Local EVP proxy]
    FR -->|Yes| L
    ER -->|No, API key available| DE[Direct EVP<br/>/api/v2/exposures]
    FR -->|No, API key available| DF[Direct EVP<br/>/api/v2/flagevaluation]
    L --> P[Event Platform]
    DE --> P
    DF --> P
Loading

Changes and Decisions

This stacked PR retains direct EVP exposure delivery from PR #12195 and adds direct EVP flagevaluation delivery.

  • Use one Feature Flag transport selector for both exposures and flagevaluations.
  • Preserve exposure response compression and disable response compression for flagevaluations.
  • Prefer a compatible local EVP proxy for both event types.
  • Use authenticated direct EVP intake when no compatible local route exists.
  • Switch from local to direct intake only after connection refusal or HTTP 403, 404, or 405.
  • Do not replay after timeouts, resets, rate limits, or server errors. This prevents possible duplicate events.
  • Keep /api/v2/exposures and /api/v2/flagevaluation as separate direct routes.
  • Cover the shared fallback behavior for both event routes.

leoromanovsky and others added 6 commits August 11, 2026 20:05
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…xposure-egress

# Conflicts:
#	communication/src/main/java/datadog/communication/BackendApiFactory.java
#	products/feature-flagging/feature-flagging-agent/src/main/java/com/datadog/featureflag/FeatureFlaggingSystem.java
#	products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/ExposureWriterImpl.java
@datadog-official

datadog-official Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 92.75%
Overall Coverage: 60.42% (+2.01%)

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

@leoromanovsky
leoromanovsky marked this pull request as ready for review August 13, 2026 15:28
@leoromanovsky
leoromanovsky requested a review from a team as a code owner August 13, 2026 15:28
@dd-octo-sts

dd-octo-sts Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.87 s 14.69 s [+0.2%; +2.3%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.71 s 13.66 s [-0.4%; +1.2%] (no difference)
startup:petclinic:appsec:Agent 17.42 s 17.38 s [-0.5%; +0.9%] (no difference)
startup:petclinic:iast:Agent 17.37 s 17.52 s [-1.6%; -0.0%] (maybe better)
startup:petclinic:profiling:Agent 17.41 s 16.53 s [+0.9%; +9.7%] (maybe worse)
startup:petclinic:sca:Agent 17.42 s 17.16 s [+0.3%; +2.7%] (maybe worse)
startup:petclinic:tracing:Agent 16.52 s 16.73 s [-2.1%; -0.4%] (maybe better)

Commit: 9b8d7589 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@datadog-official datadog-official Bot 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.

Datadog Autotest: FAIL

Direct flag-evaluation delivery still negotiates gzip because IntakeApi leaves Accept-Encoding unset when compression is disabled, allowing OkHttp to add gzip automatically. This defeats the explicit no-compression contract on every new direct or fallback route, although the local EVP path correctly sends identity.

Open Bits AI session

🤖 Datadog Autotest · Commit 5916539 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

…ct-flagevaluation-egress

# Conflicts:
#	products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/AgentlessFeatureFlagBackendApi.java
#	products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/ExposureBackendApiFactory.java
#	products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/AgentlessFeatureFlagBackendApiTest.java
#	products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/FeatureFlagBackendApiFactoryTest.java
@dd-octo-sts

dd-octo-sts Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

…ct-flagevaluation-egress

# Conflicts:
#	products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/AgentlessFeatureFlagBackendApiTest.java
#	products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/FeatureFlagBackendApiFactoryTest.java
@leoromanovsky leoromanovsky added the comp: openfeature OpenFeature label Aug 14, 2026
@leoromanovsky leoromanovsky added the type: feature Enhancements and improvements label Aug 14, 2026

@sarahchen6 sarahchen6 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.

A few small clean-up comments, but otherwise looks good!

Base automatically changed from agent/java-direct-exposure-egress to master August 18, 2026 19:02

@datadog-official datadog-official Bot 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.

Datadog Autotest: FAIL

Ambiguously accepted batches can still be replayed directly through internal HTTP retries or exposure-buffer reuse. Agentless activation can also retain an exposure worker that exits immediately afterward, disabling delivery.

Open Bits AI session

🤖 Datadog Autotest · Commit 6616b0c · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

…lagevaluation-egress

# Conflicts:
#	products/feature-flagging/feature-flagging-agent/src/main/java/com/datadog/featureflag/FeatureFlaggingSystem.java
#	products/feature-flagging/feature-flagging-agent/src/test/java/com/datadog/featureflag/FeatureFlaggingSystemTest.java
#	products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/ExposureWriterImpl.java
#	products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/ExposureWriterTests.java
@dd-octo-sts dd-octo-sts Bot added the tag: ai generated Largely based on code generated by an AI or LLM label Aug 18, 2026
@leoromanovsky
leoromanovsky added this pull request to the merge queue Aug 18, 2026
@dd-octo-sts

dd-octo-sts Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Aug 18, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-18 21:51:46 UTC ℹ️ Start processing command /merge


2026-08-18 21:51:51 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 2h (p90).


2026-08-18 22:48:35 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 18, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 315dd06 into master Aug 18, 2026
603 of 604 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the agent/java-direct-flagevaluation-egress branch August 18, 2026 22:48
@github-actions github-actions Bot added this to the 1.66.0 milestone Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: openfeature OpenFeature tag: ai generated Largely based on code generated by an AI or LLM type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants