V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
asanelder
V2EX  ›  程序员

求助, 为现有的 thrift rpc 服务添加 tracing 功能

  •  
  •   asanelder · Apr 21, 2021 · 1787 views
    This topic created in 1844 days ago, the information mentioned may be changed or developed.
    背景

    1. rpc 使用的是 thrift, thrift 都已定义好
    2. tracing 使用 opentracing api

    问题:

    发送 RPC 请求时会带上 Tracing 数据才能完成链路追踪, 但是现在 thrfit 都已定义好了, 如何在发送 RPC 请求时再带上 tracing 数据呢?


    俺想不出什么方案, 有没有铁子来给俺一下提示啊~~~
    3 replies    2021-04-21 22:18:14 +08:00
    zhwei
        1
    zhwei  
       Apr 21, 2021
    将 Tracking 信息写到 thrift 协议头里,可以参考下 dubbo thrift 的实现,dubbo 在头里加上了服务名等信息
    zhengxiaowai
        2
    zhengxiaowai  
       Apr 21, 2021
    重写 TBinaryProtocol
    asanelder
        3
    asanelder  
    OP
       Apr 21, 2021
    @zhwei #1
    @zhengxiaowai #2

    感谢提供线索, 俺在网上找了一个类似的方案, 是使用的 TProtocolDecorator, 包装一下 TProtocol, 和二位的意思应该是一样的

    再次感谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3057 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 14:15 · PVG 22:15 · LAX 07:15 · JFK 10:15
    ♥ Do have faith in what you're doing.