Open mleenhardt opened 4 years ago
A diagnostics summary like this would be nice to have available without needing to work with a dump or worry about the target architecture.
For an example use cases that would be interesting to me:
We will occasionally have (third-party, of course) dependencies that have un-synchronized access to a non-thread safe collection (like a Dictionary<K, V>). If we see three cores pegged on the process and thread stacks show three threads with a Dictionary<,>.Insert stack trace then we can easily diagnose where that is happening and push a fix to the upstream.
cc @josalem who was writing a similar tool a while ago- https://github.com/josalem/DotStack
I like this feature but I'd like to return a JSON representation of the stacks not a textual one so that we could build a nice UI on top (someday) 😄
I like this feature but I'd like to return a JSON representation of the stacks not a textual one so that we could build a nice UI on top (someday) 😄
Accept
ftw
I could not get the sample by @josalem working, I guess due to change in API with unsupported format error etc. So I put together a sample with EventPipe trace code and stack related code borrowed from his sample. https://github.com/sukesh-ak/EventPipe-Diagnostics
Do let me know if you have any suggestions.
FYI, we've added a /stacks
route to dotnet monitor
in 7.0 RC 1 as an experimental feature:
At the release of 7.0, it will remain an experimental feature.
We are continuing to invest in this feature and hope to fully support it in a post-7.0 release. Please give it a try and let us know about any feedback you have for it!
We wrote a much simpler version of dotnet monitor that uses
Microsoft.Diagnostics.Runtime
to help with high level debugging of remote processes running in Kubernetes. Our implementation returns a stack trace of all threads in a given process, as well as the type composition of all heaps, ordered by object size. This is very convenient to get a feel for what a process is doing without having to download a dump and load it indotnet analyze
.e.g. In our implementation,
http://localhost:52323/dump
returns something that looks likeWould it be feasible or would you be interested in supporting a similar feature? Maybe in two different endpoints
/stacktrace
and/heap
?