Dubbo 日志

优质
小牛编辑
135浏览
2023-12-01

SOFATracer 集成 Dubbo 后输出请求的链路数据格式,默认为 JSON 数据格式。

Dubbo 服务消费方摘要日志(dubbo-client-digest.log)

以 JSON 格式输出的数据,相应 key 的含义解释如下:

key表达含义
time日志打印时间
local.app当前应用名
traceIdTraceId
spanIdSpanId
span.kindSpan 类型
result.code状态码
current.thread.name当前线程名
time.cost.millisecondsspan 耗时
protocol协议
service服务接口
method调用方法
invoke.type调用类型
remote.host目标主机
remote.port目标端口
local.host本地主机
client.serialize.time请求序列化时间
client.deserialize.time响应反序列化时间
req.size.bytesRequest Body 大小
resp.size.bytesResponse Body 大小
error错误信息
sys.baggage系统透传的 baggage 数据
biz.baggage业务透传的 baggage 数据

样例:

{"time":"2019-09-02 23:36:08.250","local.app":"dubbo-consumer","traceId":"1e27a79c156743856804410019644","spanId":"0","span.kind":"client","result.code":"00","current.thread.name":"http-nio-8080-exec-2","time.cost.milliseconds":"205ms","protocol":"dubbo","service":"com.glmapper.bridge.boot.service.HelloService","method":"SayHello","invoke.type":"sync","remote.host":"192.168.2.103","remote.port":"20880","local.host":"192.168.2.103","client.serialize.time":35,"client.deserialize.time":5,"req.size.bytes":336,"resp.size.bytes":48,"error":"","sys.baggage":"","biz.baggage":""}

Dubbo 服务提供方摘要日志(dubbo-server-digest.log)

以 JSON 格式输出的数据,相应 key 的含义解释如下:

key表达含义
time日志打印时间
local.app当前应用名
traceIdTraceId
spanIdSpanId
span.kindSpan 类型
result.code状态码
current.thread.name当前线程名
time.cost.millisecondsspan 耗时
protocol协议
service服务接口
method调用方法
invoke.type调用类型
local.host本地主机
local.port本地端口
server.serialize.time响应序列化时间
server.deserialize.time请求反序列化时间
req.size.bytesRequest Body 大小
resp.size.bytesResponse Body 大小
error错误信息
sys.baggage系统透传的 baggage 数据
biz.baggage业务透传的 baggage 数据

样例:

{"time":"2019-09-02 23:36:08.219","local.app":"dubbo-provider","traceId":"1e27a79c156743856804410019644","spanId":"0","span.kind":"server","result.code":"00","current.thread.name":"DubboServerHandler-192.168.2.103:20880-thread-2","time.cost.milliseconds":"9ms","protocol":"dubbo","service":"com.glmapper.bridge.boot.service.HelloService","method":"SayHello","local.host":"192.168.2.103","local.port":"62443","server.serialize.time":0,"server.deserialize.time":27,"req.size.bytes":336,"resp.size.bytes":0,"error":"","sys.baggage":"","biz.baggage":""}

Dubbo 统计日志

stat.key 即本段时间内的统计关键字集合,统一关键字集合唯一确定一组统计数据,包含local.app、service、和 method 字段.

key表达含义
time日志打印时间
stat.keylocal.app当前应用名
method调用方法
service服务名
count本段时间内请求次数
total.cost.milliseconds本段时间内的请求总耗时(ms)
success请求结果:Y 表示成功;N 表示失败
load.test压测标记:T 是压测;F 不是压测

样例:

  • dubbo-client-stat.log

    {"time":"2019-09-02 23:36:13.040","stat.key":{"method":"SayHello","local.app":"dubbo-consumer","service":"com.glmapper.bridge.boot.service.HelloService"},"count":1,"total.cost.milliseconds":205,"success":"true","load.test":"F"}
    
    • dubbo-server-stat.log json {"time":"2019-09-02 23:36:13.208","stat.key":{"method":"SayHello","local.app":"dubbo-provider","service":"com.glmapper.bridge.boot.service.HelloService"},"count":1,"total.cost.milliseconds":9,"success":"true","load.test":"F"}