[英]How can I show a end-to-end transaction over RabbitMQ in Application Insights?
We have a distributed application with a mix of legacy ASP .NET webapplications, ASP .NET Core webapplications, ASP .NET Core microservices, .NET Framework console applications and .NET Core console applications.我们有一个分布式应用程序,其中混合了遗留 ASP .NET 网络应用程序、ASP .NET 核心网络应用程序、ASP .NET 核心微服务、.NET 框架控制台应用程序和 .NET 核心控制台应用程序。 Communication between the components are both point-to-point over HTTP and over RabbitMQ.组件之间的通信在 HTTP 和 RabbitMQ 上都是点对点的。
A typical case is that a request is processed by a public facing webapplication, and this results in both direct communication with one or more microservices over HTTP, but also that one or more events are generated and published to RabbitMQ, and processed as soon as the consumer has free capacity.一个典型的案例是,请求由面向公众的 Web 应用程序处理,这会导致通过 HTTP 与一个或多个微服务直接通信,还会生成一个或多个事件并将其发布到 RabbitMQ,并在消费者有空闲容量。 We are using ApplicationInsights (which works very well for HTTP), but struggles with adding the requests over RabbitMQ to the visual representation of the end-to-end transaction.我们正在使用 ApplicationInsights(它非常适用于 HTTP),但很难将超过 RabbitMQ 的请求添加到端到端事务的可视化表示中。 We are chaining up the requests with OperationId and ParentId as described in the documentation, and can run a query which returns all the correlated operations, but we are not able to see the entire end-to-end transaction in view "End-to-end transaction details" on the Azure Portal, only the pure HTTP requests.如文档中所述,我们正在使用 OperationId 和 ParentId 链接请求,并且可以运行返回所有相关操作的查询,但我们无法在“端到-”视图中看到整个端到端事务Azure Portal 上的“end transaction details”,只有纯 HTTP 请求。
Has anybody insights to share?有任何见解可以分享吗? What is necessary to do so that Application Insights understands that operations in context of a RabbitMQ consumer also should be shown graphically?需要做什么才能让 Application Insights 理解 RabbitMQ 消费者上下文中的操作也应该以图形方式显示?
Quoting ZakiMa's comment as an answer here so it helps others in the community who have similar asks:在这里引用 ZakiMa 的评论作为答案,以帮助社区中其他有类似问题的人:
Hi!你好! We're actively working on enabling exactly this.我们正在积极致力于实现这一点。 If you're interested to try private preview (a matter of having special flag in URL, no extra configuration), please send email to my alias.如果您有兴趣尝试私人预览(URL 中有特殊标志的问题,无需额外配置),请发送电子邮件至我的别名。 Domain is microsoft ---- com.域是microsoft----com。
Also, just FYI for reference that this is also quoted in the docs that relate to implementing Distrubuted Tracing with Application Insights:此外,仅供参考,在与使用 Application Insights 实施分布式跟踪相关的文档中也引用了这一点:
Currently, automatic context propagation across messaging technologies (like Kafka, RabbitMQ, and Azure Service Bus) isn't supported.目前,不支持跨消息传递技术(如 Kafka、RabbitMQ 和 Azure 服务总线)的自动上下文传播。 It is possible to code such scenarios manually by using the trackDependency and trackRequest methods.可以使用 trackDependency 和 trackRequest 方法手动编写此类场景。 In these methods, a dependency telemetry represents a message being enqueued by a producer.在这些方法中,依赖遥测表示由生产者排队的消息。 The request represents a message being processed by a consumer.请求表示消费者正在处理的消息。 In this case, both operation_id and operation_parentId should be propagated in the message's properties.在这种情况下, operation_id 和 operation_parentId 都应该在消息的属性中传播。
Thanks for reaching out.感谢您伸出援手。
UPDATE as of 06/18/2020:截至 2020 年 6 月 18 日的更新:
This feature has been released to Public Preview .此功能已发布到公共预览版。 In Application Map/End-to-end details you should see a banner and Try preview option as under:在应用程序地图/端到端详细信息中,您应该看到一个横幅和尝试预览选项,如下所示:
I achieved it some time ago.我前段时间实现了它。 The key point is to emulate Azure Service Bus, so you can explore traces like this:关键点是模拟 Azure 服务总线,因此您可以这样探索跟踪:
You can find the code here:你可以在这里找到代码:
https://github.com/JoanComasFdz/do.net-rabbitmq-client-instrumentation-app-insights https://github.com/JoanComasFdz/do.net-rabbitmq-client-instrumentation-app-insights
I have been using this library in my project for quite some time now, but I guess nowadays you should be using more established technologies:我在我的项目中使用这个库已经有一段时间了,但我想现在你应该使用更成熟的技术:
MassTransit is instrumented with Application Insight: L https://masstransit-project.com/advanced/monitoring/applications-insights.html MassTransit 配备了 Application Insight:L https://masstransit-project.com/advanced/monitoring/applications-insights.html
Then there is also the RabbitMQ traceable messaging: https://larionov.pro/en/open-source/rabbitmq-traceable-messaging/然后还有 RabbitMQ 可追踪消息: https://larionov.pro/en/open-source/rabbitmq-traceable-messaging/
Micoroft Dapr: https://dapr.io/微软 Dapr: https://dapr.io/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.