You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changes dependent-flag evaluation to return detached prerequisite evaluation records after the root graph completes. The provider publishes the returned batch synchronously before returning root details, while dependency exposures remain separate and transactional.
The batch retains reached successful and failed prerequisites, deduplicates memoized prerequisites, excludes the root, and remains isolated across parallel root evaluations. Root failures normalize to GENERAL while prerequisite records preserve their specific error. Agentless delivery negotiates through cap_dependent-flags-variant-key=v1, and Remote Config advertises reserved bit 50 through the same evaluator gate.
The in-process fixture runner now executes both the core and shared evaluation-suites/dependent-flags corpus, including evaluation-event and exposure expectations with noUnmatchedEvents.
Motivation
Returned telemetry preserves every reached prerequisite record across graph failures without coupling non-transactional evaluation events to transactional exposure behavior. Shared-corpus execution keeps graph failures, memoization, depth, and exposure rollback conformant across SDKs.
Validation
go test ./openfeature -run 'TestEvaluateFlag_JSONFixtures/Dependent' -count=1 -v — 14/14 dependent cases passed.
go test ./internal/openfeature ./internal/remoteconfig ./openfeature — passed.
go test -race ./openfeature — passed.
Lazy malformed-depth logging regression — passed.
git diff --check — passed.
Reviewer's checklist
Changed code has unit and shared-corpus coverage.
System tests covering this feature have been enabled with a development version tag.
Ordinary-root fast-path benchmark coverage remains in place.
Found 8 performance improvements and 45 performance regressions! Performance is the same for 362 metrics, 1 unstable metrics.
Explanation
This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:
🟩 = significantly better candidate vs. baseline
🟥 = significantly worse candidate vs. baseline
We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.
If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.
Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.
More details about the CI and significant changes
You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.
CIs of the difference of means are often centered around 0%, because often changes are not that big:
---------------------------------(------|---^--------)-------------------------------->
-0.6% 0% 0.3% +1.2%
| | |
lower bound of the CI --' | |
sample mean (center of the CI) -------------' |
upper bound of the CI ----------------------'
As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).
For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:
----------------------------------------|---------|---(---------^---------)---------->
0% 1% 1.3% 2.2% 3.1%
| | | |
significant impact threshold --------------' | | |
lower bound of CI --------------' | |
sample mean (center of the CI) --------------------------' |
upper bound of CI ----------------------------------'
scenario:BenchmarkBooleanEvaluation
🟥 allocated_mem [+112 bytes; +112 bytes] or [+29.787%; +29.787%]
🟥 allocations [+1; +1] or [+20.000%; +20.000%]
🟥 execution_time [+149.282ns; +154.558ns] or [+18.614%; +19.272%]
scenario:BenchmarkBooleanEvaluationOptOut
🟥 allocated_mem [+112 bytes; +112 bytes] or [+29.787%; +29.787%]
🟥 allocations [+1; +1] or [+20.000%; +20.000%]
🟥 execution_time [+146.176ns; +152.484ns] or [+23.503%; +24.517%]
scenario:BenchmarkConcurrentEvaluations
🟥 allocated_mem [+112 bytes; +112 bytes] or [+29.787%; +29.787%]
🟥 allocations [+1; +1] or [+20.000%; +20.000%]
🟥 execution_time [+139.806ns; +157.754ns] or [+17.550%; +19.803%]
scenario:BenchmarkEvaluation
🟥 allocated_mem [+112 bytes; +112 bytes] or [+29.787%; +29.787%]
🟥 allocations [+1; +1] or [+20.000%; +20.000%]
🟥 execution_time [+141.648ns; +148.852ns] or [+17.606%; +18.502%]
This PR adds dependent-flag evaluation to the OpenFeature provider and returns prerequisite telemetry as detached batches after graph evaluation, separate from transactional exposure tracking.
Changes:
Adds dependency validation, depth limits, memoization, and exposure rollback.
Publishes prerequisite telemetry synchronously and enforces public evaluation type checks.
Advertises agentless dependency support and adds graph, telemetry, isolation, and performance tests.
File
Description
openfeature/types.go
Adds dependency conditions and evaluator parameter decoding.
openfeature/remoteconfig.go
Validates dependency conditions and string-list values.
openfeature/provider.go
Publishes telemetry batches and checks requested flag types.
openfeature/flageval_pii_test.go
Updates calls for the evaluator signature.
openfeature/exposure_hook.go
Processes committed prerequisite exposures.
openfeature/evaluator.go
Implements dependency traversal, batching, and exposure rollback.
openfeature/evaluator_test.go
Updates fixtures and tests type-agnostic evaluation.
openfeature/dependent_flags_test.go
Adds dependency behavior tests and a wide-graph benchmark.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
With consent enabled, prerequisite logging copies the full caller context before queue admission and field-cap checks, adding synchronous work and allocations even when records or context are discarded.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Avoid copying full context before log admission checks
openfeature/provider.go:1091
With consent enabled, this copies the entire caller context once per prerequisite before the logging writer checks for a stopped/full queue or applies its 256-field cap (flageval_logging.go:627–663, 737–739). This adds O(prerequisites × context fields) work and allocations to synchronous evaluation even when every logging record or its context is discarded. Move context construction behind the writer's admission checks and use its bounded snapshot path, optionally sharing a snapshot across the batch while preserving drop and truncation counters.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Repeated caller-context processing for prerequisite exposures creates avoidable overhead, while missing nested JSON mutation-isolation tests leave the detached-batch guarantee insufficiently covered.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Test deep-copy isolation for nested JSON prerequisite values
openfeature/evaluator.go:932
The mutation-isolation tests use only BOOLEAN prerequisite values, leaving recursive copying of JSON maps and slices untested. A shallow-copy regression here would therefore pass those tests while violating the detached-batch guarantee. Add a JSON prerequisite with nested maps, []any, and []string; mutate them in a publisher that panics, and verify that the returned batch, other records, and configured variant remain unchanged.
Reuse one detached context snapshot across exposure events
openfeature/exposure_hook.go:152
Each eligible prerequisite calls makeExposureEvent, which copies, recursively flattens, and filters the same caller context before exposure-cache deduplication. With 512 eligible prerequisites and an eligible root, this performs 513 context walks even on cache hits, and buffers separate attribute maps for newly admitted exposures. Create one lazy, detached subject-attribute snapshot per root evaluation and reuse it read-only for both prerequisite events and the root event at line 108.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The deduplication cache is committed before the attribute snapshot succeeds, so a recovered Stringer panic can suppress later identical exposures and customer ShouldSend() calls without ever buffering an event.
The reason will be displayed to describe this comment to others. Learn more.
Shutting down an older provider after Remote Config restarts can remove a tracing subscription on the replacement client. Agentless capability negotiation also bypasses the URL-size fallback for near-limit flag selections.
Add recursive prerequisite evaluation with returned telemetry and transactional exposure handling. Advertise evaluator support through query negotiation and Remote Config capability reporting.
Environment: Datadog workspace
Co-Authored-By: Codex GPT-5 <noreply@localhost>
Co-authored-by: tyler.potter <tyler.potter@datadoghq.com>
Bind Remote Config subscription tokens to their issuing client so stale provider shutdown cannot affect a replacement client. Validate flag-selection length after capability negotiation and fall back to the full configuration at the URL boundary.
Environment: Datadog workspace
Co-Authored-By: Codex GPT-5 <noreply@localhost>
Co-authored-by: tyler.potter <tyler.potter@datadoghq.com>
Build request products and capabilities from one lock-consistent registration snapshot so concurrent subscriptions cannot be partially advertised. Canonicalize dependent-flag query negotiation to one v1 value while preserving unrelated raw query bytes.
Environment: Datadog workspace
Co-Authored-By: Codex GPT-5 <noreply@localhost>
Co-authored-by: tyler.potter <tyler.potter@datadoghq.com>
The reason will be displayed to describe this comment to others. Learn more.
Malformed dependency-depth settings can deadlock evaluations when synchronous error logging invokes a custom logger that re-enters dependent flag evaluation through the same provider.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Active issues include a re-entrant logger deadlock, loss of last-known-good configuration replay for replacement providers, and unnecessary full-condition scans on enabled root evaluations.
The reason will be displayed to describe this comment to others. Learn more.
More details
The PR adds dependent flags with detached prerequisite evaluation records, transactional exposures, and capability negotiation. The update fixes the earlier logger reentrancy deadlock by logging after depth initialization, preserves acknowledged Remote Config state during replay, and keeps dependency evaluation lazy; no findings remain open.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed because prerequisite-condition round trips can invalidate flags, and replacement providers can remain unready when cached configuration is not replayed.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Replacing a slow-path provider does not replay the Remote Config client’s previously accepted configuration, leaving the replacement unconfigured until flags change.
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
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.
What does this PR do?
Changes dependent-flag evaluation to return detached prerequisite evaluation records after the root graph completes. The provider publishes the returned batch synchronously before returning root details, while dependency exposures remain separate and transactional.
The batch retains reached successful and failed prerequisites, deduplicates memoized prerequisites, excludes the root, and remains isolated across parallel root evaluations. Root failures normalize to
GENERALwhile prerequisite records preserve their specific error. Agentless delivery negotiates throughcap_dependent-flags-variant-key=v1, and Remote Config advertises reserved bit 50 through the same evaluator gate.The in-process fixture runner now executes both the core and shared
evaluation-suites/dependent-flagscorpus, including evaluation-event and exposure expectations withnoUnmatchedEvents.Motivation
Returned telemetry preserves every reached prerequisite record across graph failures without coupling non-transactional evaluation events to transactional exposure behavior. Shared-corpus execution keeps graph failures, memoization, depth, and exposure rollback conformant across SDKs.
Validation
go test ./openfeature -run 'TestEvaluateFlag_JSONFixtures/Dependent' -count=1 -v— 14/14 dependent cases passed.go test ./internal/openfeature ./internal/remoteconfig ./openfeature— passed.go test -race ./openfeature— passed.git diff --check— passed.Reviewer's checklist