baiwfg2 / awesome-readings

记录看各种文章、论文的心得
2 stars 0 forks source link

database request tracing & distributed tracing #29

Open baiwfg2 opened 2 years ago

baiwfg2 commented 2 years ago

最近在mongo 上碰到物理加节点时,mongos端容易出现读延时spikes,导致业务性能受到突发影响。想定位此请求路径下的耗时时间,但是由于mongo 缺乏"tracing" 请求的能力,只好手工加日志 (但可惜的是,日志本身就会对延时、吞吐产生影响,特别是加在关键路径上的)。但更好的方式是支持tracing,比如scylladb ,这样能快速分析一个慢操作大头耗在什么地方,就专门优化那个地方

[1] https://docs.scylladb.com/using-scylla/tracing/

[2] https://docs.mongodb.com/manual/tutorial/manage-the-database-profiler/ ,也是存储在系统表中,但关键路径并未打出耗时,不好用

[3] https://stackoverflow.com/questions/69283926/how-to-do-distributed-tracing-within-distributed-databases

baiwfg2 commented 2 years ago

分布式tracing 经常用在微服务架构中,业务也有好几款工具,最近 了解到 tempo 已经可以grafana中展示甘特图延时,非常直观。

[a] https://github.com/jaegertracing/jaeger
openTelemetry 提供的是API,将应用的telemetry data 导出来,而 jaeger 是tracing 后端,用以存储telemetry data

https://grafana.com/blog/2020/05/22/new-in-grafana-7.0-trace-viewer-and-integrations-with-jaeger-and-zipkin/ grafana 已经支持将 Jaeger, zipkin 的UI 集成进去 (那tempo 的UI 是自己搞的吧?)

baiwfg2 commented 2 years ago

[4] https://docs.wavefront.com/tracing_basics.html , wavefront