I have a console application that runs through a web job scheduler after 15 minutes interval. But problem is that Application Insight Telemetry does not send data without using Thread.Sleep at the end of the code.
private static void Main(string[] args)
{
Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.InstrumentationKey = "APPINSIGHTS_INSTRUMENTATIONKEY";
//do others stuff
System.Threading.Thread.Sleep(10000);
}
Here, I am using 10 sec for thread sleep. But sometimes it misses some data of the last portion. But, after giving 70 sec it working fine.
I want to know, what is the minimum sleep time where every data will be sent.
Or, there is any other way which does not need Thread.Sleep.