Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.Net Application Insights 2.5 not tracking HTTP requests

I have a ASP .Net MVC app which is using Application Insights for telemetry tracking. It works fine when debugging the application from any developer machine with localhost, but when deployed to our main development environment web server, the HTTP requests are no longer being tracked.

Everything else, including exception, dependencies, traces, are all being tracked properly. But HTTP requests are not. How can I find the cause of this issue? I'm not sure where to start.

We are using Application Insights SDK 2.5.0.61767. The config file is the same across all machines. Not sure what else could be causing it. Any suggestions welcome.

EDIT: I noticed it is also not collecting Server Response Time, Server Requests, and Failed Requests.

I have the following module configuration in the ApplicationInsights.config file:

<Add Type="Microsoft.ApplicationInsights.Web.RequestTrackingTelemetryModule, Microsoft.AI.Web">
  <Handlers>
    <!-- 
    Add entries here to filter out additional handlers: 

    NOTE: handler configuration will be lost upon NuGet upgrade.
    -->
    <Add>System.Web.Handlers.TransferRequestHandler</Add>
    <Add>Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler</Add>
    <Add>System.Web.StaticFileHandler</Add>
    <Add>System.Web.Handlers.AssemblyResourceLoader</Add>
    <Add>System.Web.Optimization.BundleHandler</Add>
    <Add>System.Web.Script.Services.ScriptHandlerFactory</Add>
    <Add>System.Web.Handlers.TraceHandler</Add>
    <Add>System.Web.Services.Discovery.DiscoveryRequestHandler</Add>
    <Add>System.Web.HttpDebugHandler</Add>
  </Handlers>
</Add>
like image 787
blizz Avatar asked Oct 22 '25 20:10

blizz


1 Answers

Adding the following section to my web.config has fixed the issue for me.

<system.webServer>
  <modules>
      <add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="integratedMode,managedHandler" />
      <add name="ApplicationInsightsHttpModule" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
  </modules>
</system.webServer>
like image 112
blizz Avatar answered Oct 25 '25 18:10

blizz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!