C# ApplicationInsights在ServiceFabric ApiGateway上显示端2端中断

C# ApplicationInsights在ServiceFabric ApiGateway上显示端2端中断,c#,azure-service-fabric,azure-application-insights,service-fabric-stateless,C#,Azure Service Fabric,Azure Application Insights,Service Fabric Stateless,全部, 我在ApplicationInsights中设置end-2-end事务监视时遇到一些问题,它似乎破坏了我的ServiceFabric ApiGateway服务(.net CORE)上的end-2-end视图。这将在AppInsights中产生2个跟踪,而不是1个(我想要;-) 确定我的设置: 因此,外部API(.net core)通过HTTP与SF集群中的ApiGateway(.net core无状态服务)通信。在SF集群中,所有服务(无状态完整.net)通信都是通过远程处理V2进行的

全部,

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

确定我的设置:

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

我使用例如设置应用程序指示灯:

在ApplicationInsights中,我看到两条记录道(应该是一条),分别是:

  • 包含外部API和ApiGateWay以及对无状态服务的请求的跟踪
  • 包含无状态服务(多个)之间通信的跟踪
从APIGateway向下发送消息时,似乎没有重用“操作Id”。是的,我可以看到“操作Id”不同

有人有主意吗?我错过了什么?我是否应该在ApiGateway中的传出请求上设置操作id(以及如何设置;-)

经过一些联系()之后,问题变得清楚了

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

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