Skip to content

Commit 0220d78

Browse files
kamalmarhubilmolkovatrisch-mejoaopgrassi
authored
trace/http: Add http.{request,response}.size attributes (#84)
Co-authored-by: Liudmila Molkova <limolkova@microsoft.com> Co-authored-by: Alexandra Konrad <10500694+trisch-me@users.noreply.github.com> Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com>
1 parent f9dfdd5 commit 0220d78

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Use this changelog template to create an entry for release notes.
2+
#
3+
# If your change doesn't affect end users you should instead start
4+
# your pull request title with [chore] or use the "Skip Changelog" label.
5+
6+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
7+
change_type: enhancement
8+
9+
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
10+
component: http
11+
12+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
13+
note: Add `http.request.size` and `http.response.size` attributes for the total number of bytes in http messages
14+
15+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
16+
# The values here must be integers.
17+
issues: [38, 84]
18+
19+
# (Optional) One or more lines of additional information to render under the primary note.
20+
# These lines will be padded with 2 spaces and then inserted directly into the document.
21+
# Use pipe (|) for multiline entries.
22+
subtext:

docs/attributes-registry/http.md

+2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
| `http.request.method` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>HTTP request method. [2] | `GET`; `POST`; `HEAD` |
1515
| `http.request.method_original` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>Original HTTP method sent by the client in the request line. | `GeT`; `ACL`; `foo` |
1616
| `http.request.resend_count` | int | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>The ordinal number of request resending attempt (for any reason, including redirects). [3] | `3` |
17+
| `http.request.size` | int | The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. | `1437` |
1718
| `http.response.body.size` | 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` |
1819
| `http.response.header.<key>` | string[] | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>HTTP response headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values. [4] | `http.response.header.content-type=["application/json"]`; `http.response.header.my-custom-header=["abc", "def"]` |
20+
| `http.response.size` | int | The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. | `1437` |
1921
| `http.response.status_code` | int | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` |
2022
| `http.route` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>The matched route, that is, the path template in the format used by the respective server framework. [5] | `/users/:userID?`; `{controller}/{action}/{id?}` |
2123

model/registry/http.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ groups:
9595
was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues,
9696
or any other).
9797
examples: 3
98+
- id: request.size
99+
type: int
100+
brief: >
101+
The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1),
102+
framing (HTTP/2 and HTTP/3), headers, and request body if any.
103+
examples: 1437
104+
stability: experimental
98105
- id: response.body.size
99106
type: int
100107
brief: >
@@ -118,6 +125,13 @@ groups:
118125
or a single-item array containing a possibly comma-concatenated string, depending on the way
119126
the HTTP library provides access to headers.
120127
examples: ['http.response.header.content-type=["application/json"]', 'http.response.header.my-custom-header=["abc", "def"]']
128+
- id: response.size
129+
type: int
130+
brief: >
131+
The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1),
132+
framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any.
133+
examples: 1437
134+
stability: experimental
121135
- id: response.status_code
122136
stability: stable
123137
type: int

0 commit comments

Comments
 (0)