Hello!
I don't see a traceID or traceparent in the log line generated by traefik. How can I generate a traceID if it doesn't exist yet? Is there an option?
Also, it would be amazing if there was a way to return this traceID to the front user as a header, so they can report to our systems the trace ID in case of errors or weird behaviour.
Here is an example of LOG request I get on my traefik instance.
{
"ClientAddr": "10.x.0.x:x",
"ClientHost": "10.x.0.x",
"ClientPort": "x",
"ClientUsername": "-",
"DownstreamContentSize": 19,
"DownstreamStatus": 404,
"Duration": 162044,
"GzipRatio": 0,
"OriginContentSize": 0,
"OriginDuration": 0,
"OriginStatus": 0,
"Overhead": 162044,
"RequestAddr": "<redacted>",
"RequestContentSize": 0,
"RequestCount": 195,
"RequestHost": "<redacted>",
"RequestMethod": "GET",
"RequestPath": "/",
"RequestPort": "-",
"RequestProtocol": "HTTP/2.0",
"RequestScheme": "https",
"RetryAttempts": 0,
"StartLocal": "2025-01-17T18:45:57.701837007Z",
"StartUTC": "2025-01-17T18:45:57.701837007Z",
"TLSCipher": "TLS_AES_128_GCM_SHA256",
"TLSVersion": "1.3",
"entryPointName": "websecure",
"level": "info",
"msg": "",
"time": "2025-01-17T18:45:57Z"
}
Config:
- Kubernetes
- Traefik helm chart 32.1.1
Helm values:
...
logs:
general:
level: INFO
access:
# -- To enable access logs
enabled: true
# -- Set [access log format](https://doc.traefik.io/traefik/observability/access-logs/#format)
format: json
# -- Enables accessLogs for internal resources. Default: false.
addInternals: true
# -- Set [filtering](https://docs.traefik.io/observability/access-logs/#filtering)
filters: # @schema additionalProperties: false
# -- Set statusCodes, to limit the access logs to requests with a status codes in the specified range
statuscodes: "400-499,500-599"
# -- Set retryAttempts, to keep the access logs when at least one retry has happened
retryattempts: true
# -- Set minDuration, to keep access logs when requests take longer than the specified duration
minduration: "2000ms"
Best regards,