How to make sure no telemetry is lost when querying Application Insights in a Visual Studio (local debug session of ASP.NET CORE)?

Viewed 163

I have an ASP .NET Core app with Application Insights added. I run it locally in debug mode, send in requests at a rate of 10 per second, then examine the telemetry. I see less than half of request telemetry events from ASP and less than half of trace events produced by ILogger inside my own code. I know about adaptive sampling, but thought that trace events are excluded from it by default? (seeing how applications logs become traces in App Insights). I tried adding explicit config to make sure no telemetry is lost, but so far it didn't work:

services.AddApplicationInsightsTelemetry((ApplicationInsightsServiceOptions opt) =>
{
opt.DeveloperMode = true;
opt.EnableAdaptiveSampling = false;
});

Can I somehow configure App Insights to gather 100% of telemetry in local debug?

Update after playing around with configuration and suggestions, I noticed that visual Studio debug session is limited to searching the last 250 events, and this is what deletes my telemetry.

only the most recent 250 events are available for debug sessions

0 Answers
Related