Skip to content

Add agentless Feature Flagging configuration source#11892

Draft
leoromanovsky wants to merge 6 commits into
masterfrom
leo.romanovsky/ffl-2693-java-agentless-configuration-source
Draft

Add agentless Feature Flagging configuration source#11892
leoromanovsky wants to merge 6 commits into
masterfrom
leo.romanovsky/ffl-2693-java-agentless-configuration-source

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Motivation

Java Feature Flagging needs a tracer-side configuration-source split so SDKs can fetch UFC from an agentless Datadog backend while preserving the existing Agent Remote Configuration path.

Changes

  • Adds DD_FEATURE_FLAGS_CONFIGURATION_SOURCE with agentless, remote_config, and reserved offline; default is agentless.
  • Adds agentless polling controls: DD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_POLL_INTERVAL_SECONDS and DD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_REQUEST_TIMEOUT_SECONDS.
  • Adds AgentlessConfigurationSource, an HTTP UFC poller for the Datadog server-distribution endpoint.
  • Keeps remote_config on the existing RemoteConfigServiceImpl / Agent RC path.
  • Handles DD-API-KEY, ETag/304, timeout/429/5xx retry, malformed UFC rejection, last-known-good preservation, and no overlapping polls.
  • Removes the proposed DD_FEATURE_FLAGS_ENABLED, agentless base URL env, and extra-header env from this PR.

Decisions

No new provider kill switch. This keeps the existing provider bootstrap behavior through DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED; changing enablement is out of scope for this PR.

No public agentless base URL/header envs. The default agentless endpoint is derived from Datadog site/env as https://api.<site>/api/v2/feature-flagging/config/server-distribution?dd_env=<env>. Custom customer endpoints, dogfood proxies, and system-test proxies should be wired through an explicit custom source/client API, not process-wide env vars.

No offline factory yet. offline remains a reserved configuration-source value. This PR does not expose a startup-bytes API or offline factory because that API still needs design work.

Source selection stays SDK-local. DD_FEATURE_FLAGS_CONFIGURATION_SOURCE decides which local source implementation starts. It is not sent to the backend.

Class Shape

classDiagram
    direction LR
    class FeatureFlaggingSystem {
      +start()
      +stop()
      -createConfigurationSourceService()
    }
    class ConfigurationSourceService {
      <<interface>>
      +init()
      +close()
    }
    class RemoteConfigServiceImpl {
      +init()
      +close()
      +accept()
    }
    class AgentlessConfigurationSource {
      +init()
      +close()
      -pollOnce()
      -fetchAndApply()
    }
    class FeatureFlaggingGateway {
      +dispatch()
    }

    FeatureFlaggingSystem --> ConfigurationSourceService : selects one source
    ConfigurationSourceService <|.. RemoteConfigServiceImpl
    ConfigurationSourceService <|.. AgentlessConfigurationSource
    RemoteConfigServiceImpl --> FeatureFlaggingGateway : Agent RC UFC
    AgentlessConfigurationSource --> FeatureFlaggingGateway : HTTP UFC
Loading

Customer Usage Example

Default Datadog-hosted agentless delivery:

export DD_API_KEY=<datadog-api-key>
export DD_SITE=datadoghq.com
export DD_ENV=prod

# Optional because agentless is the default configuration source.
export DD_FEATURE_FLAGS_CONFIGURATION_SOURCE=agentless
export DD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_POLL_INTERVAL_SECONDS=30
export DD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_REQUEST_TIMEOUT_SECONDS=2

java -javaagent:/path/to/dd-java-agent.jar -jar app.jar

Explicit Agent Remote Configuration delivery still uses the existing Agent path:

export DD_FEATURE_FLAGS_CONFIGURATION_SOURCE=remote_config
export DD_REMOTE_CONFIGURATION_ENABLED=true

java -javaagent:/path/to/dd-java-agent.jar -jar app.jar

Verification

./gradlew :products:feature-flagging:feature-flagging-agent:test :products:feature-flagging:feature-flagging-lib:test --tests com.datadog.featureflag.FeatureFlaggingSystemTest --tests com.datadog.featureflag.AgentlessConfigurationSourceTest
result: BUILD SUCCESSFUL in 7s

./gradlew :products:feature-flagging:feature-flagging-agent:spotlessCheck :products:feature-flagging:feature-flagging-lib:spotlessCheck :dd-trace-api:spotlessCheck :internal-api:spotlessCheck
result: BUILD SUCCESSFUL in 5s

git diff --check
result: clean

rg "AgentlessUfcSource|UfcHttpConfigService|DD_FEATURE_FLAGS_ENABLED|DD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_BASE_URL|DD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_EXTRA_HEADERS|FeatureFlagConfigurationSources\\.offline|offline factory" -S products/feature-flagging dd-trace-api internal-api metadata dd-java-agent
result: no matches

@datadog-datadog-prod-us1-2

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Jul 8, 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.99 s 13.94 s [-0.3%; +1.0%] (no difference)
startup:insecure-bank:tracing:Agent 12.84 s 12.97 s [-1.8%; -0.1%] (maybe better)
startup:petclinic:appsec:Agent 17.06 s 17.35 s [-6.1%; +2.8%] (no difference)
startup:petclinic:iast:Agent 17.37 s 17.51 s [-1.6%; +0.1%] (no difference)
startup:petclinic:profiling:Agent 16.77 s 17.34 s [-7.5%; +0.9%] (no difference)
startup:petclinic:sca:Agent 16.82 s 17.49 s [-7.9%; +0.2%] (no difference)
startup:petclinic:tracing:Agent 16.51 s 16.63 s [-1.9%; +0.4%] (no difference)

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

Comment thread dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java Outdated
Comment thread metadata/supported-configurations.json Outdated
Comment thread internal-api/src/main/java/datadog/trace/api/Config.java Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant