Azure 应用程序 map 未连接 Application Insight

标签 azure azure-application-insights azure-api-management

我们有 Azure 云设置,以便我们的客户端 SPA 与 Azure APIM 通信,然后 Azure APIM 与微服务通信。我们在每个级别启用了 Application Insights 以收集端到端遥测数据。

在 Application Insights 的应用程序 map 中,我们确实看到每个请求的端到端流程。

唯一的问题是 AppInsight 实例(图中的数字 3)与任何内容都不相关,并且显示在图表之外。

我希望在一行中看到 No 1 > No2,然后是 No 3 箭头,显示端到端流程。

有人处理过此类有关应用程序洞察中的应用程序 map 的问题吗?

Azure Application Map

最佳答案

我也遇到了同样的问题。修复它有助于理解此图的工作原理:

在“应用程序映射”内,项目将通过依赖实体(由客户端发送)与请求实体(由服务器发送)的关联来连接:

  1. dependencyTelemetry.OperationId = requestTelemetry.OperationId
  2. dependencyTelemetry.Id = requestTelemetry.ParentId

http 调用的常见方法似乎是客户端将所需信息作为 http 请求 header 的一部分发送。在两端,每个服务方法都需要自己的代码,或者需要处理请求/发送管道的中间件服务。

使用.NET Core 3.1相关的nuget Microsoft.ApplicationInsights.AspNetCore将会添加此类服务。

此 nuget 包发送的 http header 示例,版本 2.13.0 + 使用默认配置:

  • 请求上下文:appId=cid-v1:12345678-60ba-4f61-ae37-07da9dc13267
  • 请求 ID:|abcdefdc99366a48a3886f34fb41c781.0102cca5a4ecc64f。
  • 跟踪父级:00-abcdefdc99366a48a3886f34fb41c781-0102cca5a4ecc64f-00

哪里

  • 请求上下文:AplicationInsights 门户中显示的 appId。传统 + 用于连接 2 个不同应用洞察的场景
  • Request-Id:旧版但当前使用的 header 来传输操作 ID + 父级
  • traceparent:添加对即将推出的新 W3C 标准的支持

  • abcdefdc99366a48a3886f34fb41c781:OperationId,W3C 标准的 16 字节十六进制

  • 0102cca5a4ecc64f:ParentId,W3C 标准的 8 字节十六进制

另请参阅文档“Application Insights 中的遥测关联” https://learn.microsoft.com/en-us/azure/azure-monitor/app/correlation

关于Azure 应用程序 map 未连接 Application Insight,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58458916/

相关文章:

asp.net-mvc - 如何在 Application Insights for ASP.NET MVC(.NET Full) 中临时停止记录 RequestTrackingTelemetryModule

azure - Azure API 管理是否可以同步发布到 Azure 服务总线?

azure - Azure Web 应用服务上的 Flask + Bokeh 服务器

azure-service-fabric - 应用洞察和服务结构?

azure-application-insights - Application Insights 仅跟踪失败的 ASP.NET MVC Web API 请求

使用 REST API 的 Azure 调用设备模块方法

azure-logic-apps - 从 Azure 逻辑应用访问 Azure VNet

azure - 无法从 Azure 容器实例连接到 Azure SQL 数据库

asp.net - 需要解决方法 : Windows Azure load balancers close idle connections after 60 seconds

azure - Azure AD OAuth2 中的refresh_token 是否过期