我正在尝试为应用服务上托管的现有 ASP.NET Web 应用程序启用 Azure Application Insights Auto Instrumentation。它不起作用,所以我尝试调查并从 https://learn.microsoft.com/en-us/troubleshoot/azure/azure-monitor/app-insights/auto-instrumentation-troubleshoot?source= 找到了这一部分建议
检测到诊断库
如果检测到以下库,自动检测将失败:
System.Diagnostics.DiagnosticSource
Microsoft.AspNet.TelemetryCorrelation
Microsoft.ApplicationInsights
必须删除这些库才能使自动检测成功。
就我而言,我的 Web 应用程序依赖于
System.Diagnostics.DiagnosticSource
。但令我惊讶的是,这个库是Azure.Core
的传递依赖,大多数连接Azure服务的sdks都依赖Azure.Core
。我们不太可能在不连接到 Azure 服务的情况下在 Azure 上部署 Web 应用程序。
这是否意味着几乎不可能在非平凡的应用程序上使用自动检测?