Skip to content

Conversation

@lucaspimentel
Copy link
Member

@lucaspimentel lucaspimentel commented Oct 9, 2025

Summary of changes

Adds comprehensive Azure Functions architecture documentation, Datadog API debugging guide, and PowerShell helper scripts for tracer instrumentation.

New files:

  • docs/development/AzureFunctions-Architecture.md — Deep dive into Azure Functions Host/.NET Worker architecture, gRPC protocol, tracing integration, and instrumentation hooks
  • docs/development/QueryingDatadogAPIs.md — Guide for querying Datadog Spans/Logs APIs to debug tracer issues
  • tracer/tools/Get-DatadogTrace.ps1 — PowerShell script to retrieve and visualize trace spans from Datadog API
  • tracer/tools/Get-DatadogLogs.ps1 — PowerShell script to query logs from Datadog API

Updated:

  • docs/development/AzureFunctions.md — Enhanced with NuGet package architecture, ASP.NET Core integration, HTTP proxying, and debugging examples
  • AGENTS.md — Added cross-references to new docs

Reason for change

Improves developer onboarding and debugging:

  • Understand Azure Functions internals and instrumentation hook points
  • Navigate Azure Functions Host and .NET Worker source code
  • Debug distributed tracing issues using Datadog APIs and PowerShell scripts
  • Understand trace context flow between host and worker processes

Implementation details

  • Documented Azure Functions Host and .NET Worker with specific file references
  • Explained Datadog.AzureFunctions vs Datadog.Trace package architecture
  • Added ASP.NET Core integration mode details (HTTP proxying vs standard gRPC)
  • Created PowerShell scripts for querying Datadog Spans and Logs APIs with multiple output formats (table, hierarchy, json, raw)
  • Provided comprehensive API query examples and PowerShell script documentation

Test coverage

Documentation and tooling only - no production code changes.

Other details

Internal developer documentation and debugging tools complementing existing guides.

🤖 Generated with Claude Code

@lucaspimentel lucaspimentel marked this pull request as ready for review October 9, 2025 19:58
@lucaspimentel lucaspimentel requested a review from a team as a code owner October 9, 2025 19:58
@lucaspimentel lucaspimentel enabled auto-merge (squash) October 9, 2025 20:04
@pr-commenter
Copy link

pr-commenter bot commented Oct 9, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7639 compared to master:

  • 2 benchmarks are slower, with geometric mean 1.784
  • 7 benchmarks have fewer allocations
  • 5 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7639

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.05 KB 6 KB -52 B -0.86%
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net6.0 5.61 KB 5.48 KB -129 B -2.30%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.4μs 58.1ns 372ns 0 0 0 5.61 KB
master StartStopWithChild netcoreapp3.1 13.9μs 67.6ns 270ns 0 0 0 5.7 KB
master StartStopWithChild net472 21.7μs 92.3ns 357ns 0.872 0.249 0 6.05 KB
#7639 StartStopWithChild net6.0 10.6μs 56.6ns 300ns 0 0 0 5.48 KB
#7639 StartStopWithChild netcoreapp3.1 13.5μs 70.6ns 346ns 0 0 0 5.71 KB
#7639 StartStopWithChild net472 21.9μs 123ns 849ns 0.982 0.327 0.109 6 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7639

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.33 KB 3.31 KB -23 B -0.69%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 934μs 214ns 830ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 517ns 2μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.26ms 216ns 781ns 0 0 0 3.33 KB
#7639 WriteAndFlushEnrichedTraces net6.0 936μs 149ns 576ns 0 0 0 2.71 KB
#7639 WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 82.6ns 298ns 0 0 0 2.7 KB
#7639 WriteAndFlushEnrichedTraces net472 1.21ms 42.3ns 158ns 0 0 0 3.31 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 1.06μs 5.96ns 40ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.41μs 7.53ns 39.1ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.02μs 0.626ns 2.34ns 0.192 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 7.02μs 36.8ns 187ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 8.95μs 44.7ns 195ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.74μs 11.1ns 42.9ns 0.721 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 319ns 1.77ns 11.4ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 400ns 2.24ns 14.7ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 299ns 0.0244ns 0.0943ns 0.0433 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.38μs 1.96ns 6.79ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.83μs 28.1ns 105ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.75μs 7.24ns 28.1ns 0.575 0 0 3.8 KB
#7639 AllCycleSimpleBody net6.0 1.09μs 5.56ns 26.7ns 0 0 0 1.22 KB
#7639 AllCycleSimpleBody netcoreapp3.1 1.39μs 7.71ns 44.3ns 0 0 0 1.2 KB
#7639 AllCycleSimpleBody net472 1.02μs 0.272ns 0.98ns 0.195 0 0 1.23 KB
#7639 AllCycleMoreComplexBody net6.0 7.07μs 38.9ns 237ns 0 0 0 4.72 KB
#7639 AllCycleMoreComplexBody netcoreapp3.1 8.95μs 6.56ns 23.6ns 0 0 0 4.62 KB
#7639 AllCycleMoreComplexBody net472 7.62μs 2.03ns 7.61ns 0.725 0 0 4.74 KB
#7639 ObjectExtractorSimpleBody net6.0 317ns 1.55ns 8.75ns 0 0 0 280 B
#7639 ObjectExtractorSimpleBody netcoreapp3.1 400ns 2.13ns 11.5ns 0 0 0 272 B
#7639 ObjectExtractorSimpleBody net472 297ns 0.0156ns 0.0583ns 0.044 0 0 281 B
#7639 ObjectExtractorMoreComplexBody net6.0 6.39μs 5.31ns 20.6ns 0 0 0 3.78 KB
#7639 ObjectExtractorMoreComplexBody netcoreapp3.1 7.86μs 4.09ns 15.9ns 0 0 0 3.69 KB
#7639 ObjectExtractorMoreComplexBody net472 6.7μs 1.78ns 6.89ns 0.603 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 76.1μs 223ns 865ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 96.7μs 287ns 1.11μs 0 0 0 32.4 KB
master EncodeArgs net472 109μs 17.8ns 66.6ns 4.92 0 0 32.5 KB
master EncodeLegacyArgs net6.0 144μs 104ns 402ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 197μs 61ns 228ns 0 0 0 2.15 KB
master EncodeLegacyArgs net472 263μs 162ns 627ns 0 0 0 2.16 KB
#7639 EncodeArgs net6.0 79.2μs 267ns 1.04μs 0 0 0 32.4 KB
#7639 EncodeArgs netcoreapp3.1 97.3μs 323ns 1.25μs 0 0 0 32.4 KB
#7639 EncodeArgs net472 110μs 26.7ns 103ns 4.93 0 0 32.51 KB
#7639 EncodeLegacyArgs net6.0 148μs 11.4ns 41.2ns 0 0 0 2.15 KB
#7639 EncodeLegacyArgs netcoreapp3.1 199μs 170ns 660ns 0 0 0 2.14 KB
#7639 EncodeLegacyArgs net472 266μs 28.4ns 110ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #7639

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 2.440 295,125.97 720,108.63

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 394μs 77.8ns 291ns 0 0 0 4.56 KB
master RunWafRealisticBenchmark netcoreapp3.1 411μs 146ns 544ns 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 431μs 64ns 248ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 285μs 115ns 414ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 295μs 63.6ns 238ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 318μs 42.9ns 160ns 0 0 0 2.29 KB
#7639 RunWafRealisticBenchmark net6.0 401μs 56.9ns 213ns 0 0 0 4.55 KB
#7639 RunWafRealisticBenchmark netcoreapp3.1 413μs 481ns 1.86μs 0 0 0 4.48 KB
#7639 RunWafRealisticBenchmark net472 432μs 56.1ns 217ns 0 0 0 4.66 KB
#7639 RunWafRealisticBenchmarkWithAttack net6.0 287μs 66.9ns 250ns 0 0 0 2.24 KB
#7639 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 698μs 9.05μs 88.7μs 0 0 0 2.22 KB
#7639 RunWafRealisticBenchmarkWithAttack net472 316μs 34.6ns 130ns 0 0 0 2.29 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 62μs 64.7ns 242ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 71.4μs 73.2ns 284ns 0 0 0 17.42 KB
master SendRequest net472 0.00377ns 0.00146ns 0.00567ns 0 0 0 0 b
#7639 SendRequest net6.0 62μs 66.9ns 259ns 0 0 0 14.52 KB
#7639 SendRequest netcoreapp3.1 72.1μs 284ns 1.21μs 0 0 0 17.42 KB
#7639 SendRequest net472 0.00955ns 0.00214ns 0.00828ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7639

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 1.304 838,040.36 1,093,212.50

More allocations ⚠️ in #7639

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 2 B 4 B 2 B 100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 2 B 3 B 1 B 50.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.91ms 484ns 1.87μs 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.1ms 8.91μs 33.3μs 0 0 0 640 KB
master OriginalCharSlice net472 2.75ms 179ns 670ns 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.34ms 371ns 1.44μs 0 0 0 2 B
master OptimizedCharSlice netcoreapp3.1 1.66ms 543ns 2.1μs 0 0 0 1 B
master OptimizedCharSlice net472 1.91ms 266ns 1.03μs 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 838μs 31ns 120ns 0 0 0 2 B
master OptimizedCharSliceWithPool netcoreapp3.1 827μs 70.4ns 254ns 0 0 0 0 b
master OptimizedCharSliceWithPool net472 1.13ms 92.6ns 346ns 0 0 0 0 b
#7639 OriginalCharSlice net6.0 1.89ms 942ns 3.52μs 0 0 0 640.01 KB
#7639 OriginalCharSlice netcoreapp3.1 2.11ms 9.05μs 35μs 0 0 0 640 KB
#7639 OriginalCharSlice net472 2.66ms 234ns 842ns 100 0 0 641.95 KB
#7639 OptimizedCharSlice net6.0 1.44ms 123ns 478ns 0 0 0 4 B
#7639 OptimizedCharSlice netcoreapp3.1 1.76ms 236ns 912ns 0 0 0 1 B
#7639 OptimizedCharSlice net472 2.03ms 265ns 1.03μs 0 0 0 0 b
#7639 OptimizedCharSliceWithPool net6.0 1.09ms 78.8ns 305ns 0 0 0 3 B
#7639 OptimizedCharSliceWithPool netcoreapp3.1 809μs 56ns 217ns 0 0 0 0 b
#7639 OptimizedCharSliceWithPool net472 1.14ms 112ns 434ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7639

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.82 KB 42.37 KB 551 B 1.32%

Fewer allocations 🎉 in #7639

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 56.53 KB 56.22 KB -307 B -0.54%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 687μs 3.88μs 26.6μs 0 0 0 41.82 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 730μs 4.07μs 25.8μs 0 0 0 42.25 KB
master WriteAndFlushEnrichedTraces net472 859μs 4.68μs 26.9μs 8.33 0 0 56.53 KB
#7639 WriteAndFlushEnrichedTraces net6.0 758μs 823ns 2.97μs 0 0 0 42.37 KB
#7639 WriteAndFlushEnrichedTraces netcoreapp3.1 737μs 3.65μs 17.1μs 0 0 0 42.43 KB
#7639 WriteAndFlushEnrichedTraces net472 902μs 4.34μs 16.8μs 8.33 0 0 56.22 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.87μs 9.9ns 51.4ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.65μs 11.1ns 42.9ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.98μs 15.6ns 77.8ns 0.145 0.0145 0 987 B
#7639 ExecuteNonQuery net6.0 1.9μs 1.79ns 6.94ns 0 0 0 1.02 KB
#7639 ExecuteNonQuery netcoreapp3.1 2.69μs 6.62ns 24.8ns 0 0 0 1.02 KB
#7639 ExecuteNonQuery net472 2.94μs 6.54ns 25.3ns 0.148 0.0148 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.79μs 8.9ns 38.8ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.22μs 10.5ns 42ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.61μs 2.85ns 10.6ns 0.162 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.84μs 7.87ns 30.5ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.41μs 11.8ns 48.7ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.6μs 2.84ns 10.6ns 0.162 0 0 1.1 KB
#7639 CallElasticsearch net6.0 1.68μs 1.05ns 4.08ns 0 0 0 1.03 KB
#7639 CallElasticsearch netcoreapp3.1 2.23μs 10.4ns 38.8ns 0 0 0 1.03 KB
#7639 CallElasticsearch net472 3.57μs 3.6ns 14ns 0.16 0 0 1.04 KB
#7639 CallElasticsearchAsync net6.0 1.85μs 0.878ns 3.4ns 0 0 0 1.01 KB
#7639 CallElasticsearchAsync netcoreapp3.1 2.34μs 4.87ns 17.6ns 0 0 0 1.08 KB
#7639 CallElasticsearchAsync net472 3.67μs 3.53ns 13.7ns 0.162 0 0 1.1 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.85μs 0.483ns 1.81ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.38μs 8.69ns 30.1ns 0 0 0 952 B
master ExecuteAsync net472 2.59μs 4.08ns 15.8ns 0.143 0 0 915 B
#7639 ExecuteAsync net6.0 1.9μs 5.85ns 22.6ns 0 0 0 952 B
#7639 ExecuteAsync netcoreapp3.1 2.54μs 9ns 32.5ns 0 0 0 952 B
#7639 ExecuteAsync net472 2.53μs 1.39ns 5.39ns 0.139 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 6.91μs 24.1ns 93.3ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.82μs 15.6ns 60.5ns 0 0 0 2.9 KB
master SendAsync net472 12.2μs 8.52ns 33ns 0.488 0 0 3.18 KB
#7639 SendAsync net6.0 7.03μs 22.9ns 88.5ns 0 0 0 2.36 KB
#7639 SendAsync netcoreapp3.1 8.65μs 17.5ns 65.3ns 0 0 0 2.9 KB
#7639 SendAsync net472 12.2μs 8.01ns 30ns 0.489 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7639

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 254.75 KB 272.82 KB 18.07 KB 7.09%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 274.26 KB 277.1 KB 2.84 KB 1.04%

Fewer allocations 🎉 in #7639

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 43.78 KB 43.15 KB -624 B -1.43%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 286.72 KB 278.81 KB -7.91 KB -2.76%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 65.54 KB 57.34 KB -8.19 KB -12.50%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 49.8μs 1.09μs 10.8μs 0 0 0 43.78 KB
master StringConcatBenchmark netcoreapp3.1 50.4μs 327ns 3.03μs 0 0 0 42.76 KB
master StringConcatBenchmark net472 57.2μs 273ns 1.09μs 0 0 0 65.54 KB
master StringConcatAspectBenchmark net6.0 481μs 2.32μs 9.57μs 0 0 0 274.26 KB
master StringConcatAspectBenchmark netcoreapp3.1 499μs 2.02μs 6.98μs 0 0 0 254.75 KB
master StringConcatAspectBenchmark net472 404μs 2.18μs 11.7μs 0 0 0 286.72 KB
#7639 StringConcatBenchmark net6.0 46μs 257ns 1.74μs 0 0 0 43.15 KB
#7639 StringConcatBenchmark netcoreapp3.1 46.5μs 183ns 1.02μs 0 0 0 42.8 KB
#7639 StringConcatBenchmark net472 57.1μs 97.2ns 337ns 0 0 0 57.34 KB
#7639 StringConcatAspectBenchmark net6.0 484μs 2.16μs 11μs 0 0 0 277.1 KB
#7639 StringConcatAspectBenchmark netcoreapp3.1 530μs 2.45μs 9.15μs 0 0 0 272.82 KB
#7639 StringConcatAspectBenchmark net472 403μs 2.29μs 16.4μs 0 0 0 278.81 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.62μs 14.3ns 68.7ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.7μs 17.6ns 74.5ns 0 0 0 1.7 KB
master EnrichedLog net472 3.97μs 6.14ns 23.8ns 0.258 0 0 1.64 KB
#7639 EnrichedLog net6.0 2.65μs 13.4ns 58.4ns 0 0 0 1.7 KB
#7639 EnrichedLog netcoreapp3.1 3.59μs 16.7ns 66.8ns 0 0 0 1.7 KB
#7639 EnrichedLog net472 3.97μs 5.59ns 21.7ns 0.257 0 0 1.64 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 124μs 151ns 566ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 128μs 240ns 897ns 0 0 0 4.31 KB
master EnrichedLog net472 167μs 145ns 562ns 0 0 0 4.52 KB
#7639 EnrichedLog net6.0 123μs 154ns 555ns 0 0 0 4.31 KB
#7639 EnrichedLog netcoreapp3.1 128μs 207ns 775ns 0 0 0 4.31 KB
#7639 EnrichedLog net472 166μs 41.5ns 161ns 0 0 0 4.52 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 5.08μs 16.9ns 65.6ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.61μs 24.3ns 94ns 0 0 0 2.26 KB
master EnrichedLog net472 7.5μs 4.13ns 14.9ns 0.299 0 0 2.08 KB
#7639 EnrichedLog net6.0 5.13μs 3.78ns 14.7ns 0 0 0 2.26 KB
#7639 EnrichedLog netcoreapp3.1 6.71μs 13.6ns 52.6ns 0 0 0 2.26 KB
#7639 EnrichedLog net472 7.62μs 5.62ns 21.8ns 0.303 0 0 2.08 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 2.03μs 8.98ns 33.6ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.76μs 5.12ns 19.8ns 0 0 0 1.2 KB
master SendReceive net472 3.15μs 2.85ns 11ns 0.189 0 0 1.2 KB
#7639 SendReceive net6.0 2.03μs 2.52ns 9.76ns 0 0 0 1.2 KB
#7639 SendReceive netcoreapp3.1 2.61μs 11.1ns 43.1ns 0 0 0 1.2 KB
#7639 SendReceive net472 3.14μs 2.93ns 11.3ns 0.188 0 0 1.2 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.3μs 15.2ns 56.9ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.82μs 11.4ns 44.2ns 0 0 0 1.63 KB
master EnrichedLog net472 6.53μs 6.88ns 26.7ns 0.295 0 0 2.03 KB
#7639 EnrichedLog net6.0 4.33μs 7.13ns 26.7ns 0 0 0 1.58 KB
#7639 EnrichedLog netcoreapp3.1 5.65μs 12ns 46.3ns 0 0 0 1.63 KB
#7639 EnrichedLog net472 6.7μs 8.21ns 31.8ns 0.301 0 0 2.03 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 771ns 3.64ns 15.4ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 961ns 0.308ns 1.19ns 0 0 0 576 B
master StartFinishSpan net472 923ns 0.426ns 1.65ns 0.0879 0 0 578 B
master StartFinishScope net6.0 925ns 4.74ns 21.7ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.19μs 5.37ns 20.8ns 0 0 0 696 B
master StartFinishScope net472 1.12μs 0.661ns 2.47ns 0.101 0 0 658 B
#7639 StartFinishSpan net6.0 791ns 0.361ns 1.4ns 0 0 0 576 B
#7639 StartFinishSpan netcoreapp3.1 969ns 4.88ns 18.9ns 0 0 0 576 B
#7639 StartFinishSpan net472 963ns 2.39ns 9.26ns 0.0903 0 0 578 B
#7639 StartFinishScope net6.0 928ns 4.62ns 20.1ns 0 0 0 696 B
#7639 StartFinishScope netcoreapp3.1 1.26μs 6.52ns 29.9ns 0 0 0 696 B
#7639 StartFinishScope net472 1.12μs 0.556ns 2.15ns 0.103 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 1.07μs 5.72ns 29.7ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.42μs 5.19ns 20.1ns 0 0 0 696 B
master RunOnMethodBegin net472 1.47μs 1.27ns 4.9ns 0.103 0 0 658 B
#7639 RunOnMethodBegin net6.0 1.07μs 1.8ns 6.99ns 0 0 0 696 B
#7639 RunOnMethodBegin netcoreapp3.1 1.44μs 5.95ns 23ns 0 0 0 696 B
#7639 RunOnMethodBegin net472 1.44μs 0.923ns 3.57ns 0.101 0 0 658 B

@lucaspimentel lucaspimentel force-pushed the lpimentel/add-azure-functions-architecture-docs branch from efb9200 to 241abfd Compare October 10, 2025 21:28
@lucaspimentel lucaspimentel force-pushed the lpimentel/add-azure-functions-architecture-docs branch from 241abfd to eaf21e6 Compare October 22, 2025 17:42
@lucaspimentel lucaspimentel changed the title [Azure Functions] Add architecture deep dive documentation [Docs][Azure Functions] Add architecture deep dive documentation Oct 24, 2025
@lucaspimentel lucaspimentel changed the title [Docs][Azure Functions] Add architecture deep dive documentation [Docs] Add Azure Functions architecture deep dive documentation Oct 24, 2025
@lucaspimentel lucaspimentel force-pushed the lpimentel/add-azure-functions-architecture-docs branch from eaf21e6 to 8325ae9 Compare October 31, 2025 15:41
@lucaspimentel lucaspimentel requested a review from a team as a code owner October 31, 2025 20:25
@lucaspimentel lucaspimentel force-pushed the lpimentel/add-azure-functions-architecture-docs branch from 0f9eb5a to 9ef1991 Compare October 31, 2025 20:27
@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Oct 31, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7639) and master.

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration68.96 ± (68.91 - 69.22) ms74.02 ± (73.70 - 74.38) ms+7.3%✅⬆️
.NET Framework 4.8 - Bailout
duration72.19 ± (72.28 - 72.57) ms77.30 ± (77.14 - 77.84) ms+7.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1047.28 ± (1050.52 - 1059.02) ms1088.74 ± (1090.42 - 1100.03) ms+4.0%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms21.97 ± (21.94 - 22.00) ms22.85 ± (22.75 - 22.95) ms+4.0%✅⬆️
process.time_to_main_ms79.69 ± (79.52 - 79.86) ms86.34 ± (85.87 - 86.82) ms+8.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.87 ± (10.86 - 10.87) MB10.87 ± (10.87 - 10.87) MB+0.0%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms21.95 ± (21.93 - 21.97) ms22.44 ± (22.39 - 22.50) ms+2.2%✅⬆️
process.time_to_main_ms80.94 ± (80.74 - 81.14) ms86.31 ± (85.96 - 86.66) ms+6.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.89 - 10.90) MB10.93 ± (10.92 - 10.93) MB+0.2%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms210.86 ± (209.56 - 212.16) ms216.10 ± (214.71 - 217.49) ms+2.5%✅⬆️
process.time_to_main_ms519.36 ± (518.80 - 519.91) ms538.08 ± (537.05 - 539.12) ms+3.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.62 ± (52.60 - 52.64) MB52.58 ± (52.55 - 52.60) MB-0.1%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%
.NET 6 - Baseline
process.internal_duration_ms20.77 ± (20.74 - 20.80) ms21.25 ± (21.20 - 21.31) ms+2.3%✅⬆️
process.time_to_main_ms69.11 ± (68.95 - 69.26) ms73.06 ± (72.78 - 73.34) ms+5.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.57 ± (10.57 - 10.57) MB10.60 ± (10.59 - 10.60) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.81 ± (20.78 - 20.85) ms21.27 ± (21.22 - 21.32) ms+2.2%✅⬆️
process.time_to_main_ms70.32 ± (70.18 - 70.47) ms74.28 ± (73.97 - 74.59) ms+5.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.62 - 10.63) MB10.64 ± (10.64 - 10.64) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms201.82 ± (199.42 - 204.23) ms202.49 ± (201.17 - 203.81) ms+0.3%✅⬆️
process.time_to_main_ms488.59 ± (488.00 - 489.17) ms506.16 ± (505.14 - 507.17) ms+3.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.43 ± (51.36 - 51.51) MB51.67 ± (51.63 - 51.71) MB+0.5%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.02 ± (18.98 - 19.05) ms19.58 ± (19.52 - 19.63) ms+2.9%✅⬆️
process.time_to_main_ms68.48 ± (68.34 - 68.63) ms72.97 ± (72.67 - 73.26) ms+6.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.63 ± (7.62 - 7.64) MB7.62 ± (7.61 - 7.63) MB-0.1%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms18.97 ± (18.95 - 18.99) ms19.57 ± (19.51 - 19.63) ms+3.2%✅⬆️
process.time_to_main_ms69.35 ± (69.23 - 69.48) ms74.16 ± (73.89 - 74.44) ms+6.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.66 - 7.68) MB7.66 ± (7.66 - 7.66) MB-0.2%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms178.02 ± (177.09 - 178.95) ms188.65 ± (187.84 - 189.46) ms+6.0%✅⬆️
process.time_to_main_ms462.25 ± (461.61 - 462.88) ms484.42 ± (483.43 - 485.42) ms+4.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed38.76 ± (38.73 - 38.79) MB38.84 ± (38.81 - 38.87) MB+0.2%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.1%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration192.17 ± (192.07 - 192.69) ms192.19 ± (192.13 - 192.84) ms+0.0%✅⬆️
.NET Framework 4.8 - Bailout
duration195.56 ± (195.46 - 196.08) ms196.70 ± (196.82 - 197.79) ms+0.6%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1156.85 ± (1159.66 - 1168.27) ms1158.51 ± (1160.10 - 1168.46) ms+0.1%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms187.82 ± (187.46 - 188.17) ms187.26 ± (186.94 - 187.58) ms-0.3%
process.time_to_main_ms80.54 ± (80.37 - 80.71) ms80.66 ± (80.47 - 80.84) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.14 ± (16.11 - 16.16) MB16.05 ± (16.02 - 16.08) MB-0.5%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.4%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms186.81 ± (186.48 - 187.14) ms186.68 ± (186.42 - 186.94) ms-0.1%
process.time_to_main_ms81.89 ± (81.73 - 82.04) ms82.16 ± (81.99 - 82.33) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.16 ± (16.13 - 16.18) MB16.14 ± (16.11 - 16.17) MB-0.1%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.1%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms396.14 ± (393.84 - 398.43) ms397.13 ± (394.47 - 399.79) ms+0.3%✅⬆️
process.time_to_main_ms521.90 ± (520.88 - 522.92) ms518.81 ± (518.09 - 519.53) ms-0.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed63.20 ± (63.05 - 63.34) MB62.84 ± (62.69 - 62.99) MB-0.6%
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 29)-0.2%
.NET 6 - Baseline
process.internal_duration_ms191.32 ± (190.95 - 191.69) ms191.93 ± (191.61 - 192.24) ms+0.3%✅⬆️
process.time_to_main_ms69.47 ± (69.33 - 69.61) ms70.13 ± (69.95 - 70.31) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.33 ± (16.25 - 16.41) MB16.03 ± (15.89 - 16.17) MB-1.8%
runtime.dotnet.threads.count18 ± (18 - 19)18 ± (18 - 19)-0.7%
.NET 6 - Bailout
process.internal_duration_ms190.59 ± (190.29 - 190.90) ms190.87 ± (190.65 - 191.09) ms+0.1%✅⬆️
process.time_to_main_ms70.48 ± (70.38 - 70.58) ms70.53 ± (70.43 - 70.62) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.17 ± (16.03 - 16.32) MB15.96 ± (15.81 - 16.12) MB-1.3%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.5%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms411.81 ± (408.89 - 414.73) ms411.00 ± (408.25 - 413.76) ms-0.2%
process.time_to_main_ms488.22 ± (487.62 - 488.81) ms486.52 ± (485.94 - 487.10) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed62.38 ± (62.24 - 62.52) MB62.18 ± (62.04 - 62.32) MB-0.3%
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 30)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms190.47 ± (190.04 - 190.89) ms189.85 ± (189.53 - 190.16) ms-0.3%
process.time_to_main_ms69.51 ± (69.32 - 69.69) ms69.27 ± (69.11 - 69.44) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.70 ± (11.67 - 11.73) MB11.70 ± (11.68 - 11.72) MB-0.0%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.3%
.NET 8 - Bailout
process.internal_duration_ms189.22 ± (188.96 - 189.47) ms189.44 ± (189.15 - 189.73) ms+0.1%✅⬆️
process.time_to_main_ms70.23 ± (70.11 - 70.34) ms70.22 ± (70.12 - 70.32) ms-0.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.80 ± (11.77 - 11.83) MB11.77 ± (11.74 - 11.80) MB-0.2%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.0%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms360.11 ± (358.67 - 361.55) ms358.60 ± (357.08 - 360.11) ms-0.4%
process.time_to_main_ms465.14 ± (464.52 - 465.76) ms461.95 ± (461.35 - 462.56) ms-0.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.38 ± (50.34 - 50.42) MB50.36 ± (50.32 - 50.40) MB-0.0%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.1%✅⬆️
Comparison explanation

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

Duration charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7639) - mean (74ms)  : 69, 79
    master - mean (69ms)  : 67, 71

    section Bailout
    This PR (7639) - mean (77ms)  : 72, 83
    master - mean (72ms)  : 71, 74

    section CallTarget+Inlining+NGEN
    This PR (7639) - mean (1,095ms)  : 1026, 1165
    master - mean (1,055ms)  : 994, 1116

Loading
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 (7639) - mean (116ms)  : 108, 125
    master - mean (107ms)  : 104, 110

    section Bailout
    This PR (7639) - mean (116ms)  : crit, 109, 123
    master - mean (108ms)  : 106, 111

    section CallTarget+Inlining+NGEN
    This PR (7639) - mean (786ms)  : 756, 816
    master - mean (756ms)  : 731, 782

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7639) - mean (102ms)  : 94, 109
    master - mean (95ms)  : 93, 97

    section Bailout
    This PR (7639) - mean (102ms)  : crit, 96, 109
    master - mean (96ms)  : 94, 98

    section CallTarget+Inlining+NGEN
    This PR (7639) - mean (739ms)  : 703, 775
    master - mean (719ms)  : 684, 754

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7639) - mean (100ms)  : 96, 105
    master - mean (94ms)  : 91, 97

    section Bailout
    This PR (7639) - mean (102ms)  : crit, 96, 107
    master - mean (94ms)  : 93, 96

    section CallTarget+Inlining+NGEN
    This PR (7639) - mean (704ms)  : 673, 735
    master - mean (670ms)  : 649, 690

Loading
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 (7639) - mean (192ms)  : 189, 196
    master - mean (192ms)  : 189, 195

    section Bailout
    This PR (7639) - mean (197ms)  : 192, 202
    master - mean (196ms)  : 193, 199

    section CallTarget+Inlining+NGEN
    This PR (7639) - mean (1,164ms)  : 1104, 1225
    master - mean (1,164ms)  : 1102, 1226

Loading
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 (7639) - mean (276ms)  : 272, 281
    master - mean (277ms)  : 272, 281

    section Bailout
    This PR (7639) - mean (277ms)  : 274, 280
    master - mean (277ms)  : 273, 281

    section CallTarget+Inlining+NGEN
    This PR (7639) - mean (953ms)  : 900, 1005
    master - mean (954ms)  : 901, 1008

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7639) - mean (270ms)  : 265, 276
    master - mean (269ms)  : 264, 274

    section Bailout
    This PR (7639) - mean (269ms)  : 266, 272
    master - mean (269ms)  : 265, 273

    section CallTarget+Inlining+NGEN
    This PR (7639) - mean (928ms)  : 885, 970
    master - mean (932ms)  : 880, 985

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7639) - mean (269ms)  : 264, 274
    master - mean (270ms)  : 264, 275

    section Bailout
    This PR (7639) - mean (269ms)  : 265, 272
    master - mean (269ms)  : 266, 272

    section CallTarget+Inlining+NGEN
    This PR (7639) - mean (852ms)  : 832, 871
    master - mean (856ms)  : 837, 874

Loading

@lucaspimentel lucaspimentel changed the title [Docs] Add Azure Functions architecture deep dive documentation [Docs] Add Azure Functions architecture and API debugging documentation Oct 31, 2025
@lucaspimentel lucaspimentel changed the title [Docs] Add Azure Functions architecture and API debugging documentation [Docs] Add Azure Functions architecture docs and PowerShell debugging tools Oct 31, 2025
lucaspimentel and others added 5 commits November 5, 2025 17:24
Add comprehensive documentation covering Azure Functions Host and .NET Worker architecture:
- Host components (ScriptHost, RpcFunctionInvocationDispatcher, GrpcWorkerChannel)
- Worker components (FunctionsApplication, GrpcWorker, InvocationHandler)
- gRPC communication protocol and message types
- Middleware model and execution pipeline
- Distributed tracing integration (W3C TraceContext, Activity, OpenTelemetry)
- Environment variables and configuration
- Instrumentation hook points for dd-trace-dotnet

Update AGENTS.md and AzureFunctions.md with cross-references to new documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Add NuGet package architecture section explaining Datadog.Trace vs Datadog.AzureFunctions packages
- Document ASP.NET Core integration, HTTP proxying, and trace context propagation
- Add comprehensive troubleshooting guide for Azure Functions with log analysis workflows
- Include distributed tracing architecture explanation with host/worker process span handling
- Add new QueryingDatadogAPIs.md guide for debugging with Datadog APIs
- Update AGENTS.md with package references

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Add Get-DatadogTrace.ps1 helper script that simplifies retrieving and visualizing trace spans from the Datadog API. The script supports three output formats:
- Table: Formatted table with key span information
- Hierarchy: Tree view showing parent-child relationships
- JSON: Raw output for further processing

Also update QueryingDatadogAPIs.md documentation with:
- PowerShell script usage and examples
- Response structure details
- Shell variable substitution troubleshooting note

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Adds Get-DatadogLogs.ps1 helper script to simplify querying logs from the Datadog Logs API. The script supports multiple output formats (table, json, raw) and follows the same pattern as the existing Get-DatadogTrace.ps1 script.

Updates QueryingDatadogAPIs.md documentation with comprehensive usage examples and parameter descriptions for the new script.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@lucaspimentel lucaspimentel force-pushed the lpimentel/add-azure-functions-architecture-docs branch from 07538da to a7620db Compare November 5, 2025 22:24
Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really didn't review very much as it's all azure functions etc, but I assume you have :blindfold:. I noticed some of it to be misleading though. Overall I question the utility of AI generated docs, but meh


### Specialized Packages
- **Datadog.AzureFunctions**: Bundles `Datadog.Trace.dll` and native profiler for Azure Functions (see `docs/development/AzureFunctions.md`)
- **Datadog.Monitoring.Distribution**: MSI installer for Windows (IIS, Windows Services)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the old deprecated name, and also this is just false 😛

Suggested change
- **Datadog.Monitoring.Distribution**: MSI installer for Windows (IIS, Windows Services)
- **Datadog.Trace.Bundle**: Bundles`Datadog.Trace.dll` and native profiler for all platforms. An alternative distribution mechanism for auto instrumentation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Fixed in #7799.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope you have read and validated that all this is correct, because I have not (because I don't know)😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is meant for AI, not for human consumption. Basically a way to persist previous research made by AI so it doesn't have to repeat it each time.

- In-process
- Isolated (out of process)

## NuGet Package Architecture
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not duplicating stuff from AGENTS? Is it worth duplicating it again?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm a developer reading this doc, I would want this here, and I wouldn't read AGENTS at all.

- **Does NOT contain** auto-instrumentation code or native profiler binaries
- Used by application code for manual instrumentation (e.g., `Tracer.Instance.StartActive()`)

In Azure Functions scenarios, the worker application references `Datadog.Trace` for manual instrumentation, while `Datadog.AzureFunctions` provides the auto-instrumentation. The version of `Datadog.Trace` referenced by the application doesn't need to match `Datadog.AzureFunctions` exactly, as the auto-instrumentation comes entirely from `Datadog.Trace.dll` bundled in `Datadog.AzureFunctions`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version of Datadog.Trace referenced by the application

This seems confusing, an application just shouldn't reference Datadog.Trace directly (because it's pulled in by Datadog.AzureFunctions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworded in #7799

Isolated Azure Functions also supports an [ASP.NET Core Integration](https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide?tabs=hostbuilder%2Cwindows#aspnet-core-integration) that operates differently.
Isolated Azure Functions also supports an [ASP.NET Core Integration](https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide?tabs=hostbuilder%2Cwindows#aspnet-core-integration) that operates differently from the standard gRPC-based communication.

#### HTTP Proxying Architecture
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it's duplicating the Azure Functions architecture doc? Although this is actually readable unlike the other doc? 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Different docs for different purposes (mostly: for humans vs for AI)

This means that we basically have two separate modes of operation here as typically the context is stored in the gRPC message, but the message is empty when proxying.
1. **Request Reception**: `func.exe` receives the incoming HTTP request
2. **Capability Detection**: Host checks if worker advertised the `HttpUri` capability
3. **Minimal gRPC Message**: `GrpcMessageConversionExtensions.ToRpcHttp()` returns an **empty** or minimal gRPC message (see [GrpcMessageConversionExtensions.cs:123-125](https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.Grpc/MessageExtensions/GrpcMessageConversionExtensions.cs#L123-L125))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should use perma-links for github docs, these will go stale

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #7799

Comment on lines +169 to +183
**Example distributed trace structure**:

```
Trace ID: 68e948220000000047fef7bad8bb854e
Host spans (serialized by PID 27, tagged as "host"):
├─ aspnet_core.request (s_id: 8ec7..., p_id: null) [ROOT]
├─ azure_functions.invoke (s_id: 10c8..., p_id: 8ec7...) [Child of root]
└─ http.request (s_id: 2ac3..., p_id: 10c8...) [HTTP call to worker]
Worker spans (serialized by PID 56, tagged as "worker"):
└─ aspnet_core.request (s_id: 9ddf..., p_id: 2ac3...) [Child of host's http.request]
└─ azure_functions.invoke (s_id: 114d..., p_id: 9ddf...) [Child of worker's aspnet_core]
└─ ... (additional spans)
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to update this if/when you fix parenting

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a TODO comment in #7799

@lucaspimentel lucaspimentel merged commit eb5be1b into master Nov 10, 2025
153 checks passed
@lucaspimentel lucaspimentel deleted the lpimentel/add-azure-functions-architecture-docs branch November 10, 2025 10:55
@github-actions github-actions bot added this to the vNext-v3 milestone Nov 10, 2025
lucaspimentel added a commit that referenced this pull request Nov 10, 2025
lucaspimentel added a commit that referenced this pull request Nov 10, 2025
## Summary of changes

Small docs clean-up to resolve pending comments from #7639.

## Reason for change

Improve documentation clarity and structure.

## Implementation details

- `AGENTS.md` 🤖
  - Removed reference to old `Datadog.Monitoring.Distribution`
  - Added `Datadog.Trace.Bundle`
- `docs/development/AzureFunctions.md`
- Clarified package usage patterns for `Datadog.AzureFunctions` vs
`Datadog.Trace`
- `docs/development/for-ai/AzureFunctions-Architecture.md` 🤖
- moved to `docs/development/for-ai/` subdirectory to indicate AI
agent-focused content
- Updated cross-references to reflect new Azure Functions Architecture
doc location
- Small formatting tweaks

## Test coverage

Documentation changes only - no functional code changes.

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants