TraefikPrometheus

Host header unavailable for Prometheus metric labeling

info
configurationUpdated Jan 7, 2026(via Exa)
How to detect:

The Host request header cannot be used in metrics.prometheus.headerLabels configuration because Go's HTTP implementation promotes the Host header to Request.Host field and removes it from the header map, causing the label to always be empty.

Recommended action:

Use X-Forwarded-Host header instead of Host when configuring metrics.prometheus.headerLabels to capture the request host. Update headerLabels configuration to reference X-Forwarded-Host as the source for host-based labels.