Read | Practice | Advance
In this article i will discuss regarding Application insight and how developer can integrate application insight in there web application easily.
Microsoft has provided application performance monitoring service to monitor Azure web application named Application Insights(AI). It is lightweight and extensible analytics platform which records the performance and usage of a live web applications. Preparing different reports from this records app developer can take decision about the direction of the design in each development life-cycle. Though it is Microsoft product it supports a wide variety of platforms including .NET, Node.js and J2EE, hosted on-premises or in the cloud.
To get analytical data regarding web application, it needs to integrate AI in web application. When developer integrate AI in web application than web application pushes different telemetry to azure application insight resource for analysis. Web can push data from three sources
Using Application Insights we can get idea how an app is performing and how it's being used. we can get following information from AI
There are several ways to integrate application insight in web application. I will show the easiest way.
Developer have to do following task integrate
We can create application insight resource in azure from two places
As it is application specific data so I will show how to create in application label so that we can monitor from both places.
NB:Here I consider you have created web application in azure.
2. Collect application insight resource information
From the above screen click on "view more in application insights". Following screen will show the different information's
Developers need to add JavaScript following in html page. If application have muster page then add there otherwise have to add in each page.
<!-- To collect end-user usage analytics about your application, insert the following script into each page you want to track. Place this code immediately before the closing </head> tag, and before any other scripts. Your first data will appear automatically in just a few seconds. --> <script type="text/javascript"> var appInsights=window.appInsights||function(config){ function i(config){t[config]=function(){var i=arguments;t.queue.push(function(){t[config].apply(t,i)})}}var t={config:config},u=document,e=window,o="script",s="AuthenticatedUserContext",h="start",c="stop",l="Track",a=l+"Event",v=l+"Page",y=u.createElement(o),r,f;y.src=config.url||"https://az416426.vo.msecnd.net/scripts/a/ai.0.js";u.getElementsByTagName(o)[0].parentNode.appendChild(y);try{t.cookie=u.cookie}catch(p){}for(t.queue=[],t.version="1.0",r=["Event","Exception","Metric","PageView","Trace","Dependency"];r.length;)i("track"+r.pop());return i("set"+s),i("clear"+s),i(h+a),i(c+a),i(h+v),i(c+v),i("flush"),config.disableExceptionTracking||(r="onerror",i("_"+r),f=e[r],e[r]=function(config,i,u,e,o){var s=f&&f(config,i,u,e,o);return s!==!0&&t["_"+r](config,i,u,e,o),s}),t }({ instrumentationKey:"Key" }); window.appInsights=appInsights; appInsights.trackPageView(); </script>
To push server telemetry add the application insight SDK from NuGet.
You can collect this code from azure. Here you will also get code sample for c# push and custom matrices.
Thanks for this post.I need more details for Socket Programming?