-
Notifications
You must be signed in to change notification settings - Fork 151
[Docs] Document Azure Functions process detection and fix CLI commands #7802
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
base: master
Are you sure you want to change the base?
[Docs] Document Azure Functions process detection and fix CLI commands #7802
Conversation
ee5e17e to
07a929f
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
|
|
||
| The tracer provides utility methods in `EnvironmentHelpers` (`tracer/src/Datadog.Trace/Util/EnvironmentHelpers.cs`) to detect whether code is running in the host or worker process: | ||
|
|
||
| **`EnvironmentHelpers.IsRunningInAzureFunctionsHost()`** (line 144) |
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.
To be clear though, we established recently that these don't work correctly in AAS😬
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.
Are you talking about a user potentially setting FUNCTIONS_WORKER_RUNTIME=dotnet-isolated in an in-process function? Or something else?
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.
Are you talking about a user potentially setting FUNCTIONS_WORKER_RUNTIME=dotnet-isolated in an in-process function
Yes, exactly 🙂 in that scenario it messes up these checks
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| **`EnvironmentHelpers.IsAzureFunctionsIsolated()`** (line 170) | ||
| - Returns `true` for **both host and worker processes** in isolated functions | ||
| - Only checks: | ||
| 1. Environment is Azure Functions (`IsAzureFunctions()`) | ||
| 2. `FUNCTIONS_WORKER_RUNTIME` is set to `"dotnet-isolated"` | ||
|
|
||
| **Usage examples:** | ||
|
|
||
| ```csharp | ||
| // Detect any isolated functions process (host or worker) | ||
| if (EnvironmentHelpers.IsAzureFunctionsIsolated()) | ||
| { | ||
| // This code runs in both host and worker | ||
| } | ||
|
|
||
| // Detect host process | ||
| if (EnvironmentHelpers.IsRunningInAzureFunctionsHost()) | ||
| { | ||
| // This code runs only in the host process | ||
| } | ||
|
|
||
| // Detect worker process | ||
| if (EnvironmentHelpers.IsAzureFunctionsIsolated() && !EnvironmentHelpers.IsRunningInAzureFunctionsHost()) | ||
| { |
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.
Document nonexistent EnvironmentHelpers method
The new "Detecting Host vs Worker Process" section instructs readers to call EnvironmentHelpers.IsAzureFunctionsIsolated() and even references it in sample code, but no such API exists anywhere in the repository. EnvironmentHelpers only exposes IsAzureFunctions() and IsRunningInAzureFunctionsHost(), so any consumer copying these examples will hit compile errors and be unable to follow the guidance. The documentation should either reference an existing helper or explain the logic directly instead of pointing to a missing method.
Useful? React with 👍 / 👎.
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.
Nice catch. I am adding IsAzureFunctionsIsolated() in another PR that is not merged yet. Back to "draft" you go.
07a929f to
109e538
Compare
BenchmarksBenchmarks Report for benchmark platform 🐌Benchmarks for #7802 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 ✔️ More allocations
|
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑netcoreapp3.1 | 5.69 KB | 5.73 KB | 39 B | 0.69% |
| Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net6.0 | 5.49 KB | 5.52 KB | 28 B | 0.51% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 | 6.06 KB | 6.02 KB | -39 B | -0.64% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartStopWithChild |
net6.0 | 10.4μs | 58.3ns | 382ns | 0 | 0 | 0 | 5.49 KB |
| master | StartStopWithChild |
netcoreapp3.1 | 13.9μs | 73ns | 372ns | 0 | 0 | 0 | 5.69 KB |
| master | StartStopWithChild |
net472 | 21.7μs | 109ns | 501ns | 1 | 0.334 | 0.111 | 6.06 KB |
| #7802 | StartStopWithChild |
net6.0 | 11μs | 54.9ns | 233ns | 0 | 0 | 0 | 5.52 KB |
| #7802 | StartStopWithChild |
netcoreapp3.1 | 14.1μs | 36.3ns | 141ns | 0 | 0 | 0 | 5.73 KB |
| #7802 | StartStopWithChild |
net472 | 22.2μs | 121ns | 674ns | 0.992 | 0.441 | 0.11 | 6.02 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 | 940μs | 90.9ns | 328ns | 0 | 0 | 0 | 2.71 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.05ms | 261ns | 942ns | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 1.21ms | 115ns | 400ns | 0 | 0 | 0 | 3.31 KB |
| #7802 | WriteAndFlushEnrichedTraces |
net6.0 | 927μs | 182ns | 707ns | 0 | 0 | 0 | 2.71 KB |
| #7802 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.02ms | 202ns | 782ns | 0 | 0 | 0 | 2.7 KB |
| #7802 | WriteAndFlushEnrichedTraces |
net472 | 1.2ms | 674ns | 2.52μs | 0 | 0 | 0 | 3.31 KB |
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | AllCycleSimpleBody |
net6.0 | 1.05μs | 6.15ns | 57.7ns | 0 | 0 | 0 | 1.22 KB |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 1.44μs | 7.22ns | 33.1ns | 0 | 0 | 0 | 1.2 KB |
| master | AllCycleSimpleBody |
net472 | 1.03μs | 0.385ns | 1.44ns | 0.191 | 0 | 0 | 1.23 KB |
| master | AllCycleMoreComplexBody |
net6.0 | 7.04μs | 38.5ns | 237ns | 0 | 0 | 0 | 4.72 KB |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 9μs | 44ns | 197ns | 0 | 0 | 0 | 4.62 KB |
| master | AllCycleMoreComplexBody |
net472 | 7.72μs | 2.37ns | 8.55ns | 0.733 | 0 | 0 | 4.74 KB |
| master | ObjectExtractorSimpleBody |
net6.0 | 322ns | 1.71ns | 9.37ns | 0 | 0 | 0 | 280 B |
| master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 399ns | 2.22ns | 14.2ns | 0 | 0 | 0 | 272 B |
| master | ObjectExtractorSimpleBody |
net472 | 298ns | 0.0839ns | 0.325ns | 0.0434 | 0 | 0 | 281 B |
| master | ObjectExtractorMoreComplexBody |
net6.0 | 6.25μs | 33.3ns | 170ns | 0 | 0 | 0 | 3.78 KB |
| master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.94μs | 40.4ns | 176ns | 0 | 0 | 0 | 3.69 KB |
| master | ObjectExtractorMoreComplexBody |
net472 | 6.69μs | 4.74ns | 18.4ns | 0.602 | 0 | 0 | 3.8 KB |
| #7802 | AllCycleSimpleBody |
net6.0 | 1.08μs | 2.49ns | 9.65ns | 0 | 0 | 0 | 1.22 KB |
| #7802 | AllCycleSimpleBody |
netcoreapp3.1 | 1.45μs | 7.32ns | 31.9ns | 0 | 0 | 0 | 1.2 KB |
| #7802 | AllCycleSimpleBody |
net472 | 1.03μs | 0.463ns | 1.79ns | 0.192 | 0 | 0 | 1.23 KB |
| #7802 | AllCycleMoreComplexBody |
net6.0 | 7.17μs | 36.4ns | 167ns | 0 | 0 | 0 | 4.72 KB |
| #7802 | AllCycleMoreComplexBody |
netcoreapp3.1 | 9.11μs | 45.6ns | 204ns | 0 | 0 | 0 | 4.62 KB |
| #7802 | AllCycleMoreComplexBody |
net472 | 8.08μs | 3.26ns | 12.6ns | 0.723 | 0 | 0 | 4.74 KB |
| #7802 | ObjectExtractorSimpleBody |
net6.0 | 317ns | 0.107ns | 0.415ns | 0 | 0 | 0 | 280 B |
| #7802 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 396ns | 2.04ns | 9.55ns | 0 | 0 | 0 | 272 B |
| #7802 | ObjectExtractorSimpleBody |
net472 | 296ns | 0.0212ns | 0.0821ns | 0.0432 | 0 | 0 | 281 B |
| #7802 | ObjectExtractorMoreComplexBody |
net6.0 | 6.28μs | 30.3ns | 128ns | 0 | 0 | 0 | 3.78 KB |
| #7802 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.77μs | 39.9ns | 183ns | 0 | 0 | 0 | 3.69 KB |
| #7802 | ObjectExtractorMoreComplexBody |
net472 | 6.73μs | 1.75ns | 6.3ns | 0.574 | 0 | 0 | 3.8 KB |
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EncodeArgs |
net6.0 | 76.3μs | 268ns | 1μs | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
netcoreapp3.1 | 96.9μs | 266ns | 961ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
net472 | 109μs | 8.99ns | 34.8ns | 4.93 | 0 | 0 | 32.5 KB |
| master | EncodeLegacyArgs |
net6.0 | 143μs | 39ns | 146ns | 0 | 0 | 0 | 2.15 KB |
| master | EncodeLegacyArgs |
netcoreapp3.1 | 199μs | 375ns | 1.45μs | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
net472 | 266μs | 21.5ns | 77.4ns | 0 | 0 | 0 | 2.16 KB |
| #7802 | EncodeArgs |
net6.0 | 77.4μs | 227ns | 881ns | 0 | 0 | 0 | 32.4 KB |
| #7802 | EncodeArgs |
netcoreapp3.1 | 97.1μs | 121ns | 469ns | 0 | 0 | 0 | 32.4 KB |
| #7802 | EncodeArgs |
net472 | 108μs | 36.3ns | 136ns | 4.92 | 0 | 0 | 32.51 KB |
| #7802 | EncodeLegacyArgs |
net6.0 | 144μs | 65.8ns | 255ns | 0 | 0 | 0 | 2.15 KB |
| #7802 | EncodeLegacyArgs |
netcoreapp3.1 | 198μs | 123ns | 460ns | 0 | 0 | 0 | 2.14 KB |
| #7802 | EncodeLegacyArgs |
net472 | 265μs | 19.3ns | 74.6ns | 0 | 0 | 0 | 2.16 KB |
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #7802
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1
2.403
298,797.32
718,054.12
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 | 2.403 | 298,797.32 | 718,054.12 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunWafRealisticBenchmark |
net6.0 | 392μs | 107ns | 399ns | 0 | 0 | 0 | 4.55 KB |
| master | RunWafRealisticBenchmark |
netcoreapp3.1 | 417μs | 111ns | 401ns | 0 | 0 | 0 | 4.48 KB |
| master | RunWafRealisticBenchmark |
net472 | 428μs | 70.2ns | 263ns | 0 | 0 | 0 | 4.66 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 283μs | 45.9ns | 178ns | 0 | 0 | 0 | 2.24 KB |
| master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 299μs | 134ns | 500ns | 0 | 0 | 0 | 2.22 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net472 | 319μs | 33.7ns | 130ns | 0 | 0 | 0 | 2.28 KB |
| #7802 | RunWafRealisticBenchmark |
net6.0 | 394μs | 76.9ns | 288ns | 0 | 0 | 0 | 4.55 KB |
| #7802 | RunWafRealisticBenchmark |
netcoreapp3.1 | 411μs | 132ns | 459ns | 0 | 0 | 0 | 4.48 KB |
| #7802 | RunWafRealisticBenchmark |
net472 | 428μs | 78.1ns | 302ns | 0 | 0 | 0 | 4.66 KB |
| #7802 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 285μs | 37.8ns | 147ns | 0 | 0 | 0 | 2.24 KB |
| #7802 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 715μs | 3.22μs | 12.5μs | 0 | 0 | 0 | 2.22 KB |
| #7802 | RunWafRealisticBenchmarkWithAttack |
net472 | 311μs | 28.6ns | 99.1ns | 0 | 0 | 0 | 2.29 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 | 61μs | 86.7ns | 336ns | 0 | 0 | 0 | 14.52 KB |
| master | SendRequest |
netcoreapp3.1 | 72.4μs | 103ns | 372ns | 0 | 0 | 0 | 17.42 KB |
| master | SendRequest |
net472 | 0.00936ns | 0.0029ns | 0.0112ns | 0 | 0 | 0 | 0 b |
| #7802 | SendRequest |
net6.0 | 61.7μs | 68.7ns | 266ns | 0 | 0 | 0 | 14.52 KB |
| #7802 | SendRequest |
netcoreapp3.1 | 71.9μs | 85.6ns | 320ns | 0 | 0 | 0 | 17.42 KB |
| #7802 | SendRequest |
net472 | 0.000691ns | 0.000507ns | 0.00196ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CharSliceBenchmark - Faster 🎉 More allocations ⚠️
Faster 🎉 in #7802
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑netcoreapp3.1
1.165
1,994,129.38
1,711,551.25
More allocations ⚠️ in #7802
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472
0 b
73 B
73 B
∞
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472
0 b
47 B
47 B
∞
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0
2 B
4 B
2 B
100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0
2 B
4 B
2 B
100.00%
Fewer allocations 🎉 in #7802
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1
1 B
0 b
-1 B
-100.00%
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑netcoreapp3.1 | 1.165 | 1,994,129.38 | 1,711,551.25 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472 | 0 b | 73 B | 73 B | ∞ |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472 | 0 b | 47 B | 47 B | ∞ |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 | 2 B | 4 B | 2 B | 100.00% |
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 | 2 B | 4 B | 2 B | 100.00% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 | 1 B | 0 b | -1 B | -100.00% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | OriginalCharSlice |
net6.0 | 1.9ms | 611ns | 2.36μs | 0 | 0 | 0 | 640.01 KB |
| master | OriginalCharSlice |
netcoreapp3.1 | 2.17ms | 5.39μs | 20.9μs | 0 | 0 | 0 | 640 KB |
| master | OriginalCharSlice |
net472 | 2.56ms | 801ns | 3.1μs | 100 | 0 | 0 | 641.95 KB |
| master | OptimizedCharSlice |
net6.0 | 1.39ms | 90.9ns | 328ns | 0 | 0 | 0 | 2 B |
| master | OptimizedCharSlice |
netcoreapp3.1 | 1.99ms | 361ns | 1.4μs | 0 | 0 | 0 | 1 B |
| master | OptimizedCharSlice |
net472 | 1.96ms | 273ns | 1.06μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net6.0 | 800μs | 39ns | 151ns | 0 | 0 | 0 | 2 B |
| master | OptimizedCharSliceWithPool |
netcoreapp3.1 | 837μs | 59.2ns | 229ns | 0 | 0 | 0 | 1 B |
| master | OptimizedCharSliceWithPool |
net472 | 1.14ms | 219ns | 849ns | 0 | 0 | 0 | 0 b |
| #7802 | OriginalCharSlice |
net6.0 | 1.9ms | 621ns | 2.15μs | 0 | 0 | 0 | 640.01 KB |
| #7802 | OriginalCharSlice |
netcoreapp3.1 | 2.15ms | 4.86μs | 17.5μs | 0 | 0 | 0 | 640 KB |
| #7802 | OriginalCharSlice |
net472 | 2.69ms | 145ns | 524ns | 100 | 0 | 0 | 641.95 KB |
| #7802 | OptimizedCharSlice |
net6.0 | 1.36ms | 439ns | 1.7μs | 0 | 0 | 0 | 4 B |
| #7802 | OptimizedCharSlice |
netcoreapp3.1 | 1.71ms | 324ns | 1.25μs | 0 | 0 | 0 | 1 B |
| #7802 | OptimizedCharSlice |
net472 | 1.93ms | 254ns | 983ns | 0 | 0 | 0 | 73 B |
| #7802 | OptimizedCharSliceWithPool |
net6.0 | 867μs | 25.6ns | 99.2ns | 0 | 0 | 0 | 4 B |
| #7802 | OptimizedCharSliceWithPool |
netcoreapp3.1 | 797μs | 99.5ns | 385ns | 0 | 0 | 0 | 0 b |
| #7802 | OptimizedCharSliceWithPool |
net472 | 1.15ms | 32.8ns | 127ns | 0 | 0 | 0 | 47 B |
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Fewer allocations 🎉
Fewer allocations 🎉 in #7802
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472
56.33 KB
55.57 KB
-758 B
-1.35%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 | 56.33 KB | 55.57 KB | -758 B | -1.35% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 726μs | 4.2μs | 34.9μs | 0 | 0 | 0 | 41.87 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 753μs | 3.92μs | 18.4μs | 0 | 0 | 0 | 41.98 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 934μs | 3.15μs | 12.2μs | 4.81 | 0 | 0 | 56.33 KB |
| #7802 | WriteAndFlushEnrichedTraces |
net6.0 | 733μs | 4.13μs | 29.5μs | 0 | 0 | 0 | 41.73 KB |
| #7802 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 701μs | 3.86μs | 30.1μs | 0 | 0 | 0 | 41.94 KB |
| #7802 | WriteAndFlushEnrichedTraces |
net472 | 949μs | 4.15μs | 17.1μs | 4.46 | 0 | 0 | 55.57 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.94μs | 4.06ns | 15.7ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
netcoreapp3.1 | 2.57μs | 8.39ns | 31.4ns | 0 | 0 | 0 | 1.02 KB |
| master | ExecuteNonQuery |
net472 | 2.79μs | 3.35ns | 13ns | 0.154 | 0.014 | 0 | 987 B |
| #7802 | ExecuteNonQuery |
net6.0 | 1.97μs | 9.48ns | 39.1ns | 0 | 0 | 0 | 1.02 KB |
| #7802 | ExecuteNonQuery |
netcoreapp3.1 | 2.73μs | 6.68ns | 23.1ns | 0 | 0 | 0 | 1.02 KB |
| #7802 | ExecuteNonQuery |
net472 | 2.78μs | 3.5ns | 12.6ns | 0.152 | 0.0138 | 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.66μs | 8.77ns | 46.4ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
netcoreapp3.1 | 2.24μs | 9.34ns | 36.2ns | 0 | 0 | 0 | 1.03 KB |
| master | CallElasticsearch |
net472 | 3.46μs | 1.89ns | 7.31ns | 0.155 | 0 | 0 | 1.04 KB |
| master | CallElasticsearchAsync |
net6.0 | 1.87μs | 8.87ns | 34.3ns | 0 | 0 | 0 | 1.01 KB |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 2.38μs | 12.2ns | 58.6ns | 0 | 0 | 0 | 1.08 KB |
| master | CallElasticsearchAsync |
net472 | 3.64μs | 5.98ns | 23.2ns | 0.163 | 0 | 0 | 1.1 KB |
| #7802 | CallElasticsearch |
net6.0 | 1.75μs | 6.41ns | 24.8ns | 0 | 0 | 0 | 1.03 KB |
| #7802 | CallElasticsearch |
netcoreapp3.1 | 2.25μs | 11.3ns | 50.4ns | 0 | 0 | 0 | 1.03 KB |
| #7802 | CallElasticsearch |
net472 | 3.54μs | 3.9ns | 15.1ns | 0.16 | 0 | 0 | 1.04 KB |
| #7802 | CallElasticsearchAsync |
net6.0 | 1.86μs | 8.76ns | 35ns | 0 | 0 | 0 | 1.01 KB |
| #7802 | CallElasticsearchAsync |
netcoreapp3.1 | 2.41μs | 6.64ns | 25.7ns | 0 | 0 | 0 | 1.08 KB |
| #7802 | CallElasticsearchAsync |
net472 | 3.58μs | 2ns | 7.47ns | 0.161 | 0 | 0 | 1.1 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.85μs | 8.71ns | 32.6ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
netcoreapp3.1 | 2.51μs | 11.9ns | 47.6ns | 0 | 0 | 0 | 952 B |
| master | ExecuteAsync |
net472 | 2.58μs | 0.854ns | 3.19ns | 0.142 | 0 | 0 | 915 B |
| #7802 | ExecuteAsync |
net6.0 | 1.82μs | 0.317ns | 1.14ns | 0 | 0 | 0 | 952 B |
| #7802 | ExecuteAsync |
netcoreapp3.1 | 2.52μs | 10.7ns | 41.5ns | 0 | 0 | 0 | 952 B |
| #7802 | ExecuteAsync |
net472 | 2.6μs | 1.12ns | 4.17ns | 0.144 | 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 | 7.1μs | 13ns | 48.8ns | 0 | 0 | 0 | 2.36 KB |
| master | SendAsync |
netcoreapp3.1 | 8.63μs | 20.7ns | 77.4ns | 0 | 0 | 0 | 2.9 KB |
| master | SendAsync |
net472 | 11.9μs | 7.72ns | 29.9ns | 0.477 | 0 | 0 | 3.18 KB |
| #7802 | SendAsync |
net6.0 | 6.92μs | 4.56ns | 16.4ns | 0 | 0 | 0 | 2.36 KB |
| #7802 | SendAsync |
netcoreapp3.1 | 8.71μs | 30.5ns | 118ns | 0 | 0 | 0 | 2.9 KB |
| #7802 | SendAsync |
net472 | 11.9μs | 14.8ns | 57.4ns | 0.476 | 0 | 0 | 3.18 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7802
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
247.78 KB
272.63 KB
24.85 KB
10.03%
Fewer allocations 🎉 in #7802
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472
280.41 KB
276.82 KB
-3.58 KB
-1.28%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
272.77 KB
250.06 KB
-22.7 KB
-8.32%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 247.78 KB | 272.63 KB | 24.85 KB | 10.03% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 | 280.41 KB | 276.82 KB | -3.58 KB | -1.28% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 272.77 KB | 250.06 KB | -22.7 KB | -8.32% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 45μs | 263ns | 2.22μs | 0 | 0 | 0 | 43.44 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 47.4μs | 276ns | 2.2μs | 0 | 0 | 0 | 42.69 KB |
| master | StringConcatBenchmark |
net472 | 57.5μs | 98.8ns | 342ns | 0 | 0 | 0 | 57.34 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 486μs | 1.87μs | 6.74μs | 0 | 0 | 0 | 272.77 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 497μs | 1.09μs | 3.93μs | 0 | 0 | 0 | 247.78 KB |
| master | StringConcatAspectBenchmark |
net472 | 412μs | 2.31μs | 15.3μs | 0 | 0 | 0 | 280.41 KB |
| #7802 | StringConcatBenchmark |
net6.0 | 47.9μs | 333ns | 3.18μs | 0 | 0 | 0 | 43.59 KB |
| #7802 | StringConcatBenchmark |
netcoreapp3.1 | 50.2μs | 366ns | 3.57μs | 0 | 0 | 0 | 42.86 KB |
| #7802 | StringConcatBenchmark |
net472 | 58.7μs | 252ns | 977ns | 0 | 0 | 0 | 57.34 KB |
| #7802 | StringConcatAspectBenchmark |
net6.0 | 450μs | 1.66μs | 6.45μs | 0 | 0 | 0 | 250.06 KB |
| #7802 | StringConcatAspectBenchmark |
netcoreapp3.1 | 495μs | 1.28μs | 4.42μs | 0 | 0 | 0 | 272.63 KB |
| #7802 | StringConcatAspectBenchmark |
net472 | 411μs | 2.2μs | 13.2μs | 0 | 0 | 0 | 276.82 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 | 2.63μs | 2.48ns | 9.62ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.64μs | 6.6ns | 25.6ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
net472 | 3.84μs | 2.68ns | 9.68ns | 0.249 | 0 | 0 | 1.64 KB |
| #7802 | EnrichedLog |
net6.0 | 2.62μs | 13.7ns | 65.9ns | 0 | 0 | 0 | 1.71 KB |
| #7802 | EnrichedLog |
netcoreapp3.1 | 3.66μs | 18.5ns | 80.5ns | 0 | 0 | 0 | 1.7 KB |
| #7802 | EnrichedLog |
net472 | 4.07μs | 5.16ns | 20ns | 0.243 | 0 | 0 | 1.64 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 | 122μs | 77.1ns | 278ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
netcoreapp3.1 | 129μs | 366ns | 1.32μs | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
net472 | 167μs | 255ns | 989ns | 0 | 0 | 0 | 4.52 KB |
| #7802 | EnrichedLog |
net6.0 | 123μs | 74.6ns | 269ns | 0 | 0 | 0 | 4.31 KB |
| #7802 | EnrichedLog |
netcoreapp3.1 | 129μs | 229ns | 886ns | 0 | 0 | 0 | 4.31 KB |
| #7802 | EnrichedLog |
net472 | 167μs | 122ns | 471ns | 0 | 0 | 0 | 4.52 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 | 4.89μs | 11.9ns | 44.6ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.64μs | 16.2ns | 62.7ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
net472 | 7.45μs | 5.05ns | 18.9ns | 0.299 | 0 | 0 | 2.08 KB |
| #7802 | EnrichedLog |
net6.0 | 5.05μs | 7.62ns | 29.5ns | 0 | 0 | 0 | 2.26 KB |
| #7802 | EnrichedLog |
netcoreapp3.1 | 6.66μs | 21.2ns | 79.3ns | 0 | 0 | 0 | 2.26 KB |
| #7802 | EnrichedLog |
net472 | 7.78μs | 11.2ns | 43.3ns | 0.311 | 0 | 0 | 2.08 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 | 2μs | 5.68ns | 22ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
netcoreapp3.1 | 2.58μs | 12.8ns | 55.7ns | 0 | 0 | 0 | 1.2 KB |
| master | SendReceive |
net472 | 3.13μs | 5.7ns | 22.1ns | 0.186 | 0 | 0 | 1.2 KB |
| #7802 | SendReceive |
net6.0 | 1.95μs | 9.61ns | 43ns | 0 | 0 | 0 | 1.2 KB |
| #7802 | SendReceive |
netcoreapp3.1 | 2.6μs | 8.42ns | 32.6ns | 0 | 0 | 0 | 1.2 KB |
| #7802 | SendReceive |
net472 | 3.05μs | 5.46ns | 21.2ns | 0.183 | 0 | 0 | 1.2 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 | 4.32μs | 5.17ns | 20ns | 0 | 0 | 0 | 1.58 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.59μs | 14.3ns | 53.5ns | 0 | 0 | 0 | 1.63 KB |
| master | EnrichedLog |
net472 | 6.65μs | 6.56ns | 23.7ns | 0.3 | 0 | 0 | 2.03 KB |
| #7802 | EnrichedLog |
net6.0 | 4.37μs | 4.71ns | 18.2ns | 0 | 0 | 0 | 1.58 KB |
| #7802 | EnrichedLog |
netcoreapp3.1 | 5.52μs | 9.38ns | 36.3ns | 0 | 0 | 0 | 1.63 KB |
| #7802 | EnrichedLog |
net472 | 6.65μs | 8.15ns | 31.6ns | 0.298 | 0 | 0 | 2.03 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 | 764ns | 3.74ns | 15.9ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
netcoreapp3.1 | 984ns | 5.44ns | 33.1ns | 0 | 0 | 0 | 576 B |
| master | StartFinishSpan |
net472 | 966ns | 0.679ns | 2.63ns | 0.0916 | 0 | 0 | 578 B |
| master | StartFinishScope |
net6.0 | 954ns | 0.386ns | 1.44ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.22μs | 6.07ns | 27.1ns | 0 | 0 | 0 | 696 B |
| master | StartFinishScope |
net472 | 1.13μs | 0.625ns | 2.34ns | 0.102 | 0 | 0 | 658 B |
| #7802 | StartFinishSpan |
net6.0 | 786ns | 0.303ns | 1.17ns | 0 | 0 | 0 | 576 B |
| #7802 | StartFinishSpan |
netcoreapp3.1 | 1.01μs | 4.71ns | 18.2ns | 0 | 0 | 0 | 576 B |
| #7802 | StartFinishSpan |
net472 | 951ns | 0.186ns | 0.696ns | 0.0911 | 0 | 0 | 578 B |
| #7802 | StartFinishScope |
net6.0 | 935ns | 3.83ns | 13.8ns | 0 | 0 | 0 | 696 B |
| #7802 | StartFinishScope |
netcoreapp3.1 | 1.22μs | 0.726ns | 2.72ns | 0 | 0 | 0 | 696 B |
| #7802 | StartFinishScope |
net472 | 1.14μs | 0.221ns | 0.828ns | 0.103 | 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 | 1.05μs | 5.28ns | 21.8ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.44μs | 4.72ns | 17.7ns | 0 | 0 | 0 | 696 B |
| master | RunOnMethodBegin |
net472 | 1.46μs | 0.831ns | 3.22ns | 0.102 | 0 | 0 | 658 B |
| #7802 | RunOnMethodBegin |
net6.0 | 1.05μs | 5.54ns | 27.7ns | 0 | 0 | 0 | 696 B |
| #7802 | RunOnMethodBegin |
netcoreapp3.1 | 1.47μs | 6.46ns | 23.3ns | 0 | 0 | 0 | 696 B |
| #7802 | RunOnMethodBegin |
net472 | 1.47μs | 2.86ns | 11.1ns | 0.103 | 0 | 0 | 658 B |
Summary of changes
Reason for change
Implementation details
IsRunningInAzureFunctionsHost()andIsAzureFunctionsIsolated()with usage examplesaz functionapp log download→az webapp log download--log-path→--log-fileTest coverage
Documentation-only change.
Other details
N/A