Skip to content

Fix ManualInstrumentationConfigSource and introduce base type#7508

Merged
andrewlock merged 3 commits into
masterfrom
andrew/settings/4-fix-manual-config-sources
Sep 16, 2025
Merged

Fix ManualInstrumentationConfigSource and introduce base type#7508
andrewlock merged 3 commits into
masterfrom
andrew/settings/4-fix-manual-config-sources

Conversation

@andrewlock

Copy link
Copy Markdown
Member

Summary of changes

  • Fixes a bug when using newer version of auto tracer with <3.7.0 of manual package
  • Introduce a shared config source base type

Reason for change

While working on other config stuff, I noticed that we were accidentally never using the "legacy" config source that was introduced in #6397. This source would only be used if the customer is using < 3.7.0 of the NuGet package with >= 3.7.0 of auto instrumentation, but it would be "bad" if they did 😅

Additionally, for other other upcoming changes it made sense to create a dedicated common base class, and expose the useDefaultSources flag.

Implementation details

  • Introduce a base class
  • Expose UseDefaultSources property on base class
  • Make sure we use the legacy source when we're supposed to

Test coverage

:awkward-monkey:

Other details

Part of a config stack

https://datadoghq.atlassian.net/browse/LANGPLAT-819

@andrewlock
andrewlock requested review from a team as code owners September 12, 2025 15:03
@andrewlock andrewlock added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) area:automatic-instrumentation Automatic instrumentation managed C# code (Datadog.Trace.ClrProfiler.Managed) type:refactor labels Sep 12, 2025
@andrewlock
andrewlock force-pushed the andrew/settings/4-fix-manual-config-sources branch from a3eab9e to 600824d Compare September 12, 2025 15:08
@dd-trace-dotnet-ci-bot

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-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 shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

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).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7508) - mean (72ms)  : 71, 73
     .   : milestone, 72,
    master - mean (72ms)  : 71, 73
     .   : milestone, 72,

    section Baseline
    This PR (7508) - mean (69ms)  : 65, 73
     .   : milestone, 69,
    master - mean (69ms)  : 64, 74
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (7508) - mean (1,001ms)  : 978, 1023
     .   : milestone, 1001,
    master - mean (1,005ms)  : 979, 1031
     .   : milestone, 1005,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7508) - mean (107ms)  : 105, 108
     .   : milestone, 107,
    master - mean (107ms)  : 106, 108
     .   : milestone, 107,

    section Baseline
    This PR (7508) - mean (106ms)  : 102, 109
     .   : milestone, 106,
    master - mean (106ms)  : 103, 108
     .   : milestone, 106,

    section CallTarget+Inlining+NGEN
    This PR (7508) - mean (702ms)  : 679, 725
     .   : milestone, 702,
    master - mean (705ms)  : 682, 728
     .   : milestone, 705,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7508) - mean (94ms)  : 93, 95
     .   : milestone, 94,
    master - mean (94ms)  : 93, 95
     .   : milestone, 94,

    section Baseline
    This PR (7508) - mean (93ms)  : 92, 95
     .   : milestone, 93,
    master - mean (93ms)  : 92, 95
     .   : milestone, 93,

    section CallTarget+Inlining+NGEN
    This PR (7508) - mean (657ms)  : 639, 675
     .   : milestone, 657,
    master - mean (662ms)  : 643, 682
     .   : milestone, 662,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7508) - mean (93ms)  : 92, 93
     .   : milestone, 93,
    master - mean (93ms)  : 92, 94
     .   : milestone, 93,

    section Baseline
    This PR (7508) - mean (92ms)  : 90, 94
     .   : milestone, 92,
    master - mean (92ms)  : 90, 94
     .   : milestone, 92,

    section CallTarget+Inlining+NGEN
    This PR (7508) - mean (595ms)  : 583, 606
     .   : milestone, 595,
    master - mean (598ms)  : 585, 611
     .   : milestone, 598,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7508) - mean (207ms)  : 202, 212
     .   : milestone, 207,
    master - mean (208ms)  : 204, 212
     .   : milestone, 208,

    section Baseline
    This PR (7508) - mean (204ms)  : 198, 210
     .   : milestone, 204,
    master - mean (206ms)  : 200, 212
     .   : milestone, 206,

    section CallTarget+Inlining+NGEN
    This PR (7508) - mean (1,155ms)  : 1120, 1190
     .   : milestone, 1155,
    master - mean (1,162ms)  : 1123, 1202
     .   : milestone, 1162,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7508) - mean (296ms)  : 288, 303
     .   : milestone, 296,
    master - mean (298ms)  : 291, 304
     .   : milestone, 298,

    section Baseline
    This PR (7508) - mean (296ms)  : 289, 302
     .   : milestone, 296,
    master - mean (296ms)  : 288, 303
     .   : milestone, 296,

    section CallTarget+Inlining+NGEN
    This PR (7508) - mean (948ms)  : 916, 980
     .   : milestone, 948,
    master - mean (944ms)  : 913, 975
     .   : milestone, 944,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7508) - mean (295ms)  : 284, 306
     .   : milestone, 295,
    master - mean (291ms)  : 284, 299
     .   : milestone, 291,

    section Baseline
    This PR (7508) - mean (290ms)  : 280, 301
     .   : milestone, 290,
    master - mean (292ms)  : 285, 299
     .   : milestone, 292,

    section CallTarget+Inlining+NGEN
    This PR (7508) - mean (924ms)  : 880, 968
     .   : milestone, 924,
    master - mean (943ms)  : 907, 978
     .   : milestone, 943,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7508) - mean (301ms)  : 291, 311
     .   : milestone, 301,
    master - mean (291ms)  : 284, 298
     .   : milestone, 291,

    section Baseline
    This PR (7508) - mean (290ms)  : 282, 299
     .   : milestone, 290,
    master - mean (292ms)  : 284, 300
     .   : milestone, 292,

    section CallTarget+Inlining+NGEN
    This PR (7508) - mean (846ms)  : 767, 926
     .   : milestone, 846,
    master - mean (857ms)  : 782, 932
     .   : milestone, 857,

Loading

@andrewlock
andrewlock merged commit 8306657 into master Sep 16, 2025
66 checks passed
@andrewlock
andrewlock deleted the andrew/settings/4-fix-manual-config-sources branch September 16, 2025 07:14
@github-actions github-actions Bot added this to the vNext-v3 milestone Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:automatic-instrumentation Automatic instrumentation managed C# code (Datadog.Trace.ClrProfiler.Managed) area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants