opentelemetry-specification icon indicating copy to clipboard operation
opentelemetry-specification copied to clipboard

Should `http.scheme` be renamed to `uri.scheme`?

Open reyang opened this issue 3 years ago • 2 comments
trafficstars

Strictly speaking scheme is not an HTTP concept.

https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml

reyang avatar Apr 12 '22 15:04 reyang

This would be the kind of the opposite direction of #2056, wouldn't it? I could imagine renaming to http.url_scheme (or http.uri_scheme) but I don't think there is a real problem with the current name that warrants the disruption caused by renaming (even though it is eased by the convention schema mechanism).

Oberon00 avatar Apr 12 '22 15:04 Oberon00

FYI this is the ECS approach: https://www.elastic.co/guide/en/ecs/current/ecs-http.html#ecs-http

Use the url field set to store the url of the request.

reyang avatar Apr 13 '22 21:04 reyang

if we rename http.scheme to url.scheme, would we also rename http.url to url.full?

and (maybe) rename http.target to url.target, or (aligning with ECS) split http.target into url.path + url.query + url.fragment?

trask avatar Jan 31 '23 21:01 trask

cc @AlexanderWert

trask avatar Jan 31 '23 21:01 trask

I think this is where we should borrow/learn from ECS, and maybe @AlexanderWert can help us a lot.

I will give an example which shows how we end up with if we call it http.url:

  1. A vendor is building an anti-virus software which records all the outgoing networking access, and for L7 actions, the software supports both FTP and HTTP.
  2. The vendor would want to have a table which looks like:
    | timestamp | user   | url.full              | blocked |
    | --------- | ------ | --------------------- | ------- |
    | T1        | reiley | http://wikipedia.org/ | no      |
    | T2        | reiley | http://microsoft.com/ | no      |
    | T3        | reiley | ftp://bad/malware     | yes     |
    
  3. If we ask folks to use http.url and ftp.url, they will either end up with a sparse table that is hard to use, or they have to put things to different tables, or they will push for a new major version of semantic convention.

reyang avatar Jan 31 '23 21:01 reyang

http.client_ip -> net.client_ip or net.forwarded_ip similar to ECS network.forwarded_ip?

trask avatar Jan 31 '23 23:01 trask

To provide some input from the ECS perspective to this:

Being more explicit about all the URL-related aspects and group them under a common namespace would allow to address the examples mentioned here and would also address https://github.com/open-telemetry/opentelemetry-specification/issues/2056

So basically:

  • http.url -> url.original (+ optional and where applicable: url.full, url.scheme, url.domain, url.port, url.path, url.query, etc. )
  • http.scheme -> url.scheme
  • http.target -> url.original (+ optional and where applicable: url.path, url.query) -> addresses https://github.com/open-telemetry/opentelemetry-specification/issues/2056

Also, is it necessary to have different attributes for http.url (on CLIENT spans) and http.target (on SERVER spans)? Both are representing (parts of a) URL and with the SpanKind the semantics (client request URL vs server request target) of it is also clearly defined. So, why not using a common attribute (or a set of attributes) for it?

AlexanderWert avatar Feb 01 '23 10:02 AlexanderWert

let's move this conversation over to #3163 if no objections

trask avatar Feb 02 '23 01:02 trask

@reyang ok to close this in favor of the #3163?

trask avatar Feb 03 '23 16:02 trask