Extract Datadog.AutoInstrumentation.Generator.Core shared library#8312
Draft
Extract Datadog.AutoInstrumentation.Generator.Core shared library#8312
Conversation
This was referenced Mar 16, 2026
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8312) 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 (8312) - mean (72ms) : 69, 74
master - mean (73ms) : 70, 75
section Bailout
This PR (8312) - mean (77ms) : 74, 79
master - mean (76ms) : 74, 78
section CallTarget+Inlining+NGEN
This PR (8312) - mean (1,085ms) : 1033, 1138
master - mean (1,075ms) : 1036, 1115
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 (8312) - mean (114ms) : 109, 118
master - mean (113ms) : 109, 116
section Bailout
This PR (8312) - mean (114ms) : 111, 117
master - mean (113ms) : 111, 116
section CallTarget+Inlining+NGEN
This PR (8312) - mean (794ms) : 779, 809
master - mean (798ms) : 781, 816
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8312) - mean (100ms) : 97, 103
master - mean (99ms) : 96, 102
section Bailout
This PR (8312) - mean (101ms) : 99, 103
master - mean (100ms) : 97, 103
section CallTarget+Inlining+NGEN
This PR (8312) - mean (950ms) : 914, 986
master - mean (946ms) : 911, 980
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8312) - mean (99ms) : 95, 103
master - mean (98ms) : 95, 101
section Bailout
This PR (8312) - mean (100ms) : 98, 103
master - mean (100ms) : 97, 102
section CallTarget+Inlining+NGEN
This PR (8312) - mean (830ms) : 793, 866
master - mean (833ms) : 786, 880
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 (8312) - mean (216ms) : 210, 221
master - mean (216ms) : 211, 222
section Bailout
This PR (8312) - mean (219ms) : 215, 223
master - mean (222ms) : 215, 228
section CallTarget+Inlining+NGEN
This PR (8312) - mean (1,259ms) : 1198, 1319
master - mean (1,269ms) : 1205, 1332
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 (8312) - mean (311ms) : 303, 319
master - mean (315ms) : 308, 322
section Bailout
This PR (8312) - mean (312ms) : 305, 318
master - mean (317ms) : 310, 325
section CallTarget+Inlining+NGEN
This PR (8312) - mean (1,032ms) : 1007, 1057
master - mean (1,039ms) : 1004, 1073
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8312) - mean (304ms) : 296, 311
master - mean (309ms) : 301, 316
section Bailout
This PR (8312) - mean (304ms) : 297, 311
master - mean (307ms) : 299, 315
section CallTarget+Inlining+NGEN
This PR (8312) - mean (1,202ms) : 1171, 1233
master - mean (1,208ms) : 1170, 1246
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8312) - mean (303ms) : 295, 312
master - mean (308ms) : 301, 315
section Bailout
This PR (8312) - mean (303ms) : 297, 310
master - mean (309ms) : 298, 320
section CallTarget+Inlining+NGEN
This PR (8312) - mean (1,145ms) : 1032, 1259
master - mean (1,160ms) : 1036, 1285
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Extract the generation engine, configuration models, and resource templates from the GUI into a standalone Core library. The GUI now delegates to Core, reducing MainViewModel.Editor.cs from ~300 lines of inline logic to ~109 lines. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7af054a to
72b14d2
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of changes
This extracts the instrumentation code generation core from the GUI
Datadog.AutoInstrumentation.Generatorinto aCorelibrary that can be re-used in an upcoming CLI (mainly for LLM consumption).Reason for change
We'd like to try and automate some of our validation logic that determines if our auto instrumentations still function with newer NuGet versions of the underlying libraries. Currently we rely upon just re-running CI against those tests, but this would allow us to build in the ability to in the future deterministically generate the code from one version to the next which will help with validating whether we are still functional.
Additionally, we'd like to help some ongoing initiatives to aid in the generation / support of auto-instrumentations via LLMs and this will set us up to be able to create a CLI that can be used by LLMs.
Implementation details
New
Datadog.AutoInstrumentation.Generator.Core, you will see the "File renamed without changes." are the extracted files.Main important changes:
AssemblyBrowser- assembly / method resolution logic that was in the MainViewModelGenerationConfigurationtakes all of the previous checkbox bool flags into a single object. Used byCreateForMethod()that handles the variousasync/static/voidlogic.GenerationResultcontains all the generated code stuffInstrumentMethodMetadata-[InstrumentMethod]attribute values.The GUI project now depends on Core and delegates all generation logic to it.
Test coverage
I re-ran the GUI and it seems all functional.
Other details
This is the base PR for another
Claude Code generated