使用Kamon在Spray中生成TraceContext(Using Kamon to generate a TraceContext in Spray)

编程入门 行业动态 更新时间:2024-10-27 12:31:39
使用Kamon在Spray中生成TraceContext(Using Kamon to generate a TraceContext in Spray)

我正在将Kamon添加到我的喷涂项目中。 我添加了traceName指令并按照此处的说明进行操作 - http://kamon.io/integrations/logback/trace-token-converter/建议通过Tracer.withNewContext(“simple-test”)开始创建上下文的位置?

当我看到一些与未正确启动上下文相关的线程时,我开始使用sbt左轮手枪( 参见此处 )。 我会继续看到以下行:

a4-dispatcher [WARN] [12/05/2015 10:12:55.967] [Dispatcher-akka.actor.default-dispatcher-3] [SprayExtension(akka://kamon)] EmptyTraceContext present while closing the trace with token [hostname.local-1]

我停止使用sbt左轮手枪 - 现在我没有看到那条线,我在响应头中看到了X-Trace-Token(这很棒)。 但是,我没有在日志中看到令牌。 仍然undefined %token如LogbackTraceTokenConverter所定义

第二个问题:我可以与Kamon图书馆竞争吗? 我的build.sbt中有kamon核心,scala,akka,akka-remote和spray。

I am adding Kamon to my spray project. I have added traceName directive and followed the instructions here - http://kamon.io/integrations/logback/trace-token-converter/ Where would one suggest start creating the context via Tracer.withNewContext("simple-test") ?

I had started out using the sbt revolver when I saw some threads related to not starting the context properly (See here). I would keep seeing the following line:

a4-dispatcher [WARN] [12/05/2015 10:12:55.967] [Dispatcher-akka.actor.default-dispatcher-3] [SprayExtension(akka://kamon)] EmptyTraceContext present while closing the trace with token [hostname.local-1]

I stopped using sbt revolver - and now I don't see that line and I see X-Trace-Token in the response header (which is awesome). But, I don't see the token in the logs. The %token is still undefined as defined in the LogbackTraceTokenConverter

Second question: could I be having competing Kamon libraries? I have kamon core, scala, akka, akka-remote, and spray in my build.sbt .

最满意答案

有一些事情需要到位

使用AspectJ启动Kamon流程。 见http://kamon.io/introduction/get-started/ Sbt左轮手枪无法获得正确的追踪信息。 这可能是因为aspectj weaver没有在分叉的JVM中编织。 控制台日志记录对我来说仍然无效。 我能找到的最接近的是这个主题 - https://groups.google.com/d/msg/kamon-user/uipptjm24gk/OxrbvMw_6EYJ

There are a few things that need to be in place

Start Kamon process using AspectJ. See http://kamon.io/introduction/get-started/ Sbt revolver won't get the tracing information right. It may be because the aspectj weaver doesn't get weaved in the forked JVM. Console logging is still not working for me. The closest I could find is this thread - https://groups.google.com/d/msg/kamon-user/uipptjm24gk/OxrbvMw_6EYJ

更多推荐

本文发布于:2023-07-30 22:48:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1340290.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Spray   Kamon   generate   TraceContext

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!