【问题标题】:Query logs through multiple Azure Application Insights通过多个 Azure Application Insights 查询日志
【发布时间】:2020-02-25 20:55:53
【问题描述】:

我正在开发一个包含多个 Azure 函数应用程序的 Azure 项目。一个函数应用链接到一个 Application Insights。因此,我们拥有与 Applications Insights 一样多的功能应用程序。 这些函数app会在它们之间进行对话,一些进程可以通过多个函数app。在 Azure 函数上,我添加了带有自定义 EntityID 的日志,并且该 EntityID 在所有函数应用之间都是相同的。

现在我的问题是:如何在所有 Applications Insights 上检索具有相同 EntityID 的所有日志?

点赞:

traces
| where operation_Name  == "TestLogManagement"
| where customDimensions.EventId == 888 

但在几个 Applications Insights 上。

我知道我们可以通过标签重新组合多个 Applications Insights,但在创建日志后无法检索它。

【问题讨论】:

    标签: azure azure-application-insights azure-log-analytics


    【解决方案1】:

    您也可以在 workbooks in azure monitor 中执行此操作,因此您无需在查询中编码应用名称,您只需编写所需的查询并选择 AI 资源或 LA 工作区的多个实例

    【讨论】:

    • 嗨,是的,这也是一个很好的解决方案(更友好的使用),非常感谢!
    【解决方案2】:
    app('app1').traces 
    | union app('app2').traces 
    | where * contains "42"
    | summarize count() by appId 
    

    请看这里:

    Unify multiple Azure Monitor Application Insights resources

    【讨论】:

    • 是的,它有效!谢谢你。我以前看过这个文档,但我认为它不合适。我必须声明一个新的 Workspace Analytics,我可以通过多个 Functions 应用程序进行查询!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-25
    • 2022-01-12
    • 2021-08-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多