How to troubleshoot missing "traces" in ApplicationInsights using PerfView

Rory 26 Reputation points
2023-02-22T23:55:51.9033333+00:00

I have an asp.net core app deployed on a VM (not in Azure) with AppInsights. It mostly works fine but I've found many entries I'd expect in 'traces' and 'exceptions' are not there. I use nlog to write to a text log file on the server and I can easily find logs that are written to the log file and not to AppInsights. I've checked my ingestion limit, retention, and sampling and I see no problems there. I've used PerfView to make a trace when logs should be written, but how can I interpret this to find what's going wrong? There are no obvious "error" events that i see.

I do see three events in the Microsoft-ApplicationInsights-Data/Message type that shows the log messages that I'm missing. So they have reached AppInsights locally at some level. But where should I look next to see whether these events were attempted to be uploaded to the server?

In App Insights on azure portal I can see other events, e.g. "requests" from that app running on that server, and I see a couple of other "traces" entries (so it sometimes works). I'm using the default of only logging WARN and ERROR to AppInsights so wouldn't expect to see lots of entries.

I've referred to this article on troubleshooting but I see no tips on where to look once I've captured an etl trace.

I'm using InstrumentationKey (not connection string) to write to app insights. I use 'standard' ILogger logging from my .net code. I'm missing entries that would have been written from both logger.logWarning(), logger.LogError() as well as unhandled exceptions.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,645 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.