Skip to content
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

Make server.address and server.port to opt-in on HTTP server metrics #109

Merged
merged 8 commits into from
Jun 19, 2023

Conversation

lmolkova
Copy link
Contributor

@lmolkova lmolkova commented Jun 14, 2023

Fixes #108

Most HTTP server instrumentations report server.address and server.port based on the request Host header as it's the only source of information they have.

Depending on the reverse proxies presence and other infra configuration, Host header 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.address and server.port attributes on metrics as these attributes are static and are the same for a specific service.name or a combination of resource attributes.

They are beneficial in multi-host applications, but still, resource attributes set on the corresponding meter and tracer providers can be used to distinguish tenants.

This PR changes

@lmolkova lmolkova requested review from a team June 14, 2023 04:21
@Oberon00
Copy link
Member

url.query requirement level changed from recommended to required (to match url.path) on spans - this seems like a bug that slipped into #3355

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.

@trask
Copy link
Member

trask commented Jun 14, 2023

@Oberon00 do you agree with making server.address and server.port Opt-In on the metrics side?

if so, I'd recommend we split out the other parts (that affect other signals) into separate PR(s)

@Oberon00
Copy link
Member

Oberon00 commented Jun 14, 2023

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.

@lmolkova lmolkova force-pushed the http-host-req-level branch from d95f405 to d27bada Compare June 14, 2023 18:24
@lmolkova
Copy link
Contributor Author

lmolkova commented Jun 14, 2023

I reverted all changes not related to metrics (and took the liberty to resolve corresponding threads) and will open another PR for traces (with uri.query) where we can continue the discussion.

@trask
Copy link
Member

trask commented Jun 19, 2023

@arminru @jsuereth @reyang I think this is ready to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Address high-cardinality attributes server.address and server.port attack vector
7 participants