AWS X-Ray instrumentation with Vertx Microservices build in Java

huangapple go评论89阅读模式
英文:

AWS X-Ray instrumentation with Vertx Microservices build in Java

问题

如何在使用Java构建的Vertx微服务中实现X射线仪器?是否有适用于Vertx aws-xray的任何SDK?我使用了Java SDK,但未获得服务地图。

英文:

How to implement x-ray instrumentation with Vertx microservices build in java? Is there is any sdk available for vertx aws-xray? I used java sdk but not getting service map.

答案1

得分: 1

据我所知,X-Ray在任何形式下都与Vert.x不兼容。主要原因是X-Ray中传播跨度的主要方法是使用Threadlocal来跟踪状态。

然而,在类似Vert.x这样的反应式框架中,Threadlocal无法正常工作,因为在这类框架的线程池中,上下文会在不同线程之间跳转。Spring WebFlux也存在同样的问题。

我们已与AWS支持和亚马逊代表取得联系,答复总是“我们会调查一下”,但他们似乎并不是很感兴趣,我怀疑这需要进行全面重写才能正常工作。

英文:

As far as I know, X-Ray doesn't work with Vert.x in any form. The main reason for this is that the main method of propagating spans within X-Ray is using a Threadlocal to keep track of state.

Threadlocal will not work in a reactive framework like Vert.x, because of the context jumping between threads in the thread-pools in these kinds of frameworks. Spring WebFlux has the same problem.

We have been in contact with both AWS support and Amazon representatives, and the answer is always "we will look into this", however they don't seem very interested, as I suspect it needs a full rewrite to work properly.

答案2

得分: 0

目前,AWS X-Ray SDK for Java 并不支持 Vert.x 微服务架构的中间件或追踪支持。唯一支持的框架是 Tomcat 和 Spring。我很好奇您是如何在应用程序中使用 Java SDK 的。

一种追踪应用程序的方法是使用自定义片段和子片段(尽管这意味着您将需要进行大量手动的仪器化工作)。

您可以使用 beginSegment 方法为应用程序启动一个段,并设置适当的属性。然后,您可以为下游调用或任何需要追踪的代码段创建 子片段。有关段和子段的语义含义,请参阅文档

英文:

Currently, the AWS X-Ray SDK for Java does not provide a middleware or tracing support for Vert.x microservices architecture. The only supported frameworks are Tomcat and Spring. I am curious as to how are you using the Java SDK in your application.

One way to trace your application could be to use custom segments and subsegments (although it would mean you'll have to do a lot of manual instrumentation work).

You can begin a segment for your application by using beginSegment method and set the appropriate properties. Then you can create subsegments for your downstream calls or any piece of code that you'd want to trace. Please refer to the doc for the semantic meaning of a Segment and Subsegment.

huangapple
  • 本文由 发表于 2020年5月5日 12:48:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/61605979.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定