-
Notifications
You must be signed in to change notification settings - Fork 149
[AWS][Lambda] send placeholder span to the extension #6783
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
[AWS][Lambda] send placeholder span to the extension #6783
Conversation
Datadog ReportAll test runs ❌ 2 Total Test Services: 1 Failed, 1 Passed Test Services
❌ Failed Tests (4)
|
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:
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 (6783) - mean (74ms) : 69, 79
. : milestone, 74,
master - mean (79ms) : 73, 86
. : milestone, 79,
section CallTarget+Inlining+NGEN
This PR (6783) - mean (1,043ms) : 1016, 1071
. : milestone, 1043,
master - mean (1,091ms) : 1060, 1123
. : milestone, 1091,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6783) - mean (109ms) : 105, 114
. : milestone, 109,
master - mean (118ms) : 113, 123
. : milestone, 118,
section CallTarget+Inlining+NGEN
This PR (6783) - mean (721ms) : 701, 740
. : milestone, 721,
master - mean (771ms) : 711, 832
. : milestone, 771,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6783) - mean (96ms) : 93, 100
. : milestone, 96,
master - mean (104ms) : 97, 111
. : milestone, 104,
section CallTarget+Inlining+NGEN
This PR (6783) - mean (673ms) : 657, 689
. : milestone, 673,
master - mean (717ms) : 698, 736
. : milestone, 717,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6783) - mean (190ms) : 187, 194
. : milestone, 190,
master - mean (191ms) : 187, 195
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (6783) - mean (1,107ms) : 1082, 1131
. : milestone, 1107,
master - mean (1,111ms) : 1081, 1142
. : milestone, 1111,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6783) - mean (270ms) : 266, 274
. : milestone, 270,
master - mean (269ms) : 266, 273
. : milestone, 269,
section CallTarget+Inlining+NGEN
This PR (6783) - mean (875ms) : 851, 900
. : milestone, 875,
master - mean (878ms) : 846, 910
. : milestone, 878,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6783) - mean (263ms) : 259, 268
. : milestone, 263,
master - mean (262ms) : 258, 265
. : milestone, 262,
section CallTarget+Inlining+NGEN
This PR (6783) - mean (853ms) : 827, 879
. : milestone, 853,
master - mean (860ms) : 833, 886
. : milestone, 860,
|
Benchmarks Report for tracer 🐌Benchmarks for #6783 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Fewer allocations 🎉
|
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 41.8 KB | 41.42 KB | -379 B | -0.91% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 598μs | 3.47μs | 28.6μs | 0.293 | 0 | 0 | 41.64 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 698μs | 3.96μs | 28.6μs | 0.321 | 0 | 0 | 41.8 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 873μs | 4.29μs | 17.7μs | 8.3 | 2.62 | 0.437 | 53.36 KB |
| #6783 | WriteAndFlushEnrichedTraces |
net6.0 | 565μs | 3.24μs | 26.4μs | 0.587 | 0 | 0 | 41.5 KB |
| #6783 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 729μs | 2.51μs | 9.04μs | 0.363 | 0 | 0 | 41.42 KB |
| #6783 | WriteAndFlushEnrichedTraces |
net472 | 857μs | 3.8μs | 14.2μs | 8.45 | 2.53 | 0.422 | 53.3 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.34μs | 1.69ns | 6.54ns | 0.0141 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
netcoreapp3.1 | 1.71μs | 3.38ns | 13.1ns | 0.0136 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
net472 | 2.13μs | 2.5ns | 9.36ns | 0.156 | 0.00107 | 0 | 987 B |
| #6783 | ExecuteNonQuery |
net6.0 | 1.37μs | 2.49ns | 9.65ns | 0.0145 | 0 | 0 | 1.02 KB |
| #6783 | ExecuteNonQuery |
netcoreapp3.1 | 1.83μs | 2.07ns | 8.01ns | 0.0137 | 0 | 0 | 1.02 KB |
| #6783 | ExecuteNonQuery |
net472 | 2.06μs | 2.69ns | 10.4ns | 0.156 | 0.00104 | 0 | 987 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 | 1.26μs | 0.596ns | 2.31ns | 0.0133 | 0 | 0 | 976 B |
| master | CallElasticsearch |
netcoreapp3.1 | 1.53μs | 0.333ns | 1.25ns | 0.0131 | 0 | 0 | 976 B |
| master | CallElasticsearch |
net472 | 2.62μs | 1.44ns | 5.39ns | 0.157 | 0 | 0 | 995 B |
| master | CallElasticsearchAsync |
net6.0 | 1.23μs | 1.32ns | 5.1ns | 0.0134 | 0 | 0 | 952 B |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 1.64μs | 0.733ns | 2.84ns | 0.0141 | 0 | 0 | 1.02 KB |
| master | CallElasticsearchAsync |
net472 | 2.72μs | 1.14ns | 4.4ns | 0.166 | 0 | 0 | 1.05 KB |
| #6783 | CallElasticsearch |
net6.0 | 1.21μs | 0.279ns | 1.08ns | 0.0134 | 0 | 0 | 976 B |
| #6783 | CallElasticsearch |
netcoreapp3.1 | 1.57μs | 0.578ns | 2.16ns | 0.0132 | 0 | 0 | 976 B |
| #6783 | CallElasticsearch |
net472 | 2.56μs | 1.16ns | 4.34ns | 0.157 | 0 | 0 | 995 B |
| #6783 | CallElasticsearchAsync |
net6.0 | 1.28μs | 0.649ns | 2.51ns | 0.0128 | 0 | 0 | 952 B |
| #6783 | CallElasticsearchAsync |
netcoreapp3.1 | 1.66μs | 0.775ns | 2.9ns | 0.0142 | 0 | 0 | 1.02 KB |
| #6783 | CallElasticsearchAsync |
net472 | 2.67μs | 0.677ns | 2.53ns | 0.167 | 0 | 0 | 1.05 KB |
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteAsync |
net6.0 | 1.23μs | 0.646ns | 2.5ns | 0.0135 | 0 | 0 | 952 B |
| master | ExecuteAsync |
netcoreapp3.1 | 1.66μs | 0.472ns | 1.77ns | 0.0125 | 0 | 0 | 952 B |
| master | ExecuteAsync |
net472 | 1.89μs | 0.393ns | 1.47ns | 0.144 | 0 | 0 | 915 B |
| #6783 | ExecuteAsync |
net6.0 | 1.3μs | 0.645ns | 2.41ns | 0.0136 | 0 | 0 | 952 B |
| #6783 | ExecuteAsync |
netcoreapp3.1 | 1.56μs | 0.52ns | 1.95ns | 0.0125 | 0 | 0 | 952 B |
| #6783 | ExecuteAsync |
net472 | 1.79μs | 0.455ns | 1.7ns | 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.27μs | 1.57ns | 5.88ns | 0.0321 | 0 | 0 | 2.31 KB |
| master | SendAsync |
netcoreapp3.1 | 5.37μs | 1.76ns | 6.59ns | 0.0376 | 0 | 0 | 2.85 KB |
| master | SendAsync |
net472 | 7.56μs | 2.33ns | 9.01ns | 0.495 | 0 | 0 | 3.12 KB |
| #6783 | SendAsync |
net6.0 | 4.36μs | 2.95ns | 11ns | 0.0328 | 0 | 0 | 2.31 KB |
| #6783 | SendAsync |
netcoreapp3.1 | 5.35μs | 5.58ns | 21.6ns | 0.0375 | 0 | 0 | 2.85 KB |
| #6783 | SendAsync |
net472 | 7.52μs | 1.03ns | 3.72ns | 0.492 | 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.64μs | 1.04ns | 3.88ns | 0.0238 | 0 | 0 | 1.69 KB |
| master | EnrichedLog |
netcoreapp3.1 | 2.22μs | 0.673ns | 2.52ns | 0.0223 | 0 | 0 | 1.69 KB |
| master | EnrichedLog |
net472 | 2.6μs | 2.64ns | 10.2ns | 0.258 | 0 | 0 | 1.62 KB |
| #6783 | EnrichedLog |
net6.0 | 1.51μs | 0.775ns | 3ns | 0.0234 | 0 | 0 | 1.69 KB |
| #6783 | EnrichedLog |
netcoreapp3.1 | 2.21μs | 2.23ns | 8.63ns | 0.0232 | 0 | 0 | 1.69 KB |
| #6783 | EnrichedLog |
net472 | 2.68μs | 2.48ns | 9.28ns | 0.257 | 0 | 0 | 1.62 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 | 86.1ns | 333ns | 0.0562 | 0 | 0 | 4.3 KB |
| master | EnrichedLog |
netcoreapp3.1 | 118μs | 164ns | 635ns | 0 | 0 | 0 | 4.3 KB |
| master | EnrichedLog |
net472 | 148μs | 145ns | 563ns | 0.672 | 0.224 | 0 | 4.49 KB |
| #6783 | EnrichedLog |
net6.0 | 111μs | 117ns | 436ns | 0.0556 | 0 | 0 | 4.3 KB |
| #6783 | EnrichedLog |
netcoreapp3.1 | 117μs | 163ns | 630ns | 0.0579 | 0 | 0 | 4.3 KB |
| #6783 | EnrichedLog |
net472 | 150μs | 137ns | 514ns | 0.672 | 0.224 | 0 | 4.49 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.2μs | 3.75ns | 13.5ns | 0.0305 | 0 | 0 | 2.25 KB |
| master | EnrichedLog |
netcoreapp3.1 | 4.22μs | 4.65ns | 18ns | 0.0296 | 0 | 0 | 2.25 KB |
| master | EnrichedLog |
net472 | 4.89μs | 0.999ns | 3.87ns | 0.328 | 0 | 0 | 2.07 KB |
| #6783 | EnrichedLog |
net6.0 | 2.99μs | 0.935ns | 3.5ns | 0.0313 | 0 | 0 | 2.25 KB |
| #6783 | EnrichedLog |
netcoreapp3.1 | 4.32μs | 5.16ns | 20ns | 0.0301 | 0 | 0 | 2.25 KB |
| #6783 | EnrichedLog |
net472 | 4.89μs | 1.02ns | 3.82ns | 0.329 | 0 | 0 | 2.07 KB |
Benchmarks.Trace.RedisBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #6783
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.RedisBenchmark.SendReceive‑net6.0
1.124
1,274.34
1,431.98
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.RedisBenchmark.SendReceive‑net6.0 | 1.124 | 1,274.34 | 1,431.98 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendReceive |
net6.0 | 1.27μs | 0.48ns | 1.86ns | 0.016 | 0 | 0 | 1.14 KB |
| master | SendReceive |
netcoreapp3.1 | 1.83μs | 0.661ns | 2.47ns | 0.0155 | 0 | 0 | 1.14 KB |
| master | SendReceive |
net472 | 2.15μs | 1.18ns | 4.57ns | 0.183 | 0 | 0 | 1.16 KB |
| #6783 | SendReceive |
net6.0 | 1.43μs | 0.762ns | 2.95ns | 0.0165 | 0 | 0 | 1.14 KB |
| #6783 | SendReceive |
netcoreapp3.1 | 1.81μs | 1.12ns | 4.34ns | 0.0153 | 0 | 0 | 1.14 KB |
| #6783 | SendReceive |
net472 | 2.15μs | 0.512ns | 1.85ns | 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.9μs | 0.761ns | 2.95ns | 0.0232 | 0 | 0 | 1.62 KB |
| master | EnrichedLog |
netcoreapp3.1 | 4.03μs | 2.81ns | 10.9ns | 0.0222 | 0 | 0 | 1.67 KB |
| master | EnrichedLog |
net472 | 4.59μs | 2.83ns | 10.6ns | 0.328 | 0 | 0 | 2.07 KB |
| #6783 | EnrichedLog |
net6.0 | 2.68μs | 0.795ns | 2.97ns | 0.0227 | 0 | 0 | 1.62 KB |
| #6783 | EnrichedLog |
netcoreapp3.1 | 3.95μs | 2.53ns | 9.81ns | 0.0219 | 0 | 0 | 1.67 KB |
| #6783 | EnrichedLog |
net472 | 4.31μs | 1.71ns | 6.63ns | 0.327 | 0 | 0 | 2.07 KB |
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartFinishSpan |
net6.0 | 401ns | 0.137ns | 0.531ns | 0.00819 | 0 | 0 | 576 B |
| master | StartFinishSpan |
netcoreapp3.1 | 565ns | 0.56ns | 2.17ns | 0.00758 | 0 | 0 | 576 B |
| master | StartFinishSpan |
net472 | 641ns | 0.29ns | 1.08ns | 0.0918 | 0 | 0 | 578 B |
| master | StartFinishScope |
net6.0 | 502ns | 0.119ns | 0.459ns | 0.00974 | 0 | 0 | 696 B |
| master | StartFinishScope |
netcoreapp3.1 | 686ns | 0.225ns | 0.78ns | 0.00938 | 0 | 0 | 696 B |
| master | StartFinishScope |
net472 | 863ns | 0.335ns | 1.3ns | 0.105 | 0 | 0 | 658 B |
| #6783 | StartFinishSpan |
net6.0 | 403ns | 0.0938ns | 0.325ns | 0.00808 | 0 | 0 | 576 B |
| #6783 | StartFinishSpan |
netcoreapp3.1 | 568ns | 0.274ns | 1.03ns | 0.00763 | 0 | 0 | 576 B |
| #6783 | StartFinishSpan |
net472 | 668ns | 0.595ns | 2.31ns | 0.0917 | 0 | 0 | 578 B |
| #6783 | StartFinishScope |
net6.0 | 501ns | 0.328ns | 1.23ns | 0.00965 | 0 | 0 | 696 B |
| #6783 | StartFinishScope |
netcoreapp3.1 | 723ns | 0.262ns | 0.98ns | 0.00938 | 0 | 0 | 696 B |
| #6783 | StartFinishScope |
net472 | 861ns | 1.34ns | 5.2ns | 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 | 638ns | 0.347ns | 1.34ns | 0.00962 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 912ns | 0.593ns | 2.3ns | 0.00957 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
net472 | 1.2μs | 0.283ns | 1.09ns | 0.104 | 0 | 0 | 658 B |
| #6783 | RunOnMethodBegin |
net6.0 | 704ns | 0.367ns | 1.42ns | 0.0099 | 0 | 0 | 696 B |
| #6783 | RunOnMethodBegin |
netcoreapp3.1 | 928ns | 0.575ns | 2.23ns | 0.00933 | 0 | 0 | 696 B |
| #6783 | RunOnMethodBegin |
net472 | 1.1μs | 0.293ns | 1.13ns | 0.105 | 0 | 0 | 658 B |
| private const string PlaceholderOperationName = "placeholder-operation"; | ||
| // Name of the placeholder span sent which will be filtered out by the Lambda Extension, | ||
| // required so we can get correct span metadata, tags, and more. | ||
| private const string InvocationSpanResource = "dd-tracer-serverless-span"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field name seems wrong. It's called ...SpanResource, but it's used for operation name (aka span name) and service name, not the resource name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we're setting the resource name at all on this span. Should we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I should rename it!
And I don't think adding the span resource matters because it's going to be dropped anyway, the only data we care about are the meta and meta metrics when sending it
Summary of changes
Updated the AWS Lambda instrumentation to send the top level placeholder span.
Reason for change
So telemetry in the span created by the AWS Lambda extension is more accurate.
We would get metrics, metadata, and tags (probably other stuff I'm missing here) easily.
Implementation details
Just updating the name to what the Extension expects and appending it to the context.
Test coverage
Other details