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

Change http.request.body.size and http.response.body.size attributes from recommended to opt-in #460

Merged
merged 3 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/attributes-registry/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 the 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` |
Expand Down
2 changes: 0 additions & 2 deletions docs/http/http-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<key>`](../attributes-registry/http.md) | string[] | HTTP request headers, `<key>` 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.<key>`](../attributes-registry/http.md) | string[] | HTTP response headers, `<key>` 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 |
Expand Down
4 changes: 2 additions & 2 deletions model/registry/deprecated/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
trask marked this conversation as resolved.
Show resolved Hide resolved
stability: deprecated
examples: 3495
- id: response_content_length
type: int
brief: 'Deprecated, use `http.response.body.size` instead.'
brief: 'Deprecated, use the opt-in `http.response.header.content-length` instead.'
trask marked this conversation as resolved.
Show resolved Hide resolved
stability: deprecated
examples: 3495
2 changes: 2 additions & 0 deletions model/registry/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
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

Check warning on line 14 in model/registry/http.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[comments] too few spaces before comment
- id: request.header
type: template[string[]]
brief: >
Expand Down Expand Up @@ -97,6 +98,7 @@
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

Check warning on line 101 in model/registry/http.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[comments] too few spaces before comment
- id: response.header
type: template[string[]]
brief: >
Expand Down
2 changes: 0 additions & 2 deletions model/trace/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
AlexanderWert marked this conversation as resolved.
Show resolved Hide resolved
- 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
Expand Down
Loading