fro*_*sty 2 azure-application-insights asp.net-core .net-5
我正在使用使用 Asp.Net Core 和 .Net5 在 Azure 中托管的应用程序服务。我使用 appSettings.config 中的以下设置打开了 SQL 依赖项跟踪。但我看到没有 SQL 命令文本记录 SQL 依赖关系。是否还有其他设置可以在日志中查看 SQL 命令?
"ApplicationInsights": {
"InstrumentationKey": "my guid key",
"EnableDependencyTracking": true,
"DependencyTrackingOptions": {
"EnableSqlCommandTextInstrumentation": true
},
"sampling": {
"isEnabled": true,
"maxTelemetryItemsPerSecond": 5
}
},
Run Code Online (Sandbox Code Playgroud)
您的设置appSettings.config是用于Azure Function,而不是ASP.NET Core applications。
对于 ASP.NET Core 应用程序,现在需要使用以下方法选择加入 SQL 文本集合
services.ConfigureTelemetryModule<DependencyTrackingTelemetryModule>((module, o) => { module. EnableSqlCommandTextInstrumentation = true; });
Run Code Online (Sandbox Code Playgroud)
更详细的内容可以参考官方文档
| 归档时间: |
|
| 查看次数: |
1949 次 |
| 最近记录: |