[DBM] Add dynamic_service propagation mode#8701
Conversation
This comment has been minimized.
This comment has been minimized.
andrewlock
left a comment
There was a problem hiding this comment.
I'd actually potentially suggest making more of a change in TracerSettings, so that the settings value contain the "effective" value instead, if that makes sense
| /// <summary>Service tags injected and base hash injected; equivalent to Service with DD_DBM_INJECT_SQL_BASEHASH=true</summary> | ||
| DynamicService, |
There was a problem hiding this comment.
This feels a little bit hacky, in that we're adding a new enum here, but then basically never using it (because we swap from DynamicService to Service in DbScopeFactory). I think it would be cleaner to not include this value, and instead have the TracerSettings reflect the "correct" value 🤔 That means nothing in DbScopeFactory would need to change (though extracting tracer.Settings.DbmPropagationMode as a variable probably makes a lot of sense tbh)
BenchmarksBenchmark execution time: 2026-05-28 11:35:07 Comparing candidate commit c93142e in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 72 metrics, 0 unstable metrics, 61 known flaky benchmarks, 65 flaky benchmarks without significant changes.
|
| try | ||
| { | ||
| if (tracer.Settings.DbmPropagationMode != DbmPropagationLevel.Disabled) | ||
| var dbmPropagationMode = tracer.Settings.DbmPropagationMode; |
There was a problem hiding this comment.
Note: The only change here is extracting the variable rather than reading it 5 times
andrewlock
left a comment
There was a problem hiding this comment.
LGTM, thanks! (Though I added a commit so it might be cheating 🤣 )
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8701) 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 (8701) - mean (74ms) : 71, 77
master - mean (74ms) : 70, 78
section Bailout
This PR (8701) - mean (80ms) : 77, 83
master - mean (77ms) : 75, 79
section CallTarget+Inlining+NGEN
This PR (8701) - mean (1,112ms) : 1062, 1161
master - mean (1,110ms) : 1042, 1179
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 (8701) - mean (117ms) : 111, 124
master - mean (113ms) : 108, 118
section Bailout
This PR (8701) - mean (116ms) : 111, 120
master - mean (115ms) : 112, 118
section CallTarget+Inlining+NGEN
This PR (8701) - mean (793ms) : 773, 812
master - mean (799ms) : 765, 833
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8701) - mean (105ms) : 99, 110
master - mean (102ms) : 98, 105
section Bailout
This PR (8701) - mean (103ms) : 99, 106
master - mean (105ms) : 100, 110
section CallTarget+Inlining+NGEN
This PR (8701) - mean (952ms) : 910, 993
master - mean (943ms) : 908, 979
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8701) - mean (101ms) : 95, 107
master - mean (100ms) : 97, 103
section Bailout
This PR (8701) - mean (104ms) : 100, 109
master - mean (102ms) : 97, 107
section CallTarget+Inlining+NGEN
This PR (8701) - mean (818ms) : 783, 853
master - mean (826ms) : 784, 868
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 (8701) - mean (198ms) : 193, 204
master - mean (197ms) : 191, 203
section Bailout
This PR (8701) - mean (201ms) : 193, 209
master - mean (201ms) : 196, 207
section CallTarget+Inlining+NGEN
This PR (8701) - mean (1,194ms) : 1163, 1226
master - mean (1,191ms) : 1149, 1232
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 (8701) - mean (285ms) : 280, 291
master - mean (283ms) : 272, 294
section Bailout
This PR (8701) - mean (284ms) : 277, 291
master - mean (285ms) : 277, 293
section CallTarget+Inlining+NGEN
This PR (8701) - mean (962ms) : 945, 980
master - mean (956ms) : 936, 976
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8701) - mean (276ms) : 270, 283
master - mean (275ms) : 268, 283
section Bailout
This PR (8701) - mean (277ms) : 271, 283
master - mean (277ms) : 271, 283
section CallTarget+Inlining+NGEN
This PR (8701) - mean (1,156ms) : 1115, 1197
master - mean (1,151ms) : 1101, 1201
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8701) - mean (274ms) : 265, 282
master - mean (275ms) : 268, 281
section Bailout
This PR (8701) - mean (275ms) : 268, 282
master - mean (274ms) : 268, 280
section CallTarget+Inlining+NGEN
This PR (8701) - mean (1,034ms) : 999, 1069
master - mean (1,036ms) : 1000, 1071
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
/merge |
|
View all feedbacks in Devflow UI.
Added to the queue but the mergequeue is not enabled for now.
This pull request was merged directly. |
vandonr
left a comment
There was a problem hiding this comment.
looks OK, took me longer to review andrew's touch up than the original change 😓
| Configuration key for setting DBM propagation mode | ||
| Default value is disabled, expected values are either: disabled, service or full | ||
| Default value is disabled, expected values are either: disabled, service, dynamic_service or full | ||
| dynamic_service is equivalent to service with DD_DBM_INJECT_SQL_BASEHASH=true |
There was a problem hiding this comment.
I'd say this is only relevant when the migration happens, but afterwards it's not useful documentation. I wonder if this belongs here, and if so, we should at least plan a follow up commit that removes it
There was a problem hiding this comment.
I think that when the migration will happen we'll remove also the feature flag so those comments will be changed of course
| var dbmPropagationMode = config | ||
| .WithKeys(ConfigurationKeys.DbmPropagationMode) | ||
| .GetAs( | ||
| defaultValue: new(new(DbmPropagationLevel.Disabled), nameof(DbmPropagationLevel.Disabled)), |
There was a problem hiding this comment.
this new(new( looks ugly, but I guess that's ok
no merge queue (yet) in dotnet, you can click the button directly |
Summary of changes
Adds a new value for
DD_DBM_PROPAGATION_MODE:dynamic_service.It's a shorthand for
DD_DBM_PROPAGATION_MODE=service+DD_DBM_INJECT_SQL_BASEHASH=true. Instead of requiring two separate env vars to get service-level metadata with base-hash injection, users can now set one.The base hash (
ddsh) lets the DBM backend remap services based on process tags without needing a full traceparent. It's useful for customers who want dynamic service attribution but don't want the query plan overhead that comes withfullmode.On the long term, this will replace the default mode that's today
serviceReason for change
Implementation details
Test coverage
Other details