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.
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:
- Performance issues including resourcing problems and dependencies
- Pageviews, user, and session counts
- 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:
- 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.
- Open the Optimizely B2B Commerce on the Visual Studio
- Right-click on “InsiteCommerce.Web” project
- Select “Configure Application Insights”
- On the Connect Service tab, select “Application Insights SDK (local)”
- Click on “next” and “finish.” This installs the required for Application Insight.
- Once you install the Nuget package successfully, you’ll expand the InsiteCommerce.Web and locate the “ApplicationInsights.config”
- Copy the node “<InstrumentationKey>Your Key</InstrumentationKey>” and paste it to the top of the file
- Replace “Your Key” with what we have copied during the Application Insights instance setup
- 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.