-
Notifications
You must be signed in to change notification settings - Fork 171
feat(feature-flags): wire source-agnostic activation and OpenFeature InitializeAsync #9044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
pavlokhrebto
merged 107 commits into
master
from
pavlo.khrebto/EX-2703/ffe-module-wiring
Sep 14, 2026
Merged
Changes from all commits
Commits
Show all changes
107 commits
Select commit
Hold shift + click to select a range
543c9b1
feat(feature-flags): add agentless configuration keys to supported-co…
pavlokhrebto 4753079
feat(feature-flags): add FeatureFlagsSettings with source resolution …
pavlokhrebto 25e168f
feat(feature-flags): add AgentlessEndpoint for CDN URL derivation
pavlokhrebto 9c3a236
test(feature-flags): add unit tests for FeatureFlagsSettings and Agen…
pavlokhrebto 95bf50b
fix(tests): correct AgentlessEndpointTests invalid URL expectations
pavlokhrebto 4e6232b
fix(feature-flags): redact agentless base URL telemetry and reject ma…
pavlokhrebto 7ee3cf3
fix: remove unnecessary null-forgiving operators in AgentlessEndpoint
pavlokhrebto 02a6ac6
fix: drop redundant HasWhitespace check, defer to Uri.TryCreate per r…
pavlokhrebto 7f72e7f
fix: reword credential comment and remove unnecessary null-forgiving …
pavlokhrebto fb32e7d
refactor(feature-flags): use config framework for source resolution a…
pavlokhrebto 2911d78
fix: mark DD_FEATURE_FLAGS_CONFIGURATION_SOURCE_AGENTLESS_BASE_URL as…
pavlokhrebto 7af7bc5
refactor: pass site/env/apiKey via constructor instead of re-reading …
pavlokhrebto 8f406d9
[FeatureFlags] Resolve the configuration source in a single telemetry…
pavlokhrebto ada921d
[FeatureFlags] Make AgentlessEndpoint a class so a failed TryCreate y…
pavlokhrebto c224e2d
feat(feature-flags): add UfcConfigurationParser for JSON:API envelope…
pavlokhrebto 6a5f49a
test(feature-flags): add UfcConfigurationParserTests for JSON:API env…
pavlokhrebto 388ccfa
test(feature-flags): add AgentlessConfigurationSourceTests for poller…
pavlokhrebto 376b0ad
fix(feature-flags): reject non-string data.type, log failures as errors
pavlokhrebto 2f2682f
fix(feature-flags): add explicit request timeout race for net461 asyn…
pavlokhrebto 7a29735
feat(feature-flags): wire source-agnostic activation and InitializeAs…
pavlokhrebto aeea2cb
feat(feature-flags): add OpenFeature InitializeAsync CallTarget instr…
pavlokhrebto 5647ccb
test(feature-flags): add FeatureFlagsModuleTests for activation, Init…
pavlokhrebto a31e084
fix(feature-flags): add missing using directives for Task and Cancell…
pavlokhrebto a31ba4c
fix(feature-flags): commit regenerated native calltarget definitions …
pavlokhrebto 0a0e68f
fix(feature-flags): make ExposureApi construction lazy to avoid eager…
pavlokhrebto 58ae7f4
fix(feature-flags): remove unused locals, defer RC subscription, and …
pavlokhrebto 4b925d7
[FeatureFlags] Drop the duplicate FeatureFlags settings left by the r…
pavlokhrebto 261d402
[FeatureFlags] Guard activation and disposal with a single lock
pavlokhrebto 2f725b0
[FeatureFlags] Report an error status when no delivery source could s…
pavlokhrebto 126d201
[FeatureFlags] Emit typed provider events instead of an implicit Prov…
pavlokhrebto 8c4f3b3
Merge branch 'master' of github.com:DataDog/dd-trace-dotnet into pavl…
pavlokhrebto 154ef58
[FeatureFlags] Apply dd_env per request instead of baking it into the…
pavlokhrebto dbae9dc
[FeatureFlags] Normalize dd_env the same way span tags are normalized
pavlokhrebto 7c7d7e6
[FeatureFlags] Report an unrecognised configuration source as a parsi…
pavlokhrebto f4a87d5
Merge branch 'pavlo.khrebto/EX-2703/ffe-config-and-endpoint' of githu…
pavlokhrebto 8935780
[FeatureFlags] Poll for the current environment instead of the one ca…
pavlokhrebto d174938
Merge branch 'pavlo.khrebto/EX-2703/ffe-agentless-poller' of github.c…
pavlokhrebto d6aafaf
Merge branch 'master' of github.com:DataDog/dd-trace-dotnet into pavl…
pavlokhrebto 437b9dd
Merge branch 'pavlo.khrebto/EX-2703/ffe-config-and-endpoint' of githu…
pavlokhrebto 424de1a
Merge branch 'pavlo.khrebto/EX-2703/ffe-agentless-poller' of github.c…
pavlokhrebto 2317ea8
[FeatureFlags] Fix double question mark in agentless request URI on .…
pavlokhrebto bfab9d8
Merge branch 'pavlo.khrebto/EX-2703/ffe-config-and-endpoint' of githu…
pavlokhrebto d644ab5
Merge branch 'pavlo.khrebto/EX-2703/ffe-agentless-poller' of github.c…
pavlokhrebto 574fa0d
[FeatureFlags] Subscribe to FFE_FLAGS at startup for the remote_confi…
pavlokhrebto d868f5a
[FeatureFlags] Align the provider initialization timeout default with…
pavlokhrebto b2f012a
Fix comments
pavlokhrebto fc6185d
Merge branch 'pavlo.khrebto/EX-2703/ffe-config-and-endpoint' of githu…
pavlokhrebto 5654f49
[FeatureFlags] Signal agentless poller shutdown with a TaskCompletion…
pavlokhrebto 0eadda9
[FeatureFlags] Use ThreadSafeRandom.Shared for agentless retry jitter
pavlokhrebto e2a6f9a
[FeatureFlags] Log agentless delivery failures as warnings
pavlokhrebto 4f892ab
[FeatureFlags] Fix stream disposal when reading the agentless respons…
pavlokhrebto a522bfb
[FeatureFlags] Make the agentless apply step synchronous and pass Pol…
pavlokhrebto ffcfc15
[FeatureFlags] Start the agentless poll loop with Task.Run
pavlokhrebto da215db
[FeatureFlags] Rebuild the agentless request URI only when the enviro…
pavlokhrebto 0ad52ca
[FeatureFlags] Parse the agentless payload straight from the response…
pavlokhrebto e9936a2
[FeatureFlags] Deserialize the UFC envelope without building a JSON tree
pavlokhrebto 0bcb494
[FeatureFlags] Subscribe to settings changes in the agentless constru…
pavlokhrebto 97fdde3
[FeatureFlags] Add dd_env to the managed agentless endpoint only
pavlokhrebto eba74ae
[FeatureFlags] Name the offline source after the value that selects it
pavlokhrebto 1c063c3
[FeatureFlags] Address review comments on source resolution and endpo…
pavlokhrebto 85eacdb
FeatureFlags] Document the agentless base URL contract
pavlokhrebto 4149d7b
[FeatureFlags] Fail closed on an unrecognised configuration source
pavlokhrebto 3bfd025
[FeatureFlags] Reject a Datadog site that can redirect the managed en…
pavlokhrebto d8e1083
[FeatureFlags] Reject a Datadog site that can redirect the managed en…
pavlokhrebto aa8fc5b
[FeatureFlags] Separate whether Feature Flags run from where configur…
pavlokhrebto b3f5318
Merge branch 'master' of github.com:DataDog/dd-trace-dotnet into pavl…
pavlokhrebto 24eea14
Merge branch 'pavlo.khrebto/EX-2703/ffe-config-and-endpoint' of githu…
pavlokhrebto c5cb6c0
Merge branch 'pavlo.khrebto/EX-2703/ffe-agentless-poller' of github.c…
pavlokhrebto 42aaffc
feat(feature-flags): add UfcConfigurationParser for JSON:API envelope…
pavlokhrebto 5c81862
test(feature-flags): add UfcConfigurationParserTests for JSON:API env…
pavlokhrebto c7a0d5f
test(feature-flags): add AgentlessConfigurationSourceTests for poller…
pavlokhrebto e084a93
fix(feature-flags): reject non-string data.type, log failures as errors
pavlokhrebto 1f8f03d
fix(feature-flags): add explicit request timeout race for net461 asyn…
pavlokhrebto d3b307e
[FeatureFlags] Poll for the current environment instead of the one ca…
pavlokhrebto eae179d
[FeatureFlags] Signal agentless poller shutdown with a TaskCompletion…
pavlokhrebto f21deeb
[FeatureFlags] Use ThreadSafeRandom.Shared for agentless retry jitter
pavlokhrebto 8aeefb2
[FeatureFlags] Log agentless delivery failures as warnings
pavlokhrebto 3640e9d
[FeatureFlags] Fix stream disposal when reading the agentless respons…
pavlokhrebto 7f9b72b
[FeatureFlags] Make the agentless apply step synchronous and pass Pol…
pavlokhrebto c01d3f2
[FeatureFlags] Start the agentless poll loop with Task.Run
pavlokhrebto 0610bea
[FeatureFlags] Rebuild the agentless request URI only when the enviro…
pavlokhrebto c3a452b
[FeatureFlags] Parse the agentless payload straight from the response…
pavlokhrebto 1f2d697
[FeatureFlags] Deserialize the UFC envelope without building a JSON tree
pavlokhrebto 1717780
[FeatureFlags] Subscribe to settings changes in the agentless constru…
pavlokhrebto 2edc435
[FeatureFlags] Let the HTTP abstraction own the agentless request tim…
pavlokhrebto 2701dd3
Merge branch 'master' of github.com:DataDog/dd-trace-dotnet into pavl…
pavlokhrebto d73689f
Merge branch 'pavlo.khrebto/EX-2703/ffe-agentless-poller' of github.c…
pavlokhrebto e9e9cc4
Merge branch 'pavlo.khrebto/EX-2703/ffe-agentless-poller' of github.c…
pavlokhrebto 3b2844c
Merge branch 'master' of github.com:DataDog/dd-trace-dotnet into pavl…
pavlokhrebto d72f107
[FeatureFlags] Signal initialization cancellation with a TaskCompleti…
pavlokhrebto 57ff5cc
Merge branch 'master' of github.com:DataDog/dd-trace-dotnet into pavl…
pavlokhrebto 6518981
[FeatureFlags] Trigger system-tests base image build
pavlokhrebto 4bbcfc4
Merge branch 'master' of github.com:DataDog/dd-trace-dotnet into pavl…
pavlokhrebto f742338
Merge master into pavlo.khrebto/EX-2703/ffe-module-wiring
pavlokhrebto f853cdd
Merge master into pavlo.khrebto/EX-2703/ffe-module-wiring
pavlokhrebto 9d9c452
[FeatureFlags] Skip the state lock once activation has happened
pavlokhrebto cefe935
[FeatureFlags] Document that initialization blocks the caller until t…
pavlokhrebto 73cce16
[FeatureFlags] Keep a throwing config handler from holding back the a…
pavlokhrebto 44a629f
[FeatureFlags] Keep a throwing config handler from holding back the a…
pavlokhrebto 77cfab0
[FeatureFlags] Emit the provider event before the application's confi…
pavlokhrebto cd03d2a
[FeatureFlags] Test the module's agentless activation and disposal
pavlokhrebto 05490c3
[FeatureFlags] Address review comments on naming, comments and test-o…
pavlokhrebto d264e64
[FeatureFlags] Report withdrawn configuration as a provider error
pavlokhrebto 94a9706
[FeatureFlags] Correct the initialization-timeout documentation
pavlokhrebto 0a92d2a
[FeatureFlags] Emit provider status events from initialization
pavlokhrebto 1ba423f
[FeatureFlags] Delegate the first provider ready event to the OpenFea…
pavlokhrebto 41092bc
Merge branch 'master' of github.com:DataDog/dd-trace-dotnet into pavl…
pavlokhrebto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
39 changes: 39 additions & 0 deletions
39
...umentation/ManualInstrumentation/OpenFeature/OpenFeatureSdkHasConfigurationIntegration.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // <copyright file="OpenFeatureSdkHasConfigurationIntegration.cs" company="Datadog"> | ||
| // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. | ||
| // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. | ||
| // </copyright> | ||
| #nullable enable | ||
|
|
||
| using System; | ||
| using System.ComponentModel; | ||
| using Datadog.Trace.ClrProfiler.CallTarget; | ||
| using Datadog.Trace.Configuration; | ||
|
|
||
| namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.ManualInstrumentation.OpenFeature; | ||
|
|
||
| /// <summary> | ||
| /// System.Boolean Datadog.FeatureFlags.OpenFeature.FeatureFlagsSdk::HasConfiguration() calltarget instrumentation | ||
| /// </summary> | ||
| [InstrumentMethod( | ||
| AssemblyName = "Datadog.FeatureFlags.OpenFeature", | ||
| TypeName = "Datadog.FeatureFlags.OpenFeature.FeatureFlagsSdk", | ||
| MethodName = "HasConfiguration", | ||
| ReturnTypeName = ClrNames.Bool, | ||
| ParameterTypeNames = [], | ||
| MinimumVersion = "2.0.0", | ||
| MaximumVersion = "2.*.*", | ||
| IntegrationName = nameof(IntegrationId.OpenFeature))] | ||
| [Browsable(false)] | ||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||
| public sealed class OpenFeatureSdkHasConfigurationIntegration | ||
| { | ||
| internal static CallTargetReturn<bool> OnMethodEnd<TTarget>(bool returnValue, Exception? exception, in CallTargetState state) | ||
| { | ||
| if (exception is not null) | ||
| { | ||
| return new CallTargetReturn<bool>(returnValue); | ||
| } | ||
|
|
||
| return new CallTargetReturn<bool>(TracerManager.Instance.FeatureFlags?.HasConfiguration == true); | ||
| } | ||
| } |
54 changes: 54 additions & 0 deletions
54
...rumentation/ManualInstrumentation/OpenFeature/OpenFeatureSdkInitializeAsyncIntegration.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| // <copyright file="OpenFeatureSdkInitializeAsyncIntegration.cs" company="Datadog"> | ||
| // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. | ||
| // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. | ||
| // </copyright> | ||
| #nullable enable | ||
|
|
||
| using System; | ||
| using System.ComponentModel; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
| using Datadog.Trace.ClrProfiler.CallTarget; | ||
| using Datadog.Trace.Configuration; | ||
|
|
||
| namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.ManualInstrumentation.OpenFeature; | ||
|
|
||
| /// <summary> | ||
| /// System.Threading.Tasks.Task Datadog.FeatureFlags.OpenFeature.FeatureFlagsSdk::InitializeAsync(System.Threading.CancellationToken) calltarget instrumentation | ||
| /// </summary> | ||
| [InstrumentMethod( | ||
| AssemblyName = "Datadog.FeatureFlags.OpenFeature", | ||
| TypeName = "Datadog.FeatureFlags.OpenFeature.FeatureFlagsSdk", | ||
| MethodName = "InitializeAsync", | ||
| ReturnTypeName = ClrNames.Task, | ||
| ParameterTypeNames = [ClrNames.CancellationToken], | ||
| MinimumVersion = "2.0.0", | ||
| MaximumVersion = "2.*.*", | ||
| IntegrationName = nameof(IntegrationId.OpenFeature))] | ||
| [Browsable(false)] | ||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||
| public sealed class OpenFeatureSdkInitializeAsyncIntegration | ||
| { | ||
| internal static CallTargetState OnMethodBegin<TTarget>(ref CancellationToken cancellationToken) | ||
| => new CallTargetState(scope: null, state: cancellationToken); | ||
|
|
||
| internal static CallTargetReturn<Task> OnMethodEnd<TTarget>(Task returnValue, Exception? exception, in CallTargetState state) | ||
| { | ||
| if (exception is not null) | ||
| { | ||
| return new CallTargetReturn<Task>(returnValue); | ||
| } | ||
|
|
||
| // Agentless polling only starts here, because those requests go straight to Datadog and are | ||
| // billable, so the tracer must not start them until application code adopts the provider. The | ||
| // Remote Configuration source is already subscribed by then; this call waits for its first | ||
| // configuration. | ||
| if (TracerManager.Instance.FeatureFlags is { } featureFlags) | ||
| { | ||
| var cancellationToken = state.State is CancellationToken token ? token : default; | ||
| return new CallTargetReturn<Task>(featureFlags.InitializeAsync(cancellationToken)); | ||
| } | ||
|
|
||
| return new CallTargetReturn<Task>(returnValue); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.