feat(feature-flags): add InitializeAsync to manual API with CallTarget instrumentation - #9046
Conversation
BenchmarksBenchmark execution time: 2026-08-28 14:31:28 Comparing candidate commit 433251c in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 70 metrics, 0 unstable metrics, 69 known flaky benchmarks, 57 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (9046) and master. ✅ No regressions detected |
…t instrumentation
…for manual API InitializeAsync
5dae9c5 to
731ac0a
Compare
…ebto/EX-2703/ffe-manual-api
…DataDog/dd-trace-dotnet into pavlo.khrebto/EX-2703/ffe-manual-api
…DataDog/dd-trace-dotnet into pavlo.khrebto/EX-2703/ffe-manual-api
…DataDog/dd-trace-dotnet into pavlo.khrebto/EX-2703/ffe-manual-api
…DataDog/dd-trace-dotnet into pavlo.khrebto/EX-2703/ffe-manual-api
There was a problem hiding this comment.
Pull request overview
Adds a new InitializeAsync(CancellationToken) entry point to the Datadog.Trace.Manual Feature Flags manual API so manual users can explicitly trigger Feature Flags configuration delivery activation (agentless or Remote Configuration) via CallTarget instrumentation, aligning behavior with the OpenFeature path introduced earlier in the stacked series.
Changes:
- Added
FeatureFlagsSdk.InitializeAsync(CancellationToken)stub toDatadog.Trace.Manual, marked[Instrumented], to act as the interception point. - Added a new CallTarget integration that intercepts the stub and delegates to
TracerManager.Instance.FeatureFlags.InitializeAsync(cancellationToken). - Registered the new CallTarget in the supported calltargets manifest and updated generated allowlists/definitions accordingly.
Reviewed changes
Copilot reviewed 3 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tracer/src/Datadog.Tracer.Native/Generated/generated_calltargets.g.cpp | Adds the native generated calltarget entry for Datadog.Trace.Manual FeatureFlagsSdk.InitializeAsync. |
| tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs | Updates generated instrumentation allowlist to include the new integration type. |
| tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs | Updates generated instrumentation allowlist to include the new integration type. |
| tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs | Updates generated instrumentation allowlist to include the new integration type. |
| tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs | Updates generated instrumentation allowlist to include the new integration type. |
| tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/ManualInstrumentation/FeatureFlags/FeatureFlagsSdkInitializeAsyncIntegration.cs | New CallTarget integration: replaces the stub’s return task with the tracer’s FeatureFlagsModule.InitializeAsync(...). |
| tracer/src/Datadog.Trace.Manual/FeatureFlags/FeatureFlagsSdk.cs | Adds the public manual API stub InitializeAsync(CancellationToken) returning Task.CompletedTask for instrumentation to intercept. |
| tracer/build/supported_calltargets.g.json | Registers the new manual API InitializeAsync calltarget for versions 3.31.0–3.*.*. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…DataDog/dd-trace-dotnet into pavlo.khrebto/EX-2703/ffe-manual-api
…DataDog/dd-trace-dotnet into pavlo.khrebto/EX-2703/ffe-manual-api
…DataDog/dd-trace-dotnet into pavlo.khrebto/EX-2703/ffe-manual-api
…DataDog/dd-trace-dotnet into pavlo.khrebto/EX-2703/ffe-manual-api
…DataDog/dd-trace-dotnet into pavlo.khrebto/EX-2703/ffe-manual-api
…DataDog/dd-trace-dotnet into pavlo.khrebto/EX-2703/ffe-manual-api
|
The failing
|
…DataDog/dd-trace-dotnet into pavlo.khrebto/EX-2703/ffe-manual-api
Summary of changes
Adds
InitializeAsyncto theDatadog.Trace.Manualfeature flags API so that manual API users can trigger agentless delivery activation, just like OpenFeature users can.This is PR 4 of a stacked PR series implementing agentless Feature Flags configuration delivery (FFL-2703), porting functionality from dd-trace-py#19331 and dd-trace-java#11892. Stacked on PR 1 #9040, PR 2 #9042, and PR 3 #9044.
Reason for change
.NET is the only SDK with a separate manual API (
Datadog.Trace.Manual.FeatureFlagsSdk) that bypasses OpenFeature. With the new agentless default (PR 1), the agentless poller only starts atActivate(), which is called fromInitializeAsync. The manual API had noInitializeAsync, so manual API users would be stuck withPROVIDER_NOT_READYforever unless they explicitly setremote_config.Implementation details
Datadog.Trace.Manual/FeatureFlags/FeatureFlagsSdk.cs— addsInitializeAsync(CancellationToken)stub marked[Instrumented]that returnsTask.CompletedTaskFeatureFlagsSdkInitializeAsyncIntegration.cs(new CallTarget) — intercepts the stub and callsTracerManager.Instance.FeatureFlags.InitializeAsync(cancellationToken), same pattern as the OpenFeature integration in PR 3supported_calltargets.g.json— registers the new calltarget targetingDatadog.Trace.Manualversion3.31.0–3.*.*InstrumentationDefinitions.g.cs(4 generated files) — auto-updated by the build to include the new integration in the allowlistTest coverage
The
InitializeAsyncbehavior is already tested in PR 3'sFeatureFlagsModuleTests(activation, timeout, cancellation, no-delivery-start). This PR only adds the manual API stub and CallTarget wiring — no new tests needed since the underlyingFeatureFlagsModule.InitializeAsyncis unchanged.Other details
Stacked PRs:
System tests: DataDog/system-tests#7496