我一直使用 Application Insights (AI) 监控我的 ASP.NET 应用程序。最近,我也在我的 Web 服务器(Windows Server 2012 R2 with IIS)上安装了 AI Status Monitor,以获取更详细的应用程序统计信息。如文档所述,AI Status Monitor 报告了依赖性诊断,即调用数据库、REST API 等。因此,我认为我会得到通过 Entity Framework 在我的应用程序中执行的数据库调用的诊断。
然而,我的 AI 中没有出现任何数据库调用的诊断。但是,AI Status Monitor 是可以正常工作的,因为我开始收到关于其他依赖项但不包括数据库的诊断(例如,在防火墙上阻止通信端口不太可能成为问题)。
有人成功地设置了 AI Status Monitor 来报告使用 Entity Framework 的数据库诊断吗?我是否缺少需要添加到应用程序代码或 AI Status Monitor 中的任何配置?
<Add Type="Microsoft.ApplicationInsights.Extensibility.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.DependencyCollector" />
。 - Jan Palas