我们如何在Azure应用程序见解中显示数据库查询

编程入门 行业动态 更新时间:2024-10-22 15:31:50
本文介绍了我们如何在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.

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

Assume you're using the 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应用程序见解中显示数据库查询

本文发布于:2023-11-03 20:23:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1556000.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:见解   应用程序   数据库查询   如何在   Azure

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!