Add a mention for the host header in metrics headers labels doc

Co-authored-by: Baptiste Mayelle <baptiste.mayelle@traefik.io>
This commit is contained in:
Romain 2023-10-18 13:44:05 +02:00 committed by GitHub
parent 0b4c582088
commit 8faed97e74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -227,4 +227,12 @@ The following metric is produced :
```bash
traefik_entrypoint_requests_total{code="200",entrypoint="web",method="GET",protocol="http",useragent="foobar"} 1
```
```
!!! info "`Host` header value"
The `Host` header is never present in the Header map of a request, as per go documentation says:
// For incoming requests, the Host header is promoted to the
// Request.Host field and removed from the Header map.
As a workaround, to obtain the Host of a request as a label, one should use instead the `X-Forwarded-For` header.