use*_*938 0 azure azure-application-insights
我们的应用程序正在使用天蓝色应用程序见解。我读到的是,使用应用程序洞察端到端跟踪,我们甚至可以获取在数据库中执行的查询以及该查询花费了多少时间。
但如屏幕截图所示,Azure App Insights 显示有 3 个对数据库的调用,但没有在这些调用中对数据库执行的实际查询。
我需要知道的是,我需要做什么才能获取针对数据库执行的查询?
这是 SDK 2.14 中的重大更改之一。
对于 ASP.NET Core,您只需使用以下行修改ConfigureServices():
services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>((module, o) => { module.EnableSqlCommandTextInstrumentation = true; });
Run Code Online (Sandbox Code Playgroud)
对于 ASP.NET,修改 ApplicationInsights.config 文件:
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.AI.DependencyCollector">,
<EnableSqlCommandTextInstrumentation>true</EnableSqlCommandTextInstrumentation>
</Add>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3636 次 |
| 最近记录: |