我们如何在Azure应用程序见解中显示数据库查询 [英] How can we display database query in azure application insights

查看:58
本文介绍了我们如何在Azure应用程序见解中显示数据库查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用程序正在使用天蓝色的应用程序见解.我读到的是,使用应用程序见解进行端到端跟踪,我们甚至可以获取在数据库中执行的查询以及该查询花费了多少时间.

Our application is using azure application insights. What I read is that, using application insights end to end tracking, we can even get the query which gets executed at database and how much time that query took.

但是,如屏幕截图所示,azure应用洞察力向我显示对数据库进行了3次调用,但没有对这些调用中针对数据库执行的实际查询.

But as shown in the screenshot, azure app insights shows me that there are 3 calls made to database but not the actual query that was executed against the database in those calls.

我需要知道的是,为了获得针对数据库执行的查询,我需要做些什么?

What I need to know is that what i need to do inorder to get the query that was executed against the database?

推荐答案

是的,应用程序见解可以跟踪sql查询.但是请注意,最新版本的应用程序见解nuget软件包中有一些更改,这使得它不会自动跟踪sql查询.

Yes, the application insights can track sql query. But note that there are some changes in the latest version of application insights nuget package, which makes it does not automatically track sql query.

您可以通过以下解决方法来做到这一点.

You can do it via the workaround below.

假设您正在使用.net core Web项目.然后,您需要将Microsoft.ApplicationInsights.AspNetCore降级为2.12.0版本.

Assume you're using the .net core web project. Then you need to downgrade the Microsoft.ApplicationInsights.AspNetCore to version 2.12.0.

这是我使用该软件包的2.12.0版的测试结果:

Here is my test result with version 2.12.0 of that package:

此外,您还可以使用其他解决方法,有关更多信息,请参见此处详细信息.

And also, you can use other workarounds, see here for more details.

这篇关于我们如何在Azure应用程序见解中显示数据库查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆