gpt4 book ai didi

azure - 如何在 Azure Monitor 中跨 Log Analytics 和 Application Insights 进行查询

转载 作者:行者123 更新时间:2023-12-01 23:48:51 26 4
gpt4 key购买 nike

This answer总结说,App Insights (AI) 和 Log Analytics (LA) 正在合并为一项服务。它还提供了一个建议,即人工智能中的新资源可以指向 LA,以便您的所有代码都在一个地方。

我的问题是如何查询 LA 和 AI 资源,因为两者都存在,并且您没有时间或权限将 AI 更改为指向 LA。

使用 Azure Workbooks,我意识到我可以从 LA 或 AI 内的多个资源进行查询,但我似乎无法在一个单元格中跨 LA 和 AI 进行查询(也无法在单元格之间保存结果。)

目前我能想到解决这个问题的唯一方法是通过 API 查询或加入 PBI 报告,但这两种方法对于完成探索性查询来说都是巨大的开销。有没有更简单的方法,最好是同时留在 Kusto 查询中?

最佳答案

Azure Monitor是您跨资源查询的一站式商店。

Previously with Azure Monitor, you could only analyze data from withinthe current workspace, and it limited your ability to query acrossmultiple workspaces defined in your subscription. Additionally, youcould only search telemetry items collected from your web-basedapplication with Application Insights directly in Application Insightsor from Visual Studio. This also made it a challenge to nativelyanalyze operational and application data together.

Now you can query not only across multiple Log Analytics workspaces,but also data from a specific Application Insights app in the sameresource group, another resource group, or another subscription. Thisprovides you with a system-wide view of your data. You can onlyperform these types of queries in Log Analytics.

要在查询中引用另一个工作区,请使用 workspace标识符,对于 Application Insights 中的应用程序,请使用 app标识符。

例如,您可以从任何资源实例查询多个资源,这些资源可以是工作区和应用程序的组合,如下所示。

// crossResource function that scopes my Application Insights resources
union withsource= SourceApp
app('Contoso-app1').requests,
app('Contoso-app2').requests,
app('Contoso-app3').requests,
app('Contoso-app4').requests,
app('Contoso-app5').requests

或者像,

union Update, workspace("contosoretail-it").Update, workspace("b459b4u5-912x-46d5-9cb1-p43069212nb4").Update
| where TimeGenerated >= ago(1h)
| where UpdateState == "Needed"
| summarize dcount(Computer) by Classification

或者像,

applicationsScoping 
| where timestamp > ago(12h)
| where success == 'False'
| parse SourceApp with * '(' applicationName ')' *
| summarize count() by applicationName, bin(timestamp, 1h)
| render timechart

详情请参阅this .

关于azure - 如何在 Azure Monitor 中跨 Log Analytics 和 Application Insights 进行查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63742764/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com