SOFARPC 集成了 SOFATracer 的功能,可以输出链路中的数据信息。默认开启。
默认为 JSON
数据格式,具体的字段含义解释如下:
RPC 客户端摘要日志( rpc-client-digest.log)
日志示例如下:
{"timestamp":"2018-05-20 17:03:20.708","tracerId":"1e27326d1526807000498100185597","spanId":"0","span.kind":"client","local.app":"SOFATracerRPC","protocol":"bolt","service":"com.alipay.sofa.tracer.examples.sofarpc.direct.DirectService:1.0","method":"sayDirect","current.thread.name":"main","invoke.type":"sync","router.record":"DIRECT","remote.ip":"127.0.0.1:12200","local.client.ip":"127.0.0.1","result.code":"00","req.serialize.time":"33","resp.deserialize.time":"39","resp.size":"170","req.size":"582","client.conn.time":"0","client.elapse.time":"155","local.client.port":"59774","baggage":""}
参数 | 说明 |
timestamp | 日志打印时间 |
tracerId | 请求的 TracerId。 |
spanId | 请求的 SpanId。 |
span.kind | Span 类型。 |
local.app | 当前 App 名称。 |
protocol | 协议类型。 |
service | 服务接口信息。 |
method | 方法名。 |
current.thread.name | 当前线程名。 |
invoke.type | 调用类型。 |
router.record | 路由记录 |
remote.ip | 目标 IP。 |
local.client.ip | 本机 IP。 |
result.code | 返回码。 |
req.serialize.time | 请求序列化时间。 |
resp.deserialize.time | 响应反序列化时间。 |
resp.size | 响应大小,单位Byte。 |
req.size | 请求大小,单位 Byte。 |
client.conn.time | 客户端连接耗时。 |
client.elapse.time | 客户端调用总耗时。 |
local.client.port | 本地客户端端口。 |
baggage | 透传的 baggage 数据 (KV 格式)。 |
RPC 服务端摘要日志( rpc-server-digest.log)
日志示例如下:
{"timestamp":"2018-05-20 17:00:53.312","tracerId":"1e27326d1526806853032100185011","spanId":"0","span.kind":"server","service":"com.alipay.sofa.tracer.examples.sofarpc.direct.DirectService:1.0","method":"sayDirect","remote.ip":"127.0.0.1","remote.app":"SOFATracerRPC","protocol":"bolt","local.app":"SOFATracerRPC","current.thread.name":"SOFA-BOLT-BIZ-12200-5-T1","result.code":"00","server.pool.wait.time":"3","biz.impl.time":"0","resp.serialize.time":"4","req.deserialize.time":"38","resp.size":"170","req.size":"582","baggage":"",{"timestamp":"2018-05-20 17:03:05.646","tracerId":"1e27326d1526806985394100185589","spanId":"0","span.kind":"server","service":"com.alipay.sofa.tracer.examples.sofarpc.direct.DirectService:1.0","method":"sayDirect","remote.ip":"127.0.0.1","remote.app":"SOFATracerRPC","protocol":"bolt","local.app":"SOFATracerRPC","current.thread.name":"SOFA-BOLT-BIZ-12200-5-T1","result.code":"00","server.pool.wait.time":"2","biz.impl.time":"1","resp.serialize.time":"1","req.deserialize.time":"6","resp.size":"170","req.size":"582","baggage":"",{"timestamp":"2018-05-20 17:03:20.701","tracerId":"1e27326d1526807000498100185597","spanId":"0","span.kind":"server","service":"com.alipay.sofa.tracer.examples.sofarpc.direct.DirectService:1.0","method":"sayDirect","remote.ip":"127.0.0.1","remote.app":"SOFATracerRPC","protocol":"bolt","local.app":"SOFATracerRPC","current.thread.name":"SOFA-BOLT-BIZ-12200-5-T1","result.code":"00","server.pool.wait.time":"2","biz.impl.time":"0","resp.serialize.time":"1","req.deserialize.time":"4","resp.size":"170","req.size":"582","baggage":"",{"timestamp":"2018-05-20 17:04:19.966","tracerId":"1e27326d1526807046606100185635","spanId":"0","span.kind":"server","service":"com.alipay.sofa.tracer.examples.sofarpc.direct.DirectService:1.0","method":"sayDirect","remote.ip":"127.0.0.1","remote.app":"SOFATracerRPC","protocol":"bolt","local.app":"SOFATracerRPC","current.thread.name":"SOFA-BOLT-BIZ-12200-5-T1","result.code":"00","server.pool.wait.time":"2","biz.impl.time":"0","resp.serialize.time":"1","req.deserialize.time":"4","resp.size":"170","req.size":"582","baggage":""}
参数 | 说明 |
timestamp | 日志打印时间。 |
tracerId | 请求的 TracerId。 |
spanId | 请求的 SpanId。 |
span.kind | Span 类型。 |
server | 服务接口信息。 |
method | 方法名。 |
remote.ip | 来源 IP。 |
remote.app | 来源 App 名称。 |
protocol | 协议类型。 |
local.app | 本地 App 名称。 |
current.thread.name | 当前线程名。 |
result.code | 返回码。 |
server.pool.wait.time | 服务端线程池等待时间。 |
biz.impl.time | 业务处理耗时。 |
resp.serialize.time | 响应序列化时间。 |
req.deserialize.time | 请求反序列化时间。 |
resp.size | 响应大小,单位 Byte。 |
req.size | 请求大小,单位 Byte。 |
baggage | 透传的 baggage 数据(KV 格式)。 |
RPC 客户端统计日志( rpc-client-stat.log)
日志示例如下:
{"time":"2018-05-18 07:02:19.717","stat.key":{"method":"method","local.app":"client","service":"app.service:1.0"},"count":10,"total.cost.milliseconds":17,"success":"Y"}
参数 | 说明 |
time | 日志打印时间。 |
stat.key | 日志关键 key。 |
method | 方法信息。 |
local.app | 客户端 App 名称。 |
service | 服务接口信息。 |
count | 调用次数。 |
total.cost.milliseconds | 总耗时。 |
success | 调用结果:
|
RPC 服务端统计日志( rpc-server-stat.log)
日志示例如下:
{"time":"2018-05-18 07:02:19.717","stat.key":{"method":"method","local.app":"client","service":"app.service:1.0"},"count":10,"total.cost.milliseconds":17,"success":"Y"}
参数 | 说明 |
time | 日志打印时间。 |
stat.key | 日志关键 key。 |
method | 方法信息。 |
local.app | 客户端 App 名称。 |
service | 服务接口信息。 |
count | 调用次数。 |
total.cost.milliseconds | 总耗时。 |
success | 调用结果:
|