[Feature Flags] Add flag evaluation metrics via OpenFeature hook#8367
[Feature Flags] Add flag evaluation metrics via OpenFeature hook#8367
Conversation
78be069 to
f240989
Compare
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8367) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8367) - mean (69ms) : 67, 71
master - mean (69ms) : 66, 72
section Bailout
This PR (8367) - mean (73ms) : 71, 75
master - mean (80ms) : 69, 91
section CallTarget+Inlining+NGEN
This PR (8367) - mean (1,048ms) : 1014, 1083
master - mean (1,054ms) : 999, 1109
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8367) - mean (107ms) : 104, 110
master - mean (107ms) : 104, 110
section Bailout
This PR (8367) - mean (108ms) : 106, 110
master - mean (108ms) : 106, 110
section CallTarget+Inlining+NGEN
This PR (8367) - mean (773ms) : 746, 801
master - mean (777ms) : 751, 802
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8367) - mean (95ms) : 92, 97
master - mean (95ms) : 92, 97
section Bailout
This PR (8367) - mean (95ms) : 94, 97
master - mean (95ms) : 93, 98
section CallTarget+Inlining+NGEN
This PR (8367) - mean (763ms) : 739, 787
master - mean (760ms) : 736, 784
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8367) - mean (93ms) : 91, 96
master - mean (93ms) : 90, 96
section Bailout
This PR (8367) - mean (95ms) : 93, 96
master - mean (94ms) : 93, 96
section CallTarget+Inlining+NGEN
This PR (8367) - mean (665ms) : 644, 685
master - mean (661ms) : 645, 677
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8367) - mean (193ms) : 189, 197
master - mean (193ms) : 189, 197
section Bailout
This PR (8367) - mean (196ms) : 193, 200
master - mean (196ms) : 193, 200
section CallTarget+Inlining+NGEN
This PR (8367) - mean (1,160ms) : 1102, 1218
master - mean (1,164ms) : 1107, 1222
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8367) - mean (276ms) : 272, 280
master - mean (276ms) : 270, 282
section Bailout
This PR (8367) - mean (277ms) : 274, 281
master - mean (277ms) : 272, 282
section CallTarget+Inlining+NGEN
This PR (8367) - mean (947ms) : 925, 969
master - mean (942ms) : 923, 961
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8367) - mean (271ms) : 266, 275
master - mean (270ms) : 266, 274
section Bailout
This PR (8367) - mean (270ms) : 266, 274
master - mean (269ms) : 265, 274
section CallTarget+Inlining+NGEN
This PR (8367) - mean (973ms) : 945, 1002
master - mean (965ms) : 943, 988
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8367) - mean (269ms) : 265, 273
master - mean (269ms) : 263, 275
section Bailout
This PR (8367) - mean (269ms) : 266, 273
master - mean (269ms) : 262, 276
section CallTarget+Inlining+NGEN
This PR (8367) - mean (848ms) : 827, 869
master - mean (850ms) : 829, 871
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmark execution time: 2026-03-25 16:14:56 Comparing candidate commit ea7bc67 in PR branch Found 10 performance improvements and 8 performance regressions! Performance is the same for 250 metrics, 20 unstable metrics.
|
f240989 to
a73acc0
Compare
a73acc0 to
ea7bc67
Compare
Summary of changes
Adds flag evaluation metrics support to the Datadog OpenFeature provider. When a feature flag is evaluated, a counter metric is emitted with relevant attributes.
Reason for change
Part of the Feature Flags Evaluation (FFE) initiative to provide visibility into flag evaluations across all Datadog server SDKs. This brings parity with implementations in dd-trace-py and dd-trace-go.
Implementation details
FlagEvalMetrics.cs: Core metrics recording class using
System.Diagnostics.MetricsDatadog.FeatureFlags.OpenFeaturefeature_flag.evaluations(Counter){evaluation}feature_flag.key,feature_flag.result.variant,feature_flag.result.reason,error.type(optional),feature_flag.result.allocation_key(optional)FlagEvalMetricsHook.cs: OpenFeature hook that implements
FinallyAsyncto record metrics after each evaluation completesErrorTypeenum to snake_case stringsDatadogProvider.cs: Registers the metrics hook with the OpenFeature API
Updated OpenFeature package from 2.0.0 to 2.3.0
Conditional compilation: Only enabled for .NET 6+ (
#if NET6_0_OR_GREATER) sinceSystem.Diagnostics.Metricsrequires .NET 6+.Test coverage
tests/ffe/test_flag_eval_metrics.py)Datadog.FeatureFlags.OpenFeatureandDatadog.TraceassembliesOther details