Ship dd-openfeature as a standalone SDK extended by the Java agent (AI prototype) - #12709
Draft
PerfectSlayer wants to merge 6 commits into
Draft
PerfectSlayer wants to merge 6 commits into
PerfectSlayer wants to merge 6 commits into
Conversation
Contributor
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
This branch has not been deployed
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.
Warning
AI-generated prototype, not human reviewed.
Claude Code generated all the code, tests and docs in this PR from a design brief. No human has reviewed any of it yet. It is a draft to discuss the design proposal, not a merge candidate. Review it as a design sketch and expect rough edges.
What Does This Do
This prototypes a different architecture for running Datadog Feature Flags without
dd-java-agent. It covers the same need as #12576, but under different constraints.dd-openfeatureis a standalone SDK in a new root module,:dd-openfeature(JDK 11+), published ascom.datadoghq:dd-openfeature.jackson-core, all as plain POM dependencies.java.net.http.HttpClient.dd-java-agentis optional. When attached, it connects to the SDK through library instrumentation. The SDK then uses the agent's Remote Configuration, its Datadog Agent event proxy, agent telemetry and APM span enrichment.Motivation
The design brief ("[DRAFT] FFE Design Doc", following the product brief Java Feature Flags: organize as standalone and SSI) rejects the shape of #12576 for two reasons:
The brief also notes the following:
So the install path follows OpenFeature practice: always add the SDK, and optionally attach the agent.
Design differences with #12576
internal-api,communication,config-utils, OkHttp, Moshi, JCTools…, relocated and shrunk withminimize()(~1.84 MB)dev.openfeature:sdk,io.opentelemetry:opentelemetry-apiandjackson-core. No shading, nominimize()java.net.http.HttpClientandjackson-corestreaming (no old HTTP client for security scanners to flag)ExposureEvent,FlagEvalEvent) onFeatureFlaggingGateway, plus anAGENT/STANDALONEruntime ownership claimcom.datadog.openfeature.internal.connector). Instrumentation exit advice onConnectors.detect()fills it in. The bootstrap gateway is internal to the agent, uses JDK types only and can change freelyLinkageErrorcatchesOpenFeatureAPI.getInstance()is called (openfeature-1.20instrumentation)new Provider()corepackage; the agent parses with Moshi; the evaluator is injected as helpersdd-openfeature-remote-configartifact (~4.17 MB, bundlesremote-config-core)// TODO).remote_configrequires the agentdatadog.trace.api.openfeature.Providercom.datadog.openfeature.Provider. The old class name stays as a deprecated subclass. The SDK can't sit underdatadog.trace.*, which the agent never instruments and loads bootstrap-firstChanges
:dd-openfeature(new root module), ported fromfeature-flagging-api/-liband Prototype standalone and injected Java Feature Flags together #12576:Provider;Settings, which reads the agent configuration first, thendd.*system properties, thenDD_*environment variables, with the same keys and rules as before.jackson-core) and theFlagEvaluatorfrom Prototype standalone and injected Java Feature Flags together #12576.dd-openfeature-connectorinstrumentation (dd-java-agent/instrumentation/datadog/openfeature/):Connectors.detect().TargetSystem.FEATURE_FLAGS, which follows the resolvedDD_FEATURE_FLAGS_*settings.java11source set.products/feature-flagging):FeatureFlaggingGateway.Backendregistry.FeatureFlagsBackendprovides:FFE_FLAGSdocuments. The product is registered at agent startup inremote_configmode, so the first poll asks for it.feature-flagging-apimodule, and the agent-side CDN poller, parsers, event writers and bootstrap POJOs.Configgetters, which the SDK now owns.:dd-openfeature.dd-smoke-tests/openfeature) now cover three setups:dd-openfeature/README.md.Features by setup
dd-java-agentagentless, the default)remote_config)DD_API_KEY)agentlessmodefeature_flag.evaluationsOTel metricBreaking change
dd-openfeature1.66.0 and earlier link against bootstrap types this PR removes, so they no longer work with this agent.dd-openfeatureanddd-java-agentmust be upgraded together. This was a deliberate choice to avoid keeping the legacy bridge.Testing
All suites below were run locally on this branch's head commit:
:dd-openfeature:test+forkedTestfeature-flagging-lib/-agent/-bootstrapdd-openfeature-connectorinstrumentation (test+forkedTest):dd-smoke-tests:openfeature(3 setups)internal-apiConfigTestNot covered:
passdirective can't exist until the SDK is published (// TODO).// TODO)./techdebtand/perf-reviewhave not been run.Open questions
dd-openfeatureversions on a new agent acceptable, or do we need a deprecation window?jackson-coreas a plain dependency: what minimum version do we support against customer BOMs?Additional Notes
CODEOWNERSis not updated yet for/dd-openfeature/and/dd-java-agent/instrumentation/datadog/openfeature/.Jira ticket: APMLP-1512
🤖 Generated with Claude Code