feat(ffe): add native evaluation bridge#3903
Closed
leoromanovsky wants to merge 1 commit into
Closed
Conversation
|
Benchmarks [ tracer ]Benchmark execution time: 2026-05-22 00:19:11 Comparing candidate commit d712d6b in PR branch Found 0 performance improvements and 4 performance regressions! Performance is the same for 190 metrics, 0 unstable metrics. scenario:SamplingRuleMatchingBench/benchRegexMatching1
scenario:SamplingRuleMatchingBench/benchRegexMatching2
scenario:SamplingRuleMatchingBench/benchRegexMatching3
scenario:TraceAnnotationsBench/benchTraceAnnotationOverhead-opcache
|
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.
Motivation
This is PR H in the PHP OpenFeature compatibility stack. It starts the tracer native runtime path by importing
libdatadog/datadog-ffeintodd-trace-phpand exposing a small bridge for the PHP feature flag client.Shared planning/reference doc: https://docs.google.com/document/d/1NvMfTpZWLBlFmEFNjdnlMyeVpy5l7KD8qujGFco6w2w/edit?tab=t.0
Stack context: this PR is stacked on #3902. The native bridge shape follows the
DDTrace\ffe_*approach from #3630 while keeping Remote Config lifecycle and exposure delivery in later stack slices.Changes
datadog-ffeas a directcomponents-rsdependency and registerscomponents-rs/ffe.rs.datadog_ffe::rules_based, and maps value/reason/error fields into a C/PHP result object.DDTrace\ffe_evaluate,DDTrace\ffe_has_config,DDTrace\ffe_config_version, andDDTrace\ffe_load_configfunctions.DDTrace\FeatureFlags\NativeEvaluatorand makesClient::create()prefer it when the extension bridge is available.Decisions
libdatadog/datadog-ffe; do not reimplement the evaluator locally in PHP or C.Verification
php -n -l src/api/FeatureFlags/NativeEvaluator.phpphp -n -l src/api/FeatureFlags/Client.phpphp -n -l tests/ext/ffe/native_bridge_evaluate.phptgit diff --checkRUSTC_BOOTSTRAP=1 cargo check -p ddtrace-phpEXTRA_CFLAGS="-I$(brew --prefix pcre2)/include" EXTRA_LDFLAGS="-L$(brew --prefix pcre2)/lib" make -j"$(sysctl -n hw.ncpu)"php -n -d extension=tmp/build_extension/modules/ddtrace.so -m | rg -i "^ddtrace$"make test_c TESTS=tests/ext/ffe/native_bridge_evaluate.phptddtrace.soconfirming fallback value,PROVIDER_NOT_READY, native transitional warning, and provider state when no FFE config is loaded.