Video: How to use Azure Monitor Application Insights to record custom events | Azure Tips and Tricks
>> Learn how to use Azure Application Insights to make your application logging smarter with Custom Event Tracking in this episode of Azure Tips and Tricks. Azure Application Insights is a powerful monitoring tool that you can use to track everything about your application. You can also use Application Insights to track custom information. Let's do that for this application in Visual Studio.
Here I have an ASP.net core MVC application. I've already set up Application Insights for it but I'll show you how to add it if you haven't yet. It's simple. You can right-click on the "Project file" and click "Add Application Insights Telemetry". This takes you to the ad app insights wizard. This application is already running in Azure with Application Insights enabled. But if you want, you can add a new application insights instance from here as well. All I need to do now is add the Application Insights SDK by clicking here. All right. There it goes. Now that the SDK is added, I can show you how I use it to track custom events. I do that. For instance here, in the HomeController, I do that by referencing this package and then I create a telemetry client like this. I can use the client to talk to application insights. Here I do just that. The application uses this method to filter and search for things and I want to know what users are searching for or filtering on. So here, I send custom events to application insights.
Use this as it will provide powerful insights about your application..