Use the non truncated UserAgent property in .netfx webapi#2128
Merged
pierotibou merged 6 commits intomasterfrom Dec 7, 2021
Merged
Use the non truncated UserAgent property in .netfx webapi#2128pierotibou merged 6 commits intomasterfrom
pierotibou merged 6 commits intomasterfrom
Conversation
- Change the code to pass the useragent when needed - Impact webapi integration tests
andrewlock
approved these changes
Dec 6, 2021
Member
andrewlock
left a comment
There was a problem hiding this comment.
Looks good, just a few questions
Removing useless log line Co-authored-by: Andrew Lock <[email protected]>
Co-authored-by: Andrew Lock <[email protected]>
This comment has been minimized.
This comment has been minimized.
Member
Benchmarks Report 🐌Benchmarks for #2128 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Unknown 🤷 Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Slower
|
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net472 | 1.158 | 3,503.10 | 4,056.40 |
Raw results
| Branch | Method | Toolchain | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteAsync |
net472 | 3.533 μs | 0.0672 μs | 0.0825 μs | 0.1809 | 0.0000 | 0.0000 | 1.14 KB |
| master | ExecuteAsync |
netcoreapp3.1 | 1.887 μs | 0.0222 μs | 0.0208 μs | 0.0160 | 0.0000 | 0.0000 | 1.14 KB |
| #2128 | ExecuteAsync |
net472 | 4.059 μs | 0.0799 μs | 0.0785 μs | 0.1810 | 0.0000 | 0.0000 | 1.14 KB |
| #2128 | ExecuteAsync |
netcoreapp3.1 | 1.990 μs | 0.0349 μs | 0.0512 μs | 0.0163 | 0.0000 | 0.0000 | 1.14 KB |
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 | 6.030 μs | 0.1199 μs | 0.1937 μs | 0.3621 | 0.0000 | 0.0000 | 2.26 KB |
| master | SendAsync |
netcoreapp3.1 | 4.414 μs | 0.0770 μs | 0.0643 μs | 0.0319 | 0.0000 | 0.0000 | 2.25 KB |
| #2128 | SendAsync |
net472 | 6.054 μs | 0.1196 μs | 0.1118 μs | 0.3630 | 0.0000 | 0.0000 | 2.26 KB |
| #2128 | SendAsync |
netcoreapp3.1 | 4.304 μs | 0.0546 μs | 0.0511 μs | 0.0314 | 0.0000 | 0.0000 | 2.25 KB |
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net472 | 4.307 μs | 0.0846 μs | 0.0974 μs | 0.3665 | 0.0000 | 0.0000 | 2.27 KB |
| master | EnrichedLog |
netcoreapp3.1 | 4.126 μs | 0.0524 μs | 0.0465 μs | 0.0370 | 0.0000 | 0.0000 | 2.58 KB |
| #2128 | EnrichedLog |
net472 | 4.309 μs | 0.0857 μs | 0.0880 μs | 0.3657 | 0.0000 | 0.0000 | 2.27 KB |
| #2128 | EnrichedLog |
netcoreapp3.1 | 4.265 μs | 0.0556 μs | 0.0520 μs | 0.0370 | 0.0000 | 0.0000 | 2.58 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 | 180.6 μs | 3.57 μs | 5.77 μs | 0.6897 | 0.2586 | 0.0000 | 5.43 KB |
| master | EnrichedLog |
netcoreapp3.1 | 146.5 μs | 2.27 μs | 3.32 μs | 0.0721 | 0.0000 | 0.0000 | 5.42 KB |
| #2128 | EnrichedLog |
net472 | 172.8 μs | 2.39 μs | 2.00 μs | 0.6849 | 0.2568 | 0.0000 | 5.43 KB |
| #2128 | EnrichedLog |
netcoreapp3.1 | 147.4 μs | 2.23 μs | 1.98 μs | 0.0741 | 0.0000 | 0.0000 | 5.42 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 | 12.25 μs | 0.166 μs | 0.148 μs | 0.8956 | 0.0000 | 0.0000 | 5.58 KB |
| master | EnrichedLog |
netcoreapp3.1 | 10.25 μs | 0.168 μs | 0.149 μs | 0.0983 | 0.0000 | 0.0000 | 6.92 KB |
| #2128 | EnrichedLog |
net472 | 11.59 μs | 0.156 μs | 0.138 μs | 0.8975 | 0.0000 | 0.0000 | 5.58 KB |
| #2128 | EnrichedLog |
netcoreapp3.1 | 10.63 μs | 0.206 μs | 0.211 μs | 0.0993 | 0.0000 | 0.0000 | 6.92 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.294 μs | 0.0440 μs | 0.0489 μs | 0.1678 | 0.0000 | 0.0000 | 1.04 KB |
| master | SendReceive |
netcoreapp3.1 | 1.965 μs | 0.0361 μs | 0.0320 μs | 0.0155 | 0.0000 | 0.0000 | 1.12 KB |
| #2128 | SendReceive |
net472 | 2.253 μs | 0.0421 μs | 0.0351 μs | 0.1669 | 0.0000 | 0.0000 | 1.04 KB |
| #2128 | SendReceive |
netcoreapp3.1 | 2.046 μs | 0.0261 μs | 0.0244 μs | 0.0161 | 0.0000 | 0.0000 | 1.12 KB |
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.838 μs | 0.1493 μs | 0.1396 μs | 0.5283 | 0.0000 | 0.0000 | 3.28 KB |
| master | EnrichedLog |
netcoreapp3.1 | 8.483 μs | 0.1695 μs | 0.1884 μs | 0.0462 | 0.0000 | 0.0000 | 3.25 KB |
| #2128 | EnrichedLog |
net472 | 7.923 μs | 0.0721 μs | 0.0602 μs | 0.5255 | 0.0000 | 0.0000 | 3.28 KB |
| #2128 | EnrichedLog |
netcoreapp3.1 | 7.684 μs | 0.1009 μs | 0.0944 μs | 0.0460 | 0.0000 | 0.0000 | 3.25 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 | 886.5 ns | 10.39 ns | 9.72 ns | 0.0681 | 0.0000 | 0.0000 | 433 B |
| master | StartFinishSpan |
netcoreapp3.1 | 878.4 ns | 17.05 ns | 25.52 ns | 0.0060 | 0.0000 | 0.0000 | 432 B |
| master | StartFinishScope |
net472 | 1,159.1 ns | 12.20 ns | 10.82 ns | 0.0930 | 0.0000 | 0.0000 | 594 B |
| master | StartFinishScope |
netcoreapp3.1 | 1,151.3 ns | 10.82 ns | 9.59 ns | 0.0097 | 0.0000 | 0.0000 | 712 B |
| #2128 | StartFinishSpan |
net472 | 899.6 ns | 17.17 ns | 16.86 ns | 0.0680 | 0.0000 | 0.0000 | 433 B |
| #2128 | StartFinishSpan |
netcoreapp3.1 | 856.8 ns | 8.79 ns | 8.22 ns | 0.0060 | 0.0000 | 0.0000 | 432 B |
| #2128 | StartFinishScope |
net472 | 1,182.7 ns | 23.22 ns | 38.15 ns | 0.0930 | 0.0000 | 0.0000 | 594 B |
| #2128 | StartFinishScope |
netcoreapp3.1 | 1,134.0 ns | 9.91 ns | 9.27 ns | 0.0098 | 0.0000 | 0.0000 | 712 B |
Member
Code Coverage Report 📊✔️ Merging #2128 into master will not change line coverage
View the full report for further details: Datadog.Trace Breakdown ✔️
The following classes have significant coverage changes.
View the full reports for further details: |
lucaspimentel
approved these changes
Dec 6, 2021
| public const string Origin = "x-datadog-origin"; | ||
|
|
||
| /// <summary> | ||
| /// Origin of the distributed trace. |
pierotibou
added a commit
that referenced
this pull request
Dec 27, 2021
* Fix Typo * Use the non truncated UserAgent property in .netfx webapi - Change the code to pass the useragent when needed - Impact webapi integration tests * Update tracer/src/Datadog.Trace/SpanContextPropagator.cs Removing useless log line Co-authored-by: Andrew Lock <[email protected]> * Update tracer/src/Datadog.Trace/SpanContextPropagator.cs Co-authored-by: Andrew Lock <[email protected]> * Implement one comment * Fix Public Api Tests and add a UTest Co-authored-by: Andrew Lock <[email protected]>
pierotibou
added a commit
that referenced
this pull request
Jan 6, 2022
* Use the non truncated UserAgent property in .netfx webapi (#2128) * Fix Typo * Use the non truncated UserAgent property in .netfx webapi - Change the code to pass the useragent when needed - Impact webapi integration tests * Update tracer/src/Datadog.Trace/SpanContextPropagator.cs Removing useless log line Co-authored-by: Andrew Lock <[email protected]> * Update tracer/src/Datadog.Trace/SpanContextPropagator.cs Co-authored-by: Andrew Lock <[email protected]> * Implement one comment * Fix Public Api Tests and add a UTest Co-authored-by: Andrew Lock <[email protected]> * Do not normalize periods in header tags if specified by the customer (#2205) * Fix normalization following Anna's spec * Add Feature Flag * change feature flag name * Add CallTarget Verified files They are actually the call site ones, the naming is inverted in the test Co-authored-by: Andrew Lock <[email protected]>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We are propagating headers when asked. But, in webapi, the useragent collection is handled differently and the first header value returns only a substring of the UA, until the first space.
I added support to the UserAgent property provided by web api and relied on this one instead.
Jira: AIT-321
@DataDog/apm-dotnet