Repository navigation
Enable PHP feature flag configuration from the CDN - #4312
leoromanovsky wants to merge 11 commits into
Conversation
Integrate the settings and polling prerequisites, preserve Remote Configuration thread isolation, and add bounded initialization, recovery, fork and shutdown coverage.
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 33 Pipeline jobs failed
|
| Test | New execution time | Base Execution time | Increase | DataDog link |
|---|---|---|---|---|
tmp/build_extension/tests/ext/pcntl/pcntl_fork_thread_mode_orphan_telemetry.phpt (Thread mode: a fork child orphaned by its parent's exit replays its application on the connection to its own new listener)from php.tmp.build_extension.tests.ext.pcntl |
10.41s | 661.267577ms | +9.75s (+1475%) | View in Datadog |
tmp/build_extension/tests/ext/pcntl/pcntl_fork_thread_mode_orphan_telemetry.phpt (Thread mode: a fork child orphaned by its parent's exit replays its application on the connection to its own new listener)from PHP.tmp.build_extension.tests.ext.pcntl |
10.39s | 672.862766ms | +9.71s (+1444%) | View in Datadog |
ℹ️ Info
No other issues found (see more)
🧪 All tests passed
❄️ No new flaky tests detected
🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 68.39% (-0.01%)
Useful? React with 👍 / 👎
This comment will be updated automatically if new data arrives.🔗 Commit SHA: 3c45358 | Docs | View more details | Give us feedback!
Benchmarks [ tracer ]Benchmark execution time: 2026-10-22 17:40:05 Comparing candidate commit 3c45358 in PR branch Found 2 performance improvements and 0 performance regressions! Performance is the same for 191 metrics, 1 unstable metrics.
|
|
Please don't introduce external I/O in the PHP processes. That's the sidecars task. |
Read shared-memory snapshots in PHP and resubscribe after sidecar restart. Preserve bounded initialization, last-good state and fork lifecycle. Environment: Datadog workspace
Environment: Datadog workspace
Consume CDN publications through RemoteConfigManager and stage FFE changes until each update batch is drained. Keep accepted flags available during replacements and preserve genuine removals. Pin the sidecar fix that keeps local publications independent of agent directory restarts; cover concurrent evaluation and the native CDN lifecycle. Environment: Datadog workspace
Motivation
PHP applications need to fetch feature flag configuration from the CDN and evaluate flags without running a Datadog Agent.
flowchart LR CDN[Flag configuration CDN] -. missing activation .-> PHP[PHP feature flag provider] Agent[Datadog Agent] --> RC[Remote Configuration] --> PHPChanges and Decisions
Fetch managed or custom CDN configuration in the libdatadog sidecar subprocess and deliver snapshots to PHP through shared memory. The first native or OpenFeature evaluation starts a subscription with a bounded initialization wait. Evaluations retain the last valid configuration across HTTP failures and sidecar restarts. Custom endpoints never receive the Datadog API key. Invalid settings produce redacted warnings on first use; evaluation details distinguish permanent setup failures from configuration still loading.
PHP reconnects and resubscribes after a sidecar restart, and resumes its readers after fork. CDN configuration is shared across PHP threads; Remote Configuration retains its existing thread isolation. Explicit sidecar thread mode leaves the CDN provider unavailable because configuration HTTP requires a subprocess.
Depends on libdatadog #2675 and #2676.
Caller usage
With the candidate extension installed, set these before starting PHP:
Native PHP:
OpenFeature (PHP 8, with
open-feature/sdkinstalled):flowchart LR CDN[Managed or custom CDN] -->|HTTPS and ETag| Fetcher[libdatadog sidecar fetcher] Fetcher --> SHM[Shared memory] SHM --> Reader[PHP configuration reader] Reader --> Evaluate[Native and OpenFeature evaluation] Agent[Datadog Agent] --> RC[Per-thread Remote Configuration] --> Evaluate