Skip to content

Use sensible default service name in AAS (Functions & WebApps)#2007

Merged
colin-higgins merged 2 commits intomasterfrom
colin/functions/service-naming
Nov 9, 2021
Merged

Use sensible default service name in AAS (Functions & WebApps)#2007
colin-higgins merged 2 commits intomasterfrom
colin/functions/service-naming

Conversation

@colin-higgins
Copy link
Member

@colin-higgins colin-higgins commented Nov 8, 2021

Fixes missing service names in AAS (Web Apps and Functions) when DD_SERVICE is not set

Before change:
image

After change:
image

@DataDog/apm-dotnet

@colin-higgins colin-higgins added the area:azure-site-extension Changes for AAS support label Nov 8, 2021
@colin-higgins colin-higgins self-assigned this Nov 8, 2021
@colin-higgins colin-higgins requested a review from a team as a code owner November 8, 2021 20:32
@andrewlock

This comment has been minimized.

@andrewlock
Copy link
Member

Benchmarks Report 🐌

Benchmarks for #2007 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.151
  • 1 benchmarks are slower, with geometric mean 1.254
  • 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 Error StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net472 903.1 μs 9.64 μs 8.54 μs 0.0000 0.0000 0.0000 3.09 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 705.0 μs 13.13 μs 10.96 μs 0.0000 0.0000 0.0000 2.51 KB
#2007 WriteAndFlushEnrichedTraces net472 904.3 μs 11.26 μs 9.98 μs 0.0000 0.0000 0.0000 3.09 KB
#2007 WriteAndFlushEnrichedTraces netcoreapp3.1 721.2 μs 14.21 μs 25.26 μs 0.0000 0.0000 0.0000 2.51 KB
Benchmarks.Trace.AspNetCoreBenchmark - Unknown 🤷 Same allocations ✔️

Raw results

Branch Method Toolchain Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net472 0.0000 ns 0.0000 ns 0.0000 ns 0.0000 0.0000 0.0000 0 B
master SendRequest netcoreapp3.1 286,305.0275 ns 4,347.2693 ns 4,066.4384 ns 0.2847 0.0000 0.0000 19833 B
#2007 SendRequest net472 0.0000 ns 0.0000 ns 0.0000 ns 0.0000 0.0000 0.0000 0 B
#2007 SendRequest netcoreapp3.1 289,001.5335 ns 5,148.1256 ns 4,563.6793 ns 0.1424 0.0000 0.0000 19832 B
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net472 1.949 μs 0.0311 μs 0.0291 μs 0.1082 0.0009 0.0000 682 B
master ExecuteNonQuery netcoreapp3.1 1.843 μs 0.0346 μs 0.0539 μs 0.0098 0.0000 0.0000 712 B
#2007 ExecuteNonQuery net472 2.023 μs 0.0404 μs 0.0511 μs 0.1083 0.0010 0.0000 682 B
#2007 ExecuteNonQuery netcoreapp3.1 1.908 μs 0.0330 μs 0.0339 μs 0.0094 0.0000 0.0000 712 B
Benchmarks.Trace.ElasticsearchBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #2007

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑netcoreapp3.1 1.129 1,889.38 1,673.22

Raw results

Branch Method Toolchain Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net472 2.929 μs 0.0347 μs 0.0271 μs 0.1286 0.0000 0.0000 827 B
master CallElasticsearch netcoreapp3.1 1.713 μs 0.0335 μs 0.0297 μs 0.0105 0.0000 0.0000 768 B
master CallElasticsearchAsync net472 3.316 μs 0.0662 μs 0.1338 μs 0.1505 0.0000 0.0000 963 B
master CallElasticsearchAsync netcoreapp3.1 1.891 μs 0.0340 μs 0.0284 μs 0.0122 0.0000 0.0000 888 B
#2007 CallElasticsearch net472 2.953 μs 0.0582 μs 0.0572 μs 0.1286 0.0000 0.0000 827 B
#2007 CallElasticsearch netcoreapp3.1 1.566 μs 0.0225 μs 0.0210 μs 0.0108 0.0000 0.0000 768 B
#2007 CallElasticsearchAsync net472 3.200 μs 0.0535 μs 0.0447 μs 0.1492 0.0000 0.0000 963 B
#2007 CallElasticsearchAsync netcoreapp3.1 1.681 μs 0.0280 μs 0.0262 μs 0.0124 0.0000 0.0000 888 B
Benchmarks.Trace.GraphQLBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #2007

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑netcoreapp3.1 1.173 2,130.93 1,816.78

Raw results

Branch Method Toolchain Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net472 3.406 μs 0.0666 μs 0.0740 μs 0.1690 0.0000 0.0000 1083 B
master ExecuteAsync netcoreapp3.1 2.132 μs 0.0249 μs 0.0220 μs 0.0140 0.0000 0.0000 1008 B
#2007 ExecuteAsync net472 3.324 μs 0.0501 μs 0.0418 μs 0.1691 0.0000 0.0000 1083 B
#2007 ExecuteAsync netcoreapp3.1 1.814 μs 0.0252 μs 0.0235 μs 0.0144 0.0000 0.0000 1008 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net472 5.878 μs 0.1040 μs 0.0973 μs 0.3500 0.0000 0.0000 2.19 KB
master SendAsync netcoreapp3.1 4.427 μs 0.0871 μs 0.1193 μs 0.0310 0.0000 0.0000 2.09 KB
#2007 SendAsync net472 5.905 μs 0.0888 μs 0.0787 μs 0.3493 0.0000 0.0000 2.19 KB
#2007 SendAsync netcoreapp3.1 4.378 μs 0.0857 μs 0.1501 μs 0.0284 0.0000 0.0000 2.09 KB
Benchmarks.Trace.ILoggerBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #2007

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net472 1.254 3,896.68 4,884.86

Raw results

Branch Method Toolchain Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net472 3.903 μs 0.0497 μs 0.0465 μs 0.2876 0.0000 0.0000 1.79 KB
master EnrichedLog netcoreapp3.1 3.749 μs 0.0535 μs 0.0447 μs 0.0281 0.0000 0.0000 1.94 KB
#2007 EnrichedLog net472 4.881 μs 0.0763 μs 0.0714 μs 0.2860 0.0000 0.0000 1.79 KB
#2007 EnrichedLog netcoreapp3.1 3.575 μs 0.0305 μs 0.0270 μs 0.0264 0.0000 0.0000 1.94 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net472 172.4 μs 1.82 μs 1.70 μs 0.6974 0.2615 0.0000 5.23 KB
master EnrichedLog netcoreapp3.1 147.4 μs 2.60 μs 2.43 μs 0.0000 0.0000 0.0000 5.05 KB
#2007 EnrichedLog net472 174.4 μs 3.16 μs 2.96 μs 0.7072 0.2652 0.0000 5.23 KB
#2007 EnrichedLog netcoreapp3.1 147.3 μs 2.85 μs 3.80 μs 0.0715 0.0000 0.0000 5.05 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net472 11.663 μs 0.1786 μs 0.1671 μs 0.8536 0.0000 0.0000 5.31 KB
master EnrichedLog netcoreapp3.1 9.966 μs 0.1411 μs 0.1251 μs 0.0888 0.0000 0.0000 6.28 KB
#2007 EnrichedLog net472 11.117 μs 0.2165 μs 0.1919 μs 0.8555 0.0000 0.0000 5.31 KB
#2007 EnrichedLog netcoreapp3.1 9.886 μs 0.1395 μs 0.1305 μs 0.0879 0.0000 0.0000 6.28 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net472 2.486 μs 0.0494 μs 0.0625 μs 0.1548 0.0000 0.0000 987 B
master SendReceive netcoreapp3.1 1.971 μs 0.0395 μs 0.0540 μs 0.0138 0.0000 0.0000 984 B
#2007 SendReceive net472 2.488 μs 0.0291 μs 0.0258 μs 0.1544 0.0000 0.0000 987 B
#2007 SendReceive netcoreapp3.1 2.007 μs 0.0390 μs 0.0365 μs 0.0137 0.0000 0.0000 984 B
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net472 7.659 μs 0.1206 μs 0.1069 μs 0.4462 0.0000 0.0000 2.8 KB
master EnrichedLog netcoreapp3.1 7.290 μs 0.1428 μs 0.1402 μs 0.0352 0.0000 0.0000 2.61 KB
#2007 EnrichedLog net472 7.526 μs 0.1481 μs 0.1454 μs 0.4481 0.0000 0.0000 2.8 KB
#2007 EnrichedLog netcoreapp3.1 7.909 μs 0.1133 μs 0.1059 μs 0.0357 0.0000 0.0000 2.61 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net472 856.8 ns 11.35 ns 10.06 ns 0.0682 0.0000 0.0000 433 B
master StartFinishSpan netcoreapp3.1 830.7 ns 10.19 ns 9.53 ns 0.0062 0.0000 0.0000 432 B
master StartFinishScope net472 1,022.7 ns 19.86 ns 22.87 ns 0.0806 0.0000 0.0000 514 B
master StartFinishScope netcoreapp3.1 983.5 ns 14.47 ns 13.53 ns 0.0078 0.0000 0.0000 552 B
#2007 StartFinishSpan net472 857.1 ns 9.49 ns 8.87 ns 0.0681 0.0000 0.0000 433 B
#2007 StartFinishSpan netcoreapp3.1 846.8 ns 14.48 ns 13.54 ns 0.0058 0.0000 0.0000 432 B
#2007 StartFinishScope net472 1,028.2 ns 12.79 ns 11.96 ns 0.0807 0.0000 0.0000 514 B
#2007 StartFinishScope netcoreapp3.1 1,005.1 ns 15.52 ns 13.75 ns 0.0075 0.0000 0.0000 552 B

@andrewlock
Copy link
Member

Code Coverage Report 📊

✔️ Merging #2007 into master will not change line coverage
✔️ Merging #2007 into master will not change branch coverage
✔️ Merging #2007 into master will will decrease complexity by 15

master #2007 Change
Lines 10387 / 15775 10410 / 15725
Lines % 66% 66% 0% ✔️
Branches 4526 / 6882 4535 / 6866
Branches % 66% 66% 0% ✔️
Complexity 8392 8377 -15 ✔️

View the full report for further details:

Datadog.Trace Breakdown ✔️

master #2007 Change
Lines % 66% 66% 0% ✔️
Branches % 66% 66% 0% ✔️
Complexity 8392 8377 -15 ✔️

The following classes have significant coverage changes.

File Line coverage change Branch coverage change Complexity change
Datadog.Trace.ClrProfiler.AutoInstrumentation.Testing.NUnit.NUnitCompositeWorkItemSkipChildrenIntegration -8% -8% 0 ✔️
Datadog.Trace.ClrProfiler.Emit.ModuleLookup -3% ⚠️ -8% 0 ✔️
Datadog.Trace.ClrProfiler.Integrations.Testing.NUnitIntegration -2% ⚠️ -14% 0 ✔️
Datadog.Trace.ClrProfiler.Helpers.AsyncHelper 0% ✔️ -8% 0 ✔️
Datadog.Trace.DiagnosticListeners.AspNetCoreDiagnosticObserver 3% ✔️ 7% ✔️ 0 ✔️
Datadog.Trace.HttpOverStreams.HttpHeaders 4% ✔️ 12% ✔️ 0 ✔️
Datadog.Trace.HttpOverStreams.DatadogHttpHeaderHelper 11% ✔️ 0% ✔️ 0 ✔️
Datadog.Trace.AppSec.Waf.NativeBindings.NativeLibrary 27% ✔️ 12% ✔️ -6 ✔️
Datadog.Trace.HttpOverStreams.HttpMessage 27% ✔️ 12% ✔️ 0 ✔️
Datadog.Trace.Agent.TransportStrategy 29% ✔️ 33% ✔️ 0 ✔️
...And 4 more

1 classes were removed from Datadog.Trace in #2007

View the full reports for further details:

@colin-higgins colin-higgins merged commit 1127f30 into master Nov 9, 2021
@colin-higgins colin-higgins deleted the colin/functions/service-naming branch November 9, 2021 14:08
@github-actions github-actions bot added this to the vNext milestone Nov 9, 2021
Comment on lines +650 to +653
if (AzureAppServices.Metadata.IsRelevant)
{
return AzureAppServices.Metadata.SiteName;
}
Copy link
Member

@lucaspimentel lucaspimentel Nov 9, 2021

Choose a reason for hiding this comment

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

This should have been moved up above this inner try because the log message in the catch block does not apply to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:azure-site-extension Changes for AAS support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants