Skip to content

Remove duplicate "public" APIs and Internal prefix/suffixes#7546

Merged
andrewlock merged 7 commits intomasterfrom
andrew/remove-unused-apis
Sep 23, 2025
Merged

Remove duplicate "public" APIs and Internal prefix/suffixes#7546
andrewlock merged 7 commits intomasterfrom
andrew/remove-unused-apis

Conversation

@andrewlock
Copy link
Member

Summary of changes

  • Removes APIs marked with [Public] which are no longer used
  • Remove Internal suffixes and prefixes

Reason for change

The [Public] attributes were introduced in v2 when we needed to segregate APIs customer's invoke from our own internal APIs. To work around that, we created "duplicate" APIs for many functions, and decorated the public ones with [Public]. However, in v3, we have a separate shim, so this is no longer necessary, and those public APIs are entirely unused (outside of testing).

Implementation details

  • Remove unused APIs
  • Where Internal versions of the APIs exist, rename them and update calling code
  • Left some [Public] attributes for methods that we still don't really want to call from inside Datadog.Trace
    • Will clean up this in a separate PR (e.g. rename [Public] to [TestingOnly]) to give the same usage guards but being more explicit about the purpose

Test coverage

Just removing dead code, so as long as the tests still pass, we should be good

Other details

Partly related to https://datadoghq.atlassian.net/browse/LANGPLAT-819 and the config stack, as want to avoid needing to handle unused APIs

@andrewlock andrewlock added the type:cleanup Minor code clean up label Sep 23, 2025
@datadog-official

This comment has been minimized.

@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Sep 23, 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.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7546) - mean (73ms)  : 72, 75
     .   : milestone, 73,
    master - mean (74ms)  : 72, 75
     .   : milestone, 74,

    section Baseline
    This PR (7546) - mean (69ms)  : 67, 71
     .   : milestone, 69,
    master - mean (70ms)  : 69, 72
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (7546) - mean (1,057ms)  : 1011, 1102
     .   : milestone, 1057,
    master - mean (1,065ms)  : 1006, 1124
     .   : milestone, 1065,

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

    section Baseline
    This PR (7546) - mean (108ms)  : 105, 111
     .   : milestone, 108,
    master - mean (108ms)  : 105, 111
     .   : milestone, 108,

    section CallTarget+Inlining+NGEN
    This PR (7546) - mean (752ms)  : 724, 780
     .   : milestone, 752,
    master - mean (756ms)  : 730, 783
     .   : milestone, 756,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7546) - mean (96ms)  : 95, 97
     .   : milestone, 96,
    master - mean (98ms)  : 95, 101
     .   : milestone, 98,

    section Baseline
    This PR (7546) - mean (96ms)  : 93, 99
     .   : milestone, 96,
    master - mean (97ms)  : 94, 100
     .   : milestone, 97,

    section CallTarget+Inlining+NGEN
    This PR (7546) - mean (710ms)  : 687, 732
     .   : milestone, 710,
    master - mean (720ms)  : 685, 756
     .   : milestone, 720,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7546) - mean (94ms)  : 93, 95
     .   : milestone, 94,
    master - mean (97ms)  : 94, 99
     .   : milestone, 97,

    section Baseline
    This PR (7546) - mean (94ms)  : 91, 96
     .   : milestone, 94,
    master - mean (98ms)  : 96, 100
     .   : milestone, 98,

    section CallTarget+Inlining+NGEN
    This PR (7546) - mean (664ms)  : 649, 679
     .   : milestone, 664,
    master - mean (674ms)  : 658, 691
     .   : milestone, 674,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7546) - mean (201ms)  : 196, 205
     .   : milestone, 201,
    master - mean (204ms)  : 200, 209
     .   : milestone, 204,

    section Baseline
    This PR (7546) - mean (196ms)  : 191, 201
     .   : milestone, 196,
    master - mean (201ms)  : 196, 206
     .   : milestone, 201,

    section CallTarget+Inlining+NGEN
    This PR (7546) - mean (1,179ms)  : 1115, 1243
     .   : milestone, 1179,
    master - mean (1,194ms)  : 1121, 1267
     .   : milestone, 1194,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7546) - mean (282ms)  : 278, 287
     .   : milestone, 282,
    master - mean (289ms)  : 283, 296
     .   : milestone, 289,

    section Baseline
    This PR (7546) - mean (281ms)  : 276, 286
     .   : milestone, 281,
    master - mean (289ms)  : 282, 296
     .   : milestone, 289,

    section CallTarget+Inlining+NGEN
    This PR (7546) - mean (943ms)  : 900, 986
     .   : milestone, 943,
    master - mean (961ms)  : 924, 999
     .   : milestone, 961,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7546) - mean (274ms)  : 270, 278
     .   : milestone, 274,
    master - mean (281ms)  : 276, 285
     .   : milestone, 281,

    section Baseline
    This PR (7546) - mean (274ms)  : 269, 280
     .   : milestone, 274,
    master - mean (280ms)  : 274, 286
     .   : milestone, 280,

    section CallTarget+Inlining+NGEN
    This PR (7546) - mean (932ms)  : 891, 973
     .   : milestone, 932,
    master - mean (948ms)  : 910, 987
     .   : milestone, 948,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7546) - mean (272ms)  : 267, 278
     .   : milestone, 272,
    master - mean (286ms)  : 275, 297
     .   : milestone, 286,

    section Baseline
    This PR (7546) - mean (273ms)  : 264, 283
     .   : milestone, 273,
    master - mean (283ms)  : 275, 291
     .   : milestone, 283,

    section CallTarget+Inlining+NGEN
    This PR (7546) - mean (857ms)  : 836, 878
     .   : milestone, 857,
    master - mean (882ms)  : 852, 912
     .   : milestone, 882,

Loading

@andrewlock andrewlock marked this pull request as ready for review September 23, 2025 12:10
@andrewlock andrewlock requested review from a team as code owners September 23, 2025 12:11
@andrewlock andrewlock enabled auto-merge (squash) September 23, 2025 13:59
@andrewlock andrewlock disabled auto-merge September 23, 2025 13:59
@andrewlock andrewlock force-pushed the andrew/remove-unused-apis branch from a54d3cf to f37068c Compare September 23, 2025 14:05
@andrewlock andrewlock enabled auto-merge (squash) September 23, 2025 15:41
Copy link
Collaborator

@NachoEchevarria NachoEchevarria left a comment

Choose a reason for hiding this comment

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

Thanks!

@andrewlock andrewlock merged commit c6bd674 into master Sep 23, 2025
151 of 152 checks passed
@andrewlock andrewlock deleted the andrew/remove-unused-apis branch September 23, 2025 23:15
@github-actions github-actions bot added this to the vNext-v3 milestone Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:cleanup Minor code clean up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants