test(ffe): specify exposure and metric semantics#3902
Closed
leoromanovsky wants to merge 1 commit into
Closed
Conversation
|
Benchmarks [ tracer ]Benchmark execution time: 2026-05-21 23:10:03 Comparing candidate commit 24d062a in PR branch Found 1 performance improvements and 4 performance regressions! Performance is the same for 187 metrics, 2 unstable metrics. scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache
scenario:SamplingRuleMatchingBench/benchRegexMatching1
scenario:SamplingRuleMatchingBench/benchRegexMatching3
scenario:SamplingRuleMatchingBench/benchRegexMatching4
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 E in the PHP OpenFeature compatibility stack. PR B adds the PHP 7-safe Datadog feature flag client; this PR specifies the exposure and
feature_flag.evaluationsmetric behavior that the client should drive while native delivery remains gated.The native exposure buffer, EVP/sidecar flush path, and OpenTelemetry-backed metric exporter are intentionally not implemented here. This PR gives reviewers a small, runnable contract for event shape, deduplication, batch flush, and metric gating without forcing PHP 7 users to install PHP 8-only telemetry packages.
Changes
ExposureWriterandMetricsRecordercontracts with no-op defaults.BufferedExposureWriterfor contract tests around exposure event batching, duplicate suppression, changed assignment re-emission, and empty flush behavior.CallableMetricsRecorderfor contract tests aroundfeature_flag.evaluationsattributes andDD_METRICS_OTEL_ENABLEDgating.DDTrace\FeatureFlags\Clientto record one metric per evaluation and write exposure events only for successful evaluations with exposure data anddoLog != false.doLog=false, provider-not-ready/error skip behavior, duplicate suppression, changed variant/allocation re-emission, batch cap flush, metric success/error/provider-not-ready paths, and root Composer dependency guardrails.Decisions
composer.jsonstill does not requireopen-telemetry/sdk.Reference
Verification
find src/api/FeatureFlags tests/api/Unit/FeatureFlags -name '*.php' -print0 | xargs -0 -n1 php -n -lphp -n vendor/bin/phpunit --config=phpunit.xml tests/api/Unit/FeatureFlagsvendor/bin/phpunit --config=phpunit.xml tests/api/Unit/FeatureFlagsvendor/bin/phpcs -s src/api/FeatureFlags tests/api/Unit/FeatureFlags