Skip to content

[Profiler] Propagate git repository url and commit hash from tracer to profiler#4298

Merged
gleocadie merged 8 commits intomasterfrom
gleocadie/propagate-commit-sha-repository-url-from-tracer-to-profiler
Jun 29, 2023
Merged

[Profiler] Propagate git repository url and commit hash from tracer to profiler#4298
gleocadie merged 8 commits intomasterfrom
gleocadie/propagate-commit-sha-repository-url-from-tracer-to-profiler

Conversation

@gleocadie
Copy link
Collaborator

@gleocadie gleocadie commented Jun 21, 2023

Summary of changes

Propagate git.repository_url and git.commit.sha from the Tracer to the Profiler.

Reason for change

The goal of this PR is to allow Source Code integration on profiles and share the git metadata information between the Tracer and the Profiler (Hard things have already been done, thanks @OmerRaviv ;) let's just reuse it)

Implementation details

  • When the Tracer extracts git metadata, calls (PInvoke) the Profiler to share the information (if the feature is enabled)
  • If the feature is disabled on the Tracer side, let's just fallback on Environment variables
  • Add git.repository_url and git.commit.sha to the profile.

Test coverage

  • Add integration tests
  • Add unit tests.

Other details

@github-actions github-actions bot added the area:profiler Issues related to the continous-profiler label Jun 21, 2023
@gleocadie gleocadie force-pushed the gleocadie/propagate-commit-sha-repository-url-from-tracer-to-profiler branch from a9ee91e to b9a5b10 Compare June 21, 2023 17:06
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jun 21, 2023

Datadog Report

Branch report: gleocadie/propagate-commit-sha-repository-url-from-tracer-to-profiler
Commit report: a0a6ba4

dd-trace-dotnet: 3 Failed (0 Known Flaky), 0 New Flaky, 288867 Passed, 948 Skipped, 30m 55.48s Wall Time

❌ Failed Tests (3)

  • ShouldNotCrashWhenNullOrEmptyThreadName - Datadog.Profiler.IntegrationTests.Bugs.NullOrEmptyThreadNameCheck - Details

    Expand for error
     Assert.False() Failure
     Expected: False
     Actual:   True
    
  • CheckProfilesSentThroughNamedPipe - Datadog.Profiler.IntegrationTests.WindowsOnly.NamedPipeTestcs - Details

    Expand for error
     Found error message in the log file D:\a\1\s\profiler\build_data\TestApplication_Samples.Computer01d6105ea5_1608\net6.0\logs\DD-DotNet-Profiler-Native-Samples.Computer01-5900.log
     Expected: False
     Actual:   True
    
  • TelemetryControllerAddsAllAssembliesToCollector - Datadog.Trace.Tests.Telemetry.TelemetryControllerTests - Details

    Expand for error
     Collection was modified; enumeration operation may not execute.
    

@gleocadie gleocadie force-pushed the gleocadie/propagate-commit-sha-repository-url-from-tracer-to-profiler branch 2 times, most recently from 9984212 to 0ad989c Compare June 22, 2023 09:38
@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

@gleocadie gleocadie force-pushed the gleocadie/propagate-commit-sha-repository-url-from-tracer-to-profiler branch from 0ad989c to 9e64233 Compare June 22, 2023 14:48
@gleocadie gleocadie marked this pull request as ready for review June 22, 2023 15:37
@gleocadie gleocadie requested review from a team as code owners June 22, 2023 15:37
@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

@gleocadie gleocadie force-pushed the gleocadie/propagate-commit-sha-repository-url-from-tracer-to-profiler branch from 39392e6 to 005ec23 Compare June 26, 2023 12:40
@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

@gleocadie gleocadie force-pushed the gleocadie/propagate-commit-sha-repository-url-from-tracer-to-profiler branch from 005ec23 to a0a6ba4 Compare June 27, 2023 07:59
@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

// Avoid P/Invoke if the profiler is not ready (for obvious reason)
// but also if both repository url and commit sha are empty
if (Profiler.Instance.Status.IsProfilerReady &&
(!string.IsNullOrWhiteSpace(gitMetadata.RepositoryUrl) || !string.IsNullOrWhiteSpace(gitMetadata.CommitSha)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpicking as usual so don't mind igoring, but wouldn't gitMetadata != GitMetadata.Empty be enough? Or have a IsEmpty helper in GitMetadata to have the logic there rather than here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

✔️

{
// We failed to retrieve the runtime from native this can be because:
// - P/Invoke issue (unknown dll, unknown entrypoint...)
// - We are running in a partial trust environment
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't support partial trust anymore

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

✔️

// We failed to retrieve the runtime from native this can be because:
// - P/Invoke issue (unknown dll, unknown entrypoint...)
// - We are running in a partial trust environment
Log.Warning(ex, "Failed to set git metadata for native.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a different message could be more explicit for support teams.

Suggested change
Log.Warning(ex, "Failed to set git metadata for native.");
Log.Warning(ex, "Failed to share git metadata with Continuous Profiler.");

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point

@gleocadie gleocadie force-pushed the gleocadie/propagate-commit-sha-repository-url-from-tracer-to-profiler branch from a0a6ba4 to 4958984 Compare June 29, 2023 09:10
Copy link
Contributor

@chrisnas chrisnas left a comment

Choose a reason for hiding this comment

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

LGTM

@gleocadie gleocadie force-pushed the gleocadie/propagate-commit-sha-repository-url-from-tracer-to-profiler branch from 4958984 to 504cbc3 Compare June 29, 2023 09:55
@gleocadie gleocadie force-pushed the gleocadie/propagate-commit-sha-repository-url-from-tracer-to-profiler branch from 504cbc3 to cb6d101 Compare June 29, 2023 11:31
Copy link
Collaborator

@OmerRaviv OmerRaviv left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple of questions to make sure I understand

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jun 29, 2023

Datadog Report

Branch report: gleocadie/propagate-commit-sha-repository-url-from-tracer-to-profiler
Commit report: cb6d101

❄️ dd-trace-dotnet: 0 Failed, 3 New Flaky, 289459 Passed, 1001 Skipped, 35m 30.04s Wall Time

New Flaky Tests (3)

  • CheckGitMetataFromEnvironmentVariables - Datadog.Profiler.IntegrationTests.DebugInfo.GitMetadataTest - Last Failure

    Expand for error
     Exit code of "dotnet" should be 0 instead of 134 (= 0x86)
     Expected: True
     Actual:   False
    
  • HttpClient_SubmitsTraces - Datadog.Trace.ClrProfiler.IntegrationTests.HttpMessageHandlerTests - Last Failure

    Expand for error
     Expected exit code: 0, actual exit code: 134.
    
  • HttpClient_SubmitsTraces - Datadog.Trace.ClrProfiler.IntegrationTests.HttpMessageHandlerTests - Last Failure

    Expand for error
     Expected exit code: 0, actual exit code: 134.
    

@andrewlock
Copy link
Member

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 (4298) - mean (3,016ms)  : 2901, 3132
     .   : milestone, 3016,
    master - mean (2,979ms)  : 2899, 3058
     .   : milestone, 2979,

    section CallTarget+Inlining+NGEN
    This PR (4298) - mean (3,824ms)  : 3746, 3901
     .   : milestone, 3824,
    master - mean (3,825ms)  : 3715, 3935
     .   : milestone, 3825,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4298) - mean (3,117ms)  : 3002, 3233
     .   : milestone, 3117,
    master - mean (3,124ms)  : 3007, 3242
     .   : milestone, 3124,

    section CallTarget+Inlining+NGEN
    This PR (4298) - mean (3,642ms)  : 3567, 3718
     .   : milestone, 3642,
    master - mean (3,625ms)  : 3548, 3702
     .   : milestone, 3625,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4298) - mean (3,130ms)  : 3044, 3217
     .   : milestone, 3130,
    master - mean (3,128ms)  : 3036, 3221
     .   : milestone, 3128,

    section CallTarget+Inlining+NGEN
    This PR (4298) - mean (3,630ms)  : 3523, 3738
     .   : milestone, 3630,
    master - mean (3,613ms)  : 3523, 3704
     .   : milestone, 3613,

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

    section CallTarget+Inlining+NGEN
    This PR (4298) - mean (1,091ms)  : 1050, 1133
     .   : milestone, 1091,
    master - mean (1,082ms)  : 1047, 1118
     .   : milestone, 1082,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4298) - mean (371ms)  : 364, 377
     .   : milestone, 371,
    master - mean (371ms)  : 366, 375
     .   : milestone, 371,

    section CallTarget+Inlining+NGEN
    This PR (4298) - mean (1,161ms)  : 1131, 1192
     .   : milestone, 1161,
    master - mean (1,158ms)  : 1130, 1186
     .   : milestone, 1158,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4298) - mean (361ms)  : 354, 367
     .   : milestone, 361,
    master - mean (360ms)  : 354, 365
     .   : milestone, 360,

    section CallTarget+Inlining+NGEN
    This PR (4298) - mean (1,116ms)  : 1085, 1147
     .   : milestone, 1116,
    master - mean (1,119ms)  : 1074, 1164
     .   : milestone, 1119,

Loading

@andrewlock
Copy link
Member

Benchmarks Report 🐌

Benchmarks for #4298 compared to master:

  • 4 benchmarks are faster, with geometric mean 1.153
  • 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.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 461μs 210ns 785ns 0 0 0 2.62 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 659μs 911ns 3.53μs 0 0 0 2.63 KB
master WriteAndFlushEnrichedTraces net472 797μs 407ns 1.57μs 0.396 0 0 3.22 KB
#4298 WriteAndFlushEnrichedTraces net6.0 484μs 297ns 1.07μs 0 0 0 2.62 KB
#4298 WriteAndFlushEnrichedTraces netcoreapp3.1 648μs 468ns 1.81μs 0 0 0 2.63 KB
#4298 WriteAndFlushEnrichedTraces net472 789μs 408ns 1.53μs 0.396 0 0 3.22 KB
Benchmarks.Trace.AppSecBodyBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #4298

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑net472 1.210 174.34 144.12

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 40.1μs 114ns 441ns 0.0196 0 0 1.65 KB
master AllCycleSimpleBody netcoreapp3.1 40.7μs 143ns 554ns 0.0199 0 0 1.63 KB
master AllCycleSimpleBody net472 41.4μs 100ns 389ns 0.248 0 0 1.69 KB
master AllCycleMoreComplexBody net6.0 221μs 55.1ns 213ns 0.111 0 0 9.22 KB
master AllCycleMoreComplexBody netcoreapp3.1 229μs 334ns 1.25μs 0 0 0 9.12 KB
master AllCycleMoreComplexBody net472 238μs 114ns 442ns 1.42 0 0 9.28 KB
master ObjectExtractorSimpleBody net6.0 125ns 0.0442ns 0.165ns 0.00392 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 176ns 0.107ns 0.414ns 0.00371 0 0 272 B
master ObjectExtractorSimpleBody net472 174ns 0.089ns 0.345ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.08μs 1.35ns 5.25ns 0.0552 0 0 3.88 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 4.01μs 1.48ns 5.54ns 0.0519 0 0 3.78 KB
master ObjectExtractorMoreComplexBody net472 4.03μs 2.05ns 7.38ns 0.617 0.00611 0 3.89 KB
#4298 AllCycleSimpleBody net6.0 39.1μs 19.1ns 71.3ns 0.022 0 0 1.65 KB
#4298 AllCycleSimpleBody netcoreapp3.1 41.1μs 153ns 592ns 0.0201 0 0 1.63 KB
#4298 AllCycleSimpleBody net472 41.8μs 15.5ns 60ns 0.251 0 0 1.69 KB
#4298 AllCycleMoreComplexBody net6.0 220μs 110ns 413ns 0.11 0 0 9.22 KB
#4298 AllCycleMoreComplexBody netcoreapp3.1 228μs 217ns 842ns 0.113 0 0 9.12 KB
#4298 AllCycleMoreComplexBody net472 237μs 112ns 432ns 1.41 0 0 9.28 KB
#4298 ObjectExtractorSimpleBody net6.0 120ns 0.062ns 0.232ns 0.00395 0 0 280 B
#4298 ObjectExtractorSimpleBody netcoreapp3.1 181ns 0.281ns 1.09ns 0.00373 0 0 272 B
#4298 ObjectExtractorSimpleBody net472 144ns 0.117ns 0.453ns 0.0446 0 0 281 B
#4298 ObjectExtractorMoreComplexBody net6.0 3.05μs 0.951ns 3.56ns 0.0549 0 0 3.88 KB
#4298 ObjectExtractorMoreComplexBody netcoreapp3.1 4.1μs 1.7ns 6.57ns 0.0512 0 0 3.78 KB
#4298 ObjectExtractorMoreComplexBody net472 4.02μs 3.48ns 13.5ns 0.617 0.00604 0 3.89 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 169μs 77.4ns 290ns 0.252 0 0 18.02 KB
master SendRequest netcoreapp3.1 186μs 224ns 869ns 0.279 0 0 20.08 KB
master SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
#4298 SendRequest net6.0 168μs 102ns 383ns 0.247 0 0 18.03 KB
#4298 SendRequest netcoreapp3.1 189μs 236ns 915ns 0.189 0 0 20.09 KB
#4298 SendRequest net472 0.000958ns 0.000333ns 0.00129ns 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 510μs 278ns 962ns 0.514 0 0 41.49 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 636μs 2.2μs 8.54μs 0.316 0 0 41.8 KB
master WriteAndFlushEnrichedTraces net472 785μs 3.79μs 15.2μs 8.1 2.31 0.386 53.26 KB
#4298 WriteAndFlushEnrichedTraces net6.0 533μs 627ns 2.43μs 0.525 0 0 41.7 KB
#4298 WriteAndFlushEnrichedTraces netcoreapp3.1 623μs 1.39μs 5.37μs 0.309 0 0 41.71 KB
#4298 WriteAndFlushEnrichedTraces net472 798μs 2.65μs 10.3μs 8.36 2.39 0.398 53.22 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 822ns 0.223ns 0.836ns 0.01 0 0 720 B
master ExecuteNonQuery netcoreapp3.1 1.17μs 0.461ns 1.78ns 0.00951 0 0 720 B
master ExecuteNonQuery net472 1.46μs 1.08ns 3.88ns 0.108 0.000725 0 682 B
#4298 ExecuteNonQuery net6.0 879ns 0.34ns 1.32ns 0.0101 0 0 720 B
#4298 ExecuteNonQuery netcoreapp3.1 1.17μs 0.367ns 1.37ns 0.00942 0 0 720 B
#4298 ExecuteNonQuery net472 1.4μs 0.744ns 2.68ns 0.108 0 0 682 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 984ns 2.42ns 11.4ns 0.0131 0 0 944 B
master CallElasticsearch netcoreapp3.1 1.2μs 0.421ns 1.52ns 0.0124 0 0 944 B
master CallElasticsearch net472 2.03μs 0.441ns 1.71ns 0.151 0.00102 0 955 B
master CallElasticsearchAsync net6.0 1.09μs 0.406ns 1.46ns 0.0127 0 0 920 B
master CallElasticsearchAsync netcoreapp3.1 1.39μs 2.7ns 9.74ns 0.013 0 0 992 B
master CallElasticsearchAsync net472 2.11μs 0.485ns 1.88ns 0.161 0.00106 0 1.01 KB
#4298 CallElasticsearch net6.0 1μs 0.377ns 1.41ns 0.0132 0 0 944 B
#4298 CallElasticsearch netcoreapp3.1 1.29μs 0.527ns 2.04ns 0.0125 0 0 944 B
#4298 CallElasticsearch net472 2.03μs 0.495ns 1.85ns 0.151 0.00102 0 955 B
#4298 CallElasticsearchAsync net6.0 1.12μs 0.404ns 1.56ns 0.0129 0 0 920 B
#4298 CallElasticsearchAsync netcoreapp3.1 1.38μs 0.556ns 2ns 0.0132 0 0 992 B
#4298 CallElasticsearchAsync net472 2.15μs 0.47ns 1.82ns 0.16 0.00107 0 1.01 KB
Benchmarks.Trace.GraphQLBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #4298

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 1.149 1,215.79 1,058.55

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.22μs 0.69ns 2.67ns 0.0129 0 0 912 B
master ExecuteAsync netcoreapp3.1 1.32μs 0.73ns 2.83ns 0.0126 0 0 912 B
master ExecuteAsync net472 1.5μs 0.448ns 1.74ns 0.138 0.000748 0 875 B
#4298 ExecuteAsync net6.0 1.06μs 0.412ns 1.6ns 0.0127 0 0 912 B
#4298 ExecuteAsync netcoreapp3.1 1.33μs 0.519ns 2.01ns 0.0121 0 0 912 B
#4298 ExecuteAsync net472 1.56μs 0.656ns 2.54ns 0.139 0.00078 0 875 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 3.56μs 1.43ns 5.34ns 0.0267 0 0 1.89 KB
master SendAsync netcoreapp3.1 4.21μs 1.53ns 5.74ns 0.0318 0 0 2.42 KB
master SendAsync net472 6.89μs 2.28ns 8.85ns 0.473 0 0 2.99 KB
#4298 SendAsync net6.0 3.42μs 1.21ns 4.69ns 0.0272 0 0 1.9 KB
#4298 SendAsync netcoreapp3.1 4.22μs 2.17ns 8.41ns 0.0337 0 0 2.43 KB
#4298 SendAsync net472 6.97μs 1.74ns 6.52ns 0.474 0 0 3 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.44μs 0.841ns 3.15ns 0.0223 0 0 1.62 KB
master EnrichedLog netcoreapp3.1 1.83μs 1.04ns 3.61ns 0.022 0 0 1.62 KB
master EnrichedLog net472 2.36μs 1.43ns 5.33ns 0.244 0 0 1.54 KB
#4298 EnrichedLog net6.0 1.41μs 0.582ns 2.18ns 0.0227 0 0 1.62 KB
#4298 EnrichedLog netcoreapp3.1 1.87μs 2.3ns 8.59ns 0.0223 0 0 1.62 KB
#4298 EnrichedLog net472 2.37μs 1.2ns 4.64ns 0.244 0 0 1.54 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 112μs 102ns 395ns 0.0569 0 0 4.21 KB
master EnrichedLog netcoreapp3.1 117μs 151ns 586ns 0.0586 0 0 4.21 KB
master EnrichedLog net472 148μs 52.8ns 205ns 0.668 0.223 0 4.38 KB
#4298 EnrichedLog net6.0 111μs 78ns 292ns 0.0555 0 0 4.21 KB
#4298 EnrichedLog netcoreapp3.1 116μs 145ns 543ns 0 0 0 4.21 KB
#4298 EnrichedLog net472 146μs 82ns 296ns 0.655 0.218 0 4.38 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.17μs 1.71ns 6.61ns 0.0524 0 0 3.71 KB
master EnrichedLog netcoreapp3.1 3.96μs 2.31ns 8.64ns 0.0491 0 0 3.69 KB
master EnrichedLog net472 4.94μs 1.25ns 4.83ns 0.526 0.00247 0 3.31 KB
#4298 EnrichedLog net6.0 3.17μs 1.35ns 5.06ns 0.0514 0 0 3.71 KB
#4298 EnrichedLog netcoreapp3.1 4.03μs 1.31ns 5.09ns 0.0511 0 0 3.69 KB
#4298 EnrichedLog net472 4.75μs 1.94ns 7.52ns 0.524 0.00237 0 3.31 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.07μs 0.492ns 1.84ns 0.0156 0 0 1.11 KB
master SendReceive netcoreapp3.1 1.55μs 2.89ns 11.2ns 0.0151 0 0 1.11 KB
master SendReceive net472 1.82μs 2.58ns 10ns 0.177 0.000921 0 1.12 KB
#4298 SendReceive net6.0 1.1μs 0.251ns 0.904ns 0.0154 0 0 1.11 KB
#4298 SendReceive netcoreapp3.1 1.42μs 0.691ns 2.68ns 0.015 0 0 1.11 KB
#4298 SendReceive net472 1.83μs 0.645ns 2.41ns 0.177 0.00092 0 1.12 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.5μs 0.75ns 2.81ns 0.0213 0 0 1.53 KB
master EnrichedLog netcoreapp3.1 3.46μs 1.86ns 7.2ns 0.0209 0 0 1.58 KB
master EnrichedLog net472 3.94μs 0.764ns 2.75ns 0.31 0 0 1.96 KB
#4298 EnrichedLog net6.0 2.57μs 0.593ns 2.22ns 0.0205 0 0 1.53 KB
#4298 EnrichedLog netcoreapp3.1 3.59μs 2.12ns 7.91ns 0.0211 0 0 1.58 KB
#4298 EnrichedLog net472 4.09μs 0.41ns 1.48ns 0.31 0 0 1.96 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #4298

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.142 599.60 524.91
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 1.113 693.41 622.78

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 395ns 0.165ns 0.617ns 0.00746 0 0 536 B
master StartFinishSpan netcoreapp3.1 614ns 0.187ns 0.701ns 0.00738 0 0 536 B
master StartFinishSpan net472 694ns 0.24ns 0.93ns 0.0851 0 0 538 B
master StartFinishScope net6.0 600ns 0.109ns 0.394ns 0.0093 0 0 656 B
master StartFinishScope netcoreapp3.1 712ns 0.215ns 0.832ns 0.00883 0 0 656 B
master StartFinishScope net472 878ns 0.322ns 1.16ns 0.0979 0 0 618 B
#4298 StartFinishSpan net6.0 414ns 0.161ns 0.602ns 0.00743 0 0 536 B
#4298 StartFinishSpan netcoreapp3.1 595ns 0.171ns 0.64ns 0.00731 0 0 536 B
#4298 StartFinishSpan net472 623ns 0.151ns 0.586ns 0.0853 0 0 538 B
#4298 StartFinishScope net6.0 525ns 0.137ns 0.512ns 0.0092 0 0 656 B
#4298 StartFinishScope netcoreapp3.1 642ns 0.249ns 0.933ns 0.0087 0 0 656 B
#4298 StartFinishScope net472 810ns 0.4ns 1.55ns 0.0978 0 0 618 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 590ns 0.272ns 1.02ns 0.00909 0 0 656 B
master RunOnMethodBegin netcoreapp3.1 777ns 0.405ns 1.51ns 0.00891 0 0 656 B
master RunOnMethodBegin net472 1.04μs 0.322ns 1.25ns 0.0981 0 0 618 B
#4298 RunOnMethodBegin net6.0 590ns 0.197ns 0.763ns 0.00908 0 0 656 B
#4298 RunOnMethodBegin netcoreapp3.1 834ns 0.274ns 1.03ns 0.00877 0 0 656 B
#4298 RunOnMethodBegin net472 1.03μs 0.331ns 1.28ns 0.098 0 0 618 B

@andrewlock
Copy link
Member

Throughput/Crank Report:zap:

Throughput results for AspNetCoreSimpleController comparing the following branches/commits:

Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red.

Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards!

gantt
    title Throughput Linux x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4298) (11.199M)   : 0, 11198731
    master (11.017M)   : 0, 11016654
    benchmarks/2.32.0 (11.375M)   : 0, 11374525
    benchmarks/2.9.0 (11.341M)   : 0, 11341295

    section Automatic
    This PR (4298) (7.774M)   : 0, 7773675
    master (7.621M)   : 0, 7621492
    benchmarks/2.32.0 (8.070M)   : 0, 8070318
    benchmarks/2.9.0 (8.239M)   : 0, 8238542

    section Trace stats
    master (7.643M)   : 0, 7643117
    benchmarks/2.32.0 (8.090M)   : 0, 8090308

    section Manual
    This PR (4298) (9.829M)   : 0, 9829268
    master (9.782M)   : 0, 9782109
    benchmarks/2.32.0 (10.358M)   : 0, 10357559

    section Manual + Automatic
    This PR (4298) (7.499M)   : 0, 7499017
    master (7.344M)   : 0, 7344232
    benchmarks/2.32.0 (7.698M)   : 0, 7697947

    section Version Conflict
    master (6.653M)   : 0, 6653386
    benchmarks/2.32.0 (6.996M)   : 0, 6995640

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4298) (9.770M)   : 0, 9770050
    master (9.669M)   : 0, 9668526
    benchmarks/2.32.0 (9.619M)   : 0, 9619353
    benchmarks/2.9.0 (9.777M)   : 0, 9776936

    section Automatic
    This PR (4298) (6.599M)   : 0, 6598536
    master (6.835M)   : 0, 6835085
    benchmarks/2.32.0 (6.682M)   : 0, 6681889

    section Trace stats
    master (6.712M)   : 0, 6711977
    benchmarks/2.32.0 (6.899M)   : 0, 6899182

    section Manual
    This PR (4298) (8.387M)   : 0, 8387129
    master (8.526M)   : 0, 8526372
    benchmarks/2.32.0 (8.545M)   : 0, 8545110

    section Manual + Automatic
    This PR (4298) (6.550M)   : 0, 6550499
    master (6.598M)   : 0, 6597929
    benchmarks/2.32.0 (6.707M)   : 0, 6707147

    section Version Conflict
    master (5.940M)   : 0, 5939705
    benchmarks/2.32.0 (6.004M)   : 0, 6004290

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4298) (10.373M)   : 0, 10372565
    master (10.297M)   : 0, 10296718
    benchmarks/2.32.0 (10.272M)   : 0, 10272136
    benchmarks/2.9.0 (10.452M)   : 0, 10452114

    section Automatic
    This PR (4298) (7.573M)   : 0, 7572519
    master (7.529M)   : 0, 7529388
    benchmarks/2.32.0 (7.559M)   : 0, 7559361
    benchmarks/2.9.0 (7.750M)   : 0, 7750048

    section Trace stats
    master (7.716M)   : 0, 7716414
    benchmarks/2.32.0 (7.562M)   : 0, 7562409

    section Manual
    This PR (4298) (9.458M)   : 0, 9458430
    master (9.401M)   : 0, 9400759
    benchmarks/2.32.0 (9.530M)   : 0, 9530406

    section Manual + Automatic
    This PR (4298) (7.301M)   : 0, 7300645
    master (7.301M)   : 0, 7300876
    benchmarks/2.32.0 (7.279M)   : 0, 7279188

    section Version Conflict
    master (6.660M)   : 0, 6659624
    benchmarks/2.32.0 (6.827M)   : 0, 6827118

Loading
gantt
    title Throughput Linux x64 (ASM) (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4298) (7.599M)   : 0, 7599086
    master (7.456M)   : 0, 7455528
    benchmarks/2.32.0 (7.327M)   : 0, 7327005
    benchmarks/2.9.0 (7.837M)   : 0, 7836892

    section No attack
    This PR (4298) (2.174M)   : 0, 2174199
    master (2.139M)   : 0, 2138919
    benchmarks/2.32.0 (2.076M)   : 0, 2076414
    benchmarks/2.9.0 (3.189M)   : 0, 3188753

    section Attack
    This PR (4298) (1.867M)   : 0, 1867015
    master (1.838M)   : 0, 1838462
    benchmarks/2.32.0 (1.786M)   : 0, 1786036
    benchmarks/2.9.0 (2.578M)   : 0, 2577942

    section Blocking
    This PR (4298) (3.721M)   : 0, 3721357
    master (3.704M)   : 0, 3703718
    benchmarks/2.32.0 (3.490M)   : 0, 3490178

Loading

@gleocadie gleocadie merged commit 22b804b into master Jun 29, 2023
@gleocadie gleocadie deleted the gleocadie/propagate-commit-sha-repository-url-from-tracer-to-profiler branch June 29, 2023 18:36
@github-actions github-actions bot added this to the vNext milestone Jun 29, 2023
vandonr added a commit that referenced this pull request Jan 7, 2026
## Summary of changes

Write [process
tags](https://docs.google.com/document/d/1AFdLUuVk70i0bJd5335-RxqsvwAV9ovAqcO2z5mEMbA)
to profiles

## Reason for change

[OLDAIDM-701]
[AIDM-195]

## Implementation details

Most of the C++ code is AI generated, fed with PR #4298 

## Test coverage

## Other details
<!-- Fixes #{issue} -->


<!--  ⚠️ Note:

Where possible, please obtain 2 approvals prior to merging. Unless
CODEOWNERS specifies otherwise, for external teams it is typically best
to have one review from a team member, and one review from apm-dotnet.
Trivial changes do not require 2 reviews.

MergeQueue is NOT enabled in this repository. If you have write access
to the repo, the PR has 1-2 approvals (see above), and all of the
required checks have passed, you can use the Squash and Merge button to
merge the PR. If you don't have write access, or you need help, reach
out in the #apm-dotnet channel in Slack.
-->


[OLDAIDM-701]:
https://datadoghq.atlassian.net/browse/OLDAIDM-701?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[AIDM-195]:
https://datadoghq.atlassian.net/browse/AIDM-195?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:profiler Issues related to the continous-profiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants