c# - Application Insights Exceptions and Failures -
i'm trying work application insights in azure preview portal , visual studio 2015 community edition. i'm encountering 3 different problems suspect related. i'm wondering if others encountering these issues.
in 1 of test web applications, app-insight tool partially working. in i'm getting errors concerning irretrievable data. in third, i'm running deployment failures when use app-insight resources in new resource group.
i present 3 in question, because suspect may have same root cause.
partial results
the first app tried retrofit app-insight work , display app-insight telemetry...or @ least works. half telemetry data shows, , rest not make it.
the sequence of setting follows:
i started installing sample mobile-mvc app came msdn magazine article, june 2015. after fiddling around adding bootstrap make responsive pages, decided commit code vs online git , deploy azure web app.
i followed instructions view logs in application insights , ran application succeeds in launching browser , allowing me interact site. however, during exercise tons of exceptions showing in visual studio output window. i've included small snippet here, i've bolded interesting 2 pieces:
exception thrown: 'system.methodaccessexception' in microsoft.applicationinsights.extensibility.dependencycollector.dll exception thrown: 'system.typeinitializationexception' in microsoft.applicationinsights.extensibility.dependencycollector.dll exception thrown: 'system.typeinitializationexception' in microsoft.applicationinsights.extensibility.dependencycollector.dll applicationinsightshttpmodule failed @ initialization exception: system.typeinitializationexception: type initializer 'microsoft.applicationinsights.extensibility.dependencycollector.tracing.dependencycollectoreventsource' threw exception. ---> system.methodaccessexception: attempt method 'microsoft.applicationinsights.extensibility.dependencycollector.tracing.dependencycollectoreventsource..ctor()' access method 'microsoft.applicationinsights.extensibility.implementation.tracing.applicationnameprovider..ctor()' failed.
@ microsoft.applicationinsights.extensibility.dependencycollector.tracing.dependencycollectoreventsource..ctor() @ microsoft.applicationinsights.extensibility.dependencycollector.tracing.dependencycollectoreventsource..cctor() --- end of inner exception stack trace --- @ microsoft.applicationinsights.extensibility.dependencycollector.dependencytrackingtelemetrymodule.initialize(telemetryconfiguration configuration) @ microsoft.applicationinsights.extensibility.implementation.telemetryconfigurationfactory.initializecomponents(ienumerable components, telemetryconfiguration configuration) @ microsoft.applicationinsights.extensibility.implementation.telemetryconfigurationfactory.initializecomponents(telemetryconfiguration configuration) @ microsoft.applicationinsights.extensibility.implementation.telemetryconfigurationfactory.initialize(telemetryconfiguration configuration) @ microsoft.applicationinsights.extensibility.telemetryconfiguration.get_active() @ microsoft.applicationinsights.extensibility.web.applicationinsightshttpmodule..ctor()[msg=log error];[msg=system.typeloadexception: not load type 'microsoft.applicationinsights.channel.jsonserializer' assembly 'microsoft.applicationinsights, version=1.2.0.5639, culture=neutral, publickeytoken=31bf3856ad364e35'. @ microsoft.applicationinsights.extensibility.web.implementation.telemetryserializer.d__0.movenext() @ system.runtime.compilerservices.asynctaskmethodbuilder.start[tstatemachine](tstatemachine& statemachine) @ microsoft.applicationinsights.extensibility.web.implementation.telemetryserializer.serializeasync(ienumerable
1 items) @ microsoft.applicationinsights.extensibility.web.implementation.telemetrybuffer.<>c__displayclass5.<flushasync>b__3() @ system.threading.tasks.task
1.innerinvoke() @ system.threading.tasks.task.execute() --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ microsoft.applicationinsights.extensibility.web.implementation.telemetrybuffer.d__7.movenext() --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ microsoft.applicationinsights.extensibility.implementation.tasktimer.<>c__displayclass1.<b__0>d__3.movenext()]
my azure portal receiving telemetry on things, not others. in short, ability produce telemetry crippled, suggested above exceptions.
now next problem.
new resource group
using preview portal, created brand new resource group called "sandbox". again using preview portal, made brand new web application called "scratchweb" assigned "sandbox" resource group.
the deployment of web resource completes, there associated application insight resource called ""microsoft.website3cb98c31-893c"" automatically created experiences dozen or time-out errors before declared failed deployment. below show example of 1 of timeout errors, final error gives key information.
operation id 1e2094cece6531f1 tracking id 31283062-9061-4dcf-bd42-f9885abbf596 status gatewaytimeout provisioning state running timestamp 9/28/2015 10:37:59 pm duration pt30.7117477s type microsoft.insights/components resource id /subscriptions/da769a1f-78d8-4d45-b9b3-c15ea0c89ca2/resourcegroups/sandbox/providers/microsoft.insights/components/scratchweb statusmessage {"code":"gatewaytimeout","message":"request timed out","innererror":{"diagnosticcontext":"034b642f-aece-494b-9ede-f8b015f5bfeb","time":"2015-09-29t05:37:59.8355234z","data":"d0fe44bb-8317-4359-bf2c-160f1eb00433"}} resource scratchweb
and here final failure error message:
operation id 1e2094cece6531f1 tracking id 08dbbf0a-0d4a-4692-9b1a-3603a984d40d status conflict provisioning state failed timestamp 9/28/2015 10:48:16 pm duration pt10m47.5300298s type microsoft.insights/components resource id /subscriptions/da769a1f-78d8-4d45-b9b3-c15ea0c89ca2/resourcegroups/sandbox/providers/microsoft.insights/components/scratchweb statusmessage {"code":"the component existed in different resource group.","message":"the component existed in different resource group.","innererror":{"diagnosticcontext":"9ea42d3d-4dbf-46e8-a188-eac09a4ddb09","time":"2015-09-29t05:48:15.7282268z"}} resource scratchweb
is because "application insights" preview not capable of running in more 1 resource group, or because subscription doesn't allow it?
the weirdest part once deployment of app-insights resource failed, nevertheless seems have been created , not visible inside application insights resource collection.
now last problem...
original resource group
if try create new web site in existing, default web app resource group...then none of aforementioned problems occurs. unfortunately problem. "application insight" resource blade tells me "error retrieving data" when tries show me charts. on other hand, visual studio tells me fine...it says "congratulations, have published first app insight data."
so, in end, have 1 web application viewable app-insight results, , results crippled. attempt create 2nd working web app app-insight unsuccessful regardless if used existing resource group or tried new one.
with visual studio 2015 used 2 different approaches try adding app-insight sdk. tried adding web project after-the-fact, , tried adding new project template. scenario got anything work when instrumented first web app "after-the-fact" app-insight sdk. unfortunately (1) results crippled , (2) i've described above, can't achieve "crippled" results second time. right app-insight capability unworkable me.
try removing references application insights, clean project. add nuget package microsoft.applicationinsights.web, @ version 1.2.1.
pm> install-package microsoft.applicationinsights.web
this install required dependencies. once installed, create application insights resource in subscription (follow instructions @ add application insights sdk monitor asp.net app) , add instrumentation key app. i'd recommend putting instrumentation key in web.config settings:
<appsettings> <add key="appinsightsinstrumentationkey" value="your-key-value" /> </appsettings>
and adding application in application_start
like:
telemetryconfiguration.active.instrumentationkey = configurationmanager.appsettings["appinsightsinstrumentationkey"] ?? "some-default-key";
update ---
there more troubleshooting information here.
- if browser events not being logged:
- if there firewall in front of browser client, might have open tcp ports 80 , 443 outgoing traffic dc.services.visualstudio.com , f5.services.visualstudio.com.
- in browser developer tools, "track" entry on network tab - should posting data https://dc.services.visualstudio.com/v2/track (or fc...)
- if server data not recording:
- install application insights via azure portal: browse webapp >> tools >> extensions, install application insights extension.
Comments
Post a Comment