I'm in the process of trialling MS Application Insgihts on a Web Application deployed to Azure.
One thing that doesn't seem to be available out of the box is segregation of stats/anayltics by deployment environment.
Just wondering has anyone done this already and how the went about achieving it?
Here's what I was thinking.
Create 4 seperate "Applications" within AI (each with their own App Name & Component Id)
Add a single ApplicationInsights.config to the Web Application Project
Manually Add App.Config Transforms to the application to replace the ComponentName & ComponentId at build time based on the Configuratoin (QA, UAT or Prod)
Add Conditional Compilation Symbols to the Web Application Build Configurations (QA, UAT, PROD)
Add "#if QA" pre-processor directives to the razor _layout view to swap in the correct ComponentId into the javascript snippet at build time.
Thoughts?
Here is what we did.
In layout javascript get the appId:
appInsights.start("@ServerAnalytics.ApplicationInsightsId");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With