Events
Mar 17, 11 PM - Mar 21, 11 PM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When enabled, Snapshot Debugger automatically collects a debug snapshot of the source code and variables when an exception occurs in your live .NET application. The Snapshot Debugger in Application Insights:
Learn more about the Snapshot Debugger and Snapshot Uploader processes.
Snapshot collection is available for:
The following environments are supported:
Note
Client applications (for example, WPF, Windows Forms, or UWP) aren't supported.
ApplicationInsights.config
.The Snapshot Debugger is implemented as an Application Insights telemetry processor. When your application runs, the Snapshot Debugger telemetry processor is added to your application's system-generated logs pipeline.
Important
Snapshots might contain personal data or other sensitive information in variable and parameter values. Snapshot data is stored in the same region as your Application Insights resource.
The Snapshot Debugger process starts and ends with the TrackException
method. A process snapshot is a suspended clone of the running process, so that your users experience little to no interruption. In a typical scenario:
Your application throws the TrackException
.
The Snapshot Debugger monitors exceptions as they're thrown by subscribing to the AppDomain.CurrentDomain.FirstChanceException
event.
A counter is incremented for the problem ID.
ThresholdForSnapshotting
value, the problem ID is added to a collection plan.Note
The ThresholdForSnapshotting
default minimum value is 1. With this value, your app has to trigger the same exception twice before a snapshot is created.
The exception event's problem ID is computed and compared against the problem IDs in the collection plan.
If there's a match between problem IDs, a snapshot of the running process is created.
Note
The snapshot creation rate is limited by the SnapshotsPerTenMinutesLimit
setting. By default, the limit is one snapshot every 10 minutes.
After the FirstChanceException
handler returns, the thrown exception is processed as normal.
The exception reaches the TrackException
method again and is reported to Application Insights, along with the snapshot identifier.
Note
Set IsEnabledInDeveloperMode
to true
if you want to generate snapshots while you debug in Visual Studio.
While the Snapshot Debugger process continues to run and serve traffic to users with little interruption, the snapshot is handed off to the Snapshot Uploader process. In a typical scenario, the Snapshot Uploader:
Creates a minidump.
Uploads the minidump to Application Insights, along with any relevant symbol (.pdb) files.
Note
No more than 50 snapshots per day can be uploaded.
If you enabled the Snapshot Debugger but you aren't seeing snapshots, see the Troubleshooting guide.
Snapshot Debugger auto-upgrades via the built-in, preinstalled Application Insights site extension.
Manually adding an Application Insights site extension to keep Snapshot Debugger up-to-date is deprecated.
The Snapshot Debugger is designed for use in production environments. The default settings include rate limits to minimize the impact on your applications.
However, you may experience small CPU, memory, and I/O overhead associated with the Snapshot Debugger, such as:
TrackException
is calledThere is no additional cost for storing data captured by Snapshot Debugger.
See example scenarios in which you may experience Snapshot Debugger overhead.
This section discusses limitations for the Snapshot Debugger.
Data retention
Debug snapshots are stored for 15 days. The default data retention policy is set on a per-application basis. If you need to increase this value, you can request an increase by opening a support case in the Azure portal. For each Application Insights instance, a maximum number of 50 snapshots are allowed per day.
Publish symbols
The Snapshot Debugger requires symbol files on the production server to:
By default, Visual Studio 2017 versions 15.2+ publishes symbols for release builds when it publishes to App Service.
In prior versions, you must add the following line to your publish profile .pubxml
file so that symbols are published in release mode:
<ExcludeGeneratedDebugSymbol>False</ExcludeGeneratedDebugSymbol>
For Azure Compute and other types, make sure that the symbol files are either:
.dll
(typically, wwwroot/bin
), orFor more information on the different symbol options that are available, see the Visual Studio documentation. For best results, we recommend that you use Full, Portable, or Embedded.
Optimized builds
In some cases, local variables can't be viewed in release builds because of optimizations applied by the JIT compiler.
However, in App Service, the Snapshot Debugger can deoptimize throwing methods that are part of its collection plan.
Tip
Install the Application Insights Site extension in your instance of App Service to get deoptimization support.
Enable the Application Insights Snapshot Debugger for your application:
Events
Mar 17, 11 PM - Mar 21, 11 PM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Learning path
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization