From cd62c95a569fe9e30cbb30cda1598fae910d24a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Sat, 25 Jan 2020 02:58:20 +0100 Subject: [PATCH] HTTP: Allow user_agent also on client, remove peer.ip4. (#415) * HTTP: Allow user_agent also on client, remove peer.ip4. --- specification/data-http.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/specification/data-http.md b/specification/data-http.md index 32b6a53ffc6..0c181ec6671 100644 --- a/specification/data-http.md +++ b/specification/data-http.md @@ -79,12 +79,14 @@ Note that the items marked with [1] are different from the mapping defined in th | `http.status_code` | [HTTP response status code][]. E.g. `200` (integer) | If and only if one was received/sent. | | `http.status_text` | [HTTP reason phrase][]. E.g. `"OK"` | No | | `http.flavor` | Kind of HTTP protocol used: `"1.0"`, `"1.1"`, `"2"`, `"SPDY"` or `"QUIC"`. | No | +| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | No | It is recommended to also use the general [network attributes][], especially `net.peer.ip`. If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. [network attributes]: data-span-general.md#general-network-connection-attributes [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 [HTTP reason phrase]: https://tools.ietf.org/html/rfc7230#section-3.1.2 +[User-Agent]: https://tools.ietf.org/html/rfc7231#section-5.5.3 ## HTTP client @@ -185,12 +187,10 @@ If the route cannot be determined, the `name` attribute MUST be set as defined i | `http.server_name` | The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). | [1] | | `http.route` | The matched route (path template). (TODO: Define whether to prepend application root) E.g. `"/users/:userID?"`. | No | | `http.client_ip` | The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For][]). Note that this is not necessarily the same as `net.peer.ip`, which would identify the network-level peer, which may be a proxy. | No | -| `http.user_agent` | Value of the HTTP [User-Agent][] header sent by the client. | No | [HTTP request line]: https://tools.ietf.org/html/rfc7230#section-3.1.1 [HTTP host header]: https://tools.ietf.org/html/rfc7230#section-5.4 [X-Forwarded-For]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For -[User-Agent]: https://tools.ietf.org/html/rfc7231#section-5.5.3 **[1]**: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. ). It is thus preferred to supply the raw data that *is* available. @@ -220,7 +220,7 @@ Span name: `/webshop/articles/4` (NOTE: This is subject to change, see [open-tel | `http.method` | `"GET"` | | `http.flavor` | `"1.1"` | | `http.url` | `"https://example.com:8080/webshop/articles/4?s=1"` | -| `peer.ip4` | `"192.0.2.5"` | +| `net.peer.ip` | `"192.0.2.5"` | | `http.status_code` | `200` | | `http.status_text` | `"OK"` | @@ -243,6 +243,7 @@ Span name: `/webshop/articles/:article_id`. | `http.status_text` | `"OK"` | | `http.client_ip` | `"192.0.2.4"` | | `net.peer.ip` | `"192.0.2.5"` (the client goes through a proxy) | +| `http.user_agent` | `"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"` | Note that following the recommendations above, `http.url` is not set in the above example. If set, it would be