Skip to content

Conversation

@lucaspimentel
Copy link
Member

@lucaspimentel lucaspimentel commented Sep 30, 2025

Summary of changes

Exclude environment variables named *API_KEY* in SampleHelpers.GetDatadogEnvironmentVariables().

Reason for change

Prevent logging API keys in test outputs.

Implementation details

  • In GetDatadogEnvironmentVariables(), filter out any environment variable whose key contains "API_KEY" (case-insensitive)

Bonus changes:

  • Changed the return type from IEnumerable<T> to List<T> since we already materialize the list (potential tiny perf improvement when iterating)
  • Removed unnecessary ToUpperInvariant() call on the key and replaced StartsWith() with a case-insensitive comparison

Test coverage

None, it's a helper method used in tests.

Other details

@lucaspimentel lucaspimentel added the area:tests unit tests, integration tests label Sep 30, 2025
@lucaspimentel lucaspimentel changed the title exclude api keys in test logs exclude api keys from test logs Sep 30, 2025
@lucaspimentel lucaspimentel marked this pull request as ready for review September 30, 2025 18:52
@lucaspimentel lucaspimentel requested a review from a team as a code owner September 30, 2025 18:52
@lucaspimentel lucaspimentel changed the title exclude api keys from test logs exclude api keys from sample app logs Sep 30, 2025
@lucaspimentel lucaspimentel enabled auto-merge (squash) September 30, 2025 20:21
@dd-trace-dotnet-ci-bot
Copy link

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 (7592) - mean (72ms)  : 71, 73
     .   : milestone, 72,
    master - mean (72ms)  : 70, 73
     .   : milestone, 72,

    section Baseline
    This PR (7592) - mean (68ms)  : 66, 71
     .   : milestone, 68,
    master - mean (68ms)  : 67, 70
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (7592) - mean (1,051ms)  : 997, 1104
     .   : milestone, 1051,
    master - mean (1,051ms)  : 995, 1106
     .   : milestone, 1051,

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

    section Baseline
    This PR (7592) - mean (106ms)  : 103, 109
     .   : milestone, 106,
    master - mean (106ms)  : 104, 109
     .   : milestone, 106,

    section CallTarget+Inlining+NGEN
    This PR (7592) - mean (744ms)  : 719, 769
     .   : milestone, 744,
    master - mean (745ms)  : 728, 763
     .   : milestone, 745,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7592) - mean (101ms)  : 100, 102
     .   : milestone, 101,
    master - mean (101ms)  : 99, 102
     .   : milestone, 101,

    section Baseline
    This PR (7592) - mean (100ms)  : 98, 102
     .   : milestone, 100,
    master - mean (100ms)  : 98, 102
     .   : milestone, 100,

    section CallTarget+Inlining+NGEN
    This PR (7592) - mean (776ms)  : 731, 821
     .   : milestone, 776,
    master - mean (771ms)  : 716, 826
     .   : milestone, 771,

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

    section Baseline
    This PR (7592) - mean (92ms)  : 90, 94
     .   : milestone, 92,
    master - mean (92ms)  : 90, 94
     .   : milestone, 92,

    section CallTarget+Inlining+NGEN
    This PR (7592) - mean (661ms)  : 645, 676
     .   : milestone, 661,
    master - mean (663ms)  : 651, 675
     .   : milestone, 663,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7592) - mean (210ms)  : 200, 221
     .   : milestone, 210,
    master - mean (207ms)  : 197, 218
     .   : milestone, 207,

    section Baseline
    This PR (7592) - mean (206ms)  : 196, 216
     .   : milestone, 206,
    master - mean (204ms)  : 192, 216
     .   : milestone, 204,

    section CallTarget+Inlining+NGEN
    This PR (7592) - mean (1,208ms)  : 1142, 1274
     .   : milestone, 1208,
    master - mean (1,215ms)  : 1146, 1284
     .   : milestone, 1215,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7592) - mean (290ms)  : 280, 299
     .   : milestone, 290,
    master - mean (296ms)  : 280, 311
     .   : milestone, 296,

    section Baseline
    This PR (7592) - mean (290ms)  : 279, 301
     .   : milestone, 290,
    master - mean (292ms)  : 276, 309
     .   : milestone, 292,

    section CallTarget+Inlining+NGEN
    This PR (7592) - mean (967ms)  : 925, 1009
     .   : milestone, 967,
    master - mean (983ms)  : 936, 1030
     .   : milestone, 983,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7592) - mean (294ms)  : 284, 304
     .   : milestone, 294,
    master - mean (297ms)  : 284, 310
     .   : milestone, 297,

    section Baseline
    This PR (7592) - mean (294ms)  : 284, 304
     .   : milestone, 294,
    master - mean (298ms)  : 282, 314
     .   : milestone, 298,

    section CallTarget+Inlining+NGEN
    This PR (7592) - mean (1,019ms)  : 958, 1080
     .   : milestone, 1019,
    master - mean (1,041ms)  : 977, 1105
     .   : milestone, 1041,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7592) - mean (283ms)  : 271, 294
     .   : milestone, 283,
    master - mean (287ms)  : 272, 302
     .   : milestone, 287,

    section Baseline
    This PR (7592) - mean (281ms)  : 272, 290
     .   : milestone, 281,
    master - mean (289ms)  : 274, 305
     .   : milestone, 289,

    section CallTarget+Inlining+NGEN
    This PR (7592) - mean (893ms)  : 830, 955
     .   : milestone, 893,
    master - mean (917ms)  : 829, 1005
     .   : milestone, 917,

Loading

@lucaspimentel lucaspimentel merged commit ef0229c into master Sep 30, 2025
84 of 149 checks passed
@lucaspimentel lucaspimentel deleted the lpimentel/exclude-api-key-from-test-logs branch September 30, 2025 21:28
@github-actions github-actions bot added this to the vNext-v3 milestone Sep 30, 2025
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.

4 participants