From 98c964ea5ba5149beae4d1febadbf072a02aa85e Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 27 Oct 2023 12:52:02 -0700 Subject: [PATCH] Change http.request.body.size and http.response.body.size attributes from recommended to opt-in --- CHANGELOG.md | 3 +++ docs/attributes-registry/http.md | 4 ++-- docs/http/http-spans.md | 2 -- model/registry/deprecated/http.yaml | 4 ++-- model/registry/http.yaml | 2 ++ model/trace/http.yaml | 2 -- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c85977b6f9..d903fccd04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,9 @@ release. ([#384](https://github.com/open-telemetry/semantic-conventions/pull/384)) - BREAKING: Remove `total` from list of well-known values of `system.memory.state` attribute. ([#409](https://github.com/open-telemetry/semantic-conventions/pull/409)) +- Change `http.request.body.size` and `http.response.body.size` + from recommended to opt-in. + ([#460](https://github.com/open-telemetry/semantic-conventions/pull/460)) ### Features diff --git a/docs/attributes-registry/http.md b/docs/attributes-registry/http.md index 62955335ba..551cc45fde 100644 --- a/docs/attributes-registry/http.md +++ b/docs/attributes-registry/http.md @@ -68,8 +68,8 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin | Attribute | Type | Description | Examples | |---|---|---|---| | `http.method` | string | Deprecated, use `http.request.method` instead. | `GET`; `POST`; `HEAD` | -| `http.request_content_length` | int | Deprecated, use `http.request.body.size` instead. | `3495` | -| `http.response_content_length` | int | Deprecated, use `http.response.body.size` instead. | `3495` | +| `http.request_content_length` | int | Deprecated, use the opt-in `http.request.header.content-length` instead. | `3495` | +| `http.response_content_length` | int | Deprecated, use opt-in `http.response.header.content-length` instead. | `3495` | | `http.scheme` | string | Deprecated, use `url.scheme` instead. | `http`; `https` | | `http.status_code` | int | Deprecated, use `http.response.status_code` instead. | `200` | | `http.target` | string | Deprecated, use `url.path` and `url.query` instead. | `/search?q=OpenTelemetry#SemConv` | diff --git a/docs/http/http-spans.md b/docs/http/http-spans.md index f11fae9ee9..901bb03010 100644 --- a/docs/http/http-spans.md +++ b/docs/http/http-spans.md @@ -119,11 +119,9 @@ sections below. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | `error.type` | string | Describes a class of error the operation ended with. [1] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | Conditionally Required: If request has ended with an error. | -| [`http.request.body.size`](../attributes-registry/http.md) | 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.request.header.`](../attributes-registry/http.md) | string[] | HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. [2] | `http.request.header.content-type=["application/json"]`; `http.request.header.x-forwarded-for=["1.2.3.4", "1.2.3.5"]` | Opt-In | | [`http.request.method`](../attributes-registry/http.md) | string | HTTP request method. [3] | `GET`; `POST`; `HEAD` | Required | | [`http.request.method_original`](../attributes-registry/http.md) | string | Original HTTP method sent by the client in the request line. | `GeT`; `ACL`; `foo` | Conditionally Required: [4] | -| [`http.response.body.size`](../attributes-registry/http.md) | 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 | | [`http.response.header.`](../attributes-registry/http.md) | string[] | HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. [5] | `http.response.header.content-type=["application/json"]`; `http.response.header.my-custom-header=["abc", "def"]` | Opt-In | | [`http.response.status_code`](../attributes-registry/http.md) | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | Conditionally Required: If and only if one was received/sent. | | [`network.protocol.name`](../attributes-registry/network.md) | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. [6] | `http`; `spdy` | Opt-In | diff --git a/model/registry/deprecated/http.yaml b/model/registry/deprecated/http.yaml index f904126c67..921f867eb8 100644 --- a/model/registry/deprecated/http.yaml +++ b/model/registry/deprecated/http.yaml @@ -31,11 +31,11 @@ groups: examples: ['/search?q=OpenTelemetry#SemConv'] - id: request_content_length type: int - brief: 'Deprecated, use `http.request.body.size` instead.' + brief: 'Deprecated, use the opt-in `http.request.header.content-length` instead.' stability: deprecated examples: 3495 - id: response_content_length type: int - brief: 'Deprecated, use `http.response.body.size` instead.' + brief: 'Deprecated, use opt-in `http.response.header.content-length` instead.' stability: deprecated examples: 3495 diff --git a/model/registry/http.yaml b/model/registry/http.yaml index 4264ae3251..ec763f0eaa 100644 --- a/model/registry/http.yaml +++ b/model/registry/http.yaml @@ -11,6 +11,7 @@ groups: 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. examples: 3495 + stability: experimental # this should not be marked stable with other HTTP attributes - id: request.header type: template[string[]] brief: > @@ -97,6 +98,7 @@ groups: 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. examples: 3495 + stability: experimental # this should not be marked stable with other HTTP attributes - id: response.header type: template[string[]] brief: > diff --git a/model/trace/http.yaml b/model/trace/http.yaml index 5749f3a6f5..426c5df8a1 100644 --- a/model/trace/http.yaml +++ b/model/trace/http.yaml @@ -10,10 +10,8 @@ groups: - ref: http.request.method_original requirement_level: conditionally_required: If and only if it's different than `http.request.method`. - - ref: http.request.body.size - ref: http.request.header requirement_level: opt_in - - ref: http.response.body.size - ref: http.response.header requirement_level: opt_in - ref: http.request.method