You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. In `_Layout.cshtml`, insert `HtmlHelper` at the end of the `<head>` section but before any other script. If you want to report any custom JavaScript telemetry from the page, inject it after this snippet:
181
181
182
-
```cshtml
183
-
@Html.Raw(JavaScriptSnippet.FullScript)
184
-
</head>
185
-
```
182
+
```cshtml
183
+
@Html.Raw(JavaScriptSnippet.FullScript)
184
+
</head>
185
+
```
186
186
187
187
As an alternative to using the `FullScript`, the `ScriptBody` is available starting in Application Insights SDK for ASP.NET Core version 2.14. Use `ScriptBody` if you need to control the `<script>` tag to set a Content Security Policy:
188
188
@@ -197,7 +197,7 @@ The `.cshtml` file names referenced earlier are from a default MVC application t
197
197
If your project doesn't include `_Layout.cshtml`, you can still add [client-side monitoring](./website-monitoring.md) by adding the JavaScript snippet to an equivalent file that controls the `<head>` of all pages within your app. Alternatively, you can add the snippet to multiple pages, but we don't recommend it.
198
198
199
199
> [!NOTE]
200
-
> JavaScript injection provides a default configuration experience. If you require [configuration](./javascript.md#configuration) beyond setting the connection string, you are required to remove auto-injection as described above and manually add the [JavaScript SDK](./javascript.md#adding-the-javascript-sdk).
200
+
> JavaScript injection provides a default configuration experience. If you require [configuration](./javascript.md#configuration) beyond setting the connection string, you are required to remove auto-injection as described above and manually add the [JavaScript SDK](./javascript.md#add-the-javascript-sdk).
201
201
202
202
## Configure the Application Insights SDK
203
203
@@ -326,13 +326,13 @@ Application Insights automatically collects telemetry about specific workloads w
326
326
327
327
By default, the following automatic-collection modules are enabled. These modules are responsible for automatically collecting telemetry. You can disable or configure them to alter their default behavior.
328
328
329
-
*`RequestTrackingTelemetryModule` - Collects RequestTelemetry from incoming web requests
330
-
*`DependencyTrackingTelemetryModule` - Collects [DependencyTelemetry](./asp-net-dependencies.md) from outgoing http calls and sql calls
331
-
*`PerformanceCollectorModule` - Collects Windows PerformanceCounters
332
-
*`QuickPulseTelemetryModule` - Collects telemetry for showing in Live Metrics portal
333
-
*`AppServicesHeartbeatTelemetryModule` - Collects heart beats (which are sent as custom metrics), about Azure App Service environment where application is hosted
334
-
*`AzureInstanceMetadataTelemetryModule` - Collects heart beats (which are sent as custom metrics), about Azure VM environment where application is hosted
335
-
*`EventCounterCollectionModule` - Collects [EventCounters](eventcounters.md); this module is a new feature and is available in SDK version 2.8.0 and later
329
+
*`RequestTrackingTelemetryModule`: Collects RequestTelemetry from incoming web requests
330
+
*`DependencyTrackingTelemetryModule`: Collects [DependencyTelemetry](./asp-net-dependencies.md) from outgoing http calls and sql calls
331
+
*`PerformanceCollectorModule`: Collects Windows PerformanceCounters
332
+
*`QuickPulseTelemetryModule`: Collects telemetry for showing in Live Metrics portal
333
+
*`AppServicesHeartbeatTelemetryModule`: Collects heart beats (which are sent as custom metrics), about Azure App Service environment where application is hosted
334
+
*`AzureInstanceMetadataTelemetryModule`: Collects heart beats (which are sent as custom metrics), about Azure VM environment where application is hosted
335
+
*`EventCounterCollectionModule`: Collects [EventCounters](eventcounters.md); this module is a new feature and is available in SDK version 2.8.0 and later
336
336
337
337
To configure any default `TelemetryModule`, use the extension method `ConfigureTelemetryModule<T>` on `IServiceCollection`, as shown in the following example.
338
338
@@ -408,7 +408,7 @@ If you want to disable telemetry conditionally and dynamically, you can resolve
408
408
}
409
409
```
410
410
411
-
The preceding code sample prevents the sending of telemetry to Application Insights. It doesn't prevent any automatic collection modules from collecting telemetry. If you want to remove a particular auto collection module, see [remove the telemetry module](#configuring-or-removing-default-telemetrymodules).
411
+
The preceding code sample prevents the sending of telemetry to Application Insights. It doesn't prevent any automatic collection modules from collecting telemetry. If you want to remove a particular auto collection module, see [Remove the telemetry module](#configuring-or-removing-default-telemetrymodules).
412
412
413
413
## Frequently asked questions
414
414
@@ -449,8 +449,8 @@ For more information about custom data reporting in Application Insights, see [A
449
449
450
450
### How do I customize ILogger logs collection?
451
451
452
-
Bydefault, only `Warning` logsandmoreseverelogsareautomaticallycaptured. Tochangethisbehavior, explicitlyoverridetheloggingconfigurationfortheprovider `ApplicationInsights` asshownbelow.
This limitation isn't applicable from version [2.15.0](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore/2.15.0) and later.
530
530
531
531
### Is this SDK supported for the new .NET Core 3.X Worker Service template applications?
532
532
533
-
This SDK requires `HttpContext`; therefore, it doesn't work in any non-HTTPapplications, includingthe .NETCore 3.XWorkerServiceapplications. ToenableApplicationInsightsinsuchapplicationsusingthenewlyreleasedMicrosoft.ApplicationInsights.WorkerServiceSDK, see [ApplicationInsightsforWorkerServiceapplications (non-HTTPapplications)](worker-service.md).
533
+
This SDK requires `HttpContext`. Therefore, it doesn't work in any non-HTTPapplications, includingthe .NETCore 3.XWorkerServiceapplications. ToenableApplicationInsightsinsuchapplicationsusingthenewlyreleasedMicrosoft.ApplicationInsights.WorkerServiceSDK, see [ApplicationInsightsforWorkerServiceapplications (non-HTTPapplications)](worker-service.md).
534
534
535
535
## Open-source SDK
536
536
@@ -544,4 +544,4 @@ For the latest updates and bug fixes, see the [release notes](./release-notes.md
0 commit comments