Skip to content

Download and Copy libdatadog binaries for Data-Pipeline integration #6777

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

Merged
merged 10 commits into from
Mar 25, 2025

Conversation

gleocadie
Copy link
Collaborator

@gleocadie gleocadie commented Mar 19, 2025

Summary of changes

Copy libdatadog shared libraries when building the tracer.

Reason for change

Tracer (managed) will need the libdatadog shared library (for config and data-pipeline). Follow libddwaf and add nuke targets to download (if not done) and copy the shared library.

Implementation details

Test coverage

  • Modify FindLibDatadog.cmake to add support for OSX and a known name for download directory
  • Add nuke targets to download and copy the library where it's needed.
  • Add an initial class for libdatadog interop
  • Modify native tracer to rewrite the PInvoke maps for libdatadog managed classes.

Other details

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Mar 19, 2025

Datadog Report

All test runs 80f0570 🔗

2 Total Test Services: 0 Failed, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Test Service View
dd-trace-dotnet 0 0 0 259628 4091 36h 7m 1.43s Link
exploration_tests 0 0 0 22085 3 1h 29m 31.7s Link

@andrewlock
Copy link
Member

andrewlock commented Mar 19, 2025

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 (6777) - mean (69ms)  : 67, 71
     .   : milestone, 69,
    master - mean (69ms)  : 67, 72
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6777) - mean (1,005ms)  : 981, 1029
     .   : milestone, 1005,
    master - mean (1,006ms)  : 985, 1026
     .   : milestone, 1006,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6777) - mean (102ms)  : 100, 104
     .   : milestone, 102,
    master - mean (103ms)  : 101, 105
     .   : milestone, 103,

    section CallTarget+Inlining+NGEN
    This PR (6777) - mean (692ms)  : 674, 711
     .   : milestone, 692,
    master - mean (687ms)  : 667, 708
     .   : milestone, 687,

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

    section CallTarget+Inlining+NGEN
    This PR (6777) - mean (644ms)  : 625, 663
     .   : milestone, 644,
    master - mean (645ms)  : 626, 664
     .   : milestone, 645,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6777) - mean (190ms)  : 187, 194
     .   : milestone, 190,
    master - mean (191ms)  : 184, 197
     .   : milestone, 191,

    section CallTarget+Inlining+NGEN
    This PR (6777) - mean (1,104ms)  : 1074, 1133
     .   : milestone, 1104,
    master - mean (1,110ms)  : 1079, 1141
     .   : milestone, 1110,

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

    section CallTarget+Inlining+NGEN
    This PR (6777) - mean (872ms)  : 844, 900
     .   : milestone, 872,
    master - mean (872ms)  : 847, 898
     .   : milestone, 872,

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

    section CallTarget+Inlining+NGEN
    This PR (6777) - mean (858ms)  : 822, 895
     .   : milestone, 858,
    master - mean (858ms)  : 824, 892
     .   : milestone, 858,

Loading

@gleocadie gleocadie force-pushed the gleocadie/data-pipeline-integration-initial-work branch 7 times, most recently from e7f3713 to 64a4df7 Compare March 19, 2025 20:40
@andrewlock
Copy link
Member

andrewlock commented Mar 19, 2025

Benchmarks Report for tracer 🐌

Benchmarks for #6777 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.125
  • 1 benchmarks are slower, with geometric mean 1.135
  • 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 44.7ns 313ns 0.0202 0.00809 0 5.62 KB
master StartStopWithChild netcoreapp3.1 10.1μs 55.5ns 356ns 0.024 0.0144 0.00479 5.8 KB
master StartStopWithChild net472 16.2μs 56.4ns 219ns 1.04 0.299 0.0968 6.21 KB
#6777 StartStopWithChild net6.0 7.78μs 43.2ns 276ns 0.0148 0.00739 0 5.61 KB
#6777 StartStopWithChild netcoreapp3.1 10.1μs 55.7ns 334ns 0.0151 0.00503 0 5.8 KB
#6777 StartStopWithChild net472 16.3μs 55.7ns 216ns 1.06 0.322 0.0991 6.21 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 499μs 260ns 937ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 649μs 400ns 1.55μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 843μs 573ns 2.22μs 0.419 0 0 3.3 KB
#6777 WriteAndFlushEnrichedTraces net6.0 495μs 1.04μs 3.76μs 0 0 0 2.7 KB
#6777 WriteAndFlushEnrichedTraces netcoreapp3.1 646μs 281ns 1.05μs 0 0 0 2.7 KB
#6777 WriteAndFlushEnrichedTraces net472 857μs 700ns 2.62μs 0.428 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 130μs 578ns 2.24μs 0.198 0 0 14.47 KB
master SendRequest netcoreapp3.1 150μs 234ns 907ns 0.223 0 0 17.27 KB
master SendRequest net472 0.000986ns 0.000254ns 0.000949ns 0 0 0 0 b
#6777 SendRequest net6.0 132μs 401ns 1.55μs 0.198 0 0 14.47 KB
#6777 SendRequest netcoreapp3.1 147μs 189ns 732ns 0.218 0 0 17.27 KB
#6777 SendRequest net472 0.000221ns 0.000136ns 0.000509ns 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 570μs 2.74μs 11μs 0.568 0 0 41.68 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 680μs 3.77μs 24.7μs 0.347 0 0 41.62 KB
master WriteAndFlushEnrichedTraces net472 851μs 4.17μs 17.7μs 8.22 2.47 0.411 53.32 KB
#6777 WriteAndFlushEnrichedTraces net6.0 589μs 3.28μs 28.2μs 0.355 0 0 41.7 KB
#6777 WriteAndFlushEnrichedTraces netcoreapp3.1 691μs 3.75μs 21.9μs 0.351 0 0 41.79 KB
#6777 WriteAndFlushEnrichedTraces net472 856μs 4.27μs 19.1μs 8.36 2.64 0.44 53.3 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.43μs 1.54ns 5.95ns 0.0142 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.77μs 2.3ns 8.91ns 0.0133 0 0 1.02 KB
master ExecuteNonQuery net472 2.1μs 1.62ns 5.85ns 0.156 0.00107 0 987 B
#6777 ExecuteNonQuery net6.0 1.4μs 1.23ns 4.76ns 0.0146 0 0 1.02 KB
#6777 ExecuteNonQuery netcoreapp3.1 1.8μs 1.38ns 5.17ns 0.0135 0 0 1.02 KB
#6777 ExecuteNonQuery net472 2.06μs 2.74ns 10.6ns 0.156 0.00103 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6777

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net6.0 1.126 1,395.38 1,239.58
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 1.124 1,254.01 1,115.23

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.25μs 0.455ns 1.76ns 0.0138 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.58μs 4.69ns 18.2ns 0.0134 0 0 976 B
master CallElasticsearch net472 2.73μs 1.3ns 4.87ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.4μs 0.516ns 2ns 0.0133 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.62μs 1.27ns 4.58ns 0.0139 0 0 1.02 KB
master CallElasticsearchAsync net472 2.68μs 1.27ns 4.92ns 0.167 0 0 1.05 KB
#6777 CallElasticsearch net6.0 1.12μs 0.702ns 2.62ns 0.0134 0 0 976 B
#6777 CallElasticsearch netcoreapp3.1 1.65μs 0.531ns 1.99ns 0.0133 0 0 976 B
#6777 CallElasticsearch net472 2.66μs 1.33ns 4.79ns 0.158 0 0 995 B
#6777 CallElasticsearchAsync net6.0 1.24μs 0.465ns 1.74ns 0.0131 0 0 952 B
#6777 CallElasticsearchAsync netcoreapp3.1 1.68μs 0.787ns 2.95ns 0.0143 0 0 1.02 KB
#6777 CallElasticsearchAsync net472 2.74μs 1.57ns 6.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.35μs 1.29ns 4.83ns 0.0134 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.67μs 0.933ns 3.36ns 0.0125 0 0 952 B
master ExecuteAsync net472 1.76μs 0.378ns 1.31ns 0.145 0 0 915 B
#6777 ExecuteAsync net6.0 1.29μs 0.575ns 2.15ns 0.0137 0 0 952 B
#6777 ExecuteAsync netcoreapp3.1 1.57μs 1.02ns 3.82ns 0.0127 0 0 952 B
#6777 ExecuteAsync net472 1.79μs 0.401ns 1.55ns 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.41μs 1.19ns 4.6ns 0.033 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.34μs 2.59ns 10ns 0.0376 0 0 2.85 KB
master SendAsync net472 7.51μs 1.99ns 7.45ns 0.495 0 0 3.12 KB
#6777 SendAsync net6.0 4.35μs 1.96ns 7.07ns 0.0327 0 0 2.31 KB
#6777 SendAsync netcoreapp3.1 5.25μs 2.2ns 8.24ns 0.0393 0 0 2.85 KB
#6777 SendAsync net472 7.4μs 1.23ns 4.6ns 0.492 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.62μs 1.11ns 4.16ns 0.0233 0 0 1.69 KB
master EnrichedLog netcoreapp3.1 2.34μs 0.923ns 3.33ns 0.0223 0 0 1.69 KB
master EnrichedLog net472 2.67μs 1.21ns 4.52ns 0.258 0 0 1.62 KB
#6777 EnrichedLog net6.0 1.51μs 6.64ns 25.7ns 0.024 0 0 1.69 KB
#6777 EnrichedLog netcoreapp3.1 2.28μs 0.901ns 3.49ns 0.0228 0 0 1.69 KB
#6777 EnrichedLog net472 2.7μs 1.52ns 5.68ns 0.257 0 0 1.62 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 111μs 164ns 636ns 0 0 0 4.3 KB
master EnrichedLog netcoreapp3.1 118μs 267ns 1.04μs 0 0 0 4.3 KB
master EnrichedLog net472 151μs 135ns 523ns 0.679 0.226 0 4.49 KB
#6777 EnrichedLog net6.0 113μs 90.6ns 351ns 0.0566 0 0 4.3 KB
#6777 EnrichedLog netcoreapp3.1 117μs 156ns 606ns 0.0581 0 0 4.3 KB
#6777 EnrichedLog net472 150μs 116ns 435ns 0.671 0.224 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 net6.0 3.07μs 1.06ns 3.67ns 0.0318 0 0 2.25 KB
master EnrichedLog netcoreapp3.1 4.19μs 3.78ns 14.6ns 0.0293 0 0 2.25 KB
master EnrichedLog net472 4.94μs 2.56ns 9.93ns 0.328 0 0 2.07 KB
#6777 EnrichedLog net6.0 3.25μs 4.35ns 16.8ns 0.0311 0 0 2.25 KB
#6777 EnrichedLog netcoreapp3.1 4.25μs 1.43ns 5.36ns 0.0296 0 0 2.25 KB
#6777 EnrichedLog net472 4.88μs 2.09ns 8.1ns 0.329 0 0 2.07 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.34μs 1.76ns 6.84ns 0.0161 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.79μs 0.716ns 2.77ns 0.0151 0 0 1.14 KB
master SendReceive net472 2.08μs 1.31ns 4.88ns 0.184 0 0 1.16 KB
#6777 SendReceive net6.0 1.37μs 0.568ns 2.2ns 0.0159 0 0 1.14 KB
#6777 SendReceive netcoreapp3.1 1.79μs 0.791ns 3.07ns 0.0152 0 0 1.14 KB
#6777 SendReceive net472 2.13μs 0.809ns 3.03ns 0.184 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.67μs 0.706ns 2.64ns 0.0226 0 0 1.62 KB
master EnrichedLog netcoreapp3.1 3.96μs 1.49ns 5.75ns 0.0218 0 0 1.67 KB
master EnrichedLog net472 4.37μs 5.01ns 19.4ns 0.328 0 0 2.07 KB
#6777 EnrichedLog net6.0 2.78μs 0.99ns 3.84ns 0.0223 0 0 1.62 KB
#6777 EnrichedLog netcoreapp3.1 4.06μs 6.44ns 24.9ns 0.0223 0 0 1.67 KB
#6777 EnrichedLog net472 4.49μs 2.2ns 8.24ns 0.326 0 0 2.07 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6777

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.135 493.87 560.57

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 429ns 0.18ns 0.673ns 0.00814 0 0 576 B
master StartFinishSpan netcoreapp3.1 554ns 0.301ns 1.17ns 0.0078 0 0 576 B
master StartFinishSpan net472 642ns 0.2ns 0.748ns 0.0917 0 0 578 B
master StartFinishScope net6.0 494ns 0.122ns 0.473ns 0.00981 0 0 696 B
master StartFinishScope netcoreapp3.1 718ns 0.573ns 2.22ns 0.00921 0 0 696 B
master StartFinishScope net472 815ns 0.307ns 1.19ns 0.105 0 0 658 B
#6777 StartFinishSpan net6.0 446ns 0.0655ns 0.245ns 0.00812 0 0 576 B
#6777 StartFinishSpan netcoreapp3.1 570ns 0.231ns 0.866ns 0.00781 0 0 576 B
#6777 StartFinishSpan net472 624ns 0.129ns 0.484ns 0.0917 0 0 578 B
#6777 StartFinishScope net6.0 561ns 0.162ns 0.629ns 0.00973 0 0 696 B
#6777 StartFinishScope netcoreapp3.1 742ns 0.397ns 1.54ns 0.00939 0 0 696 B
#6777 StartFinishScope net472 859ns 1.54ns 5.95ns 0.104 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 619ns 1.84ns 7.12ns 0.00988 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 956ns 0.501ns 1.94ns 0.0092 0 0 696 B
master RunOnMethodBegin net472 1.1μs 0.272ns 0.98ns 0.104 0 0 658 B
#6777 RunOnMethodBegin net6.0 648ns 0.319ns 1.24ns 0.00978 0 0 696 B
#6777 RunOnMethodBegin netcoreapp3.1 920ns 0.326ns 1.17ns 0.00937 0 0 696 B
#6777 RunOnMethodBegin net472 1.04μs 0.318ns 1.23ns 0.104 0 0 658 B

@gleocadie gleocadie marked this pull request as ready for review March 20, 2025 08:55
@gleocadie gleocadie requested review from a team as code owners March 20, 2025 08:55
@gleocadie gleocadie force-pushed the gleocadie/data-pipeline-integration-initial-work branch 2 times, most recently from 7760cf2 to c99f536 Compare March 20, 2025 12:57
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.

Thanks! I'm so happy you did this so I didn't have to 🙈

if (CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
if (DEFINED ENV{IsAlpine} AND "$ENV{IsAlpine}" MATCHES "true")
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
Copy link
Member

Choose a reason for hiding this comment

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

Have you tested this on mac?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no but before merging, I plan to ask someone with a mac

// So just reuse it.

}
else if (IsWin)
Copy link
Member

Choose a reason for hiding this comment

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

It looks like this branch always executes, regardless if it's already downloaded. Is that the case? Does it need to?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤔 in that case, I rely on vcpkg to download it only once (using timestamp).

Comment on lines +224 to +225
.DependsOn(DownloadLibDatadog)
.DependsOn(CopyLibDatadog)
Copy link
Member

Choose a reason for hiding this comment

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

This raises an interesting question actually - should we enable the trace exporter in the AWS Lambda artifacts 🤔 My gut feeling is no, at least initially, as they're very sensitive to size. It's also possible that the lambda layer would strip out this file anyway!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will follow you gut on that

Copy link
Contributor

Choose a reason for hiding this comment

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

The plan was to cover AWS Lambda as well, Lambda layer I think allows 250MB and specially these are all AL2 instances - we should be good.

My other question related to this, do we test on AL2 instances in our CI?

Copy link
Member

Choose a reason for hiding this comment

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

(this PR is merged already, but commenting here for visiblity)

should we enable the trace exporter in the AWS Lambda artifacts? My gut feeling is no, at least initially, as they're very sensitive to size. It's also possible that the lambda layer would strip out this file anyway!

Yup, we are already stripping it out (DataDog/dd-trace-dotnet-aws-lambda-layer#10), so including this in the Lambda artifacts is useless at the moment.

Comment on lines +19 to +20
// [DllImport(DllName, EntryPoint = "ddog_trace_exporter_new")]
// internal static extern ErrorHandle Create(out IntPtr outHandle, SafeHandle config);
Copy link
Member

Choose a reason for hiding this comment

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

I assume these are intentionally comment out, as they'll be used shortly by the trace exporter pipeline?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

exactly

Copy link
Contributor

@ganeshnj ganeshnj left a comment

Choose a reason for hiding this comment

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

Thanks @gleocadie for making this change.

foreach (var arch in new[] { MSBuildTargetPlatform.x64, MSBuildTargetPlatform.x86 })
{
// This big line is the same generated by VS when installing libdatadog while building the profiler
vcpkg($"install --x-wait-for-lock --triplet \"{arch}-windows\" --vcpkg-root \"{vcpkgRoot}\" \"--x-manifest-root={RootDirectory}\" \"--x-install-root={BuildArtifactsDirectory}\\deps\\vcpkg\\{arch}-windows\" --downloads-root {BuildArtifactsDirectory}\\obj\\vcpkg\\downloads --x-packages-root {BuildArtifactsDirectory}\\obj\\vcpkg\\packages --x-buildtrees-root {BuildArtifactsDirectory}\\obj\\vcpkg/buildtrees --clean-after-build");
Copy link
Contributor

Choose a reason for hiding this comment

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

glad we have you :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, I wanted a place more centralized (sharing it with the profiler so we avoid duplicating things and stuff) but nop
😢

internal static extern void ReleaseError(IntPtr error);

[DllImport(DllName, EntryPoint = "ddog_trace_exporter_free")]
internal static extern void Release(IntPtr handle);
Copy link
Contributor

Choose a reason for hiding this comment

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

we can probably add a dummy test in Datadog.Trace.Tests, which calls with some ptr. It will fail but we can make sure library is loaded on all platforms and right entry point is invoked.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was to see if the native part was able to rewrite it.
The tests should be added when you add data-pipeline and/or config support

Copy link
Contributor

Choose a reason for hiding this comment

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

After rewrite, were you able to call any of the methods?

I want to this on my end as well - just to see library integration is perfect and we can focus on calling the methods.


internal class NativeInterop
{
private const string DllName = "LibDatadog";
Copy link
Contributor

Choose a reason for hiding this comment

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

/question

shouldn't this be name of file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in this case, it can be whatever you want: here I use libdatadog for documentation.
Since it will be rewritten by the native side, it does not matter.

@gleocadie gleocadie force-pushed the gleocadie/data-pipeline-integration-initial-work branch from f21dac9 to 80f0570 Compare March 25, 2025 13:06
@gleocadie gleocadie merged commit b75fab2 into master Mar 25, 2025
137 of 141 checks passed
@gleocadie gleocadie deleted the gleocadie/data-pipeline-integration-initial-work branch March 25, 2025 15:42
@github-actions github-actions bot added this to the vNext-v3 milestone Mar 25, 2025
@NachoEchevarria NachoEchevarria added the area:builds project files, build scripts, pipelines, versioning, releases, packages label Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:builds project files, build scripts, pipelines, versioning, releases, packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants