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

Add DSM support for AWS SNS #6253

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Add DSM support for AWS SNS #6253

wants to merge 8 commits into from

Conversation

vandonr
Copy link
Contributor

@vandonr vandonr commented Nov 7, 2024

Summary of changes

  • sending an SNS message will set a checkpoint for DSM
  • the pathway hash determined on checkpoint will be injected in the message

Reason for change

Implementation details

Test coverage

Added integration test similar to the one we have for SQS

Other details

JIRA: AIDM-414

Copy link
Contributor

github-actions bot commented Nov 7, 2024

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.

1 occurrences of :

+    Name: sns.request,
+    Resource: SNS.PublishBatch,
+    Service: Samples.AWS.SimpleNotificationService-aws-sns,
+    Type: http,
+    ParentId: Id_2,
+    Tags: {
+      aws.agent: dotnet-aws-sdk,
+      aws.operation: PublishBatch,
+      aws.requestId: Guid_3,
+      aws.service: SNS,
+      aws.topic.arn: arn:aws:sns:us-east-1:000000000000:MyTopic,
+      aws.topic.name: MyTopic,
+      aws_service: SNS,
+      component: aws-sdk,
+      env: integration_tests,
+      http.method: POST,
+      http.status_code: 200,
+      http.url: http://localhost:00000/,
+      language: dotnet,
+      runtime-id: Guid_1,
+      span.kind: client,
+      topicname: MyTopic,
+      _dd.base_service: Samples.AWS.SimpleNotificationService
+    },
+    Metrics: {
+      _dd.top_level: 1.0
+    }
+  },
+  {
+    TraceId: Id_1,
+    SpanId: Id_6,

1 occurrences of :

+    Name: aws.sns.send,
+    Resource: SNS.PublishBatch,
+    Service: Samples.AWS.SimpleNotificationService,
+    Type: http,
+    ParentId: Id_2,
+    Tags: {
+      aws.agent: dotnet-aws-sdk,
+      aws.operation: PublishBatch,
+      aws.requestId: Guid_3,
+      aws.service: SNS,
+      aws.topic.arn: arn:aws:sns:us-east-1:000000000000:MyTopic,
+      aws.topic.name: MyTopic,
+      aws_service: SNS,
+      component: aws-sdk,
+      env: integration_tests,
+      http.method: POST,
+      http.status_code: 200,
+      http.url: http://localhost:00000/,
+      language: dotnet,
+      peer.service: MyTopic,
+      span.kind: producer,
+      topicname: MyTopic,
+      _dd.peer.service.source: topicname
+    }
+  },
+  {
+    TraceId: Id_1,
+    SpanId: Id_6,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

noticed that the SNS example was missing from the slnf, so I decided to do a pass and add all missing projects.

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Nov 7, 2024

Datadog Report

Branch report: vandonr/dsm
Commit report: 131faa6
Test service: dd-trace-dotnet

❌ 1 Failed (0 Known Flaky), 447094 Passed, 2710 Skipped, 18h 29m 59.4s Total Time

❌ Failed Tests (1)

  • WorkingWithContinuousProfiler - Datadog.Trace.Tools.dd_dotnet.ArtifactTests.Checks.ProcessBasicChecksTests - Details

    Expand for error
     
     
     With StandardOutput:
     Running checks on process 5384 Process name: Samples.Console  ---- STARTING TRACER SETUP CHECKS ----- Target process is running with .NET Framework 1. Checking Modules Needed so the Tracer Loads:  [SUCCESS]: The native library version 3.6.0.0 is loaded into the process.  [WARNING]: Found multiple instances of Datadog.Trace.dll in the target process. Detected versions: 3.6.0.0  2. Checking DD_DOTNET_TRACER_HOME and related configuration value:  [SUCCESS]: DD_DOTNET_TRACER_HOME is set to 'D:\a\1\s\shared\bin\monitoring-home' and the directory was found correctly. 3. Checking COR_PROFILER_PATH and related configuration value:  [SUCCESS]: The environment variable COR_PROFILER_PATH is set to the correct value of D:\a\1\s\shared\bin\monitoring-home\win-x64\Datadog.Trace.ClrProfiler.Native.dll . 4. Checking COR_PROFILER and related configuration value:  [SUCCESS]: The environment variable COR_PROFILER is set to the correct value of {846F5F1C-F9AE-4B07-969E-05C26BC060D8}. 5. Checking COR_ENABLE_PROFILING and related configuration value:  [SUCCESS]: The environment variable COR_ENABLE_PROFILING is set to the correct value of 1.  ---- CONFIGURATION CHECKS ----- 1. Checking if tracing is disabled using DD_TRACE_ENABLED.  [INFO]: DD_TRACE_ENABLED is not set, the default value is true. 2. Checking if profiling is enabled using DD_PROFILING_ENABLED.  [SUCCESS]: DD_PROFILING_ENABLED is set.  ---- DATADOG AGENT CHECKS ----- Detected agent url: http://127.0.0.1:55517/. Note: this url may be incorrect if you configured the application through a configuration file. Connecting to Agent at endpoint http://127.0.0.1:55517/ using HTTP  [WARNING]: Could not detect the agent version. It may be running with a version older than 7.27.0.  [SUCCESS]: No issue found with the target process. 
     With ErrorOutput:
     
     With ExitCode:
     0acer version 3.6.0.0 is loaded into the process."}.
    

@andrewlock
Copy link
Member

andrewlock commented Nov 7, 2024

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 (6253) - mean (73ms)  : 63, 82
     .   : milestone, 73,
    master - mean (72ms)  : 64, 79
     .   : milestone, 72,

    section CallTarget+Inlining+NGEN
    This PR (6253) - mean (1,111ms)  : 1094, 1128
     .   : milestone, 1111,
    master - mean (1,110ms)  : 1096, 1125
     .   : milestone, 1110,

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

    section CallTarget+Inlining+NGEN
    This PR (6253) - mean (773ms)  : 760, 787
     .   : milestone, 773,
    master - mean (775ms)  : 757, 793
     .   : milestone, 775,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6253) - mean (93ms)  : 89, 96
     .   : milestone, 93,
    master - mean (93ms)  : 88, 97
     .   : milestone, 93,

    section CallTarget+Inlining+NGEN
    This PR (6253) - mean (721ms)  : 707, 736
     .   : milestone, 721,
    master - mean (724ms)  : 711, 736
     .   : milestone, 724,

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

    section CallTarget+Inlining+NGEN
    This PR (6253) - mean (1,230ms)  : 1206, 1253
     .   : milestone, 1230,
    master - mean (1,231ms)  : 1206, 1255
     .   : milestone, 1231,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6253) - mean (276ms)  : 270, 282
     .   : milestone, 276,
    master - mean (276ms)  : 272, 279
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (6253) - mean (949ms)  : 931, 967
     .   : milestone, 949,
    master - mean (948ms)  : 927, 968
     .   : milestone, 948,

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

    section CallTarget+Inlining+NGEN
    This PR (6253) - mean (925ms)  : 905, 944
     .   : milestone, 925,
    master - mean (926ms)  : 909, 943
     .   : milestone, 926,

Loading

@andrewlock
Copy link
Member

andrewlock commented Nov 7, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #6253 compared to master:

  • 3 benchmarks are faster, with geometric mean 1.186
  • 1 benchmarks are slower, with geometric mean 1.125
  • 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.99μs 44.6ns 306ns 0.0124 0.00413 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10μs 55.7ns 348ns 0.0193 0.00964 0 5.8 KB
master StartStopWithChild net472 16.3μs 51.8ns 200ns 1.04 0.303 0.0984 6.21 KB
#6253 StartStopWithChild net6.0 7.88μs 44.9ns 339ns 0.0158 0.00788 0 5.61 KB
#6253 StartStopWithChild netcoreapp3.1 10.1μs 54.5ns 288ns 0.0209 0.0105 0 5.8 KB
#6253 StartStopWithChild net472 16.4μs 69.3ns 269ns 1.06 0.335 0.0898 6.2 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 489μs 468ns 1.75μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 639μs 255ns 986ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 839μs 500ns 1.93μs 0.419 0 0 3.3 KB
#6253 WriteAndFlushEnrichedTraces net6.0 490μs 199ns 771ns 0 0 0 2.7 KB
#6253 WriteAndFlushEnrichedTraces netcoreapp3.1 641μs 400ns 1.55μs 0 0 0 2.7 KB
#6253 WriteAndFlushEnrichedTraces net472 844μs 478ns 1.79μs 0.419 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 203μs 1.18μs 9.8μs 0.194 0 0 18.73 KB
master SendRequest netcoreapp3.1 226μs 1.3μs 10.3μs 0.216 0 0 20.89 KB
master SendRequest net472 0.00038ns 0.000225ns 0.000841ns 0 0 0 0 b
#6253 SendRequest net6.0 218μs 1.47μs 14.7μs 0.209 0 0 18.73 KB
#6253 SendRequest netcoreapp3.1 235μs 1.58μs 15.6μs 0.222 0 0 20.89 KB
#6253 SendRequest net472 0.00301ns 0.00103ns 0.004ns 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 561μs 1.87μs 7μs 0.546 0 0 41.56 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 693μs 3.51μs 16.1μs 0.342 0 0 41.78 KB
master WriteAndFlushEnrichedTraces net472 870μs 2.7μs 10.5μs 8.08 2.55 0.425 53.35 KB
#6253 WriteAndFlushEnrichedTraces net6.0 569μs 2.79μs 13.1μs 0.579 0 0 41.63 KB
#6253 WriteAndFlushEnrichedTraces netcoreapp3.1 713μs 4.1μs 30.9μs 0.359 0 0 41.72 KB
#6253 WriteAndFlushEnrichedTraces net472 873μs 4.37μs 19μs 8.5 2.55 0.425 53.33 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.38μs 1.33ns 4.78ns 0.0144 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.72μs 1.45ns 5.44ns 0.0134 0 0 1.02 KB
master ExecuteNonQuery net472 2.11μs 1.52ns 5.68ns 0.156 0.00105 0 987 B
#6253 ExecuteNonQuery net6.0 1.28μs 1.3ns 5.05ns 0.0141 0 0 1.02 KB
#6253 ExecuteNonQuery netcoreapp3.1 1.73μs 1.78ns 6.88ns 0.0139 0 0 1.02 KB
#6253 ExecuteNonQuery net472 2.12μs 2.09ns 8.11ns 0.157 0.00107 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6253

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net6.0 1.184 1,440.72 1,216.89

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.37μs 1.93ns 7.48ns 0.0136 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.51μs 0.541ns 1.95ns 0.0129 0 0 976 B
master CallElasticsearch net472 2.51μs 1.83ns 7.11ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.44μs 0.643ns 2.49ns 0.0131 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.65μs 0.695ns 2.6ns 0.0137 0 0 1.02 KB
master CallElasticsearchAsync net472 2.54μs 0.708ns 2.74ns 0.167 0 0 1.05 KB
#6253 CallElasticsearch net6.0 1.28μs 1.01ns 3.8ns 0.0133 0 0 976 B
#6253 CallElasticsearch netcoreapp3.1 1.56μs 7.35ns 28.5ns 0.013 0 0 976 B
#6253 CallElasticsearch net472 2.59μs 0.591ns 2.21ns 0.158 0 0 995 B
#6253 CallElasticsearchAsync net6.0 1.22μs 0.464ns 1.8ns 0.0129 0 0 952 B
#6253 CallElasticsearchAsync netcoreapp3.1 1.69μs 0.823ns 3.19ns 0.0135 0 0 1.02 KB
#6253 CallElasticsearchAsync net472 2.55μs 1.15ns 4.15ns 0.166 0 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6253

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 1.125 1,132.20 1,273.25

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.13μs 0.481ns 1.86ns 0.0131 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.67μs 0.376ns 1.3ns 0.0124 0 0 952 B
master ExecuteAsync net472 1.79μs 1.6ns 5.54ns 0.145 0 0 915 B
#6253 ExecuteAsync net6.0 1.28μs 2.3ns 8.61ns 0.013 0 0 952 B
#6253 ExecuteAsync netcoreapp3.1 1.71μs 0.796ns 3.08ns 0.0128 0 0 952 B
#6253 ExecuteAsync net472 1.83μs 0.584ns 2.19ns 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 2.68ns 10ns 0.0329 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.27μs 1.8ns 6.74ns 0.037 0 0 2.85 KB
master SendAsync net472 7.42μs 3.7ns 13.8ns 0.493 0 0 3.12 KB
#6253 SendAsync net6.0 4.38μs 1.85ns 7.16ns 0.0328 0 0 2.31 KB
#6253 SendAsync netcoreapp3.1 5.27μs 4.35ns 16.3ns 0.0368 0 0 2.85 KB
#6253 SendAsync net472 7.49μs 5.43ns 21ns 0.494 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.59μs 5.07ns 19.6ns 0.0233 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.14μs 1.24ns 4.81ns 0.0224 0 0 1.64 KB
master EnrichedLog net472 2.48μs 1.68ns 6.51ns 0.25 0 0 1.57 KB
#6253 EnrichedLog net6.0 1.45μs 1.7ns 6.58ns 0.0231 0 0 1.64 KB
#6253 EnrichedLog netcoreapp3.1 2.29μs 1.55ns 5.78ns 0.0218 0 0 1.64 KB
#6253 EnrichedLog net472 2.53μs 1.29ns 5.01ns 0.249 0 0 1.57 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 120μs 174ns 675ns 0.0601 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 120μs 191ns 741ns 0 0 0 4.28 KB
master EnrichedLog net472 151μs 210ns 787ns 0.678 0.226 0 4.46 KB
#6253 EnrichedLog net6.0 118μs 102ns 352ns 0.0593 0 0 4.28 KB
#6253 EnrichedLog netcoreapp3.1 123μs 227ns 879ns 0 0 0 4.28 KB
#6253 EnrichedLog net472 154μs 187ns 724ns 0.693 0.231 0 4.46 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.16μs 0.709ns 2.75ns 0.0316 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.13μs 0.543ns 1.96ns 0.0308 0 0 2.2 KB
master EnrichedLog net472 4.94μs 1.55ns 5.99ns 0.319 0 0 2.02 KB
#6253 EnrichedLog net6.0 3.26μs 0.863ns 3.11ns 0.0311 0 0 2.2 KB
#6253 EnrichedLog netcoreapp3.1 4.17μs 0.922ns 3.45ns 0.0311 0 0 2.2 KB
#6253 EnrichedLog net472 4.76μs 1.09ns 4.22ns 0.319 0 0 2.02 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.33μs 0.356ns 1.33ns 0.0159 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.72μs 0.584ns 2.11ns 0.0146 0 0 1.14 KB
master SendReceive net472 2.05μs 0.847ns 3.06ns 0.184 0 0 1.16 KB
#6253 SendReceive net6.0 1.3μs 1.14ns 4.43ns 0.0157 0 0 1.14 KB
#6253 SendReceive netcoreapp3.1 1.75μs 0.738ns 2.86ns 0.0157 0 0 1.14 KB
#6253 SendReceive net472 2.1μs 1.23ns 4.78ns 0.183 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.74μs 1.15ns 4.46ns 0.0218 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.94μs 2.75ns 10.3ns 0.0217 0 0 1.65 KB
master EnrichedLog net472 4.46μs 2.48ns 9.27ns 0.322 0 0 2.04 KB
#6253 EnrichedLog net6.0 2.76μs 0.845ns 3.27ns 0.0221 0 0 1.6 KB
#6253 EnrichedLog netcoreapp3.1 3.74μs 0.934ns 3.62ns 0.0224 0 0 1.65 KB
#6253 EnrichedLog net472 4.4μs 1.01ns 3.9ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6253

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.225 667.15 544.75
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.150 473.26 411.37

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 473ns 0.421ns 1.57ns 0.0081 0 0 576 B
master StartFinishSpan netcoreapp3.1 664ns 2.41ns 9.32ns 0.0075 0 0 576 B
master StartFinishSpan net472 720ns 0.797ns 3.09ns 0.0915 0 0 578 B
master StartFinishScope net6.0 522ns 0.457ns 1.77ns 0.00978 0 0 696 B
master StartFinishScope netcoreapp3.1 765ns 0.641ns 2.48ns 0.00916 0 0 696 B
master StartFinishScope net472 906ns 0.849ns 3.29ns 0.104 0 0 658 B
#6253 StartFinishSpan net6.0 412ns 0.367ns 1.42ns 0.00807 0 0 576 B
#6253 StartFinishSpan netcoreapp3.1 544ns 0.614ns 2.38ns 0.0076 0 0 576 B
#6253 StartFinishSpan net472 717ns 0.772ns 2.99ns 0.0916 0 0 578 B
#6253 StartFinishScope net6.0 500ns 0.332ns 1.28ns 0.00979 0 0 696 B
#6253 StartFinishScope netcoreapp3.1 703ns 0.726ns 2.81ns 0.0094 0 0 696 B
#6253 StartFinishScope net472 902ns 0.636ns 2.46ns 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 731ns 0.424ns 1.59ns 0.00951 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 977ns 1.19ns 4.59ns 0.00928 0 0 696 B
master RunOnMethodBegin net472 1.15μs 1.61ns 6.23ns 0.104 0 0 658 B
#6253 RunOnMethodBegin net6.0 662ns 0.648ns 2.51ns 0.0097 0 0 696 B
#6253 RunOnMethodBegin netcoreapp3.1 975ns 0.907ns 3.51ns 0.00913 0 0 696 B
#6253 RunOnMethodBegin net472 1.22μs 1.43ns 5.52ns 0.104 0 0 658 B

@andrewlock
Copy link
Member

andrewlock commented Nov 8, 2024

Throughput/Crank Report ⚡

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 (6253) (11.207M)   : 0, 11207220
    master (11.092M)   : 0, 11092190
    benchmarks/2.9.0 (11.033M)   : 0, 11032866

    section Automatic
    This PR (6253) (7.195M)   : 0, 7195251
    master (7.315M)   : 0, 7314582
    benchmarks/2.9.0 (7.786M)   : 0, 7785853

    section Trace stats
    master (7.630M)   : 0, 7629946

    section Manual
    master (11.027M)   : 0, 11026584

    section Manual + Automatic
    This PR (6253) (6.698M)   : 0, 6697637
    master (6.813M)   : 0, 6813328

    section DD_TRACE_ENABLED=0
    master (10.150M)   : 0, 10150076

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6253) (9.436M)   : 0, 9436020
    master (9.560M)   : 0, 9559953
    benchmarks/2.9.0 (9.495M)   : 0, 9494821

    section Automatic
    This PR (6253) (6.266M)   : 0, 6265711
    master (6.378M)   : 0, 6377870

    section Trace stats
    master (6.751M)   : 0, 6751094

    section Manual
    master (9.498M)   : 0, 9497984

    section Manual + Automatic
    This PR (6253) (5.946M)   : 0, 5945837
    master (5.967M)   : 0, 5966547

    section DD_TRACE_ENABLED=0
    master (8.995M)   : 0, 8994981

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6253) (10.088M)   : 0, 10087764
    master (10.347M)   : 0, 10347441
    benchmarks/2.9.0 (10.020M)   : 0, 10019592

    section Automatic
    This PR (6253) (6.486M)   : 0, 6485842
    master (6.779M)   : 0, 6779281
    benchmarks/2.9.0 (7.255M)   : 0, 7255257

    section Trace stats
    master (7.590M)   : 0, 7590179

    section Manual
    master (10.414M)   : 0, 10413511

    section Manual + Automatic
    This PR (6253) (6.053M)   : 0, 6053003
    master (5.506M)   : 0, 5506075

    section DD_TRACE_ENABLED=0
    master (9.537M)   : 0, 9537294

Loading

Comment on lines -99 to -100
null or "" => ".pre3.7.101.88",
{ } v when new Version(v) < new Version("3.7.101.88") => ".pre3.7.101.88",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was wrong, the value used in the sample app to determine if we do a batch request or not is 3.7.3, and it's the value used by default if there is no version specified.

@vandonr vandonr marked this pull request as ready for review November 12, 2024 09:17
@vandonr vandonr requested review from a team as code owners November 12, 2024 09:17
Copy link
Contributor

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

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

I've modified tests to run on .NET Framework could you just check those over to make sure they look good (I think they are fine)

@@ -23,17 +25,24 @@ public static CallTargetState BeforePublish<TPublishRequest>(TPublishRequest req
var requestProxy = request.DuckCast<IAmazonSNSRequestWithTopicArn>();

var scope = AwsSnsCommon.CreateScope(Tracer.Instance, sendType.OperationName, SpanKinds.Producer, out var tags);

var topicName = AwsSnsCommon.GetTopicName(requestProxy.TopicArn);
Copy link
Contributor

Choose a reason for hiding this comment

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

requestProxy.TopicArn appears that it could be null here as there is the null check directly below.

Granted the GetTopicName seems to just return null when given a null string

}

if (scope?.Span.Context is { } context)
{
var dataStreamsManager = Tracer.Instance.TracerManager.DataStreamsManager;
// avoid allocation if edgeTags are not going to be used
var edgeTags = dataStreamsManager is { IsEnabled: true } ? ["direction:out", $"topic:{topicName}", "type:sns"] : Array.Empty<string>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it okay that topicName here can be null?

Comment on lines 46 to 48
// there is no snapshot for NetFramework so this test would fail if run
// but it is compiled, so it still needs to look legit for the CI
var expectedCount = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

I added tests/snapshots for these

@@ -26,6 +26,9 @@ public static async Task StartSNSTasks(AmazonSimpleNotificationServiceClient sns
await PublishMessageAsync(snsClient, topicArn);
#if AWS_SNS_3_7_3
await PublishBatchAsync(snsClient, topicArn);
#else
// do a second publish if batch is not available to keep a constant number of spans and make assertions simpler
await PublishMessageAsync(snsClient, topicArn);
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is okay but I'm unsure how I really feel about this as it is a bit misleading. The span count will be consistent, but not the operations between them.

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.

3 participants