Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a unique request ID header to Traefik

Tags:

trace

traefik

In Traefik, is it possible to add a unique Request ID header to requests? I'd like to be able to correlate access logs with logs from backend services.

like image 805
Matt R Avatar asked Nov 07 '22 12:11

Matt R


1 Answers

AFAIK there is no support for it, however here is a funcional workaround in 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"

...

like image 95
Xplouder Avatar answered Nov 16 '22 16:11

Xplouder