Skip to content

Support UDS and Named Pipes for Live Debugger#3125

Merged
shurivich merged 13 commits into
masterfrom
shurivich/support_uds
Aug 31, 2022
Merged

Support UDS and Named Pipes for Live Debugger#3125
shurivich merged 13 commits into
masterfrom
shurivich/support_uds

Conversation

@shurivich

Copy link
Copy Markdown
Contributor

Summary of changes

Support UDS and Named Pipes for Live Debugger

@shurivich shurivich self-assigned this Aug 25, 2022
@shurivich
shurivich requested review from a team as code owners August 25, 2022 10:51
@andrewlock

This comment has been minimized.

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good so far, just a couple minor things + the IApiRequestFactory comments we have discussed offline

Comment thread tracer/src/Datadog.Trace/ClrProfiler/Instrumentation.cs Outdated
Comment thread tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/Debugger/ProbesTests.cs Outdated
@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

Comment thread tracer/src/Datadog.Trace/Debugger/Sink/AgentBatchUploadApi.cs

@OmerRaviv OmerRaviv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

@shurivich
shurivich force-pushed the shurivich/support_uds branch from 99f4b84 to fdfa509 Compare August 29, 2022 11:40
@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

Comment thread tracer/src/Datadog.Trace/Agent/DiscoveryService/DiscoveryService.cs
Comment thread tracer/src/Datadog.Trace/Agent/DiscoveryService/DiscoveryService.cs Outdated
Comment thread tracer/src/Datadog.Trace/Agent/DiscoveryService/DiscoveryService.cs Outdated
Comment thread tracer/src/Datadog.Trace/Agent/DiscoveryService/DiscoveryService.cs Outdated
Comment thread tracer/src/Datadog.Trace/Debugger/LiveDebuggerFactory.cs Outdated
Comment thread tracer/src/Datadog.Trace/HttpOverStreams/DefaultJsonHeaderHelper.cs Outdated
@andrewlock

Copy link
Copy Markdown
Member

Benchmarks Report 🐌

Benchmarks for #3125 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.264
  • All benchmarks have the same 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.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net472 744μs 559ns 2.17μs 0.365 0 0 3.18 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 458μs 132ns 457ns 0 0 0 2.58 KB
#3125 WriteAndFlushEnrichedTraces net472 708μs 285ns 1.07μs 0.357 0 0 3.18 KB
#3125 WriteAndFlushEnrichedTraces netcoreapp3.1 475μs 383ns 1.38μs 0 0 0 2.58 KB
Benchmarks.Trace.AppSecBodyBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #3125

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.AppSecBodyBenchmark.AllCycleSimpleBody‑net472 1.264 241.10 190.70

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net472 242ns 1.14ns 4.55ns 0.0676 0 0 425 B
master AllCycleSimpleBody netcoreapp3.1 243ns 0.71ns 2.75ns 0.00577 0 0 424 B
master AllCycleMoreComplexBody net472 190ns 0.677ns 2.62ns 0.0637 0 0 401 B
master AllCycleMoreComplexBody netcoreapp3.1 239ns 0.684ns 2.65ns 0.00553 0 0 400 B
master BodyExtractorSimpleBody net472 268ns 0.886ns 3.19ns 0.0573 0 0 361 B
master BodyExtractorSimpleBody netcoreapp3.1 229ns 0.921ns 3.57ns 0.00365 0 0 272 B
master BodyExtractorMoreComplexBody net472 15μs 69ns 267ns 1.21 0.0219 0 7.62 KB
master BodyExtractorMoreComplexBody netcoreapp3.1 12.7μs 41.3ns 160ns 0.0901 0 0 6.75 KB
#3125 AllCycleSimpleBody net472 191ns 0.661ns 2.56ns 0.0676 0 0 425 B
#3125 AllCycleSimpleBody netcoreapp3.1 241ns 0.552ns 2.14ns 0.00566 0 0 424 B
#3125 AllCycleMoreComplexBody net472 192ns 0.898ns 3.48ns 0.0637 0 0 401 B
#3125 AllCycleMoreComplexBody netcoreapp3.1 238ns 0.45ns 1.74ns 0.00546 0 0 400 B
#3125 BodyExtractorSimpleBody net472 273ns 0.885ns 3.43ns 0.0573 0 0 361 B
#3125 BodyExtractorSimpleBody netcoreapp3.1 229ns 0.476ns 1.84ns 0.00366 0 0 272 B
#3125 BodyExtractorMoreComplexBody net472 14.9μs 49.7ns 193ns 1.21 0.015 0 7.62 KB
#3125 BodyExtractorMoreComplexBody netcoreapp3.1 12.6μs 35.2ns 136ns 0.088 0 0 6.75 KB
Benchmarks.Trace.AspNetCoreBenchmark - Unknown 🤷 Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
master SendRequest netcoreapp3.1 179μs 118ns 456ns 0.268 0 0 20.57 KB
#3125 SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
#3125 SendRequest netcoreapp3.1 184μs 164ns 614ns 0.184 0 0 20.57 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 net472 1.97μs 1.21ns 4.69ns 0.15 0.000982 0 947 B
master ExecuteNonQuery netcoreapp3.1 1.44μs 0.932ns 3.61ns 0.0122 0 0 936 B
#3125 ExecuteNonQuery net472 1.87μs 0.781ns 2.92ns 0.15 0.000941 0 947 B
#3125 ExecuteNonQuery netcoreapp3.1 1.38μs 0.364ns 1.31ns 0.0125 0 0 936 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 net472 2.5μs 0.895ns 3.35ns 0.183 0 0 1.16 KB
master CallElasticsearch netcoreapp3.1 1.61μs 0.471ns 1.76ns 0.0146 0 0 1.1 KB
master CallElasticsearchAsync net472 2.62μs 0.924ns 3.46ns 0.204 0 0 1.29 KB
master CallElasticsearchAsync netcoreapp3.1 1.63μs 0.965ns 3.74ns 0.0164 0 0 1.22 KB
#3125 CallElasticsearch net472 2.54μs 0.586ns 2.27ns 0.182 0 0 1.16 KB
#3125 CallElasticsearch netcoreapp3.1 1.56μs 0.636ns 2.46ns 0.0149 0 0 1.1 KB
#3125 CallElasticsearchAsync net472 2.72μs 0.913ns 3.54ns 0.205 0 0 1.29 KB
#3125 CallElasticsearchAsync netcoreapp3.1 1.64μs 0.864ns 3.23ns 0.0164 0 0 1.22 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 net472 2.66μs 6.53ns 25.3ns 0.224 0 0 1.41 KB
master ExecuteAsync netcoreapp3.1 1.66μs 3.6ns 14ns 0.0184 0 0 1.34 KB
#3125 ExecuteAsync net472 2.69μs 6.51ns 24.4ns 0.224 0 0 1.41 KB
#3125 ExecuteAsync netcoreapp3.1 1.7μs 3.72ns 14.4ns 0.018 0 0 1.34 KB
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net472 5.66μs 7.35ns 27.5ns 0.439 0 0 2.77 KB
master SendAsync netcoreapp3.1 3.65μs 5.89ns 22.8ns 0.035 0 0 2.6 KB
#3125 SendAsync net472 5.65μs 9.95ns 38.5ns 0.439 0 0 2.77 KB
#3125 SendAsync netcoreapp3.1 3.58μs 5.86ns 21.9ns 0.0344 0 0 2.6 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 net472 3.23μs 1.43ns 5.33ns 0.288 0 0 1.81 KB
master EnrichedLog netcoreapp3.1 2.59μs 2.26ns 8.46ns 0.0246 0 0 1.85 KB
#3125 EnrichedLog net472 3.17μs 3.47ns 13.4ns 0.287 0 0 1.81 KB
#3125 EnrichedLog netcoreapp3.1 2.58μs 2.03ns 7.61ns 0.0252 0 0 1.85 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 net472 153μs 104ns 405ns 0.688 0.229 0 4.65 KB
master EnrichedLog netcoreapp3.1 118μs 167ns 647ns 0.0587 0 0 4.49 KB
#3125 EnrichedLog net472 153μs 92ns 344ns 0.688 0.229 0 4.65 KB
#3125 EnrichedLog netcoreapp3.1 116μs 310ns 1.2μs 0.0591 0 0 4.49 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 net472 5.5μs 7.99ns 29.9ns 0.568 0.00277 0 3.59 KB
master EnrichedLog netcoreapp3.1 4.54μs 8.47ns 32.8ns 0.0535 0 0 3.91 KB
#3125 EnrichedLog net472 5.47μs 12.7ns 49.1ns 0.568 0.00273 0 3.59 KB
#3125 EnrichedLog netcoreapp3.1 4.5μs 10.1ns 39.2ns 0.0524 0 0 3.91 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 net472 2.28μs 2.59ns 10ns 0.218 0 0 1.37 KB
master SendReceive netcoreapp3.1 1.82μs 1.38ns 5.34ns 0.0174 0 0 1.32 KB
#3125 SendReceive net472 2.34μs 2.52ns 9.74ns 0.218 0 0 1.37 KB
#3125 SendReceive netcoreapp3.1 1.82μs 2.9ns 10.8ns 0.018 0 0 1.32 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 net472 4.91μs 1.41ns 5.26ns 0.352 0 0 2.23 KB
master EnrichedLog netcoreapp3.1 4.45μs 2.88ns 9.96ns 0.0224 0 0 1.8 KB
#3125 EnrichedLog net472 5.03μs 1.82ns 6.55ns 0.353 0 0 2.23 KB
#3125 EnrichedLog netcoreapp3.1 4.3μs 0.834ns 3.23ns 0.0238 0 0 1.8 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 net472 1.17μs 0.232ns 0.869ns 0.128 0 0 810 B
master StartFinishSpan netcoreapp3.1 918ns 0.566ns 2.12ns 0.0101 0 0 760 B
master StartFinishScope net472 1.42μs 0.412ns 1.59ns 0.141 0 0 891 B
master StartFinishScope netcoreapp3.1 1.11μs 0.563ns 2.1ns 0.0122 0 0 880 B
#3125 StartFinishSpan net472 1.15μs 0.168ns 0.652ns 0.128 0 0 810 B
#3125 StartFinishSpan netcoreapp3.1 929ns 0.263ns 0.984ns 0.0102 0 0 760 B
#3125 StartFinishScope net472 1.46μs 0.459ns 1.72ns 0.141 0 0 891 B
#3125 StartFinishScope netcoreapp3.1 1.1μs 0.736ns 2.85ns 0.0117 0 0 880 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 net472 1.55μs 0.776ns 2.8ns 0.142 0 0 891 B
master RunOnMethodBegin netcoreapp3.1 1.26μs 0.376ns 1.46ns 0.0113 0 0 880 B
#3125 RunOnMethodBegin net472 1.56μs 0.333ns 1.29ns 0.141 0 0 891 B
#3125 RunOnMethodBegin netcoreapp3.1 1.18μs 0.469ns 1.76ns 0.0118 0 0 880 B

@andrewlock

Copy link
Copy Markdown
Member

Code Coverage Report 📊

✔️ Merging #3125 into master will not change line coverage
✔️ Merging #3125 into master will not change branch coverage
⛔ Merging #3125 into master will will increase complexity by 69

master #3125 Change
Lines 17339 / 23659 17397 / 23771
Lines % 73% 73% 0% ✔️
Branches 10283 / 14578 10307 / 14621
Branches % 71% 70% 0% ✔️
Complexity 15715 15784 69

View the full report for further details:

Datadog.Trace Breakdown ✔️

master #3125 Change
Lines % 73% 73% 0% ✔️
Branches % 71% 70% 0% ✔️
Complexity 15715 15784 69

The following classes have significant coverage changes.

File Line coverage change Branch coverage change Complexity change
Datadog.Trace.Debugger.DebuggerTransportStrategy -100% 0% ✔️ 0 ✔️
Datadog.Trace.Ci.GitInfo -17% -11% 0 ✔️
Datadog.Trace.Debugger.Sink.AgentBatchUploadApi -6% -8% -6 ✔️
Datadog.Trace.Ci.CIVisibility 5% ✔️ 6% ✔️ 0 ✔️
Datadog.Trace.Agent.Transports.SocketHandlerRequestFactory 7% ✔️ 0% ✔️ 0 ✔️
Datadog.Trace.ContinuousProfiler.ContextTracker 7% ✔️ 8% ✔️ 12
Datadog.Trace.Agent.Transports.HttpStreamRequestFactory 12% ✔️ 0% ✔️ 0 ✔️
Datadog.Trace.Agent.DiscoveryService.DiscoveryService 14% ✔️ 0% ✔️ 0 ✔️

The following classes were added in #3125:

File Line coverage Branch coverage Complexity
Datadog.Trace.DataStreamsMonitoring.VarEncodingHelper 99% 100% 65
Datadog.Trace.HttpOverStreams.MinimalAgentHeaderHelper 80% 100% 3

1 classes were removed from Datadog.Trace in #3125

View the full reports for further details:

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work 👍

@shurivich
shurivich merged commit 98d4104 into master Aug 31, 2022
@shurivich
shurivich deleted the shurivich/support_uds branch August 31, 2022 14:37
@github-actions github-actions Bot added this to the vNext milestone Aug 31, 2022
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.

4 participants