A Traefik plugin that adds request and response timestamp headers to HTTP responses, helping you track request processing times and latency.
This plugin injects both a REQUEST-TIMESTAMP and a RESPONSE-TIMESTAMP header into each HTTP response. The REQUEST-TIMESTAMP reflects when the request first reached Traefik, while the RESPONSE-TIMESTAMP marks when the response is sent back to the client. Both header names and the date format are fully configurable, supporting any Go time format. The plugin is lightweight, fast, and has no dependencies.
Parameter | Description | Default |
---|---|---|
requestHeaderName |
Name of the request timestamp header | "REQUEST-TIMESTAMP" |
responseHeaderName |
Name of the response timestamp header | "RESPONSE-TIMESTAMP" |
dateFormat |
Go time format string | "2006-01-02T15:04:05.000Z" |
experimental:
plugins:
timestampheaders:
moduleName: "github.com/feedzai/traefikRequestTimestamps"
version: "v1.0.0"
http:
middlewares:
timestamp-headers:
plugin:
timestampheaders: {}
routers:
api:
rule: "Path(`/`)"
service: backend-service
middlewares:
- timestamp-headers
http:
middlewares:
custom-timestamps:
plugin:
timestampheaders:
requestHeaderName: "X-Request-Time"
responseHeaderName: "X-Response-Time"
dateFormat: "2006-01-02 15:04:05 UTC"
- Traefik v3.0+
- Go 1.19+ (for development)