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.
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:{
// your code here
}
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.{
tracker["PartitionKey"] = "1";
// your code here
}
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? Try LeanSentry free for 14 days.