2
votes

I have added Application Insights to an existing Web API project. It appears to be working in that I can see traces and dependencies (to Azure storage) showing up.

However requests are not showing at all. I was initially testing with an existing POST method but decided to add a new GET method that simply return the string "OK". This also did not show as a request.

At this stage I decided to check if exceptions would show so added a throw as the first line of my method. Interestingly this time I could see the reqest (but not the exception!?) in Application Insights.

Is there anything in the pipeline that could somehow be swallowing the call to stop it appearing? This is a .NET Classic 4.6.2 app and I never really much delved into the pipeline of this version of .NET.

1

1 Answers

0
votes

According to your description, I suggest you could firstly check the Application Insights.config file.

In this file, you could find the AdaptiveSamplingTelemetryProcessor node.

In this node, it contains ExcludedTypes.

<ExcludedTypes>Trace;Exception</ExcludedTypes>

This means:

A semi-colon delimited list of types that you do not want to be sampled. Recognized types are: Dependency, Event, Exception, PageView, Request, Trace. All instances of the specified types are transmitted; the types that are not specified are sampled.

Besides, if your application sends a lot of data and you are using the Application Insights SDK for ASP.NET version 2.0.0-beta3 or later, the adaptive sampling feature may operate and send only a percentage of your telemetry.

It will not send all your request to the Application Insights.

You can disable it, but this is not recommended. Sampling is designed so that related telemetry is correctly transmitted, for diagnostic purposes.