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
Copy file name to clipboardExpand all lines: articles/azure-monitor/faq.yml
-112Lines changed: 0 additions & 112 deletions
Original file line number
Diff line number
Diff line change
@@ -676,118 +676,6 @@ sections:
676
676
677
677
> [!NOTE]
678
678
> If the resource you are creating in a new region is replacing a classic resource we recommend exploring the benefits of [creating a new workspace-based resource](app/create-workspace-resource.md) or alternatively [migrating your existing resource to workspace-based](app/convert-classic-resource.md).
679
-
680
-
- question: |
681
-
What versions of ASP.NET and ASP.NET Core are supported by Application Insights?
682
-
answer: |
683
-
.NET and .NET Core [LTS](https://dotnet.microsoft.com/download/visual-studio-sdks)
684
-
685
-
- question: |
686
-
How can I track telemetry that's not automatically collected?
687
-
answer: |
688
-
Get an instance of `TelemetryClient` by using constructor injection, and call the required `TrackXXX()` method on it. We don't recommend creating new `TelemetryClient` or `TelemetryConfiguration` instances in an ASP.NET Core application. A singleton instance of `TelemetryClient` is already registered in the `DependencyInjection` container, which shares `TelemetryConfiguration` with rest of the telemetry. Creating a new `TelemetryClient` instance is recommended only if it needs a configuration that's separate from the rest of the telemetry.
689
-
690
-
The following example shows how to track more telemetry from a controller.
691
-
692
-
```csharp
693
-
using Microsoft.ApplicationInsights;
694
-
public class HomeController : Controller
695
-
{
696
-
private TelemetryClient telemetry;
697
-
// Use constructor injection to get a TelemetryClient instance.
698
-
public HomeController(TelemetryClient telemetry)
699
-
{
700
-
this.telemetry = telemetry;
701
-
}
702
-
public IActionResult Index()
703
-
{
704
-
// Call the required TrackXXX method.
705
-
this.telemetry.TrackEvent("HomePageRequested");
706
-
return View();
707
-
}
708
-
```
709
-
For more information about custom data reporting in Application Insights, see [Application Insights custom metrics API reference](app/api-custom-events-metrics.md). A similar approach can be used for sending custom metrics to Application Insights using the [GetMetric API](app/get-metric.md).
710
-
711
-
- question: |
712
-
How do I customize ILogger logs collection?
713
-
answer: |
714
-
By default, only `Warning` logs and more severe logs are automatically captured. To change this behavior, explicitly override the logging configuration for the provider `ApplicationInsights` as shown below.
715
-
716
-
The following configuration allows ApplicationInsights to capture all `Information` logs and more severe logs.
717
-
718
-
```json
719
-
{
720
-
"Logging": {
721
-
"LogLevel": {
722
-
"Default": "Warning"
723
-
},
724
-
"ApplicationInsights": {
725
-
"LogLevel": {
726
-
"Default": "Information"
727
-
}
728
-
}
729
-
}
730
-
}
731
-
```
732
-
It's important to note that the following example doesn't cause the ApplicationInsights provider to capture `Information` logs. It doesn't capture it because the SDK adds a default logging filter that instructs `ApplicationInsights` to capture only `Warning` logs and more severe logs. ApplicationInsights requires an explicit override.
733
-
```json
734
-
{
735
-
"Logging": {
736
-
"LogLevel": {
737
-
"Default": "Information"
738
-
}
739
-
}
740
-
}
741
-
```
742
-
For more information, see [ILogger configuration](app/ilogger.md#logging-level).
743
-
744
-
- question: |
745
-
Some Visual Studio templates used the UseApplicationInsights() extension method on IWebHostBuilder to enable Application Insights. Is this usage still valid?
746
-
answer: |
747
-
The extension method `UseApplicationInsights()` is still supported, but it's marked as obsolete in Application Insights SDK version 2.8.0 and later. It will be removed in the next major version of the SDK. To enable Application Insights telemetry, we recommend using `AddApplicationInsightsTelemetry()` because it provides overloads to control some configuration. Also, in ASP.NET Core 3.X apps, `services.AddApplicationInsightsTelemetry()` is the only way to enable Application Insights.
748
-
749
-
- question: |
750
-
I'm deploying my ASP.NET Core application to Web Apps. Should I still enable the Application Insights extension from Web Apps?
751
-
answer: |
752
-
If the SDK is installed at build time as shown in this article, you don't need to enable the [Application Insights extension](app/azure-web-apps.md) from the App Service portal. If the extension is installed, it will back off when it detects the SDK is already added. If you enable Application Insights from the extension, you don't have to install and update the SDK. But if you enable Application Insights by following instructions in this article, you have more flexibility because:
753
-
754
-
* Application Insights telemetry will continue to work in:
755
-
* All operating systems, including Windows, Linux, and Mac.
756
-
* All publish modes, including self-contained or framework dependent.
757
-
* All target frameworks, including the full .NET Framework.
758
-
* All hosting options, including Web Apps, VMs, Linux, containers, Azure Kubernetes Service, and non-Azure hosting.
759
-
* All .NET Core versions including preview versions.
760
-
* You can see telemetry locally when you're debugging from Visual Studio.
761
-
* You can track more custom telemetry by using the `TrackXXX()` API.
762
-
* You have full control over the configuration.
763
-
764
-
- question: |
765
-
Can I enable Application Insights monitoring by using tools like Azure Monitor Application Insights Agent (formerly Status Monitor v2)?
766
-
answer: |
767
-
Yes. In [Application Insights Agent 2.0.0-beta1](https://www.powershellgallery.com/packages/Az.ApplicationMonitor/2.0.0-beta1) and later, ASP.NET Core applications hosted in IIS are supported.
768
-
769
-
- question: |
770
-
Are all features supported if I run my application in Linux?
771
-
answer: |
772
-
Yes. Feature support for the SDK is the same in all platforms, with the following exceptions:
773
-
774
-
* The SDK collects [Event Counters](app/eventcounters.md) on Linux because [Performance Counters](app/performance-counters.md) are only supported in Windows. Most metrics are the same.
775
-
* Although `ServerTelemetryChannel` is enabled by default, if the application is running in Linux or macOS, the channel doesn't automatically create a local storage folder to keep telemetry temporarily if there are network issues. Because of this limitation, telemetry is lost when there are temporary network or server issues. To work around this issue, configure a local folder for the channel:
776
-
```csharp
777
-
using Microsoft.ApplicationInsights.Channel;
778
-
using Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel;
779
-
public void ConfigureServices(IServiceCollection services)
780
-
{
781
-
// The following will configure the channel to use the given folder to temporarily
782
-
// store telemetry items during network or Application Insights server issues.
783
-
// User should ensure that the given folder already exists
784
-
// and that the application has read/write permissions.
785
-
services.AddSingleton(typeof(ITelemetryChannel),
786
-
new ServerTelemetryChannel () {StorageFolder = "/tmp/myfolder"});
787
-
services.AddApplicationInsightsTelemetry();
788
-
}
789
-
```
790
-
This limitation isn't applicable from version [2.15.0](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore/2.15.0) and later.
0 commit comments