diagnostics icon indicating copy to clipboard operation
diagnostics copied to clipboard

Add dumprequests command to sos

Open davidfowl opened this issue 6 years ago • 6 comments

The dumprequests command will show all executing requests in the captured dump. It should have a statistics view of all the requests grouped by path and should allow digging into a specific "async stack" for a request.

Super high level (maybe seemingly obvious):

  • It should support all servers (Kestrel, IIS, HttpSysServer)
  • It should support Http1 and Http2 (Http3 etc)

WIP:

> dumprequests -stat

Statistics:
                    Path    |  StatusCode   | Protocol      | ResponseStarted
                --------------------------------------------------------------
                     /      |     500       |   HTTP/1      |   True
                     /grpc  |     200       |   HTTP/2      |   False

Total 100 Requests

davidfowl avatar Oct 06 '19 05:10 davidfowl

By default I am putting all the incoming feature requests into 5.0. If you had something ready much sooner than that we can still PR it.

noahfalk avatar Oct 08 '19 03:10 noahfalk

@noahfalk yep expected, I think we'll need some iteration on the design before doing anything else here.

davidfowl avatar Oct 08 '19 03:10 davidfowl

hello, i would be willing to work on this if i get a pointer where to start from .

crnegule avatar Jan 11 '22 08:01 crnegule

Looking at the command examples like dumpasync in https://github.com/dotnet/diagnostics/blob/50a1ea135699ce5c5d10a49c49e672597b95c99c/src/Microsoft.Diagnostics.ExtensionCommands/DumpAsyncCommand.cs is probably the best way to start. There is a little documentation on SOS extensibility here: https://github.com/dotnet/diagnostics/blob/main/documentation/design-docs/dotnet-dump-extensibility.md

mikem8361 avatar Oct 12 '22 20:10 mikem8361

It's probably much simpler that dump async 😄. It should be as "simple" as finding all of the requests in memory and doing some digging around the various object models to grab state from them.

cc @halter73 @Tratcher @adityamandaleeka

davidfowl avatar Oct 13 '22 06:10 davidfowl

What about outgoing HTTP requests? It's also very useful to dump requests with headers and content when available. It should be a separate command, I think.

Filter options:

  • Request URL
  • Response status code
  • Request/response header value (eg. filter by trace id)
  • Request/response body size (find heavy requests)

Ne4to avatar Apr 25 '23 05:04 Ne4to