Skip to content

Commit 1c8b98f

Browse files
authored
Merge pull request #95827 from cijothomas/cijothomas/fix1
Few minor doc changes
2 parents 0470866 + ee6cecd commit 1c8b98f

File tree

6 files changed

+30
-23
lines changed

6 files changed

+30
-23
lines changed

articles/azure-monitor/app/asp-net-troubleshoot-no-data.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ ms.date: 07/23/2018
1010

1111
---
1212

13-
# Troubleshooting no data - Application Insights for .NET
13+
# Troubleshooting no data - Application Insights for .NET/.NET Core
14+
1415
## Some of my telemetry is missing
1516
*In Application Insights, I only see a fraction of the events that are being generated by my app.*
1617

@@ -209,7 +210,7 @@ Follow these instructions to capture troubleshooting logs for your framework.
209210

210211
1. Install the [Microsoft.AspNet.ApplicationInsights.HostingStartup](https://www.nuget.org/packages/Microsoft.AspNet.ApplicationInsights.HostingStartup) package from NuGet. The version you install must match the current installed version of `Microsoft.ApplicationInsights`
211212

212-
The latest version of Microsoft.ApplicationInsights.AspNetCore is 2.7.1, and it refers to Microsoft.ApplicationInsights version 2.10. Hence the version of Microsoft.AspNet.ApplicationInsights.HostingStartup to be installed should be 2.10.0
213+
The latest version of Microsoft.ApplicationInsights.AspNetCore is 2.8.2, and it refers to Microsoft.ApplicationInsights version 2.11.2. Hence the version of Microsoft.AspNet.ApplicationInsights.HostingStartup to be installed should be 2.11.2
213214

214215
2. Modify `ConfigureServices` method in your `Startup.cs` class.:
215216

articles/azure-monitor/app/console.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ You need a subscription with [Microsoft Azure](https://azure.com). Sign in with
2323
## Getting started
2424

2525
* In the [Azure portal](https://portal.azure.com), [create an Application Insights resource](../../azure-monitor/app/create-new-resource.md). For application type, choose **General**.
26-
* Take a copy of the Instrumentation Key. Find the key in the **Essentials** drop-down of the new resource you created.
26+
* Take a copy of the Instrumentation Key. Find the key in the **Essentials** drop-down of the new resource you created.
2727
* Install latest [Microsoft.ApplicationInsights](https://www.nuget.org/packages/Microsoft.ApplicationInsights) package.
2828
* Set the instrumentation key in your code before tracking any telemetry (or set APPINSIGHTS_INSTRUMENTATIONKEY environment variable). After that, you should be able to manually track telemetry and see it on the Azure portal
2929

@@ -35,6 +35,10 @@ var telemetryClient = new TelemetryClient(configuration);
3535
telemetryClient.TrackTrace("Hello World!");
3636
```
3737

38+
> [!NOTE]
39+
> 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.
40+
41+
3842
* 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.
3943

4044
You may initialize and configure Application Insights from the code or using `ApplicationInsights.config` file. Make sure initialization happens as early as possible.
@@ -43,6 +47,7 @@ You may initialize and configure Application Insights from the code or using `Ap
4347
> Instructions referring to **ApplicationInsights.config** are only applicable to apps that are targeting the .NET Framework, and do not apply to .NET Core applications.
4448
4549
### Using config file
50+
4651
By default, Application Insights SDK looks for `ApplicationInsights.config` file in the working directory when `TelemetryConfiguration` is being created
4752

4853
```csharp

articles/azure-monitor/app/eventcounters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: Monitor system and custom .NET/.NET Core EventCounters in Applicati
44
ms.service: azure-monitor
55
ms.subservice: application-insights
66
ms.topic: conceptual
7-
author: cithomas
8-
ms.author: cithomas
7+
author: mrbullwinkle
8+
ms.author: mbullwin
99
ms.date: 09/20/2019
1010

1111
---

articles/azure-monitor/app/ilogger.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: Samples of using the Azure Application Insights ILogger provider wi
44
ms.service: azure-monitor
55
ms.subservice: application-insights
66
ms.topic: conceptual
7-
author: cijothomas
8-
ms.author: cithomas
7+
author: mrbullwinkle
8+
ms.author: mbullwin
99
ms.date: 02/19/2019
1010

1111
ms.reviewer: mbullwin
@@ -18,11 +18,12 @@ To learn more, see [Logging in ASP.NET Core](https://docs.microsoft.com/aspnet/c
1818

1919
## ASP.NET Core applications
2020

21-
ApplicationInsightsLoggerProvider is enabled by default in [Microsoft.ApplicationInsights.AspNet SDK](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore) version 2.7.0-beta3 (and later) when you turn on regular Application Insights monitoring through either of the standard methods:
22-
- By calling the **UseApplicationInsights** extension method on IWebHostBuilder
21+
ApplicationInsightsLoggerProvider is enabled by default in [Microsoft.ApplicationInsights.AspNet SDK](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore) version 2.7.1 (and later) when you turn on regular Application Insights monitoring through either of the standard methods:
22+
23+
- By calling the **UseApplicationInsights** extension method on IWebHostBuilder
2324
- By calling the **AddApplicationInsightsTelemetry** extension method on IServiceCollection
2425

25-
ILogger logs that ApplicationInsightsLoggerProvider captures are subject to the same configuration as any other telemetry that's collected. They have the same set of TelemetryInitializers and TelemetryProcessors, use the same TelemetryChannel, and are correlated and sampled in the same way as other telemetry. If you use version 2.7.0-beta3 or later, no action is required to capture ILogger logs.
26+
ILogger logs that ApplicationInsightsLoggerProvider captures are subject to the same configuration as any other telemetry that's collected. They have the same set of TelemetryInitializers and TelemetryProcessors, use the same TelemetryChannel, and are correlated and sampled in the same way as other telemetry. If you use version 2.7.1 or later, no action is required to capture ILogger logs.
2627

2728
Only *Warning* or higher ILogger logs (from all categories) are sent to Application Insights by default. But you can [apply filters to modify this behavior](#control-logging-level). Additional steps are required to capture ILogger logs from **Program.cs** or **Startup.cs**. (See [Capturing ILogger logs from Startup.cs and Program.cs in ASP.NET Core applications](#capture-ilogger-logs-from-startupcs-and-programcs-in-aspnet-core-apps).)
2829

@@ -105,7 +106,7 @@ public class ValuesController : ControllerBase
105106
> [!NOTE]
106107
> In ASP.NET Core 3.0 and later, it is no longer possible to inject `ILogger` in Startup.cs and Program.cs. See https://github.com/aspnet/Announcements/issues/353 for more details.
107108
108-
The new ApplicationInsightsLoggerProvider can capture logs from early in the application-startup pipeline. Although ApplicationInsightsLoggerProvider is automatically enabled in Application Insights (starting with version 2.7.0-beta3), it doesn't have an instrumentation key set up until later in the pipeline. So, only logs from **Controller**/other classes will be captured. To capture every log starting with **Program.cs** and **Startup.cs** itself, you must explicitly enable an instrumentation key for ApplicationInsightsLoggerProvider. Also, *TelemetryConfiguration* is not fully set up when you log from **Program.cs** or **Startup.cs** itself. So those logs will have a minimum configuration that uses InMemoryChannel, no sampling, and no standard telemetry initializers or processors.
109+
The new ApplicationInsightsLoggerProvider can capture logs from early in the application-startup pipeline. Although ApplicationInsightsLoggerProvider is automatically enabled in Application Insights (starting with version 2.7.1), it doesn't have an instrumentation key set up until later in the pipeline. So, only logs from **Controller**/other classes will be captured. To capture every log starting with **Program.cs** and **Startup.cs** itself, you must explicitly enable an instrumentation key for ApplicationInsightsLoggerProvider. Also, *TelemetryConfiguration* is not fully set up when you log from **Program.cs** or **Startup.cs** itself. So those logs will have a minimum configuration that uses InMemoryChannel, no sampling, and no standard telemetry initializers or processors.
109110

110111
The following examples demonstrate this capability with **Program.cs** and **Startup.cs**.
111112

@@ -199,7 +200,7 @@ public class Startup
199200

200201
## Migrate from the old ApplicationInsightsLoggerProvider
201202

202-
Microsoft.ApplicationInsights.AspNet SDK versions before 2.7.0-beta2 supported a logging provider that's now obsolete. This provider was enabled through the **AddApplicationInsights()** extension method of ILoggerFactory. We recommend that you migrate to the new provider, which involves two steps:
203+
Microsoft.ApplicationInsights.AspNet SDK versions before 2.7.1 supported a logging provider that's now obsolete. This provider was enabled through the **AddApplicationInsights()** extension method of ILoggerFactory. We recommend that you migrate to the new provider, which involves two steps:
203204

204205
1. Remove the *ILoggerFactory.AddApplicationInsights()* call from the **Startup.Configure()** method to avoid double logging.
205206
2. Reapply any filtering rules in code, because they will not be respected by the new provider. Overloads of *ILoggerFactory.AddApplicationInsights()* took minimum LogLevel or filter functions. With the new provider, filtering is part of the logging framework itself. It's not done by the Application Insights provider. So any filters that are provided via *ILoggerFactory.AddApplicationInsights()* overloads should be removed. And filtering rules should be provided by following the [Control logging level](#control-logging-level) instructions. If you use *appsettings.json* to filter logging, it will continue to work with the new provider, because both use the same provider alias, *ApplicationInsights*.
@@ -217,8 +218,7 @@ You can still use the old provider. (It will be removed only in a major version
217218
## Console application
218219

219220
> [!NOTE]
220-
> There is a new beta Application Insights SDK called [Microsoft.ApplicationInsights.WorkerService](https://www.nuget.org/packages/Microsoft.ApplicationInsights.WorkerService) which can used to enable Application Insights (ILogger and other Application Insights telemetry) for any Console Applications. It is recommended to use this package and associated instructions from [here](../../azure-monitor/app/worker-service.md).
221-
The following example will be deprecated once stable version of this new package is released.
221+
> There is a new Application Insights SDK called [Microsoft.ApplicationInsights.WorkerService](https://www.nuget.org/packages/Microsoft.ApplicationInsights.WorkerService) which can used to enable Application Insights (ILogger and other Application Insights telemetry) for any Console Applications. It is recommended to use this package and associated instructions from [here](../../azure-monitor/app/worker-service.md).
222222
223223
The following code shows a sample console application that's configured to send ILogger traces to Application Insights.
224224

@@ -363,11 +363,11 @@ The following code snippet configures logs for *Warning* and above from all cate
363363

364364
### What are the old and new versions of ApplicationInsightsLoggerProvider?
365365

366-
[Microsoft.ApplicationInsights.AspNet SDK](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore) included a built-in ApplicationInsightsLoggerProvider (Microsoft.ApplicationInsights.AspNetCore.Logging.ApplicationInsightsLoggerProvider), which was enabled through **ILoggerFactory** extension methods. This provider is marked obsolete from version 2.7.0-beta2. It will be removed completely in the next major version change. The [Microsoft.ApplicationInsights.AspNetCore 2.6.1](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore) package itself isn't obsolete. It's required to enable monitoring of requests, dependencies, and so on.
366+
[Microsoft.ApplicationInsights.AspNet SDK](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore) included a built-in ApplicationInsightsLoggerProvider (Microsoft.ApplicationInsights.AspNetCore.Logging.ApplicationInsightsLoggerProvider), which was enabled through **ILoggerFactory** extension methods. This provider is marked obsolete from version 2.7.1. It will be removed completely in the next major version change. The [Microsoft.ApplicationInsights.AspNetCore 2.6.1](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore) package itself isn't obsolete. It's required to enable monitoring of requests, dependencies, and so on.
367367
368368
The suggested alternative is the new standalone package [Microsoft.Extensions.Logging.ApplicationInsights](https://www.nuget.org/packages/Microsoft.Extensions.Logging.ApplicationInsights), which contains an improved ApplicationInsightsLoggerProvider (Microsoft.Extensions.Logging.ApplicationInsights.ApplicationInsightsLoggerProvider) and extension methods on ILoggerBuilder for enabling it.
369369
370-
[Microsoft.ApplicationInsights.AspNet SDK](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore) version 2.7.0-beta3 takes a dependency on the new package and enables ILogger capture automatically.
370+
[Microsoft.ApplicationInsights.AspNet SDK](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore) version 2.7.1 takes a dependency on the new package and enables ILogger capture automatically.
371371
372372
### Why are some ILogger logs shown twice in Application Insights?
373373

@@ -394,7 +394,7 @@ If you experience double logging when you debug from Visual Studio, set `EnableD
394394
}
395395
```
396396

397-
### I updated to [Microsoft.ApplicationInsights.AspNet SDK](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore) version 2.7.0-beta3, and logs from ILogger are captured automatically. How do I turn off this feature completely?
397+
### I updated to [Microsoft.ApplicationInsights.AspNet SDK](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore) version 2.7.1, and logs from ILogger are captured automatically. How do I turn off this feature completely?
398398
399399
See the [Control logging level](../../azure-monitor/app/ilogger.md#control-logging-level) section to see how to filter logs in general. To turn-off ApplicationInsightsLoggerProvider, use `LogLevel.None`:
400400

@@ -452,7 +452,7 @@ If you prefer to always send TraceTelemetry, use this snippet: ```builder.AddApp
452452

453453
### I don't have the SDK installed, and I use the Azure Web Apps extension to enable Application Insights for my ASP.NET Core applications. How do I use the new provider?
454454

455-
The Application Insights extension in Azure Web Apps uses the old provider. You can modify the filtering rules in the *appsettings.json* file for your application. To take advantage of the new provider, use build-time instrumentation by taking a NuGet dependency on the SDK. This article will be updated when the extension switches to use the new provider.
455+
The Application Insights extension in Azure Web Apps uses the new provider. You can modify the filtering rules in the *appsettings.json* file for your application.
456456

457457
### I'm using the standalone package Microsoft.Extensions.Logging.ApplicationInsights and enabling Application Insights provider by calling **builder.AddApplicationInsights("ikey")**. Is there an option to get an instrumentation key from configuration?
458458

articles/azure-monitor/app/sampling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: How to keep the volume of telemetry under control.
44
ms.service: azure-monitor
55
ms.subservice: application-insights
66
ms.topic: conceptual
7-
author: cijothomas
8-
ms.author: cithomas
7+
author: mrbullwinkle
8+
ms.author: mbullwin
99
ms.date: 03/14/2019
1010

1111
ms.reviewer: vitalyg

articles/azure-monitor/app/worker-service.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: Monitoring .NET Core/.NET Framework non-HTTP apps with Application
44
ms.service: azure-monitor
55
ms.subservice: application-insights
66
ms.topic: conceptual
7-
author: cijothomas
8-
ms.author: cithomas
7+
author: mrbullwinkle
8+
ms.author: mbullwin
99
ms.date: 09/15/2019
1010

1111
---
@@ -31,7 +31,7 @@ A valid Application Insights instrumentation key. This key is required to send a
3131

3232
```xml
3333
<ItemGroup>
34-
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.8.0" />
34+
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.8.2" />
3535
</ItemGroup>
3636
```
3737

@@ -133,6 +133,7 @@ Typically, `APPINSIGHTS_INSTRUMENTATIONKEY` specifies the instrumentation key fo
133133
> An instrumentation key specified in code wins over the environment variable `APPINSIGHTS_INSTRUMENTATIONKEY`, which wins over other options.
134134
135135
## ASP.NET Core background tasks with hosted services
136+
136137
[This](https://docs.microsoft.com/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-2.2&tabs=visual-studio) document describes how to create backgrounds tasks in ASP.NET Core 2.1/2.2 application.
137138

138139
Full example is shared [here](https://github.com/microsoft/ApplicationInsights-Home/tree/master/Samples/WorkerServiceSDK/BackgroundTasksWithHostedService)

0 commit comments

Comments
 (0)