Skip to content

feat: Dependent Flags - #9589

Draft
typotter wants to merge 6 commits into
masterfrom
typo/dependent-flags-returned-batch
Draft

typotter wants to merge 6 commits into
masterfrom
typo/dependent-flags-returned-batch

Conversation

@typotter

@typotter typotter commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • return one prerequisite evaluation record for every reached dependency after graph evaluation, including successful records retained before later failures
  • normalize graph failures to GENERAL at the requested root while preserving dependency-specific error details
  • publish evaluation telemetry independently of transactional exposure delivery
  • commit dependency and root exposures only after successful root resolution and hook completion
  • keep independent evaluations on the ordinary fast path and skip telemetry construction when the bounded writer cannot accept events
  • negotiate direct UFC delivery through the capability query and register Remote Config capability bit 50 from evaluator support

Validation

Using the .NET 11 SDK with .NET 8 roll-forward:

  • FeatureFlags namespace: 1,149 passed, 2 platform skips, 0 failed
  • OpenFeature bridge, exposure, and dependent canonical corpus: 53 passed, 0 failed
  • closed and saturated evaluation-writer regressions: 3 passed, 0 failed
  • final local Crucible review: no material findings on 3c34fbdae
  • all seven SDK review lenses: no findings on 3c34fbdae
  • git diff --check and the request-surface audit pass

@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (9589) and master.

✅ No regressions detected

📄 View the full report (charts + all metrics) →

@pr-commenter

pr-commenter Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-11-17 23:14:26

Comparing candidate commit b7a160f in PR branch typo/dependent-flags-returned-batch with baseline commit 9fadaa7 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 72 metrics, 0 unstable metrics, 6 known flaky benchmarks, 119 flaky benchmarks without significant changes.

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 ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • unstable execution_time [-0.004ns; +0.002ns] or [-23.153%; +11.614%]
  • unstable throughput [-5282098212.898op/s; +83475573920.919op/s] or [-7.386%; +116.729%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0

  • 🟥 execution_time [+96.481µs; +133.820µs] or [+9.465%; +13.128%]
  • 🟥 throughput [-111.770op/s; -82.303op/s] or [-11.392%; -8.388%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1

  • unstable throughput [+21.780op/s; +137.987op/s] or [+4.134%; +26.191%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1

  • unstable execution_time [+176.558µs; +580.078µs] or [+5.115%; +16.806%]
  • unstable throughput [-72.654op/s; -18.776op/s] or [-23.677%; -6.119%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1

  • unstable execution_time [+44.795µs; +184.290µs] or [+8.202%; +33.746%]
  • unstable throughput [-324.945op/s; -74.693op/s] or [-17.573%; -4.039%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • unstable execution_time [+0.002ns; +0.010ns] or [+13.090%; +82.372%]
  • unstable throughput [-2032870366324.085op/s; +1260876513943.265op/s] or [-190.602%; +118.220%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1
  • scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472
  • scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0
  • scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net472
  • scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net472
  • scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1
  • scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0
  • scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1
  • scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472
  • scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0
  • scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0
  • scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472
  • scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net6.0
  • scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch netcoreapp3.1
  • scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472
  • scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net6.0
  • scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync netcoreapp3.1
  • scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472
  • scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net6.0
  • scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net6.0
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net6.0
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net6.0
  • scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net6.0
  • scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@typotter
typotter force-pushed the typo/dependent-flags-returned-batch branch from 038dd20 to 6dbb277 Compare November 4, 2026 00:41
@typotter typotter changed the title [Feature Flags] Return dependency telemetry after evaluation [Feature Flags] Support dependent flag telemetry Nov 4, 2026
@typotter
typotter requested a balanced review from Copilot November 4, 2026 00:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved issues allow dependency evaluation to bypass its node budget, drop nested prerequisite telemetry fields, and invalidate flags during condition JSON round trips.

3 open issues
What changed in this PR

This PR adds dependent-flag evaluation telemetry to the managed tracer and integrates deferred exposure delivery with the OpenFeature provider.

Changes:

  • Evaluate prerequisite graphs with ordered telemetry, memoization, and cycle/depth checks.
  • Separate dependency telemetry from exposure batches committed after successful evaluation and hooks.
  • Bound exposure queueing and context capture, with compatibility handling and expanded tests.
File Description
tracer/​test/​Datadog.Trace.Tests/​FeatureFlags/​UfcConfigurationParserTests.cs Tests dependency configuration parsing and validation.
tracer/​test/​Datadog.Trace.Tests/​FeatureFlags/​FlagEvaluationModuleTests.cs Tests dependency telemetry delivery and context failures.
tracer/​test/​Datadog.Trace.Tests/​FeatureFlags/​FeatureFlagsEvaluatorTests.cs Tests bounded exposure context capture.
tracer/​test/​Datadog.Trace.Tests/​FeatureFlags/​FeatureFlagsDependentFlagTests.cs Covers graph evaluation, rollback, snapshots, and depth limits.
tracer/​test/​Datadog.Trace.Tests/​FeatureFlags/​ExposureApiTests.cs Tests queue overflow and bounded batches.
tracer/​test/​Datadog.Trace.Tests/​FeatureFlags/​AgentlessConfigurationSourceTests.cs Verifies dependency capability headers.
tracer/​test/​Datadog.FeatureFlags.OpenFeature.Tests/​SynchronousHookTests.cs Covers commit hooks and metric reason formatting.
tracer/​test/​Datadog.FeatureFlags.OpenFeature.Tests/​FlagEvalEVPHookTests.cs Updates the expected OpenFeature error reason.
tracer/​test/​Datadog.FeatureFlags.OpenFeature.Tests/​FeatureFlagsSdkTests.cs Tests canonical OpenFeature reason mappings.
tracer/​test/​Datadog.FeatureFlags.OpenFeature.Tests/​ExposureCommitHookTests.cs Tests successful commits and hook-failure rollback.
tracer/​test/​Datadog.FeatureFlags.OpenFeature.Tests/​CanonicalFixtureTests.cs Aligns fixture assertions with canonical reasons.
tracer/​src/​Datadog.Trace/​FeatureFlags/​Rcm/​Model/​ServerConfiguration.cs Adds evaluator parameters and merge handling.
tracer/​src/​Datadog.Trace/​FeatureFlags/​Rcm/​Model/​FlagEvaluationConfiguration.cs Defines prerequisite flag descriptors.
tracer/​src/​Datadog.Trace/​FeatureFlags/​Rcm/​Model/​FlagCollectionJsonConverter.cs Validates condition sources and dependency operands.
tracer/​src/​Datadog.Trace/​FeatureFlags/​Rcm/​Model/​EvaluatorParams.cs Models optional dependency-depth settings.
tracer/​src/​Datadog.Trace/​FeatureFlags/​Rcm/​Model/​ConditionConfiguration.cs Adds dependency conditions and field-presence tracking.
tracer/​src/​Datadog.Trace/​FeatureFlags/​FeatureFlagsModule.cs Publishes dependency telemetry and defers exposures.
tracer/​src/​Datadog.Trace/​FeatureFlags/​FeatureFlagsEvaluator.cs Implements dependency graph evaluation and transactional exposures.
tracer/​src/​Datadog.Trace/​FeatureFlags/​ExposureCommitMetadata.cs Carries deferred exposure callbacks.
tracer/​src/​Datadog.Trace/​FeatureFlags/​Exposure/​ExposureApi.cs Bounds queued exposures and transport batches.
tracer/​src/​Datadog.Trace/​FeatureFlags/​EvaluationTrace.cs Groups results, dependency records, and exposures.
tracer/​src/​Datadog.Trace/​FeatureFlags/​DependencyEvaluation.cs Captures detached dependency telemetry snapshots.
tracer/​src/​Datadog.Trace/​FeatureFlags/​Agentless/​AgentlessConfigurationSource.cs Advertises dependent-flag support.
tracer/​src/​Datadog.Trace/​ClrProfiler/​AutoInstrumentation/​ManualInstrumentation/​OpenFeature/​OpenFeatureSdkEvaluateIntegration.cs Detects SDK support for deferred exposures.
tracer/​src/​Datadog.FeatureFlags.OpenFeature/​Sdk/​FeatureFlagsSdk.cs Transfers commit callbacks and canonicalizes reasons.
tracer/​src/​Datadog.FeatureFlags.OpenFeature/​FlagEvalMetricsHook.cs Preserves lowercase telemetry reason tags.
tracer/​src/​Datadog.FeatureFlags.OpenFeature/​ExposureCommitHook.cs Adds one-shot exposure completion handling.
tracer/​src/​Datadog.FeatureFlags.OpenFeature/​DatadogProvider.Experimental.cs Connects synchronous evaluation to exposure completion.
tracer/​src/​Datadog.FeatureFlags.OpenFeature/​DatadogProvider.cs Registers and supplies the exposure commit hook.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Dependency telemetry still loses valid context and omission metadata, while quadratic exposure deduplication and eager bookkeeping allocations add avoidable overhead to flag evaluation.

1 open issue
4 previously missed issues

In code that hasn't changed since last review

Medium severity Skip oversized keys before snapshotting their values

tracer/​src/​Datadog.Trace/​FeatureFlags/​DependencyEvaluation.cs:103

[P2] With consent enabled, a 257-character top-level key containing a 2,000-element array consumes the entire snapshot budget before FlattenContext discards it, so subsequent valid attributes are lost. Skip oversized keys before detaching their values, while still charging one node for each rejected entry. Add a regression through both snapshotting and flattening; the current oversized-path test exercises only flattening.

Medium severity Normalize nested OpenFeature context values

tracer/​src/​Datadog.Trace/​FeatureFlags/​DependencyEvaluation.cs:206

[P2] FeatureFlagsSdk.GetContextAttributes unwraps only top-level values, leaving nested OpenFeature Structure and Value objects that this snapshot code cannot normalize. Consented dependency telemetry therefore loses nested fields such as user.country and the scalar types of list entries. Add bounded OpenFeature-aware normalization at the SDK/tracer boundary and verify the resulting dependency payload with a builder-created nested context.

Medium severity Initialize dependency bookkeeping only when needed

tracer/​src/​Datadog.Trace/​FeatureFlags/​FeatureFlagsEvaluator.cs:113

[P2] Allocate dependency bookkeeping only when a prerequisite is reached. Every EvaluateWithTrace now constructs this session before looking up the flag, eagerly allocating a memo dictionary, two hash sets, and three lists, including populating the active-root set. Consequently even ordinary static, disabled, or missing flags incur graph allocations and hashing, including when dependency telemetry is disabled. This adds GC pressure to every flag evaluation, rather than only dependent evaluations. Keep the ordinary path lightweight and initialize memoization, frames, and dependency telemetry collections lazily on the first Resolve call (PERF-3.1).

Medium severity Use rollback-aware sets to deduplicate exposures

tracer/​src/​Datadog.Trace/​FeatureFlags/​FeatureFlagsEvaluator.cs:1101

[P2] Avoid quadratic exposure deduplication on the evaluation hot path (PERF-4.2). Every insertion scans the accumulated list, and a successfully resolved dependency immediately replays its exposure trace through the same scan. A depth-one root with 1,000 distinct logging prerequisites performs 1,001,000 flag-key comparisons; 2,000 prerequisites perform 4,002,000. The depth limit does not bound this breadth, and the exposure queue cap is applied only after resolution, so this cost blocks the application's evaluation call. Keep the ordered lists but use rollback-aware hash-set membership for both the session and frame traces.

3 resolved since last review

Review effort: Balanced

@typotter

typotter commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Addressed all four previously missed issues in 1bc9ada:

  • Oversized keys are rejected before their values are traversed, while still charging the rejected entry against the node budget.
  • Nested OpenFeature Structure and list values are normalized with bounded recursion per top-level attribute, preserving every top-level targeting field; a real provider/evaluator regression proves matching still works after 300 fields and after a budget-heavy nested value.
  • Dependency memo, active/frame state, telemetry lists, and exposure collections are initialized only when used.
  • Ordered exposure traces now use rollback-aware hash sets, including removing keys with rolled-back list tails so memo replay can re-add the selected exposure.

The remediation also rejects unsupported values without invoking caller ToString. Validation passes the complete OpenFeature suite (771 tests), dependent-flag tests (32 tests), analyzer builds, and independent local review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved normalization and dependency-telemetry issues discard timestamp values, fail to report truncation, and let the reserved root targeting key consume attribute capacity.

3 open issues
1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed to evaluate configuration serialization and parsing regressions alongside a Windows net48 test compilation failure.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

@typotter

typotter commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Fresh Copilot review reports no open issues. On the remaining “closer look” note: the current head has no Windows/net48 failure; its only visible failed GitHub check is the repository policy requiring at least one PR label. The dependency configuration serialization/presence behavior was covered earlier in this review loop, and the final changes are limited to context normalization/omission transport. Local validation passes the complete OpenFeature suite (771), dependent-flag suite (33), focused SDK/profiler bridge suite (29), and analyzer-enabled builds. The PR remains draft for human review of the broader configuration surface.

@aarsilv aarsilv added the crucible: reviewing A Crucible review has started; this PR has reviewer attention. label Nov 4, 2026
@typotter
typotter requested a balanced review from Copilot November 4, 2026 19:24
@typotter
typotter marked this pull request as ready for review November 4, 2026 19:27
@typotter
typotter requested a review from a team as a code owner November 4, 2026 19:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T19:40:34.767883Z 12d8d99 Draft marked ready
🔒 Security Review ✅ Completed 2026-11-04T19:32:07.947417Z 12d8d99 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Serialization fails to preserve omitted evaluator settings, causing dependent flags to return PARSE_ERROR, while per-attribute budget resets permit excessive synchronous context expansion.

3 open issues

Review effort: Balanced

@typotter typotter changed the title [Feature Flags] Support dependent flag telemetry feat: Dependent Flags Nov 4, 2026

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

No reportable static defect was identified in dependency evaluation, rollback, or deferred exposure delivery. Runtime confidence remains limited because tests were not run and production telemetry was intentionally excluded.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 12d8d99

@typotter typotter added the docker_image_artifacts Use to label PRs for which you would need a Docker Image created for. label Nov 4, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 12d8d99adf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Evaluate prerequisite graphs with retained dependency telemetry, transactional exposures, and canonical corpus coverage.

Environment: Datadog workspace

Co-Authored-By: Codex GPT-5 <noreply@localhost>

Co-authored-by: tyler.potter <tyler.potter@datadoghq.com>
@typotter
typotter force-pushed the typo/dependent-flags-returned-batch branch from 07ce412 to 5e79afb Compare November 17, 2026 21:17
typotter and others added 2 commits November 17, 2026 15:52
Regenerate managed and native calltarget manifests for dependency telemetry retrieval.

Environment: Datadog workspace

Co-Authored-By: Codex GPT-5 <noreply@localhost>

Co-authored-by: tyler.potter <tyler.potter@datadoghq.com>
Ensure custom configuration endpoints advertise dependent flags while preserving existing query data and replacing stale capability values.

Environment: Datadog workspace
Co-Authored-By: Codex GPT-5 <noreply@localhost>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Normalization can turn supplied attributes into null and alter targeting, root exposures can publish despite deferred handling and later hook failures, and wide dependency graphs incur quadratic telemetry lookups.

3 open issues

Review effort: Balanced

Keep one canonical dependent-flags capability parameter while preserving unrelated query segments.

Environment: Datadog workspace

Co-Authored-By: Codex GPT-5 <noreply@localhost>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Root-only exposures can be reported before After hooks complete, and normalization budget exhaustion can convert non-null containers to null, incorrectly changing targeting results.

3 open issues

Review effort: Balanced

Preserve targeting semantics, index dependency verdicts, and defer root-only exposure batches.

Environment: Datadog workspace

Co-Authored-By: Codex GPT-5 <noreply@localhost>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The use of Dictionary.TryAdd without a compatible extension breaks compilation for the tracer’s net461 and netstandard2.0 targets.

1 open issue
3 resolved since last review

Review effort: Balanced

Keep canonical dependency telemetry indexing compatible with older target frameworks.

Environment: Datadog workspace

Co-Authored-By: Codex GPT-5 <noreply@localhost>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human review is needed to assess unpublished findings involving malformed dependency conditions matching incorrectly and unnecessary telemetry collection when events cannot be accepted.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@hhan2024 hhan2024 removed the crucible: reviewing A Crucible review has started; this PR has reviewer attention. label Dec 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker_image_artifacts Use to label PRs for which you would need a Docker Image created for.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants