Implement url.scheme
attribute label for Opentelemetry compliance
#8
Labels
url.scheme
attribute label for Opentelemetry compliance
#8
https://opentelemetry.io/docs/specs/semconv/http/http-metrics/#http-server
http
;https
[2]: The scheme of the original client request, if known (e.g. from Forwarded#proto, X-Forwarded-Proto, or a similar header). Otherwise, the scheme of the immediate peer request.
Since generally in any modern environment the webserver app is not going to be terminating TLS itself, the spec tells us to lean on the
X-Forwarded-Proto
andForwarded
headers for the information.The middleware needs to:
url.scheme
attribute label on each requestThe docs do not explicitly say this but I would assume we should give precedence to
Forwarded
since it is a real standard, whileX-Forwarded-Proto
is a "de-facto standard" which seems unlikely to ever be promoted from that status, asForwarded
covers the same info.Given that this is an HTTP server middleware, we can fall back to
http
or just splitting it from the URL if it's not present in the headers, as described: Otherwise, the scheme of the immediate peer request.The text was updated successfully, but these errors were encountered: