Make server.address and server.port to opt-in on HTTP server metrics#109
Conversation
Maybe it was accidental, but query is particularly prone to containing sensitive information, so it seems OK to be "just" recommended. I think that would allow instrumentations to provide an opt-out option which REQUIRED technically doesn't. |
|
@Oberon00 do you agree with making if so, I'd recommend we split out the other parts (that affect other signals) into separate PR(s) |
|
I guess the metric changes are fine, given the cardinality constraints. Making a full URL non-constructible for traces on the server-side would be big change on the other hand: unless I'm mistaken, both the old conventions and the previous ECS-based version always made that possible with just required attributes. |
d95f405 to
d27bada
Compare
|
I reverted all changes not related to metrics (and took the liberty to resolve corresponding threads) and will open another PR for traces (with |
Fixes #108
Most HTTP server instrumentations report
server.addressandserver.portbased on the requestHostheader as it's the only source of information they have.Depending on the reverse proxies presence and other infra configuration,
Hostheader might come unmodified from clients. Malicious or buggy clients could cause a cardinality explosion and degrade the server metrics experience.The expectation is that the majority of HTTP applications do not need
server.addressandserver.portattributes on metrics as these attributes are static and are the same for a specificservice.nameor a combination of resource attributes.They are beneficial in multi-host applications, but still, resource attributes set on the corresponding meter
and tracerproviders can be used to distinguish tenants.This PR changes
server.*requirement level to:opt_infor metrics, to mitigate the attack vectorrecommendedfor traces. These attributes are still interesting, but not essential for the tracing experience.url.queryrequirement level changed fromrecommendedtorequired(to matchurl.path) on spans - this seems like a bug that slipped into BREAKING: Introduce commonurl.*attributes, and improve use of namespacing underhttp.*opentelemetry-specification#3355