I'm using TelemetryClient (v0.17.0.576) directly in my code and it looks like I can push data to Azure only when I manually call Flush at the end which feels wrong. Am I missing something here ?
var configuration = TelemetryConfiguration.CreateDefault();
configuration.InstrumentationKey = "KEY";
var client = new TelemetryClient(configuration);
for (int i = 0; i < 10; i++)
{
log.Information("Loop: {0} {1}", i, value);
client.Track(new TraceTelemetry(value));
}
client.Flush();
For performance reasons, the Application Insights SDK batches telemetry and sends it up in chunks. To see this in action you can replace your Flush call with a call to Thread.Sleep (70000) and you will see the instrumentation uploaded to AI once the app terminates.