f

BUSINESS TIER This feature is available for Business plans only. Enable

Add code-level tracing to your application with just a few lines of code.

By default, LeanSentry tracing is limited in resolution to the trace events provided by IIS and ASP.NET. You can gain code-level resolution by adding lightweight trackers to the few portions of your code likely to cause slow requests.

This enables:

1. Tracking of slow operations at code level (for operations you instrument).

2. Ability to publish custom debug state for tracked operations to enable more complex debugging of only-sometimes-slow operations.


Adding trackers

To add a tracker, reference the LeanSentry.ApplicationMonitoring.dll library in your application, and surround tracked code with a tracker:

using(new Tracker("Connecting to SQL"))
{
// your code here
}
You can then publish additional information about this operation by adding properties to the tracker:

using(var tracker = new Tracker("Connecting to SQL"))
{
tracker["PartitionKey"] = "1";
// your code here
}
This information will then be available in selected slow request traces for this operation.

This feature is available on the plan.




More resources


Want to learn the best techniques for managing your IIS web server? Join our how-to newsletter.
Want to get the best tool for troubleshooting and tuning your web apps? .

Build your skills


Get performance best practices straight from our IIS & ASP.NET experts:


How-to newsletter: 1-2 emails/week with expert IIS & ASP.NET tips.