Skip to content

Commit 3df4063

Browse files
authored
Merge pull request #116071 from mrbullwinkle/mrb_05_21_2020_console_app
clarify that InMemoryChannel is blocking and link to active issue
2 parents ad865ec + d45ee64 commit 3df4063

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

articles/azure-monitor/app/console.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Azure Application Insights for Console Applications | Microsoft Docs
33
description: Monitor web applications for availability, performance and usage.
44
ms.topic: conceptual
5-
ms.date: 12/02/2019
5+
ms.date: 05/21/2020
66

77
ms.reviewer: lmolkova
88
---
@@ -32,7 +32,7 @@ telemetryClient.TrackTrace("Hello World!");
3232
```
3333

3434
> [!NOTE]
35-
> Telemetry is not sent instantly. Telemetry items are batched and sent by the ApplicationInsights SDK. In Console apps, which exits right after calling `Track()` methods, telemetry may not be sent unless `Flush()` and `Sleep` is done before the app exits as shown in [full example](#full-example) later in this article.
35+
> Telemetry is not sent instantly. Telemetry items are batched and sent by the ApplicationInsights SDK. In Console apps, which exits right after calling `Track()` methods, telemetry may not be sent unless `Flush()` and `Sleep`/`Delay` is done before the app exits as shown in [full example](#full-example) later in this article. `Sleep` is not required if you are using `InMemoryChannel`. There is an active issue regarding the need for `Sleep` which is tracked here: [ApplicationInsights-dotnet/issues/407](https://github.com/microsoft/ApplicationInsights-dotnet/issues/407)
3636
3737

3838
* Install latest version of [Microsoft.ApplicationInsights.DependencyCollector](https://www.nuget.org/packages/Microsoft.ApplicationInsights.DependencyCollector) package - it automatically tracks HTTP, SQL, or some other external dependency calls.
@@ -168,7 +168,8 @@ namespace ConsoleApp
168168
// before exit, flush the remaining data
169169
telemetryClient.Flush();
170170

171-
// flush is not blocking so wait a bit
171+
// flush is not blocking when not using InMemoryChannel so wait a bit. There is an active issue regarding the need for `Sleep`/`Delay`
172+
// which is tracked here: https://github.com/microsoft/ApplicationInsights-dotnet/issues/407
172173
Task.Delay(5000).Wait();
173174

174175
}

0 commit comments

Comments
 (0)