OpenFeign 日志

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

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

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

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

key表达含义
time日志打印时间
local.app当前应用名
traceIdTraceId
spanIdSpanId
span.kindSpan 类型
result.code状态码
current.thread.name当前线程名
time.cost.millisecondsspan 耗时
request.url请求地址
methodhttp method
error错误信息
req.size.bytes请求大小
resp.size.bytes响应大小
sys.baggage系统透传的 baggage 数据
biz.baggage业务透传的 baggage 数据

样例:

{"time":"2019-09-03 10:28:52.363","local.app":"tracer-consumer","traceId":"0a0fe9271567477731347100110969","spanId":"0.1","span.kind":"client","result.code":"200","current.thread.name":"http-nio-8082-exec-1","time.cost.milliseconds":"219ms","request.url":"http://10.15.233.39:8800/feign","method":"GET","error":"","req.size.bytes":0,"resp.size.bytes":18,"remote.host":"10.15.233.39","remote.port":"8800","sys.baggage":"","biz.baggage":""}

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

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 不是压测

样例:

{"time":"2019-09-03 10:29:34.528","stat.key":{"method":"GET","local.app":"tracer-consumer","request.url":"http://10.15.233.39:8800/feign"},"count":2,"total.cost.milliseconds":378,"success":"true","load.test":"F"}