Skip to content

Connect the dd-openfeature SDK to the agent - #12844

Draft
PerfectSlayer wants to merge 3 commits into
bbujon/ffe-sdk-providerfrom
bbujon/ffe-agent-connector
Draft

PerfectSlayer wants to merge 3 commits into
bbujon/ffe-sdk-providerfrom
bbujon/ffe-agent-connector

Conversation

@PerfectSlayer

@PerfectSlayer PerfectSlayer commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

What Does This Do

Ships the standalone dd-openfeature SDK in place of the agent-coupled provider:

  • New dd-openfeature-connector instrumentation: detects the SDK and plugs the agent backend in through the bootstrap FeatureFlaggingGateway (Remote Configuration documents, event platform proxy, telemetry health metrics, span enrichment).
  • Agent backend (feature-flagging-lib) now forwards raw configuration documents and event payloads (FeatureFlagsBackend, EventProxy).
  • Removes feature-flagging-api and the agent-side agentless configuration/event code now owned by the SDK, plus their config keys. Removes the feature-flagging-config module, its keys moving to dd-trace-api.
  • Publishes :dd-openfeature as com.datadoghq:dd-openfeature; keeps datadog.trace.api.openfeature.Provider as a deprecated alias.
  • System tests build the matching dd-openfeature jar.

Motivation

The SDK must not share dd-trace-java internals, and SDK (customer build time) and agent (SSI runtime) versions must be able to differ (APMLP-1512). See dd-openfeature/README.md.

Additional Notes

Most of the diff (~17k lines) deletes agent-side code and tests that now live in the dd-openfeature SDK (#12840–#12843). Review closely the new connector instrumentation, FeatureFlaggingGateway, FeatureFlagsBackend, EventProxy, RemoteConfigServiceImpl and FeatureFlaggingSystem; the rest is mechanical or deletions.

New files
File Notes
dd-openfeature-connector/build.gradle New instrumentation module; helpers in a java11 source set compiled against :dd-openfeature (compileOnly). TODO: add a muzzle directive once the SDK is published
DDOpenFeatureInstrumentation InstrumenterModule("openfeature") for the FEATURE_FLAGS target system, instruments Connectors.detect()
DetectConnectorAdvice Exit advice replacing the detected connector with JavaAgentConnector.connect(fallback)
JavaAgentConnector SDK Connector backed by FeatureFlaggingGateway.backend(), falls back to the SDK default without backend
AgentConfigurationSource, AgentEventProxy, AgentHealthMetrics, AgentSpanEnricher Thin adapters from the SDK connector SPI to the gateway Backend. AgentEventProxy throws EventProxyUnavailableException on definitive rejection so the SDK switches to direct intake
DDOpenFeatureInstrumentationTest, …DisabledForkedTest Connector detection, fallback, delegation of each SPI; no instrumentation when Feature Flags is disabled
ConfigurationResolutionParityTest Agent InstrumenterConfig and SDK Settings must resolve enablement and source identically
lib FeatureFlagsBackend Agent FeatureFlaggingGateway.Backend: settings from Config (agent defaults for API key, site, env, service, version; others from configProvider()), lazy RemoteConfigServiceImpl, event proxy delegation, health metrics through CoreMetricCollector, span enrichment through SpanEnrichmentWriter. start() registers RC early only for the remote_config source
lib EventProxy One lazy agent EVP proxy client per route; NEVER_RETRY when the SDK can fall back to direct intake. ConnectException / 403 / 404 / 405 mean unavailable, other IOExceptions are rethrown
lib FeatureFlagsBackendTest, EventProxyTest Unit tests of the above
dd-openfeature/README.md User documentation and contributor design notes
datadog/trace/api/openfeature/Provider + ProviderTest @Deprecated alias of com.datadog.openfeature.Provider (and Options) for source compatibility
Significant changes
File Changes
bootstrap FeatureFlaggingGateway Static listener hub replaced by a single registered Backend with JDK-only types: setting, isRemoteConfigAvailable, subscribeRemoteConfig(Consumer<byte[]>), isEventProxyAvailable, postEvent(route, json), count, enrichSerialId, enrichRuntimeDefault. Config / activation / exposure / span enrichment listeners, cached configuration, flag evaluation writer and enqueue toggle removed
lib RemoteConfigServiceImpl No UFC parsing anymore: forwards raw FFE_FLAGS documents (null on removal) to subscribers, replays the current one to late subscribers. Idempotent start() / close()
lib SpanEnrichmentWriter No longer a gateway listener; exposes serialId(...) / runtimeDefault(...) called by FeatureFlagsBackend
agent FeatureFlaggingSystem ~200 → ~60 lines: builds, starts (rolls back on failure) and registers FeatureFlagsBackend. Agentless activation, writers, kill switch and source factory moved to the SDK
lib FeatureFlagEventType logName removed
Config, ConfigDefaults, ConfigTest Configuration source returned as the FeatureFlaggingSource enum. Agentless base URL, poll interval and request timeout removed; the SDK Settings reads and validates them, still resolvable from agent config through Backend.setting()
FeatureFlaggingConfig Moved from feature-flagging-config to dd-trace-api; span enrichment, evaluation counts and agentless keys removed (owned by the SDK)
dd-openfeature/build.gradle.kts Publishing enabled (com.datadoghq:dd-openfeature), Automatic-Module-Name, Java 11 javadoc, compareToReferenceJar disabled
Tests: RemoteConfigServiceImplTest, SpanEnrichmentWriterTest, FeatureFlaggingSystemTest, FeatureFlaggingGatewayTest Rewritten for raw document forwarding, new enrichment entry points, backend registration / rollback
Mechanical changes
  • run-system-tests.yaml, .gitlab-ci.yml: build :dd-openfeature:jar so system tests use the matching SDK
  • settings.gradle.kts: drops feature-flagging-api, includes dd-openfeature-connector
  • .github/CODEOWNERS: adds /dd-java-agent/instrumentation/datadog/openfeature/
  • metadata/agent-jar-checks.properties: adds the openfeature integration
  • metadata/supported-configurations.json: adds DD_TRACE_OPENFEATURE_ENABLED and aliases
  • feature-flagging-{lib,bootstrap,agent} builds: drop unused dependencies (Moshi, JCTools, dd-trace-core, JMH…) and coverage exclusions
  • Smoke tests build / app: use the :dd-openfeature jar and com.datadog.openfeature.Provider
  • Lockfiles
Deleted files (81 files, moved to the SDK)
Deleted Now in
feature-flagging-api module (Provider, DDEvaluator, hooks, metrics, benchmark, tests, README, build) com.datadog.openfeature.* (#12843)
feature-flagging-config module Keys in dd-trace-api FeatureFlaggingConfig, resolution in InstrumenterConfig (#12845)
api SpanEnrichmentGate SDK Settings (#12841)
bootstrap ufc/v1/* + ParsedSemverTest SDK internal/ufc (#12840)
bootstrap exposure/*, flagevaluation/* SDK internal/exposure, internal/flagevaluation (#12842)
bootstrap SpanEnrichmentEvent + test Backend.enrichSerialId / enrichRuntimeDefault and the SDK SpanEnricher SPI
lib UniversalFlagConfigParser, JsonApiUfcResponseParser + tests SDK internal/ufc/UniversalFlagConfigParser (#12840)
lib AgentlessConfigurationSource, AgentlessFeatureFlagBackendApi, ConfigurationSourceService + tests SDK internal/delivery (#12841)
lib FeatureFlagEvpPublisher, FeatureFlagBackendApiFactory, FeatureFlagEvpContext + tests SDK FallbackTransport, DirectIntakeTransport (#12841); agent proxy part is now EventProxy
lib exposure writer / caches, flag evaluation writer / aggregator / payloads + tests SDK pipelines (#12842)
lib JMH benchmarks, remote-config/*.json fixtures dd-openfeature (#12842, #12840)

Stack

The full change is in #12709. It was split into this stack to ease the review.

  1. Resolve Feature Flags enablement from instrumenter config #12845
  2. Add dd-openfeature SDK flag configuration and evaluation core #12840
  3. Add dd-openfeature SDK settings and configuration delivery #12841
  4. Add dd-openfeature SDK exposure and flag evaluation pipelines #12842
  5. Add dd-openfeature SDK OpenFeature provider #12843
  6. Connect the dd-openfeature SDK to the agent #12844 👈 this PR
  7. Add agentless and standalone OpenFeature smoke tests #12846

Jira ticket: APMLP-1512

🤖 Generated with Claude Code

@datadog-official

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Oct 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 13.94 s 14.02 s [-1.3%; +0.3%] (no difference)
startup:insecure-bank:tracing:Agent 12.89 s 12.97 s [-1.4%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 17.08 s 17.05 s [-0.9%; +1.2%] (no difference)
startup:petclinic:iast:Agent 16.18 s 16.94 s [-8.7%; -0.3%] (maybe better)
startup:petclinic:profiling:Agent 16.58 s 16.74 s [-2.0%; +0.1%] (no difference)
startup:petclinic:sca:Agent 16.95 s 16.97 s [-1.2%; +0.9%] (no difference)
startup:petclinic:tracing:Agent 16.16 s 16.03 s [-0.3%; +1.9%] (no difference)

Commit: bfba4592 · 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.

@PerfectSlayer
PerfectSlayer force-pushed the bbujon/ffe-agent-connector branch from cdbf2c1 to 95be4d3 Compare October 13, 2026 09:03
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/ffe-agent-connector branch from 95be4d3 to 128b8ba Compare October 13, 2026 09:28
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/ffe-agent-connector branch from 128b8ba to 9027902 Compare October 13, 2026 10:07
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/ffe-agent-connector branch from 9027902 to a6f0035 Compare October 13, 2026 10:28
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/ffe-agent-connector branch from a6f0035 to 7db60be Compare October 13, 2026 10:59
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/ffe-agent-connector branch from 7db60be to e00532b Compare October 13, 2026 13:50
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/ffe-agent-connector branch from e00532b to e4e4a30 Compare October 14, 2026 05:34
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/ffe-agent-connector branch from e4e4a30 to d4e4bbf Compare October 14, 2026 06:03
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/ffe-agent-connector branch from d4e4bbf to fd5f72b Compare October 14, 2026 06:16
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/ffe-agent-connector branch from fd5f72b to ded4413 Compare October 14, 2026 07:11
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/ffe-agent-connector branch from ded4413 to 50e4ae5 Compare October 14, 2026 08:07
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/ffe-agent-connector branch from 50e4ae5 to fdd1b89 Compare October 14, 2026 08:38
PerfectSlayer and others added 3 commits October 14, 2026 10:40
Ship the standalone dd-openfeature SDK in place of the agent-coupled
provider. The new dd-openfeature-connector instrumentation detects the
SDK and plugs the agent backend in through the FeatureFlaggingGateway:
Remote Configuration documents, the event platform proxy, telemetry
health metrics and span enrichment. The agent now forwards raw
configuration documents and event payloads, UFC parsing, evaluation and
event batching stay in the SDK.

Remove the feature-flagging-api module and the agent-side agentless
configuration and event code the SDK now owns. Keep
datadog.trace.api.openfeature.Provider as a deprecated alias.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the Feature Flags configuration keys to dd-trace-api next to the
other products. The module has no remaining use since the configuration
resolution moved to InstrumenterConfig.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Return the configuration source enum from Config now that the previous
feature flagging code is gone, and drop the source value constants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/ffe-agent-connector branch from fdd1b89 to bfba459 Compare October 14, 2026 08:43

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

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.

1 participant