-
Notifications
You must be signed in to change notification settings - Fork 140
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
Update http.route
data to align with OpenTelemetry.Instrumentation.AspNetCore output
#2989
Conversation
…ip, http.route, http.useragent Collecting tags, http.url with query string and not raw, http.client_ip, http.route, http.useragent
Fix snapshots fix snapshots fix test name Fix name snapshots
fix public api and fix attempts for mock agent try fix agent port in tests fix snapshots fix snapshots 2.1 fix error contains fix snapshots since rebase and verify helper has the scrubs guids
throughput
Fix return method Fix unit test query string unit tests fix timeout
longer timeout for security tests remove key duplicate in integration test log timeout add log
change way of starting tasks change the way task is initialized with real timeout change way initializing task catch the right exception catch exception better adjust token and crop query string fix substring
snapshots ignore fields reset some files
answer to comments fix api test fixing snapshots fix snapshots response to comments 2 fix publi api tests
…on in OwinWebApi2Tests
…ith the value of typedArg.ActionDescriptor?.AttributeRouteInfo?.Template when the Microsoft.AspNetCore.Mvc.BeforeAction diagnostic source event fires.
Snapshot tests include: - http.route is added to the NoFF tests (in addition to the WithFF test cases) - http.route is removed from the 'GET /' snapshot because the controller action's HttpGetAttribute does not have a route template - The 'GET /status-code/statusCode' requests have a change in case because http.route is set to the exact same value as its route template, which is camel-cased
Snapshot tests include: - http.route is added to the NoFF tests (in addition to the WithFF test cases) - http.route is removed from the 'GET /' snapshot because the controller action's HttpGetAttribute does not have a route template - The 'GET /status-code/statusCode' requests have a change in case because http.route is set to the exact same value as its route template, which is camel-cased
Snapshot tests include: - http.route is added to the NoFF tests (in addition to the WithFF test cases) - http.route is removed from the 'GET /' snapshot because the controller action's HttpGetAttribute does not have a route template - The 'GET /status-code/statusCode' requests have a change in case because http.route is set to the exact same value as its route template, which is camel-cased
Snapshot tests include: - http.route is added to the NoFF tests (in addition to the WithFF test cases) - http.route is removed from the 'GET /' snapshot because the controller action's HttpGetAttribute does not have a route template - The 'GET /status-code/statusCode' requests have a change in case because http.route is set to the exact same value as its route template, which is camel-cased
Snapshot tests include: - http.route is added to the NoFF tests (in addition to the WithFF test cases) - http.route is removed from the 'GET /' snapshot because the controller action's HttpGetAttribute does not have a route template - The 'GET /status-code/statusCode' requests have a change in case because http.route is set to the exact same value as its route template, which is camel-cased
Snapshot tests include: - http.route is added to the NoFF tests (in addition to the WithFF test cases) - http.route is removed from the 'GET /' snapshot because the controller action's HttpGetAttribute does not have a route template - The 'GET /status-code/statusCode' requests have a change in case because http.route is set to the exact same value as its route template, which is camel-cased
Snapshot tests include: - http.route is added to the NoFF tests (in addition to the WithFF test cases) - http.route is removed from the 'GET /' snapshot because the controller action's HttpGetAttribute does not have a route template - The 'GET /status-code/statusCode' requests have a change in case because http.route is set to the exact same value as its route template, which is camel-cased
Snapshot tests include: - http.route is added to the NoFF tests (in addition to the WithFF test cases) - http.route is removed from the 'GET /' snapshot because the controller action's HttpGetAttribute does not have a route template - The 'GET /status-code/statusCode' requests have a change in case because http.route is set to the exact same value as its route template, which is camel-cased
Snapshot tests include: - http.route is added to the NoFF tests (in addition to the WithFF test cases) - http.route is removed from the 'GET /' snapshot because the controller action's HttpGetAttribute does not have a route template - The 'GET /status-code/statusCode' requests have a change in case because http.route is set to the exact same value as its route template, which is camel-cased
…pshots. Snapshot tests include: - http.route is added to the NoFF tests (in addition to the WithFF test cases) - http.route is removed from the 'GET /' snapshot because the controller action's HttpGetAttribute does not have a route template - The 'GET /status-code/statusCode' requests have a change in case because http.route is set to the exact same value as its route template, which is camel-cased
…ots. Snapshot tests include: - http.route is added to the NoFF tests (in addition to the WithFF test cases) - http.route is removed from the 'GET /' snapshot because the controller action's HttpGetAttribute does not have a route template - The 'GET /status-code/statusCode' requests have a change in case because http.route is set to the exact same value as its route template, which is camel-cased
Snapshot tests include: - http.route is added to the NoFF tests (in addition to the WithFF test cases) - http.route is removed from the 'GET /' snapshot because the controller action's HttpGetAttribute does not have a route template - The 'GET /status-code/statusCode' requests have a change in case because http.route is set to the exact same value as its route template, which is camel-cased
…allsites where http.route is set, leaving the only setter during the Microsoft.AspNetCore.Mvc.BeforeAction diagnostic source event fires.
Snapshot tests include: - http.route is removed from the 'GET /' snapshot because the controller action's HttpGetAttribute does not have a route template
Benchmarks Report 🐌Benchmarks for #2989 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.AppSecBodyBenchmark - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.AppSecBodyBenchmark.BodyExtractorSimpleBody‑net472 | 1.123 | 249.88 | 280.70 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | AllCycleSimpleBody |
net472 | 1.68μs | 1.59ns | 6.16ns | 0.237 | 0 | 0 | 1.49 KB |
master | AllCycleSimpleBody |
netcoreapp3.1 | 1.87μs | 3.58ns | 13.8ns | 0.0186 | 0 | 0 | 1.37 KB |
master | AllCycleMoreComplexBody |
net472 | 16.9μs | 20ns | 72.2ns | 1.39 | 0.0251 | 0 | 8.75 KB |
master | AllCycleMoreComplexBody |
netcoreapp3.1 | 14.2μs | 14ns | 54.2ns | 0.106 | 0 | 0 | 7.85 KB |
master | BodyExtractorSimpleBody |
net472 | 250ns | 0.35ns | 1.31ns | 0.0574 | 0 | 0 | 361 B |
master | BodyExtractorSimpleBody |
netcoreapp3.1 | 220ns | 0.345ns | 1.34ns | 0.00364 | 0 | 0 | 272 B |
master | BodyExtractorMoreComplexBody |
net472 | 15.2μs | 14.4ns | 55.8ns | 1.2 | 0.0152 | 0 | 7.62 KB |
master | BodyExtractorMoreComplexBody |
netcoreapp3.1 | 12.8μs | 21.4ns | 80ns | 0.0889 | 0 | 0 | 6.75 KB |
#2989 | AllCycleSimpleBody |
net472 | 1.68μs | 1.58ns | 5.9ns | 0.237 | 0 | 0 | 1.49 KB |
#2989 | AllCycleSimpleBody |
netcoreapp3.1 | 1.78μs | 1.3ns | 4.88ns | 0.0187 | 0 | 0 | 1.37 KB |
#2989 | AllCycleMoreComplexBody |
net472 | 17μs | 13.5ns | 50.6ns | 1.39 | 0.017 | 0 | 8.75 KB |
#2989 | AllCycleMoreComplexBody |
netcoreapp3.1 | 13.8μs | 20.3ns | 78.7ns | 0.103 | 0 | 0 | 7.85 KB |
#2989 | BodyExtractorSimpleBody |
net472 | 281ns | 0.258ns | 0.999ns | 0.0573 | 0 | 0 | 361 B |
#2989 | BodyExtractorSimpleBody |
netcoreapp3.1 | 230ns | 0.438ns | 1.7ns | 0.00368 | 0 | 0 | 272 B |
#2989 | BodyExtractorMoreComplexBody |
net472 | 15.5μs | 12.1ns | 45.3ns | 1.21 | 0.0149 | 0 | 7.62 KB |
#2989 | BodyExtractorMoreComplexBody |
netcoreapp3.1 | 12.2μs | 24.8ns | 96.2ns | 0.0905 | 0 | 0 | 6.75 KB |
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #2989
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑netcoreapp3.1
19.98 KB
20.42 KB
440 B
2.20%
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑netcoreapp3.1 | 19.98 KB | 20.42 KB | 440 B | 2.20% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | SendRequest |
net472 | 0ns | 0ns | 0ns | 0 | 0 | 0 | 0 b |
master | SendRequest |
netcoreapp3.1 | 175μs | 89.6ns | 347ns | 0.263 | 0 | 0 | 19.98 KB |
#2989 | SendRequest |
net472 | 0ns | 0ns | 0ns | 0 | 0 | 0 | 0 b |
#2989 | SendRequest |
netcoreapp3.1 | 180μs | 145ns | 561ns | 0.27 | 0 | 0 | 20.42 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 |
net472 | 1.55μs | 0.469ns | 1.69ns | 0.126 | 0.000775 | 0 | 794 B |
master | ExecuteNonQuery |
netcoreapp3.1 | 1.32μs | 0.475ns | 1.78ns | 0.0112 | 0 | 0 | 824 B |
#2989 | ExecuteNonQuery |
net472 | 1.59μs | 0.819ns | 2.95ns | 0.126 | 0.000795 | 0 | 794 B |
#2989 | ExecuteNonQuery |
netcoreapp3.1 | 1.25μs | 0.428ns | 1.6ns | 0.0112 | 0 | 0 | 824 B |
Benchmarks.Trace.ElasticsearchBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #2989
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑netcoreapp3.1
1.139
1,603.58
1,407.95
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑netcoreapp3.1 | 1.139 | 1,603.58 | 1,407.95 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | CallElasticsearch |
net472 | 2.09μs | 3.97ns | 15.4ns | 0.159 | 0 | 0 | 1 KB |
master | CallElasticsearch |
netcoreapp3.1 | 1.39μs | 1.97ns | 7.64ns | 0.0132 | 0 | 0 | 984 B |
master | CallElasticsearchAsync |
net472 | 2.36μs | 4.26ns | 16.5ns | 0.18 | 0 | 0 | 1.14 KB |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.6μs | 1.85ns | 7.17ns | 0.0152 | 0 | 0 | 1.1 KB |
#2989 | CallElasticsearch |
net472 | 2.18μs | 3.31ns | 12.8ns | 0.159 | 0 | 0 | 1 KB |
#2989 | CallElasticsearch |
netcoreapp3.1 | 1.4μs | 2.14ns | 7.99ns | 0.0133 | 0 | 0 | 984 B |
#2989 | CallElasticsearchAsync |
net472 | 2.29μs | 2.08ns | 8.04ns | 0.18 | 0 | 0 | 1.14 KB |
#2989 | CallElasticsearchAsync |
netcoreapp3.1 | 1.41μs | 1.58ns | 6.11ns | 0.0147 | 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 |
net472 | 2.4μs | 4.68ns | 17.5ns | 0.2 | 0 | 0 | 1.26 KB |
master | ExecuteAsync |
netcoreapp3.1 | 1.51μs | 3.03ns | 11.8ns | 0.0167 | 0 | 0 | 1.22 KB |
#2989 | ExecuteAsync |
net472 | 2.34μs | 6.45ns | 25ns | 0.199 | 0 | 0 | 1.26 KB |
#2989 | ExecuteAsync |
netcoreapp3.1 | 1.56μs | 2.23ns | 8.65ns | 0.0164 | 0 | 0 | 1.22 KB |
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | SendAsync |
net472 | 5.13μs | 6.71ns | 24.2ns | 0.4 | 0 | 0 | 2.53 KB |
master | SendAsync |
netcoreapp3.1 | 3.56μs | 4.42ns | 15.9ns | 0.0338 | 0 | 0 | 2.44 KB |
#2989 | SendAsync |
net472 | 5.24μs | 12.1ns | 47ns | 0.4 | 0 | 0 | 2.53 KB |
#2989 | SendAsync |
netcoreapp3.1 | 3.51μs | 8ns | 31ns | 0.033 | 0 | 0 | 2.44 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 |
net472 | 3μs | 3.59ns | 13.9ns | 0.263 | 0 | 0 | 1.66 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.35μs | 2.09ns | 8.11ns | 0.0235 | 0 | 0 | 1.73 KB |
#2989 | EnrichedLog |
net472 | 2.83μs | 1.27ns | 4.91ns | 0.263 | 0 | 0 | 1.66 KB |
#2989 | EnrichedLog |
netcoreapp3.1 | 2.31μs | 2.09ns | 7.83ns | 0.0233 | 0 | 0 | 1.73 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 |
net472 | 147μs | 251ns | 974ns | 0.671 | 0.224 | 0 | 4.5 KB |
master | EnrichedLog |
netcoreapp3.1 | 111μs | 179ns | 669ns | 0.0553 | 0 | 0 | 4.38 KB |
#2989 | EnrichedLog |
net472 | 149μs | 204ns | 791ns | 0.664 | 0.221 | 0 | 4.5 KB |
#2989 | EnrichedLog |
netcoreapp3.1 | 112μs | 183ns | 710ns | 0.0566 | 0 | 0 | 4.38 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 |
net472 | 5.12μs | 5.45ns | 18.9ns | 0.544 | 0.00256 | 0 | 3.43 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.11μs | 6.41ns | 24ns | 0.051 | 0 | 0 | 3.8 KB |
#2989 | EnrichedLog |
net472 | 5.27μs | 7.97ns | 30.9ns | 0.546 | 0.00262 | 0 | 3.43 KB |
#2989 | EnrichedLog |
netcoreapp3.1 | 4.09μs | 9.11ns | 35.3ns | 0.0513 | 0 | 0 | 3.8 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 |
net472 | 1.97μs | 1.9ns | 7.37ns | 0.192 | 0 | 0 | 1.21 KB |
master | SendReceive |
netcoreapp3.1 | 1.68μs | 1.47ns | 5.49ns | 0.0159 | 0 | 0 | 1.2 KB |
#2989 | SendReceive |
net472 | 2.1μs | 0.857ns | 3.21ns | 0.192 | 0 | 0 | 1.21 KB |
#2989 | SendReceive |
netcoreapp3.1 | 1.7μs | 0.637ns | 2.47ns | 0.0161 | 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 |
net472 | 4.59μs | 5.48ns | 21.2ns | 0.329 | 0 | 0 | 2.08 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.1μs | 5.16ns | 20ns | 0.0227 | 0 | 0 | 1.69 KB |
#2989 | EnrichedLog |
net472 | 4.59μs | 4.93ns | 19.1ns | 0.328 | 0 | 0 | 2.08 KB |
#2989 | EnrichedLog |
netcoreapp3.1 | 4.28μs | 4.82ns | 18ns | 0.0214 | 0 | 0 | 1.69 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 |
net472 | 826ns | 0.377ns | 1.46ns | 0.104 | 0 | 0 | 658 B |
master | StartFinishSpan |
netcoreapp3.1 | 767ns | 0.294ns | 1.14ns | 0.0089 | 0 | 0 | 648 B |
master | StartFinishScope |
net472 | 1.05μs | 0.77ns | 2.98ns | 0.117 | 0 | 0 | 738 B |
master | StartFinishScope |
netcoreapp3.1 | 862ns | 0.488ns | 1.76ns | 0.0104 | 0 | 0 | 768 B |
#2989 | StartFinishSpan |
net472 | 806ns | 0.674ns | 2.61ns | 0.104 | 0 | 0 | 658 B |
#2989 | StartFinishSpan |
netcoreapp3.1 | 780ns | 0.195ns | 0.703ns | 0.00901 | 0 | 0 | 648 B |
#2989 | StartFinishScope |
net472 | 1.06μs | 0.809ns | 3.13ns | 0.117 | 0 | 0 | 738 B |
#2989 | StartFinishScope |
netcoreapp3.1 | 906ns | 0.25ns | 0.903ns | 0.0105 | 0 | 0 | 768 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 |
net472 | 1.26μs | 0.835ns | 3.23ns | 0.117 | 0 | 0 | 738 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 1.09μs | 0.335ns | 1.25ns | 0.0103 | 0 | 0 | 768 B |
#2989 | RunOnMethodBegin |
net472 | 1.22μs | 0.961ns | 3.72ns | 0.117 | 0 | 0 | 738 B |
#2989 | RunOnMethodBegin |
netcoreapp3.1 | 1.06μs | 0.38ns | 1.47ns | 0.0106 | 0 | 0 | 768 B |
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.
Thanks for the very understandable commit sequence, made it easy to review!🙌 but I have mixed feelings about the PR generally...
I completely agree with you that we should align with OTEL here given we have a clean-slate, and if they don't normalize then we shouldn't either.
But I think there's some issues with the implementation, due to the 2x2 grid of possible routing styles conventional vs attribute and Endpoint vs legacy.
- This PR does not include conventional routes. I think that's an error, those endpoints absolutely do have routes. I commented on all the cases of this I saw, just to make sure we catch them all.
- I think this will cause an issue for endpoints which don't use MVC. i.e. direct endpoint routed (e.g. minimal APIs) won't trigger the BeforeMvc DianosticObserver event, so I think we'll be missing that tag (I don't see the snapshots updated, so that seems to be the case)
- If we've adding the tag to the span 100% of the time, I think this should be a "fast-path" tag property?
@@ -793,6 +793,9 @@ private void OnMvcBeforeAction(object arg) | |||
{ | |||
span = StartMvcCoreSpan(tracer, parentSpan, typedArg, httpContext, request); | |||
} | |||
|
|||
// Override the http.route to match the OpenTelemetry implementation | |||
parentSpan.SetTag(Tags.HttpRoute, typedArg.ActionDescriptor?.AttributeRouteInfo?.Template); |
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.
If we're adding this to every aspnetcore span, we should probably update AspNetCoreTags
to use a property instead of falling back to the dictionary slow-path
@@ -33,7 +33,6 @@ | |||
http.client_ip: 127.0.0.1, | |||
http.method: GET, | |||
http.request.headers.host: localhost:00000, | |||
http.route: {controller=home}/{action=index}/{id?}, |
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 this is correct 🤔 Every ASP.NET Core path has a route, it's just that some are conventionally routed and some use attribute routing + some use endpoint routing and some use legacy routing... This is using conventional endpoint routing IIRC....
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.
That's a good point, I've added a comment in this PR to see if OTEL can adopt the conventional routing pattern for their non-attribute routed spans
@@ -33,7 +33,6 @@ | |||
http.client_ip: 127.0.0.1, | |||
http.method: GET, | |||
http.request.headers.host: localhost:00000, | |||
http.route: {controller=home}/{action=index}/{id?}, |
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.
Same argument as before - conventionally routed requests still have a route
@@ -33,7 +33,6 @@ | |||
http.client_ip: 127.0.0.1, | |||
http.method: GET, | |||
http.request.headers.host: localhost:00000, | |||
http.route: {controller=home}/{action=index}/{id?}, |
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.
conventional routing
@@ -33,7 +33,6 @@ | |||
http.client_ip: 127.0.0.1, | |||
http.method: GET, | |||
http.request.headers.host: localhost:00000, | |||
http.route: {controller=home}/{action=index}/{id?}, |
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.
conventional routing
@@ -33,7 +33,6 @@ | |||
http.client_ip: 127.0.0.1, | |||
http.method: GET, | |||
http.request.headers.host: localhost:00000, | |||
http.route: {controller=home}/{action=index}/{id?}, |
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.
conventional routing
@@ -37,7 +37,6 @@ | |||
http.request.headers.sample_correlation_identifier: 0000-0000-0000, | |||
http.response.headers.sample_correlation_identifier: 0000-0000-0000, | |||
http.response.headers.server: Kestrel, | |||
http.route: {controller=home}/{action=index}/{id?}, |
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.
conventional routing
@@ -14,7 +14,6 @@ | |||
http.client_ip: 127.0.0.1, | |||
http.method: GET, | |||
http.request.headers.host: localhost:00000, | |||
http.route: /api/delay/{seconds}, |
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.
Lies, they do have a route template 😛 It's just a conventional route template
@@ -14,7 +14,6 @@ | |||
http.client_ip: 127.0.0.1, | |||
http.method: GET, | |||
http.request.headers.host: localhost:00000, | |||
http.route: /api/delay/{seconds}, |
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.
conventional
@@ -18,7 +18,6 @@ | |||
http.request.headers.sample_correlation_identifier: 0000-0000-0000, | |||
http.response.headers.sample_correlation_identifier: 0000-0000-0000, | |||
http.response.headers.server: Kestrel, | |||
http.route: /api/delay/{seconds}, |
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.
conventional
217fdcd
to
cebed4c
Compare
Summary of changes
Modifies the addition of the
http.route
tag (introduced in #2915) to match the value provided by the OpenTelemetry.Instrumentation.AspNetCore package. You can see the current source code in that package here and I've validated by hand that thehttp.route
tags provided by the OTEL instrumentation and the new values embedded in our snapshots match. Snapshot changes include:http.route
tag is added to all of the NoFF snapshotshttp.route
tag is removed from theGET /
request snapshots because theHttpGetAttribute
that decorates its controller action does not have a templatehttp.route
in theGET /status-code/statusCode
request snapshots are updated fromstatus-code-string/{statuscode}
tostatus-code-string/{statusCode}
(notice the uppercaseC
)To review the snapshot changes, I advise viewing this one commit at a time. Each commit handles both the NoFF/WithFF scenarios for a given test application and its deployment (e.g.
AspNetCoreIisMvc30Tests.InProcess
,AspNetCoreIisMvc30Tests.OutOfProcess
).Reason for change
Since we are introducing a new tag
http.route
that is also standardized by OpenTelemetry, I'd like to align the output with the .NET OTEL SDK's instrumentation now so we don't have to update it (and perhaps customer monitors) later.Implementation details
Updates the AspNetCoreDiagnosticObserver to set the
http.route
when handling theMicrosoft.AspNetCore.Mvc.BeforeAction
diagnostic event and removes all other locations wherehttp.route
was being set.Test coverage
Same tests as before, just updated snapshots
Other details
This is targeting the
zach/remove-headertags-owintest
branch, so please wait until #2986 is merged before merging this.