-
Notifications
You must be signed in to change notification settings - Fork 702
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
Add event tracing to NuGet.Common and write events for the NuGet-based MSBuid project SDK resolver #5409
Conversation
src/NuGet.Core/Microsoft.Build.NuGetSdkResolver/NuGetSdkResolverEventSource.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/Microsoft.Build.NuGetSdkResolver/NuGetSdkResolver.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/Microsoft.Build.NuGetSdkResolver/GlobalJsonReader.cs
Outdated
Show resolved
Hide resolved
I like that idea. @zivkan has some experience with the events and he did a lot of work on the VS side with, so he's probably the best person to review it. |
Yes, I'd approve without hesitation. I've been thinking about how we can monitor NuGet better since mid to late 2020, but there's always higher priority work. But adding an EventSource so we can start using it more is very much needed. It probably would have been nice to add some instrumentation into NuGetAudit to get detailed perf & diagnostic data in case someone ends up reporting a difficult to reproduce bug. The only thing I haven't thought about is naming conventions for events. If we're going to have all NuGet assemblies using one provider, we need event names to include the assembly name, or feature area, so we don't end up with dumb event names like Since the
While this PR's first iteration uses a class that extends |
This has now been moved to |
84cfb1a
to
0bafeab
Compare
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.
LGTM.
The only thing I could think of is whether the EventKeywords need to be defined in common instead maybe in the assemblies themselves.
Keywords have to be a flags so I was worried that if they weren't declared in one place then we could end up with collisions. I can move them but their just constants that we'll never change so I wasn't as worried about them being part of the public API |
Bug
Fixes: NuGet/Home#11445
Regression? Last working version:
Description
This adds a new
EventSource
to NuGet.Common and writes events for the NuGet-based MSBuild project SDK resolver.I also implemented the following Keywords:
NuGet.Common
namespaceNuGet.Configuration
namespaceThis will allow users to filter out potential components that aren't necessary for a particular trace.
Users will be able to enable the tracing with tools like PerfView:
The resulting Event Trace Log (.etl) will be useful when diagnosing issues with it. The above command also includes traces from MSBuild and there are additional sources like Visual Studio which include more information.
Here is a sample trace log you can view in tools like PerfView:
PerfViewData.etl.zip
Its also possible to create these traces with Visual Studio and
dotnet trace
PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation