Introduction
In this article, we learn about Application Insights SDK setup in a local environment using Visual Studio 2019 community edition. It helped to diagnose issues by using Application Insight SDK in Visual Studio 2019. By using this SDK, we can get collection-level information using application insights telemetry such as request rates, response times and failure rates, exceptions, etc.
Prerequisites
- Visual Studio 2019 - Community Edition
- Azure SDK
Learning Series
- Part 1
- Part 2
- Part 3
- Part 4
Step 1. Right-click on your application and select the ‘Configure Application Insights’ option, as shown in the below screenshot.
Step 2. Select the first option, Application Insights SDK (Local), and click on the ‘Next’ button, as shown in the below screenshot.
Step 3. In the below screenshot, your Application Insights information will be fetched based on your subscription which is mapped with your email ID using Visual Studio 2019. Select your valid Application Insights App service name and click on ‘Next’ for the next process.
If your Visual Studio is not retrieving your Azure subscription or app services, you need to re-login with your valid login details which are mapped with your Azure subscription service so that it retrieves all your subscriptions and application insights services using Visual Studio 2019.
Step 4. Now it’s re-validate the application insights connection string and click on ‘Next’ for the project dependencies section.
Step 5. Select all checkboxes as shown in the below screenshot and click on the ‘Finish’ button.
Step 6. The configuration process was done and is shown in the below screenshot.
Step 7. Now select the ‘View’ option - > go ‘Other Windows’ -> select the Application Insights Search option as shown in the below screenshot.
Step 8. The basic Application Insights dashboard was opened and options were available for basic local environments like in the below screenshot.
- Application Insights Dashboard tab.
- Search option for all types of collection-level logs.
- Application Insights Information details.
- Time ranges for all collections – Filters for basic visual analytics.
- All types of Collections.
Step 9. Select a custom range and provide from and to dates to retrieve collection-level traces.
In this section, you’ll get all collection level logs, statistics graphs, more filters which is available in Refine By Section, etc.
- Collection Level details are separated by count level.
- Statistics graph available for selected time ranges, collection level, etc.
- Results in the selected range of information would be very helpful for logging.
- Refine Section will help to filter the sections like Requests, Dependencies, and request URLs.
- Stack information will be listed in detail along with execution time, request type, request URL, device type, collection type information, etc.
Step 10. The diagnostic tool will provide Process Memory, Events, and CPU % for all collections.
- In Application Insights logging, operation ID will play a major role in filtering, getting logs, collections involved in selected operation ID, etc. This type of information very much helps the developer to debug more into the application.
- In the below screenshot, the statistics graph for the request collection level for a selected particular ID.
- Stack information in detail.
- Refine section.
- Search new data with the selected operation ID.
Step 11. If there are multiple application that needs to be monitored, you can easily switch to another application insights, shown in the below screengrab.
Step 12. The time range filter option will help to get the last log information within the selected time range options.
Step 13
- Statistics graphs will be separated and presented, which includes collection-level colors.
- This is an easy way to get the collection level for selected logs, as shown in the below screenshot.
- Request details for selected details.
- The collection-level log information will be displayed here.
In the next article, we learn how to access application insights app service on the portal level, here.
Happy Logging