-
Notifications
You must be signed in to change notification settings - Fork 292
Monitor performance and diagnose issues
This article explains how to diagnose performance issues in a web or mobile application in Microsoft Azure by using Visual Studio Application Insights, HockeyApp and the diagnostic tools in Visual Studio 2015.
You need an Azure account to use Application Insights. You can:
-
Open an Azure account for free. You get credits that can be used to try out paid Azure services. Even after the credits are used up, you can keep the account and use free Azure services and features, such as the Web Apps feature in Azure App Service.
-
Activate Visual Studio subscriber benefits. Your Visual Studio subscription gives you credits every month that you can use for paid Azure services.
-
Get credits every month by joining Visual Studio Dev Essentials.
If you want to get started with Azure App Service before you sign up for an Azure account, go to Create your Azure App Service app. There, you can immediately create a short-lived starter web app in App Service—a credit card is not required, and there are no commitments.
To start, set up your development environment by installing the latest version of the Azure SDK.
If you don't have Visual Studio installed, use the link for Visual Studio 2015, and Visual Studio will be installed along with the SDK for Universal Windows applications.
Alternatively, and depending on the type of target project that you want to monitor, install the Xamarin platform and also those platforms which are part of the project, or Visual Studio Tools for Apache Cordova.
There are two separate performance monitoring offerings that meet the differing requirements of device and server apps:
- HockeyApp for device apps helps you with app versioning and distribution as well as collecting user feedback, crash reports, and app telemetry. This is ideal for phone apps and Windows Store apps.
- Application Insights for web apps and services monitors usage and performance and provides powerful performance diagnostic tools. In this demo, Application Insights is ideal both for the web app in Azure app service and the Azure mobile app service, which provides the back end for your mobile client apps.
As a sample, you can use our demo app, which is an example of the web service component that supports a mobile client.
- Download and extract the code from: https://github.com/Microsoft/HealthClinic.biz
- Open 06_Demos_MobileApp.sln in Visual Studio.
In Solution Explorer, right-click the web app project.
- Select Add Application Insights; or
- Choose Application Insights > Configure Application Insights.
- Under Register your app with Application Insights, click Change
- Sign in to Azure in this window if required.
- Click Update resource
This does two things:
- Sets up a new Application Insights resource in Azure, where your telemetry will be stored, analyzed and displayed.
- Adds the Application Insights SDK to your code, and configures it to send to the new resource.
- Use the Visual Studio 'publish' feature to upload and start the app.
- To get more comprehensive telemetry, link the app in Azure to its Application Insights resource:
- In the Azure portal open your web app's control panel.
- Choose Tools > Performance monitoring > Click here > Application Insights and then select the Application Insights resource.
-
Make some use of the app, so as to generate some telemetry.
-
In the Azure portal, open the Application Insights resource of your web app.
-
Click through any of the charts that shows data, to get more detail.
Here are some more things you can do to analyze your data:
- Open the Search blade to find and inspect individual requests, or exceptions
- Use Metrics explorer to make customized charts of request counts, success rates, response times, dependency calls, and exceptions.
- Go to Analytics to create powerful queries over your app's telemetry.
- Create Dashboards showing the metric and analytics charts that are most important to you and your team.
Application Insights will send you alert emails:
- Smart alerts are automatically configured by Application Insights (after a few days of substantial traffic). They will email you to warn of unusual changes in your web app's failed response rate.
- Alerts on metric thresholds can be set manually on metrics of your choice.
- Availability web tests send test requests to your web app at frequent intervals from our points of presence around the world.
You can analyze the data that is reported by Application Insights in Azure in the Azure portal. By doing this, you can see metrics and debug data from the application.
You can also analyze this data from Visual Studio. To do this, click the Application Insights button that is available on the menu bar. This displays a window with the Application Insights loading screen.
After Application Insights starts, Application Insights information about the latest project is displayed. To change the project or Azure subscription, select the project or existing subscription in the window.
From this window, you can view information about the project that is saved in Application Insights.
You can view detailed information, browse different dates, or filter different types of saved events from this window.
To monitor the client apps, use HockeyApp.
- HockeyApp for iOS
- HockeyApp for Android
- HockeyApp for Universal Windows apps
- HockeyApp and Xamarin
- HockeyApp and Cordova
For some types of app, you can right-click the project in Solution Explorer, and use HockeyApp tools:
- Enable crash reporting - adds the HockeyApp SDK to the app, so that telemetry is sent back to HockeyApp
- Distribute with HockeyApp - publish the app to HockeyApp so that you can supervise distribution to test and beta users, and collect feedback from them.
To use these tools, make sure you have the latest update of Visual Studio, and the latest version of the Developer Analytics Tools extension. In Tools > Extensions and updates, open Updates and run any that are available.
=================================
- Application Insights overview
- Azure Developer Tools for more information about the tools and for the recently released installers
- HockeyApp