Distributed Tracing: How many spans is too many?

blov · · 374 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;ve not yet come across some recommendations for how granular you should get with distributed tracing. I know this isn&#39;t strictly a Go question, but I am working with Jaeger via OpenTracing in Go.</p> <p>I&#39;m working on some services that use <a href="https://blog.golang.org/pipelines" rel="nofollow">pipelines</a> to process a bunch of data. Usually this data comes from a third-party, so the processing is the transformation of the data returned from a third-party back into a normalised format. Lots of items are returned, so the pipeline approach is used to ensure that as many items are processed as possible before a timeout. If we ever do reach a timeout, at least we can have finished processing some of the data, and there&#39;s something to send back normalised, even if it&#39;s missing some things.</p> <p>The problem with this approach is that each of these transformations requires calls to downstream services, or database queries. These are all the kinds of things that I&#39;d like to be able to trace, along with how long each stage in the pipeline took overall, from the first item being processed to the last.</p> <p>When I&#39;ve added tracing that does accomplish this goal, I&#39;ve ended up with thousands of spans. Even with the newer Jaeger UI that has better performance it&#39;s a bit much...</p> <p>I&#39;d been toying with the idea of swapping the approach to batch things up instead so there were larger chunks of work to trace, but there are too many advantages for my use-case in pipelines.</p> <p>I understand that in production use only <em>some</em> of the requests would actually be sampled in Jaeger, as long as I use probabilistic sampling. That helps to alleviate some of my concern, however; what I&#39;d prefer really is some way to say, when a request is done &#34;Was this request slower than we expected? Yes? Okay, then this trace is worth sending over, even if it does have thousands of spans&#34; (on top of the probabilistic sampling).</p> <p>I&#39;m keen to hear about how other people may have tackled similar issues before.</p>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

374 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传