diff --git a/CHANGELOG.md b/CHANGELOG.md index b5b9a2b9697..fcc2693b484 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,8 @@ release. [#3158](https://github.com/open-telemetry/opentelemetry-specification/pull/3158) - `http.route` SHOULD contain the "application root" if there is one. ([#3164](https://github.com/open-telemetry/opentelemetry-specification/pull/3164)) +- Rename `http.user_agent` to `user_agent.original`. + ([#3190](https://github.com/open-telemetry/opentelemetry-specification/pull/3190)) ### Compatibility diff --git a/schemas/1.18.0 b/schemas/1.18.0 index 400bd0969e0..e89dbdd2460 100644 --- a/schemas/1.18.0 +++ b/schemas/1.18.0 @@ -2,6 +2,12 @@ file_format: 1.1.0 schema_url: https://opentelemetry.io/schemas/1.18.0 versions: 1.18.0: + spans: + changes: + # https://github.com/open-telemetry/opentelemetry-specification/pull/3190 + - rename_attributes: + attribute_map: + http.user_agent: user_agent.original 1.17.0: spans: changes: diff --git a/semantic_conventions/trace/http.yaml b/semantic_conventions/trace/http.yaml index 6b8736e8840..b7362388c96 100644 --- a/semantic_conventions/trace/http.yaml +++ b/semantic_conventions/trace/http.yaml @@ -47,10 +47,6 @@ groups: note: > 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. - - id: user_agent - type: string - brief: 'Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client.' - examples: ['CERN-LineMode/2.15 libwww/2.17b3'] - id: request_content_length type: int brief: > @@ -70,6 +66,7 @@ groups: - ref: net.sock.peer.name - ref: net.sock.family examples: ['inet', 'inet6'] + - ref: user_agent.original constraints: - include: network diff --git a/semantic_conventions/user-agent.yaml b/semantic_conventions/user-agent.yaml new file mode 100644 index 00000000000..2f43b1af3e6 --- /dev/null +++ b/semantic_conventions/user-agent.yaml @@ -0,0 +1,10 @@ +groups: + - id: attributes.user_agent + type: attribute_group + brief: "Describes user-agent attributes." + prefix: user_agent + attributes: + - id: original + type: string + brief: 'Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client.' + examples: ['CERN-LineMode/2.15 libwww/2.17b3'] diff --git a/specification/trace/semantic_conventions/http.md b/specification/trace/semantic_conventions/http.md index 10b808fa381..a6747a78eb7 100644 --- a/specification/trace/semantic_conventions/http.md +++ b/specification/trace/semantic_conventions/http.md @@ -68,13 +68,13 @@ sections below. | `http.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Required | | `http.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: If and only if one was received/sent. | | `http.flavor` | string | Kind of HTTP protocol used. [1] | `1.0` | Recommended | -| `http.user_agent` | string | Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | | `http.request_content_length` | int | The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. | `3495` | Recommended | | `http.response_content_length` | int | The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. | `3495` | Recommended | | [`net.sock.family`](span-general.md) | string | Protocol [address family](https://man7.org/linux/man-pages/man7/address_families.7.html) which is used for communication. | `inet`; `inet6` | Conditionally Required: [2] | | [`net.sock.peer.addr`](span-general.md) | string | Remote socket peer address: IPv4 or IPv6 for internet protocols, path for local communication, [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). | `127.0.0.1`; `/tmp/mysql.sock` | Recommended | | [`net.sock.peer.name`](span-general.md) | string | Remote socket peer name. | `proxy.example.com` | Recommended: [3] | | [`net.sock.peer.port`](span-general.md) | int | Remote socket peer port. | `16456` | Recommended: [4] | +| `user_agent.original` | string | Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. | `CERN-LineMode/2.15 libwww/2.17b3` | Recommended | **[1]:** 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.