【问题标题】:ApplicationInsights end-2-end breaks on ServiceFabric ApiGatewayService Fabric Api Gateway 上的 Application Insights 端到端中断
【发布时间】:2021-05-06 17:44:48
【问题描述】:

全部,

我在 ApplicationInsights 中设置 end-2-end 事务监控时遇到了一些问题,它似乎破坏了我的 ServiceFabric ApiGateway 服务 (.net CORE) 上的 end-2-end 视图。这会在 AppInsights 中产生 2 个跟踪而不是 1 个(我想要的 ;-)。

好的,我的设置:

因此,外部 API(.net 核心)通过 HTTP 与 SF 集群中的 ApiGateway(.net 核心无状态服务)通信。在 SF 集群内,所有服务(无状态的完整 .net)通信都是通过 Remoting V2 进行的。

我使用 ex 设置 ApplicationInsights。 :https://github.com/yantang-msft/service-fabric-application-insights-example

在 ApplicationInsights 中,我看到 2 个跟踪(应该是一个),分别是:

  • 包含外部 API 和 ApiGateWay 以及对无状态服务的请求的跟踪
  • 包含无状态服务(多个)之间通信的跟踪

从 APIGateway 向下发送消息时,“操作 ID”似乎没有被重用。 AppInsights 我可以看到“操作 ID”不同吗?

有人有想法吗?我错过了什么?我是否应该在 ApiGateway 中的传出请求上设置操作 ID(我该怎么做 ;-))

【问题讨论】:

    标签: c# azure-service-fabric azure-application-insights service-fabric-stateless


    【解决方案1】:

    经过一些联系 (https://github.com/microsoft/ApplicationInsights-ServiceFabric/issues/115),问题变得清晰。

    这是因为新版本的 AppInsight 使用了新协议,该协议位于 .net 版本的库中。 您可以强制 AppInsights 使用“旧”协议,然后端到端跟踪再次工作。您可以通过将 ActivityIDformat 属性设置为旧版属性来实现这一点,如下所示。 (在应用启动的某个地方)

    Activity.DefaultIdFormat = ActivityIdFormat.Hierrachical;
    Activity.ForceDefaultIdFormat = true;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-05
      • 2017-12-22
      • 2021-03-14
      • 2018-06-07
      • 2021-02-06
      • 2019-02-07
      • 1970-01-01
      • 2022-11-16
      相关资源
      最近更新 更多