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

upgrade(tracer): Support & use libdatadog's library_config crate #6615

Draft
wants to merge 5 commits into
base: baptiste.foy/bump-libdatadog-15
Choose a base branch
from

Conversation

BaptisteFoy
Copy link

@BaptisteFoy BaptisteFoy commented Jan 31, 2025

Summary of changes

tbd

Reason for change

tbd

Implementation details

The core of the logic is in shared/library_config.cpp. It imports libdatadog's code to:

  • Define a library_config crate object
  • Retrieve configurations from it

Then it is called in the Native Profiler's Configuration.cpp to be applied in the profiler's Configuration object

It is also embedded in the native's tracer interop.cpp so it can be called as a new configuration layer in the managed tracer.

Test coverage

tbd

Other details

  • Base branch is [Profiler/Crashtracker] Bump libdatadog 15 #6589 but up-to-date with master; to only display changes that are relevant.
  • Windows changes aren't supported yet, but will be in another PR:
    • The library-config crate is not included in libdatadog 15.0.0 and that is an error. We'll need to fix it in another libdatadog PR.
    • There are issues importing libdatadog in Windows's Datadog.Trace altogether... I tried to follow [Profiler] Use Vcpkg download and install native dependencies (libdatadog) #6388 but as I don't have a Windows machine to test it's pretty much trial and error. For now I think I'm missing the SetupVcpkg build step.
  • There are issues around the required GLIBC version for this change. I wonder if it's my changes or the libdatadog changes; I need to investigate.

TODO:

  • Update ShouldRewriteProfilerMaps to use the library-config methods so we can load the profiler natively?
  • When released, use the newer libdatadog version
  • Fix GLIBC issues
  • Fix Windows
  • Fix MacOS

@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library_config branch 2 times, most recently from ecc176f to d01d9f6 Compare January 31, 2025 21:44
Copy link
Contributor

Snapshots difference summary

The following differences have been observed in committed snapshots. It is meant to help the reviewer.
The diff is simplistic, so please check some files anyway while we improve it.

49 occurrences of :

+        "exceptionHash": "ScrubbedValue",
+        "exceptionId": "ScrubbedValue",
+        "frameIndex": "ScrubbedValue",

1 occurrences of :

-            "value": "'3','32.38','Vins et alcools Chevalier','John',",
+            "value": "'3','32','Vins et alcools Chevalier','John',",
[...]
-            "value": "'Reims','51100','France')",
-            "source": 0
-          },
-          {
-            "value": ";\nSELECT OrderID FROM Orders ORDER BY OrderID DESC LIMIT 1;"
+            "value": "'Reims','51100','France');\nSELECT OrderID FROM Orders ORDER BY OrderID DESC LIMIT 1;"

15 occurrences of :

+      _dd.appsec.user.collection_mode: sdk

1 occurrences of :

+      appsec.events.users.login.success.usr.login: my-id,

1 occurrences of :

+      appsec.events.users.login.failure.usr.login: my-id,

14 occurrences of :

+      _dd.appsec.user.collection_mode: sdk,

6 occurrences of :

+      _dd.appsec.fp.http.header: hdr-0000000100-3626b5f8-2-da57b738,
+      _dd.appsec.fp.http.network: net-1-1000000000,
+      _dd.appsec.fp.session: ssn-<fingerprint>,

@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library_config branch from 79274ef to b8208a8 Compare January 31, 2025 21:51
@BaptisteFoy BaptisteFoy changed the base branch from gleocadie/bump-libdatadog-15 to baptiste.foy/bump-libdatadog-15 January 31, 2025 21:51
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jan 31, 2025

Datadog Report

Branch report: baptiste.foy/FA/library_config
Commit report: 6f06f3d
Test service: dd-trace-dotnet

❌ 11804 Failed (9 Known Flaky), 87209 Passed, 576 Skipped, 1h 24m 30.77s Total Time

❌ Failed Tests (11804)

This report shows up to 5 failed tests.

  • UseTracerServiceName - Datadog.Profiler.IntegrationTests.ApplicationInfo.ApplicationInfoTest - Details

    Expand for error
     Expected infos.Last() to be equal to 
     {
         Item1 = "BuggyBitsService", 
         Item2 = "BuggyBitsEnv", 
         Item3 = "BuggyBitsVersion"
     }, but found 
     {
         Item1 = "Samples.BuggyBi", 
         Item2 = "Unspecified-Environment", 
         Item3 = "Unspecified-Version"
     ...
    
  • UseTracerServiceName - Datadog.Profiler.IntegrationTests.ApplicationInfo.ApplicationInfoTest - Details

    Expand for error
     Expected infos.Last() to be equal to 
     {
         Item1 = "BuggyBitsService", 
         Item2 = "BuggyBitsEnv", 
         Item3 = "BuggyBitsVersion"
     }, but found 
     {
         Item1 = "Samples.BuggyBi", 
         Item2 = "Unspecified-Environment", 
         Item3 = "Unspecified-Version"
     ...
    
  • UseTracerServiceName - Datadog.Profiler.IntegrationTests.ApplicationInfo.ApplicationInfoTest - Details

    Expand for error
     Expected infos.Last() to be equal to 
     {
         Item1 = "BuggyBitsService", 
         Item2 = "BuggyBitsEnv", 
         Item3 = "BuggyBitsVersion"
     }, but found 
     {
         Item1 = "Samples.BuggyBi", 
         Item2 = "Unspecified-Environment", 
         Item3 = "Unspecified-Version"
     ...
    
  • UseTracerServiceName - Datadog.Profiler.IntegrationTests.ApplicationInfo.ApplicationInfoTest - Details

    Expand for error
     Expected infos.Last() to be equal to 
     {
         Item1 = "BuggyBitsService", 
         Item2 = "BuggyBitsEnv", 
         Item3 = "BuggyBitsVersion"
     }, but found 
     {
         Item1 = "Samples.BuggyBi", 
         Item2 = "Unspecified-Environment", 
         Item3 = "Unspecified-Version"
     ...
    
  • UseTracerServiceName - Datadog.Profiler.IntegrationTests.ApplicationInfo.ApplicationInfoTest - Details

    Expand for error
     Expected infos.Last() to be equal to 
     {
         Item1 = "BuggyBitsService", 
         Item2 = "BuggyBitsEnv", 
         Item3 = "BuggyBitsVersion"
     }, but found 
     {
         Item1 = "Samples.BuggyBi", 
         Item2 = "Unspecified-Environment", 
         Item3 = "Unspecified-Version"
     ...
    

@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library_config branch 7 times, most recently from db5e906 to aec533c Compare February 1, 2025 16:08
@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library_config branch 4 times, most recently from b8a07ed to a31d5ce Compare February 3, 2025 15:37
@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library_config branch from a31d5ce to 4dde6e4 Compare February 3, 2025 16:05
@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library_config branch from 2d6b37b to bc16be6 Compare February 3, 2025 16:51
@BaptisteFoy BaptisteFoy force-pushed the baptiste.foy/FA/library_config branch from bc16be6 to 6f06f3d Compare February 4, 2025 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant