ASP.NET Core Goals - GibraltarSoftware/Loupe.Agent.Core GitHub Wiki

Request Metric

We want to record extended information for every dynamic request in a common format we can analyze. At a minimum we want to record:

  • Start and End Timestamp
  • Duration
  • Request: The controller and action referenced by the request
  • Controller Name: The short-form name of the controller used for the request (not the .NET class name)
  • Action Name: The short-form name of the action used for the request (not the .NET method name)
  • Controller Type: The class name of the controller used for the request
  • Http Method
  • Parameters
  • Correlation Id: A unique Id for this request for correlation.
  • Session Id: Optional value - Unique Id of the user's session. For stringing together requests from the same session.
  • Client Session Id: Optional value - Unique Id of a client session requesting this
  • UserName: Optional value - the user key for authenticated requests.

Additionally, we'd like to be able to separate dynamic requests (ones that result in content handled programmatically) from static requests (ones that just grab files or pre-calculated output). Since ASP.NET Core is modular this may take the form of recognizing the module that originates handling the request.

Automatic Logging

We want to record without additional user code one message per dynamic request at the start of the request to the log. This message should be attributed to the controller and method that is handling the request and include the calling parameters, user name, correlation, and session information.

If the request completes with a 400-series status a corresponding warning should be recorded that can be matched with the start request log message.

If the request completes with a 500-series status code a corresponding error should be recorded that can be matched with the start request log message. If an exception was thrown that should be included in the log message.