Expand each operation to view the operation details. This includes a complete performance history of how many slow requests were affected by this operation vs. other slow operations, and the avg. operation duration during slow requests. It also shows the operation-specific details, such as application stacktrace or SQL query text.

Finally, you can also view the sampled detailed request traces that involved this operation.

Click "Show traces for affected requests" to view the detailed request traces for requests affected by this operation.

It works by tracking operations that take place during the execution of the request, and correlating that data with the request-level monitoring information LeanSentry already collects. LeanSentry can track the following operations:

IIS and ASP.NET modules.

SQL queries.

HTTP/REST service calls made by your application (*)

Application code (*)

(*) Requires optional LeanSentry.ApplicationMonitoring.dll library.

The LeanSentry Agent automatically tracks operations that are traced by IIS and ASP.NET, such as IIS/ASP.NET modules and SQL queries.

To enable tracing of HTTP/REST service calls, and arbitrary application code, your application needs to use LeanSentry.ApplicationMonitoring.dll library.

This is a lighweight application instrumentation library that you can use to trace arbitrary operations within your application code.

Unlike a profiler, which indiscriminately intercepts the execution of every method inside your application and usually has a significant performance overhead, this approach allows you to control how much instrumentation you want to have. As a result, it allows you to get continuous 24/7 operation tracking in production without the overhead.

In most cases, having just a few tracked operations at the top level is enough to identify the cause of slow loads. Then you can simply add more instrumentation to get more resolution.

NOTE: LeanSentry.ApplicationMonitoring.Automatic.Mvc.dll automatically enables tracing for ASP.NET MVC controller actions and views without additional code changes. It only works for applications using ASP.NET 4.0+.

If you are using an older version of the framework/MVC, do not use this library - instead simply instrument your code with trackers. You can use the included action and view wrapper classes to manually instrument your MVC controllers and views.

In both cases, LeanSentry.ApplicationMonitoring.dll will allow you to trace outgoing HTTP/REST calls made by your application, and any custom trackers you add.

WARNING: To insure security, make sure the libraries are signed by LeanServer LLC:

Use new Tracker("OperationName") to track any operation in your code!

[C#] using (new Tracker("Downloading data")) {
// Do something ...
}

[VB.NET] Using tracker As New Tracker("Downloading data")
' Do something ...
End Using

You can also do more with trackers:

- Log arbitrary information using trackers for debugging purposes, and have this information show up in your detailed request logs:

[VB.NET] Using tracker As New Tracker("Downloading data", TrackingDetail.CpuTime or TrackingDetail.FullStack)
' Do something ...
End Using

Frequently asked questions

1. How does LeanSentry track operations?

The operations are tracked from the lightweight ETW event trace generated for each request by IIS.

2. What is the performance impact of operation tracking?

The impact for most workloads is typically less than 1% CPU even if you have thousands of trackers per second, due to the high-performance nature of ETW tracing. The LeanSentry.ApplicationMonitoring.dll library was tested with workloads up to 5000RPS per server, with negligible performance overhead. This is significantly faster than most other application instrumentation libraries including System.Diagnostics or log4net.

Additionally, because LeanSentry.ApplicationMonitoring only traces operations you chose, it has SIGNIFICANTLY lower overhead then a profiler.

3. Where can I see custom information I log with the Tracker class?

You can see all traced operations, and all of their custom state, when viewing the detailed request trace for the request. You can find detailed request traces for slow or failed requests on the website's Performance page, the URL details page for a specific URL, or when viewing any of the tracked slow operation entries.

4. How do I debug tracing errors?

Startup exceptionsIf the library encounters a problem, it WILL NOT prevent your application from starting by default.

Instead, it will log the error to the EventLog (it will be visible in the LeanSentry dashboard).

If you would like to debug any tracing issues, you can enable startup exceptions to be thrown by adding the following: