File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
articles/azure-monitor/app Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -169,10 +169,14 @@ namespace ConsoleApp
169
169
// before exit, flush the remaining data
170
170
telemetryClient .Flush ();
171
171
172
- // flush is not blocking when not using InMemoryChannel so wait a bit. There is an active issue regarding the need for `Sleep`/`Delay`
173
- // which is tracked here: https://github.com/microsoft/ApplicationInsights-dotnet/issues/407
172
+ // Console apps should use the WorkerService package.
173
+ // This uses ServerTelemetryChannel which does not have synchronous flushing.
174
+ // For this reason we add a short 5s delay in this sample.
175
+
174
176
Task .Delay (5000 ).Wait ();
175
177
178
+ // If you're using InMemoryChannel, Flush() is synchronous and the short delay is not required.
179
+
176
180
}
177
181
178
182
static DependencyTrackingTelemetryModule InitializeDependencyTracking (TelemetryConfiguration configuration )
You can’t perform that action at this time.
0 commit comments