sogou / srpc

RPC framework based on C++ Workflow. Supports SRPC, Baidu bRPC, Tencent tRPC, thrift protocols.
Apache License 2.0
1.95k stars 385 forks source link

rpc_module : support trace data transmission in TRPCHttp; skip no trace_id data in RPCTraceFilterPolicy::collect(); #295

Closed holmes1412 closed 1 year ago

holmes1412 commented 1 year ago
  1. support trace data transmission in TRPCHttp
    ./server 
curl localhost:1412/rpc_test/Echo -d "{message:'hiahia'}"
rpc_test TRPCHttp server started, port 1412
[SPAN_LOG] trace_id: 00a0afd77be57d0002a0afd77be57d00 span_id: 04a0afd77be57d00 service: rpc_test method: Echo start_time: 1680012943793962000 finish_time: 1680012943793994000 duration: 32000(ns) remote_ip: 127.0.0.1 port: 60525 state: 12 error: 0
  1. skip no trace_id data in RPCTraceFilterPolicy::collect()
    ./server 
    curl localhost:1412

    Origin behavior:

    rpc_test TRPCHttp server started, port 1412
    [SPAN_LOG] trace_id: 00000000000000000000000000000000 span_id: 0000000000000000 service:  method:  start_time:

    Now we check the module data and skip empty trace info in RPCTraceFilterPolicy::collect().