OpenFeign 日志

更新时间: 2019-06-21

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

Spring Cloud OpenFeign 摘要日志(feign-digest.log)

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

key表达含义
time日志打印时间
local.app当前应用名
traceIdTraceId
spanIdSpanId
request.url请求 URL
method请求 HTTP 方法
result.codeHTTP 返回状态码
error错误信息
req.size.bytesRequest Body 大小
resp.size.bytesResponse Body 大小
time.cost.milliseconds请求耗时(ms)
current.thread.name当前线程名
remote.host目标主机
remote.port目标端口
component.client.impl组件名称
baggage透传的 baggage 数据

样例:

  1. {"time":"2019-03-28 18:08:06.800","local.app":"tracer-consumer","traceId":"0a0fe88f1553767685981100124403","spanId":"0.1","request.url":"http://10.15.232.143:8800/feign","method":"GET","result.code":"200","error":"","req.size.bytes":0,"resp.size.bytes":18,"time.cost.milliseconds":206,"current.thread.name":"http-nio-8082-exec-1","remote.host":"10.15.232.143","remote.port":"8800","component.client.impl":"open-feign","baggage":""}

Spring Cloud OpenFeign 统计日志(feign-stat.log)

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

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

样例:

  1. {"time":"2019-03-28 18:09:06.800","stat.key":{"request.url":"http://10.15.232.143:8800/feign","local.app":"tracer-consumer","method":"GET"},"count":1,"total.cost.milliseconds":206,"success":"Y","load.test":"F"}