From 8faed97e74e5d28527882d960f7d2320d3535f24 Mon Sep 17 00:00:00 2001 From: Romain Date: Wed, 18 Oct 2023 13:44:05 +0200 Subject: [PATCH] Add a mention for the host header in metrics headers labels doc Co-authored-by: Baptiste Mayelle --- docs/content/observability/metrics/prometheus.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/content/observability/metrics/prometheus.md b/docs/content/observability/metrics/prometheus.md index be3e29cb6..4a3ec0a32 100644 --- a/docs/content/observability/metrics/prometheus.md +++ b/docs/content/observability/metrics/prometheus.md @@ -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 -``` \ No newline at end of file +``` + +!!! 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.