Skip to content

Commit

Permalink
Rename http body size metrics to match attribute names (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask authored Sep 21, 2023
1 parent 203691d commit 9db3c5f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 36 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ release.
- BREAKING: Rename `messaging.message.payload_size_bytes` to `messaging.message.body.size`,
remove `messaging.message.payload_compressed_size_bytes`.
([#229](https://github.com/open-telemetry/semantic-conventions/pull/229))
- BREAKING: Rename `http.server.request.size` metric to `http.server.request.body.size`
and `http.server.response.size` metric to `http.server.response.body.size`
([#247](https://github.com/open-telemetry/semantic-conventions/pull/247))

## v1.21.0 (2023-07-13)

Expand Down
48 changes: 24 additions & 24 deletions docs/http/http-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ operations. By adding HTTP attributes to metric events it allows for finely tune
- [HTTP Server](#http-server)
* [Metric: `http.server.request.duration`](#metric-httpserverrequestduration)
* [Metric: `http.server.active_requests`](#metric-httpserveractive_requests)
* [Metric: `http.server.request.size`](#metric-httpserverrequestsize)
* [Metric: `http.server.response.size`](#metric-httpserverresponsesize)
* [Metric: `http.server.request.body.size`](#metric-httpserverrequestbodysize)
* [Metric: `http.server.response.body.size`](#metric-httpserverresponsebodysize)
- [HTTP Client](#http-client)
* [Metric: `http.client.request.duration`](#metric-httpclientrequestduration)
* [Metric: `http.client.request.size`](#metric-httpclientrequestsize)
* [Metric: `http.client.response.size`](#metric-httpclientresponsesize)
* [Metric: `http.client.request.body.size`](#metric-httpclientrequestbodysize)
* [Metric: `http.client.response.body.size`](#metric-httpclientresponsebodysize)

<!-- tocstop -->

Expand Down Expand Up @@ -229,21 +229,21 @@ SHOULD NOT be set if only IP address is available and capturing name would requi
| `_OTHER` | Any HTTP method that the instrumentation has no prior knowledge of. |
<!-- endsemconv -->

### Metric: `http.server.request.size`
### Metric: `http.server.request.body.size`

**Status**: [Experimental][DocumentStatus]

This metric is optional.

<!-- semconv metric.http.server.request.size(metric_table) -->
<!-- semconv metric.http.server.request.body.size(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `http.server.request.size` | Histogram | `By` | Measures the size of HTTP request messages. [1] |
| `http.server.request.body.size` | Histogram | `By` | Measures the size of HTTP request messages. [1] |

**[1]:** Size as measured over the wire (compressed size if messages are compressed).
**[1]:** 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.
<!-- endsemconv -->

<!-- semconv metric.http.server.request.size(full) -->
<!-- semconv metric.http.server.request.body.size(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `http.route` | string | The matched route (path template in the format used by the respective server framework). See note below [1] | `/users/:userID?`; `{controller}/{action}/{id?}` | Conditionally Required: If and only if it's available |
Expand Down Expand Up @@ -331,21 +331,21 @@ SHOULD NOT be set if only IP address is available and capturing name would requi
| `_OTHER` | Any HTTP method that the instrumentation has no prior knowledge of. |
<!-- endsemconv -->

### Metric: `http.server.response.size`
### Metric: `http.server.response.body.size`

**Status**: [Experimental][DocumentStatus]

This metric is optional.

<!-- semconv metric.http.server.response.size(metric_table) -->
<!-- semconv metric.http.server.response.body.size(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `http.server.response.size` | Histogram | `By` | Measures the size of HTTP response messages. [1] |
| `http.server.response.body.size` | Histogram | `By` | Measures the size of HTTP response messages. [1] |

**[1]:** Size as measured over the wire (compressed size if messages are compressed).
**[1]:** 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.
<!-- endsemconv -->

<!-- semconv metric.http.server.response.size(full) -->
<!-- semconv metric.http.server.response.body.size(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `http.route` | string | The matched route (path template in the format used by the respective server framework). See note below [1] | `/users/:userID?`; `{controller}/{action}/{id?}` | Conditionally Required: If and only if it's available |
Expand Down Expand Up @@ -535,21 +535,21 @@ When observed from the server side, this SHOULD represent the physical server ad
| `_OTHER` | Any HTTP method that the instrumentation has no prior knowledge of. |
<!-- endsemconv -->

### Metric: `http.client.request.size`
### Metric: `http.client.request.body.size`

**Status**: [Experimental][DocumentStatus]

This metric is optional.

<!-- semconv metric.http.client.request.size(metric_table) -->
<!-- semconv metric.http.client.request.body.size(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `http.client.request.size` | Histogram | `By` | Measures the size of HTTP request messages. [1] |
| `http.client.request.body.size` | Histogram | `By` | Measures the size of HTTP request messages. [1] |

**[1]:** Size as measured over the wire (compressed size if messages are compressed).
**[1]:** 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.
<!-- endsemconv -->

<!-- semconv metric.http.client.request.size(full) -->
<!-- semconv metric.http.client.request.body.size(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `error.type` | string | Describes a class of error the operation ended with. [1] | `timeout`; `name_resolution_error`; `500` | Conditionally Required: If request has ended with an error. |
Expand Down Expand Up @@ -631,21 +631,21 @@ When observed from the server side, this SHOULD represent the physical server ad
| `_OTHER` | Any HTTP method that the instrumentation has no prior knowledge of. |
<!-- endsemconv -->

### Metric: `http.client.response.size`
### Metric: `http.client.response.body.size`

**Status**: [Experimental][DocumentStatus]

This metric is optional.

<!-- semconv metric.http.client.response.size(metric_table) -->
<!-- semconv metric.http.client.response.body.size(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `http.client.response.size` | Histogram | `By` | Measures the size of HTTP response messages. [1] |
| `http.client.response.body.size` | Histogram | `By` | Measures the size of HTTP response messages. [1] |

**[1]:** Size as measured over the wire (compressed size if messages are compressed).
**[1]:** 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.
<!-- endsemconv -->

<!-- semconv metric.http.client.response.size(full) -->
<!-- semconv metric.http.client.response.body.size(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `error.type` | string | Describes a class of error the operation ended with. [1] | `timeout`; `name_resolution_error`; `500` | Conditionally Required: If request has ended with an error. |
Expand Down
36 changes: 24 additions & 12 deletions model/metrics/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,28 @@ groups:
if it's sent in absolute-form.
- Port identifier of the `Host` header
- id: metric.http.server.request.size
- id: metric.http.server.request.body.size
type: metric
metric_name: http.server.request.size
metric_name: http.server.request.body.size
brief: "Measures the size of HTTP request messages."
instrument: histogram
unit: "By"
note: Size as measured over the wire (compressed size if messages are compressed).
note: >
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.
extends: metric_attributes.http.server

- id: metric.http.server.response.size
- id: metric.http.server.response.body.size
type: metric
metric_name: http.server.response.size
metric_name: http.server.response.body.size
brief: "Measures the size of HTTP response messages."
instrument: histogram
unit: "By"
note: Size as measured over the wire (compressed size if messages are compressed).
note: >
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.
extends: metric_attributes.http.server

- id: metric.http.client.request.duration
Expand All @@ -160,20 +166,26 @@ groups:
unit: "s"
extends: metric_attributes.http.client

- id: metric.http.client.request.size
- id: metric.http.client.request.body.size
type: metric
metric_name: http.client.request.size
metric_name: http.client.request.body.size
brief: "Measures the size of HTTP request messages."
instrument: histogram
unit: "By"
note: Size as measured over the wire (compressed size if messages are compressed).
note: >
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.
extends: metric_attributes.http.client

- id: metric.http.client.response.size
- id: metric.http.client.response.body.size
type: metric
metric_name: http.client.response.size
metric_name: http.client.response.body.size
brief: "Measures the size of HTTP response messages."
instrument: histogram
unit: "By"
note: Size as measured over the wire (compressed size if messages are compressed).
note: >
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.
extends: metric_attributes.http.client
4 changes: 4 additions & 0 deletions schema-next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ versions:
status: system.processes.status
apply_to_metrics:
- system.processes.count
# https://github.com/open-telemetry/semantic-conventions/pull/247
- rename_metrics:
http.server.request.size: http.server.request.body.size
http.server.response.size: http.server.response.body.size
1.21.0:
spans:
changes:
Expand Down

0 comments on commit 9db3c5f

Please sign in to comment.