Skip to content

[FeatureFlags] Wait for OpenFeature initial config - #9093

Draft
typotter wants to merge 13 commits into
masterfrom
typo/dotnet-openfeature-readiness
Draft

[FeatureFlags] Wait for OpenFeature initial config#9093
typotter wants to merge 13 commits into
masterfrom
typo/dotnet-openfeature-readiness

Conversation

@typotter

@typotter typotter commented Aug 20, 2026

Copy link
Copy Markdown

Motivation

FFL-2468 captures a customer-visible startup race in the .NET OpenFeature provider. `await SetProviderAsync(new DatadogProvider())` could report the provider as ready before the first FFE Remote Config payload had installed an evaluator, so an immediate flag evaluation returned `PROVIDER_NOT_READY`. This made `DD_TRACE_DEBUG=true` appear necessary because debug logging slowed startup enough for Remote Config to arrive first.

Changes

This adds an OpenFeature readiness shim and calltarget hook so the provider can ask the tracer whether Feature Flags are ready. `DatadogProvider.InitializeAsync` now waits for the initial usable FFE configuration before completing provider initialization. If that first configuration never arrives, initialization fails after 30 seconds with a provider-not-ready timeout instead of completing as ready or blocking forever.

The Feature Flags module now exposes readiness based on whether an evaluator has been installed, replays the config callback if the evaluator already exists when the handler is registered, and avoids blocking provider initialization when Remote Config is explicitly unavailable. Later Remote Config updates still flow through the existing configuration-change callback path.

Additionally, `InitializeAsync` now fails immediately with `ProviderFatalException` when the Datadog tracer is not instrumented (`IsAvailable()` returns false). This mirrors the Java provider's behavior: if the tracer agent is absent, initialization is unrecoverable rather than timing out after 30 seconds.

Decisions

The initialization behavior deliberately mirrors the Java OpenFeature provider across all three states:

Condition .NET Java
Tracer not instrumented `ProviderFatalException` (immediate) `FatalError` (immediate, `DDEvaluator` load fails)
Tracer running, RC disabled 30s timeout → `ProviderNotReadyException` 30s timeout → `ProviderNotReadyError`
Tracer running, RC enabled Waits for config → READY Waits for config → READY

The fix treats an awaited `SetProviderAsync(...)` as a readiness contract because the OpenFeature SDK documents the returned task as waiting for provider setup and initialization to complete. A caller that intentionally does not await the task can still run async startup, but once the task completes successfully, Datadog should not immediately return `PROVIDER_NOT_READY` because the initial FFE config has not been applied yet.

The timeout is bounded at the provider layer rather than changing evaluation semantics. If there is no evaluator during evaluation, evaluations still report `PROVIDER_NOT_READY`; the provider just no longer advertises readiness before the evaluator exists. Generated calltarget metadata was updated for the new `IsReady` hook.

`IsReady()` uses `_isRemoteConfigurationAvailable && evaluator != null` rather than the inverse form, so a provider with RC explicitly disabled does not falsely report ready. If RC is disabled, the provider waits up to 30 seconds then fails with `ProviderNotReadyException`, consistent with the Java provider's timeout path.

Validation

  • `dotnet build tracer/src/Datadog.FeatureFlags.OpenFeature/Datadog.FeatureFlags.OpenFeature.csproj -c Release`
  • `dotnet build tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/Datadog.Trace.ClrProfiler.IntegrationTests.csproj -c Release -f net10.0`
  • `git diff --check`

Not run locally:

  • Focused OpenFeature integration test execution, because local test execution still requires a populated monitoring home under `/shared/bin/monitoring-home`; the integration test project build passes.

leoromanovsky and others added 4 commits June 4, 2026 14:57
Addresses two inline review comments from dromanol on PR #8754.

IsReadyIntegration (comment 3389306667):
  Before: featureFlags is null || featureFlags.IsReady()
  After:  featureFlags?.IsReady() ?? false

FeatureFlagsModule.IsReady (comment 3389322766):
  Before: !_isRemoteConfigurationAvailable || evaluator != null
  After:  _isRemoteConfigurationAvailable && evaluator != null

FATAL on uninstrumented tracer (Java parity):
  InitializeAsync now throws ProviderFatalException immediately when
  IsAvailable() is false (tracer not instrumented). Mirrors Java's
  Provider.initialize(): FatalError when DDEvaluator cannot be loaded.

  Behavior:
    Tracer not instrumented → ProviderFatalException (FATAL, immediate)
    Tracer running, RC off  → 30s timeout → ProviderNotReadyException
    Tracer running, RC on   → waits for config → READY

No new calltargets or public API. IsAvailable() is already hooked.

Jira: FFL-2468
@typotter typotter added area:ffe type:bug status:work-in-progress Actively worked on. If this is a PR, no review needed yet. WIP. AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos area:remote-config labels Aug 20, 2026
@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

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

✅ No regressions detected

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

@pr-commenter

pr-commenter Bot commented Aug 20, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-21 19:28:21

Comparing candidate commit 99b317a in PR branch typo/dotnet-openfeature-readiness with baseline commit bf6901b in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 2 performance regressions! Performance is the same for 70 metrics, 0 unstable metrics, 68 known flaky benchmarks, 58 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 ----------------------------------'

scenario:Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery net472

  • 🟥 throughput [-24176.939op/s; -21068.802op/s] or [-6.809%; -5.934%]

scenario:Benchmarks.Trace.HttpClientBenchmark.SendAsync net472

  • 🟥 throughput [-5061.645op/s; -4810.605op/s] or [-5.778%; -5.492%]

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.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472

  • 🟩 throughput [+8392.307op/s; +10136.755op/s] or [+5.436%; +6.566%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472

  • 🟩 throughput [+10289.213op/s; +11978.513op/s] or [+5.360%; +6.240%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-12616.875op/s; -12215.438op/s] or [-14.960%; -14.484%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1

  • 🟥 throughput [-8347.437op/s; -7035.672op/s] or [-8.488%; -7.154%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 allocated_mem [+1.605KB; +1.605KB] or [+48.760%; +48.776%]
  • 🟥 execution_time [+312.654ms; +315.559ms] or [+155.150%; +156.591%]
  • 🟥 throughput [-61.422op/s; -57.131op/s] or [-11.051%; -10.279%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • 🟥 allocated_mem [+1.012KB; +1.012KB] or [+37.524%; +37.537%]
  • 🟥 execution_time [+373.181ms; +377.025ms] or [+294.836%; +297.873%]
  • 🟩 throughput [+67.957op/s; +73.854op/s] or [+8.960%; +9.737%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 allocated_mem [+1.088KB; +1.088KB] or [+40.343%; +40.355%]
  • 🟥 execution_time [+393.972ms; +397.526ms] or [+348.650%; +351.795%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net472

  • 🟥 allocated_mem [+4.725KB; +4.725KB] or [+99.465%; +99.482%]
  • 🟥 throughput [-60337.385op/s; -59898.181op/s] or [-46.946%; -46.604%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0

  • 🟥 allocated_mem [+3.848KB; +3.848KB] or [+81.379%; +81.391%]
  • 🟩 execution_time [-16.117ms; -11.919ms] or [-7.527%; -5.567%]
  • 🟥 throughput [-59885.700op/s; -57115.999op/s] or [-43.713%; -41.691%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody netcoreapp3.1

  • 🟥 allocated_mem [+4.576KB; +4.576KB] or [+98.954%; +98.966%]
  • 🟥 throughput [-49493.699op/s; -47244.158op/s] or [-44.748%; -42.714%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net472

  • 🟥 allocated_mem [+1.348KB; +1.348KB] or [+109.063%; +109.078%]
  • 🟥 throughput [-273780.589op/s; -266664.719op/s] or [-27.954%; -27.228%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net6.0

  • 🟥 allocated_mem [+511 bytes; +512 bytes] or [+41.822%; +41.834%]
  • 🟩 execution_time [-26.284ms; -21.411ms] or [-11.721%; -9.548%]
  • 🟥 throughput [-85046.369op/s; -61090.801op/s] or [-9.086%; -6.526%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1

  • 🟥 allocated_mem [+1.312KB; +1.312KB] or [+108.600%; +108.616%]
  • 🟥 throughput [-179222.112op/s; -161407.001op/s] or [-25.751%; -23.191%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472

  • 🟥 allocated_mem [+3.378KB; +3.378KB] or [+89.003%; +89.017%]
  • 🟥 throughput [-72661.840op/s; -71888.288op/s] or [-48.901%; -48.380%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0

  • 🟥 allocated_mem [+3.336KB; +3.336KB] or [+88.150%; +88.161%]
  • 🟥 throughput [-72706.344op/s; -69831.797op/s] or [-46.262%; -44.433%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1

  • 🟥 allocated_mem [+3.264KB; +3.264KB] or [+88.493%; +88.506%]
  • 🟥 throughput [-56072.448op/s; -53454.278op/s] or [-44.669%; -42.583%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0

  • 🟩 throughput [+330306.281op/s; +346688.925op/s] or [+11.014%; +11.560%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1

  • 🟩 execution_time [-19.255ms; -14.919ms] or [-8.876%; -6.877%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net472

  • 🟩 allocated_mem [-13.759KB; -13.757KB] or [-42.326%; -42.318%]
  • 🟥 execution_time [+300.069ms; +301.000ms] or [+149.934%; +150.399%]
  • 🟩 throughput [+1062.586op/s; +1077.755op/s] or [+11.736%; +11.904%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net6.0

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+300.167ms; +303.293ms] or [+151.375%; +152.951%]
  • 🟩 throughput [+2331.215op/s; +2545.678op/s] or [+17.830%; +19.471%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs netcoreapp3.1

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+299.089ms; +303.778ms] or [+150.658%; +153.020%]
  • 🟩 throughput [+1835.153op/s; +1993.590op/s] or [+17.717%; +19.247%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net472

  • 🟥 execution_time [+295.298ms; +296.929ms] or [+145.039%; +145.840%]
  • 🟩 throughput [+517.331op/s; +532.343op/s] or [+13.715%; +14.113%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0

  • 🟥 execution_time [+299.187ms; +300.736ms] or [+146.262%; +147.019%]
  • 🟩 throughput [+2591.795op/s; +2695.360op/s] or [+37.654%; +39.159%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1

  • 🟥 execution_time [+301.467ms; +302.447ms] or [+150.673%; +151.163%]
  • 🟩 throughput [+1397.603op/s; +1427.630op/s] or [+27.741%; +28.337%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472

  • 🟩 execution_time [-144.055µs; -139.445µs] or [-29.577%; -28.630%]
  • 🟩 throughput [+827.730op/s; +859.775op/s] or [+40.314%; +41.875%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0

  • 🟩 execution_time [-134.342µs; -104.837µs] or [-30.811%; -24.044%]
  • 🟩 throughput [+795.744op/s; +949.810op/s] or [+34.596%; +41.294%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1

  • 🟩 execution_time [-143.132µs; -121.136µs] or [-30.667%; -25.954%]
  • 🟩 throughput [+781.335op/s; +864.201op/s] or [+36.068%; +39.893%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472

  • 🟩 execution_time [-127.283µs; -122.677µs] or [-34.365%; -33.122%]
  • 🟩 throughput [+1348.623op/s; +1405.364op/s] or [+49.947%; +52.048%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net6.0

  • 🟩 execution_time [-102.390µs; -78.772µs] or [-32.688%; -25.148%]
  • 🟩 throughput [+1183.397op/s; +1386.122op/s] or [+36.890%; +43.209%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1

  • 🟩 execution_time [-137.436µs; -114.988µs] or [-37.597%; -31.456%]
  • 🟩 throughput [+1323.279op/s; +1462.755op/s] or [+47.487%; +52.492%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.878ms; +300.656ms] or [+149.670%; +150.058%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • 🟥 execution_time [+408.170ms; +415.507ms] or [+443.494%; +451.466%]
  • 🟩 throughput [+763.154op/s; +930.023op/s] or [+6.271%; +7.642%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1

  • unstable execution_time [+300.574ms; +351.110ms] or [+228.223%; +266.595%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+248.616ms; +298.776ms] or [+114.311%; +137.374%]
  • 🟥 throughput [-615.265op/s; -553.137op/s] or [-55.749%; -50.120%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • unstable execution_time [+201.913ms; +335.178ms] or [+86.047%; +142.839%]
  • 🟥 throughput [-676.391op/s; -592.527op/s] or [-45.115%; -39.522%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+336.164ms; +343.885ms] or [+201.065%; +205.683%]
  • 🟥 throughput [-394.437op/s; -357.268op/s] or [-27.464%; -24.876%]

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

  • unstable throughput [+15.028op/s; +59.009op/s] or [+4.320%; +16.962%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+300.754ms; +302.218ms] or [+151.454%; +152.191%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net6.0

  • 🟥 execution_time [+299.087ms; +306.517ms] or [+149.873%; +153.596%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch netcoreapp3.1

  • 🟥 execution_time [+300.933ms; +303.992ms] or [+151.176%; +152.713%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+303.183ms; +305.175ms] or [+152.249%; +153.248%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net6.0

  • 🟥 execution_time [+298.459ms; +300.387ms] or [+147.575%; +148.528%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync netcoreapp3.1

  • 🟥 execution_time [+304.883ms; +308.356ms] or [+154.528%; +156.288%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+300.914ms; +302.879ms] or [+151.032%; +152.018%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net6.0

  • 🟥 execution_time [+300.514ms; +303.717ms] or [+149.779%; +151.375%]
  • 🟩 throughput [+40498.138op/s; +45392.964op/s] or [+8.042%; +9.014%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1

  • 🟥 execution_time [+299.443ms; +302.604ms] or [+148.970%; +150.543%]

scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net6.0

  • 🟩 execution_time [-16.718ms; -13.084ms] or [-7.774%; -6.084%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472

  • unstable execution_time [+15.781µs; +59.814µs] or [+3.898%; +14.774%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net6.0

  • 🟩 allocated_mem [-19.227KB; -19.204KB] or [-7.014%; -7.005%]
  • unstable execution_time [-7.480µs; +49.063µs] or [-1.478%; +9.697%]

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

  • 🟩 allocated_mem [-19.501KB; -19.484KB] or [-7.109%; -7.103%]
  • 🟩 execution_time [-103.909µs; -46.628µs] or [-18.007%; -8.080%]
  • 🟩 throughput [+175.110op/s; +337.524op/s] or [+10.004%; +19.283%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0

  • 🟥 execution_time [+8.622µs; +12.360µs] or [+20.381%; +29.216%]
  • 🟥 throughput [-5620.873op/s; -3899.308op/s] or [-23.662%; -16.415%]

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

  • unstable execution_time [-13.407µs; -5.643µs] or [-20.800%; -8.755%]
  • unstable throughput [+1334.436op/s; +3033.759op/s] or [+8.187%; +18.613%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+304.104ms; +305.391ms] or [+153.711%; +154.362%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+303.683ms; +306.010ms] or [+154.574%; +155.758%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+298.768ms; +302.119ms] or [+149.570%; +151.248%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472

  • 🟥 throughput [-23033.928op/s; -21237.134op/s] or [-6.376%; -5.879%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0

  • 🟩 throughput [+37188.287op/s; +41627.392op/s] or [+7.039%; +7.879%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+299.686ms; +301.486ms] or [+149.366%; +150.263%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+301.632ms; +303.774ms] or [+151.465%; +152.541%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+302.486ms; +306.247ms] or [+153.401%; +155.309%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+301.887ms; +303.526ms] or [+150.583%; +151.400%]
  • 🟩 throughput [+65105092.301op/s; +65752445.175op/s] or [+47.414%; +47.885%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0

  • unstable execution_time [+326.666ms; +391.702ms] or [+406.267%; +487.152%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1

  • 🟥 execution_time [+299.579ms; +300.752ms] or [+149.423%; +150.008%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0

  • 🟩 throughput [+84328.588op/s; +93918.019op/s] or [+7.873%; +8.769%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0

  • 🟩 throughput [+75141.985op/s; +105933.895op/s] or [+5.816%; +8.199%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan netcoreapp3.1

  • 🟩 throughput [+75196.809op/s; +84717.948op/s] or [+7.468%; +8.414%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0

  • 🟩 throughput [+50708.531op/s; +55087.596op/s] or [+9.208%; +10.003%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0

  • 🟩 throughput [+55423.760op/s; +74554.051op/s] or [+6.192%; +8.330%]

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 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 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 net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

IsReady() now returns false when RC is disabled (_isRemoteConfigurationAvailable
&& evaluator != null), so the test expectation must be false, not true.
The provider handles this via InitializeAsync throwing ProviderFatalException
when IsAvailable() returns false (tracer not instrumented).

Jira: FFL-2468
- Fix stale type name in OpenFeatureSdkIsReadyIntegration doc comment
  (was Datadog.Trace.FeatureFlags, should be Datadog.FeatureFlags.OpenFeature)
- Add [DoesNotReturn] to ThrowInitialConfigTimeout so analyzers suppress
  spurious unreachable-code and null-ref warnings at call sites
- Cancel the 30s Task.Delay timer via CancellationTokenSource when
  initialization succeeds or is cancelled, eliminating orphaned timer objects
- Use Volatile.Write for _onNewConfigEventHander assignment to close the
  ordering gap between RC thread and registration thread; also invoke
  the local parameter directly rather than re-reading the field
- Add IsReady_WhenEvaluatorInstalledAndRCEnabled_ReturnsTrue and
  RegisterOnNewConfigEventHandler_ReplaysFiredWhenEvaluatorAlreadyPresent
  unit tests to improve coverage of IsReady() and replay paths

Note: ProviderFatalException path in InitializeAsync is not unit-testable
from Datadog.Trace.Tests due to System.Diagnostics.DiagnosticSource version
conflict with Datadog.FeatureFlags.OpenFeature; covered by integration tests.

Jira: FFL-2468
…y flag

The _isRemoteConfigurationAvailable guard in IsReady() caused false negatives
in environments where TracerSettings.IsRemoteConfigurationAvailable returns
false even though RC is functional (observed on net48/x86 integration tests).

The guard is redundant: when RC is truly disabled, no payload arrives and
the evaluator stays null anyway. IsReady() = evaluator != null is sufficient
for all cases:
  - RC enabled + evaluator installed  → true  (READY)
  - RC enabled + no evaluator yet     → false (wait)
  - RC disabled                       → false (wait → 30s timeout)
  - No tracer                         → IsAvailable() = false → FATAL

Also renames the unit test to reflect the corrected semantic.

Jira: FFL-2468
…ags state

Temporary diagnostic instrumentation to identify root cause of
ProviderReadyWaitsForInitialConfig failure.

IsReadyIntegration calltarget now logs to stderr:
  - Whether TracerManager.Instance.FeatureFlags is null
  - _isRemoteConfigurationAvailable value
  - Whether evaluator is installed

DatadogProvider.InitializeAsync now logs to stderr:
  - IsReady() and IsAvailable() values on entry
  - Which branch is taken (CompletedTask / FATAL / WaitForInitialConfig)

Stderr output does not affect the test's stdout assertions.
Remove this commit once root cause is identified.

Jira: FFL-2468
Log timestamp, list count, and handler null status on every
UpdateRemoteConfig call to understand why configUpdates stays 0
and when evaluator is installed/cleared relative to SetProviderAsync.

Jira: FFL-2468
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos area:ffe area:remote-config status:work-in-progress Actively worked on. If this is a PR, no review needed yet. WIP. type:bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants