Commerce

How to Monitor Performance Using Application Insights

Monitoring your website performance is a key factor to ensure your application performs as expected. There are a lot of application performance monitoring (APM) tools available in the market that can be used to monitor the performance of the application, such as NewRelic, Azure Monitor, AppDynamics, and others. In this post, I’ll talk more about Application Insights, which is a performance monitoring tool provided by Microsoft.

What is Application Insights?

Application Insights is a powerful APM within the Azure Monitor. It monitors and delivers real-time data to detect and diagnose app issues.

In addition to monitoring, the tool gathers and compiles user data to reveal how an app is utilized. This helps developers review and improve the app performance bottleneck.

Application Insights has built-in support for .NET, Java, Node.js, Python, and client-side JavaScript-based applications. In this blog, we’ll talk about .NET applications and how they can be integrated with the Optimizely B2B Commerce SDK version.

What Application Insights Monitors

Application Insights is aimed to assist the development team to help them understand how the app is performing and how it’s used. It monitors:

  1. Performance issues including resourcing problems and dependencies
  2. Pageviews, user, and session counts
  3. Errors and diagnostics codes, etc.

How to Configure Application Insights in Your Project or Application

The configuration of Application Insights is very simple and straightforward. Together we’ll learn how to configure Application Insights on Optimizely B2B Commerce framework.

Before starting the configuration of Application Insights in your application, you’ll need to first create the Application Insights instance using the Azure Portal.

Below are the steps to create the Application Insight instance using the Azure Portal:

  1. Login to the Azure Portal then follow the steps shown in the video.

Once all the above steps have been completed, your Application Insights is finally set up and ready to collect data.

Below are steps to configure Application Insights in your applications. For this blog post, we’re setting up Application Insights for an Optimizely B2B Commerce Framework.

  1. Open the Optimizely B2B Commerce on the Visual Studio
  2. Right-click on “InsiteCommerce.Web” project
  3. Select “Configure Application Insights”
  4. On the Connect Service tab, select “Application Insights SDK (local)”
  5. Click on “next” and “finish.” This installs the required for Application Insight.
  6. Once you install the Nuget package successfully, you’ll expand the InsiteCommerce.Web and locate the “ApplicationInsights.config”
  7. Copy the node “<InstrumentationKey>Your Key</InstrumentationKey>” and paste it to the top of the file
  8. Replace “Your Key” with what we have copied during the Application Insights instance setup
  9. Finally, build and run the application/website on your local instance

Refer to the below video for all the steps mentioned above:

If all of the above steps are executed successfully, you’ll be able to see the Application Map and logs/traces into the Application Insights. You can see this in the screenshot below:

These are the initial steps to configure Application Insights in your project/application. In the next blog, we’ll talk about the details on implementing custom logging in Application Insights from the Optimizely B2B commerce framework. For more information on these processes, contact our experts today.

 

About the Author

Nitin Garg is a Lead Technical Consultant with a demonstrated history of working in the information technology and services industry. He has over 10 years of experience in the eCommerce domain using the platform like (Insite Commerce & Znode B2B commerce) and .Net based application.

More from this Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.