【发布时间】:2019-10-22 12:56:45
【问题描述】:
在 Traefik 中,是否可以为请求添加唯一的请求 ID 标头?我希望能够将访问日志与来自后端服务的日志关联起来。
【问题讨论】:
在 Traefik 中,是否可以为请求添加唯一的请求 ID 标头?我希望能够将访问日志与来自后端服务的日志关联起来。
【问题讨论】:
AFAIK 不支持它,但是这是 Traefik 2.3.6 中的一个功能解决方法:
# static config
...
[tracing]
# Workaround for the non support of Correlation/Request Id Header
# - https://github.com/traefik/traefik/issues/4640
# - https://github.com/traefik/traefik/pull/6707#issuecomment-640429009
[tracing.jaeger]
samplingParam = 0
traceContextHeaderName = "X-Correlation-Id"
...
【讨论】: