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.
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
[ASP.NET Core] Add
error.type
attribute for tracing and metrics #4986[ASP.NET Core] Add
error.type
attribute for tracing and metrics #4986Changes from 14 commits
15fd6ff
80ac64f
fbe3eb5
219519f
1d03f34
a7e39de
e240c6b
f6a8e42
34419b5
6a173ab
2ad4a4a
386573d
a84e7a9
2350dc7
2f44398
d9a2b19
ef2bdd3
ea5e5dc
cd73339
20be1e3
6bf11e0
9777eac
7927e10
a36104c
b59075c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Would the framework create an activity even if only add AspNetCore metrics instrumentation? If yes, then I think we could add this information to
Activity.Current
. Do you know of any obvious pros and cons to adding this information toHttpContext
vsActivity.Current
?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.
yes, the activity will always be there. Perf was the main reason to choose
HttpContext.Items
. However, we could use custom property as well on activity. Here are the results from benchmarkingResults when trace is also enabled and activity will have additional tags.
Results when only metrics will be enabled and activity will only have one tag
Based on above, I have updated the implementation to use custom property. We could follow the same thing on HttpClient side where we need to add
error.type
.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.
IIRC the first time you add a custom property to activity you pay for an allocation. Are we already adding one somewhere else? Seems a bit odd that the allocation isn't showing in the benchmark.
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.
@CodeBlanch Good catch. The alloc is not showing up in the benchmark as it is getting ignored due to multiple runs. I have switched back to using context.items and it improved the look up as well using the minor tweak on the context key suggested by you. here are the results.