Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix alpine .NET Core 3.1 telemetry failures #6339

Merged
merged 2 commits into from
Nov 25, 2024
Merged

Conversation

andrewlock
Copy link
Member

Summary of changes

Fix the telemetry issues we saw after updating the VMs recently

Reason for change

We updated the VMs and suddenly .NET Core <=3.1 started failing on alpine when we used the "standalone telemetry agent", only when using the "curl" handler (not the socket handler).

We eventually traced it down to the fact we were setting the url to localhost, not 127.0.0.1 as we do elsewhere. Presumably an update to the underlying libcurl caused it to choose the IPv6 address, which the listener is not bound to, causing telemetry to fail

Implementation details

Test coverage

The same

Other details

Reverting the change isn't necessary obviously, but it shows that we fixed it.

@andrewlock andrewlock added the area:tests unit tests, integration tests label Nov 22, 2024
@andrewlock andrewlock requested review from a team as code owners November 22, 2024 16:48
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Nov 22, 2024

Datadog Report

Branch report: andrew/alpine-debug
Commit report: 9fc13f3
Test service: dd-trace-dotnet

✅ 0 Failed, 452139 Passed, 2715 Skipped, 19h 25m 11.41s Total Time

@andrewlock
Copy link
Member Author

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.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6339) - mean (71ms)  : 65, 77
     .   : milestone, 71,
    master - mean (71ms)  : 64, 78
     .   : milestone, 71,

    section CallTarget+Inlining+NGEN
    This PR (6339) - mean (1,109ms)  : 1089, 1128
     .   : milestone, 1109,
    master - mean (1,109ms)  : 1083, 1135
     .   : milestone, 1109,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6339) - mean (108ms)  : 106, 111
     .   : milestone, 108,
    master - mean (109ms)  : 106, 112
     .   : milestone, 109,

    section CallTarget+Inlining+NGEN
    This PR (6339) - mean (762ms)  : 750, 775
     .   : milestone, 762,
    master - mean (772ms)  : 752, 791
     .   : milestone, 772,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6339) - mean (92ms)  : 90, 94
     .   : milestone, 92,
    master - mean (92ms)  : 91, 94
     .   : milestone, 92,

    section CallTarget+Inlining+NGEN
    This PR (6339) - mean (721ms)  : 706, 736
     .   : milestone, 721,
    master - mean (726ms)  : 711, 741
     .   : milestone, 726,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6339) - mean (191ms)  : 187, 196
     .   : milestone, 191,
    master - mean (192ms)  : 186, 198
     .   : milestone, 192,

    section CallTarget+Inlining+NGEN
    This PR (6339) - mean (1,213ms)  : 1189, 1238
     .   : milestone, 1213,
    master - mean (1,214ms)  : 1192, 1237
     .   : milestone, 1214,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6339) - mean (278ms)  : 273, 282
     .   : milestone, 278,
    master - mean (278ms)  : 272, 284
     .   : milestone, 278,

    section CallTarget+Inlining+NGEN
    This PR (6339) - mean (943ms)  : 921, 965
     .   : milestone, 943,
    master - mean (949ms)  : 933, 965
     .   : milestone, 949,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6339) - mean (266ms)  : 262, 269
     .   : milestone, 266,
    master - mean (266ms)  : 262, 270
     .   : milestone, 266,

    section CallTarget+Inlining+NGEN
    This PR (6339) - mean (929ms)  : 910, 948
     .   : milestone, 929,
    master - mean (931ms)  : 914, 948
     .   : milestone, 931,

Loading

@andrewlock
Copy link
Member Author

Benchmarks Report for tracer 🐌

Benchmarks for #6339 compared to master:

  • 5 benchmarks are faster, with geometric mean 1.149
  • 2 benchmarks are slower, with geometric mean 1.137
  • 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.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 7.96μs 43.9ns 267ns 0.012 0.00398 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.1μs 52.8ns 347ns 0.0153 0.00511 0 5.8 KB
master StartStopWithChild net472 16.1μs 52.2ns 202ns 1.04 0.307 0.0995 6.21 KB
#6339 StartStopWithChild net6.0 7.71μs 40.3ns 255ns 0.0158 0.00789 0 5.61 KB
#6339 StartStopWithChild netcoreapp3.1 10.1μs 56.8ns 368ns 0.0202 0.0101 0 5.8 KB
#6339 StartStopWithChild net472 16μs 33.3ns 129ns 1.03 0.3 0.0916 6.22 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 482μs 390ns 1.41μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 656μs 368ns 1.38μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 846μs 643ns 2.49μs 0.425 0 0 3.3 KB
#6339 WriteAndFlushEnrichedTraces net6.0 509μs 152ns 570ns 0 0 0 2.7 KB
#6339 WriteAndFlushEnrichedTraces netcoreapp3.1 649μs 261ns 940ns 0 0 0 2.7 KB
#6339 WriteAndFlushEnrichedTraces net472 850μs 472ns 1.77μs 0.425 0 0 3.3 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 154μs 905ns 8.68μs 0.152 0 0 14.47 KB
master SendRequest netcoreapp3.1 173μs 1.02μs 9.81μs 0.174 0 0 17.27 KB
master SendRequest net472 0.00198ns 0.000761ns 0.00285ns 0 0 0 0 b
#6339 SendRequest net6.0 154μs 1.14μs 11.1μs 0.15 0 0 14.47 KB
#6339 SendRequest netcoreapp3.1 174μs 1.28μs 12.8μs 0.159 0 0 17.27 KB
#6339 SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 586μs 3.31μs 21.7μs 0.573 0 0 41.66 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 688μs 3.38μs 17.5μs 0.34 0 0 41.86 KB
master WriteAndFlushEnrichedTraces net472 862μs 3.26μs 12.2μs 8.08 2.55 0.425 53.29 KB
#6339 WriteAndFlushEnrichedTraces net6.0 553μs 2.42μs 9.38μs 0.571 0 0 41.54 KB
#6339 WriteAndFlushEnrichedTraces netcoreapp3.1 689μs 3.13μs 16μs 0.351 0 0 41.83 KB
#6339 WriteAndFlushEnrichedTraces net472 861μs 3.42μs 13.2μs 8.13 2.57 0.428 53.31 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.29μs 1.18ns 4.58ns 0.0142 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.75μs 1.4ns 5.44ns 0.014 0 0 1.02 KB
master ExecuteNonQuery net472 2.03μs 1.28ns 4.62ns 0.156 0.00102 0 987 B
#6339 ExecuteNonQuery net6.0 1.38μs 1.2ns 4.65ns 0.0144 0 0 1.02 KB
#6339 ExecuteNonQuery netcoreapp3.1 1.78μs 0.92ns 3.44ns 0.0132 0 0 1.02 KB
#6339 ExecuteNonQuery net472 2.08μs 2.3ns 8.91ns 0.156 0.00103 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6339

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 1.203 1,344.05 1,117.28

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.34μs 0.663ns 2.48ns 0.0135 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.65μs 0.742ns 2.78ns 0.0131 0 0 976 B
master CallElasticsearch net472 2.62μs 1.31ns 5.09ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.38μs 0.896ns 3.35ns 0.0131 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.72μs 0.655ns 2.36ns 0.0138 0 0 1.02 KB
master CallElasticsearchAsync net472 2.68μs 0.647ns 2.42ns 0.166 0 0 1.05 KB
#6339 CallElasticsearch net6.0 1.12μs 0.361ns 1.4ns 0.0135 0 0 976 B
#6339 CallElasticsearch netcoreapp3.1 1.63μs 1.47ns 5.51ns 0.013 0 0 976 B
#6339 CallElasticsearch net472 2.53μs 0.911ns 3.53ns 0.157 0 0 995 B
#6339 CallElasticsearchAsync net6.0 1.3μs 0.462ns 1.73ns 0.013 0 0 952 B
#6339 CallElasticsearchAsync netcoreapp3.1 1.57μs 1.09ns 4.06ns 0.0134 0 0 1.02 KB
#6339 CallElasticsearchAsync net472 2.61μs 2.09ns 8.09ns 0.166 0 0 1.05 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.26μs 0.543ns 2.1ns 0.0133 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.66μs 1.3ns 5.05ns 0.0124 0 0 952 B
master ExecuteAsync net472 1.84μs 0.301ns 1.13ns 0.145 0 0 915 B
#6339 ExecuteAsync net6.0 1.21μs 0.775ns 2.9ns 0.0134 0 0 952 B
#6339 ExecuteAsync netcoreapp3.1 1.5μs 0.752ns 2.81ns 0.0127 0 0 952 B
#6339 ExecuteAsync net472 1.78μs 0.614ns 2.21ns 0.145 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 4.31μs 1.21ns 4.69ns 0.0309 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.29μs 2.35ns 9.09ns 0.0372 0 0 2.85 KB
master SendAsync net472 7.39μs 1.92ns 7.43ns 0.496 0 0 3.12 KB
#6339 SendAsync net6.0 4.35μs 1.97ns 7.37ns 0.0327 0 0 2.31 KB
#6339 SendAsync netcoreapp3.1 5.3μs 2.19ns 8.47ns 0.0373 0 0 2.85 KB
#6339 SendAsync net472 7.3μs 2.77ns 10.7ns 0.493 0 0 3.12 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 1.53μs 3.18ns 12.3ns 0.023 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.16μs 1.2ns 4.49ns 0.0228 0 0 1.64 KB
master EnrichedLog net472 2.49μs 1.29ns 4.99ns 0.249 0 0 1.57 KB
#6339 EnrichedLog net6.0 1.47μs 1.18ns 4.58ns 0.0234 0 0 1.64 KB
#6339 EnrichedLog netcoreapp3.1 2.36μs 2.65ns 10.3ns 0.0223 0 0 1.64 KB
#6339 EnrichedLog net472 2.7μs 1.02ns 3.94ns 0.25 0 0 1.57 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 121μs 108ns 418ns 0 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 124μs 114ns 442ns 0.0636 0 0 4.28 KB
master EnrichedLog net472 153μs 112ns 434ns 0.686 0.229 0 4.46 KB
#6339 EnrichedLog net6.0 121μs 127ns 492ns 0.061 0 0 4.28 KB
#6339 EnrichedLog netcoreapp3.1 124μs 106ns 410ns 0 0 0 4.28 KB
#6339 EnrichedLog net472 151μs 138ns 535ns 0.676 0.225 0 4.46 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 3.09μs 1.09ns 4.21ns 0.0309 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.12μs 1.34ns 5.18ns 0.029 0 0 2.2 KB
master EnrichedLog net472 5.04μs 1.16ns 4.32ns 0.319 0 0 2.02 KB
#6339 EnrichedLog net6.0 3.05μs 1.27ns 4.92ns 0.0304 0 0 2.2 KB
#6339 EnrichedLog netcoreapp3.1 4.03μs 1.45ns 5.62ns 0.0303 0 0 2.2 KB
#6339 EnrichedLog net472 4.91μs 1.9ns 7.36ns 0.321 0 0 2.02 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 1.32μs 1.04ns 4.03ns 0.016 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.73μs 0.644ns 2.49ns 0.015 0 0 1.14 KB
master SendReceive net472 2.13μs 1.32ns 4.93ns 0.183 0 0 1.16 KB
#6339 SendReceive net6.0 1.44μs 0.602ns 2.33ns 0.0157 0 0 1.14 KB
#6339 SendReceive netcoreapp3.1 1.75μs 0.976ns 3.65ns 0.0155 0 0 1.14 KB
#6339 SendReceive net472 2.14μs 1.21ns 4.38ns 0.183 0 0 1.16 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 2.65μs 0.864ns 3.23ns 0.0225 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.88μs 1.75ns 6.55ns 0.0213 0 0 1.65 KB
master EnrichedLog net472 4.37μs 1.01ns 3.77ns 0.324 0 0 2.04 KB
#6339 EnrichedLog net6.0 2.8μs 1.03ns 3.99ns 0.0224 0 0 1.6 KB
#6339 EnrichedLog netcoreapp3.1 4μs 1.71ns 6.6ns 0.0221 0 0 1.65 KB
#6339 EnrichedLog net472 4.38μs 4.68ns 18.1ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6339

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 1.134 574.57 651.41

Faster 🎉 in #6339

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.146 629.60 549.51
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.139 545.85 479.38
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.138 450.95 396.31

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 450ns 0.727ns 2.82ns 0.00817 0 0 576 B
master StartFinishSpan netcoreapp3.1 629ns 1.04ns 4.03ns 0.0075 0 0 576 B
master StartFinishSpan net472 574ns 0.796ns 3.08ns 0.0918 0 0 578 B
master StartFinishScope net6.0 547ns 1.03ns 4ns 0.00969 0 0 696 B
master StartFinishScope netcoreapp3.1 686ns 0.962ns 3.72ns 0.00925 0 0 696 B
master StartFinishScope net472 860ns 2.17ns 8.4ns 0.105 0 0 658 B
#6339 StartFinishSpan net6.0 396ns 0.717ns 2.68ns 0.00817 0 0 576 B
#6339 StartFinishSpan netcoreapp3.1 549ns 0.941ns 3.64ns 0.0077 0 0 576 B
#6339 StartFinishSpan net472 650ns 1.67ns 6.26ns 0.0916 0 0 578 B
#6339 StartFinishScope net6.0 478ns 1.04ns 4.03ns 0.00981 0 0 696 B
#6339 StartFinishScope netcoreapp3.1 750ns 1.24ns 4.81ns 0.00925 0 0 696 B
#6339 StartFinishScope net472 900ns 1.63ns 6.3ns 0.105 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6339

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.140 577.32 658.21

Faster 🎉 in #6339

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1 1.120 956.87 854.29

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 577ns 0.762ns 2.95ns 0.00983 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 956ns 0.864ns 3.23ns 0.00933 0 0 696 B
master RunOnMethodBegin net472 1.15μs 1.43ns 5.54ns 0.104 0 0 658 B
#6339 RunOnMethodBegin net6.0 659ns 0.931ns 3.61ns 0.00967 0 0 696 B
#6339 RunOnMethodBegin netcoreapp3.1 851ns 1.52ns 5.88ns 0.00949 0 0 696 B
#6339 RunOnMethodBegin net472 1.15μs 2.11ns 8.17ns 0.104 0 0 658 B

@andrewlock andrewlock merged commit f950b87 into master Nov 25, 2024
73 of 76 checks passed
@andrewlock andrewlock deleted the andrew/alpine-debug branch November 25, 2024 11:23
@github-actions github-actions bot added this to the vNext-v3 milestone Nov 25, 2024
veerbia pushed a commit that referenced this pull request Dec 16, 2024
## Summary of changes

Fix the telemetry issues we saw after updating the VMs recently

## Reason for change

We updated the VMs and suddenly .NET Core <=3.1 started failing on
alpine when we used the "standalone telemetry agent", only when using
the "curl" handler (not the socket handler).

We eventually traced it down to the fact we were setting the url to
`localhost`, not `127.0.0.1` as we do elsewhere. Presumably an update to
the underlying libcurl caused it to choose the IPv6 address, which the
listener is not bound to, causing telemetry to fail

## Implementation details

- Reverted the change in
#6324
- `localhost` -> `127.0.0.1` in the `TelemetryHelper`

## Test coverage

The same

## Other details

Reverting the change isn't necessary obviously, but it shows that we
fixed it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tests unit tests, integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants