-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should HTTP server.address
and server.port
prioritize Host
header over virtual host name?
#388
Comments
IMHO: No, the Host header should not be prioritized. Unfortunately, it often contains bogus content, and it can be captured separately in Doing a bit of PR archeology, it seems it was @lmolkova who defined this priority order in open-telemetry/opentelemetry-specification#2469 and declared that to be the order to find the "best known server name". I think it is a very reasonable priority order. |
Agree with @Oberon00. Reverse proxies don't always preserve the original host header (and custom configuration can put anything there). In my mental model, since the "primary server name" is essentially user-configurable, this is the way for users to force Something we should probably do:
WDYT? |
I agree that "virtual host" verbiage could/should probably be removed and replaced by something simpler. One thing that just occured to me: server.address is also used as metric attribute for HTTP server metric. A bad Host header could easily cause a cardinality explosion there. So that is a no-go also for that reason I believe. https://opentelemetry.io/docs/specs/otel/metrics/semantic_conventions/http-metrics/#metric-httpserverduration Given that, "or a primary server name" might need an additional hint that it must still be something that needs to be low cardinality. |
this discussion led me to a similar worry, let me know if you think #401 is sufficient |
moving this question to #414 |
Closing this issue, I think the original question has been answered, and there are follow-up issues and PRs for the other discussion items: |
Since one of the motivations for these attributes on the server side:
server.address
server.port
url.path
url.query
url.scheme
is to reconstruct the original URL, does it make sense to prioritize capturing
server.address
andserver.port
from theHost
header instead of the current state of prioritizing the virtual host name?(and since we have more clarity on these being logical attributes now, and since we can introduce more lower-level attributes to capture virtual host name / port in the future as needed)
here's the current definition of
server.address
(as captured on the server side):semantic-conventions/model/http-common.yaml
Lines 70 to 80 in b127e12
The text was updated successfully, but these errors were encountered: