Skip to content

Commit

Permalink
Rename http body size metrics to match attribute names
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Aug 13, 2023
1 parent d5b8de4 commit 2901149
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 30 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ release.
clients invoking them.
- BREAKING: Rename all JVM metrics from `process.runtime.jvm.*` to `jvm.*`
([#241](https://github.com/open-telemetry/semantic-conventions/pull/241))
- 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`
([#999](https://github.com/open-telemetry/semantic-conventions/pull/999))

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

Expand Down
40 changes: 20 additions & 20 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-httpserverrequestsize)
* [Metric: `http.server.response.body.size`](#metric-httpserverresponsesize)
- [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-httpclientrequestsize)
* [Metric: `http.client.response.body.size`](#metric-httpclientresponsesize)

<!-- tocstop -->

Expand Down Expand Up @@ -206,19 +206,19 @@ 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 (compressed). |
| `http.server.request.body.size` | Histogram | `By` | 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 @@ -284,19 +284,19 @@ 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 (compressed). |
| `http.server.response.body.size` | Histogram | `By` | 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 @@ -439,19 +439,19 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup.
| `_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 (compressed). |
| `http.client.request.body.size` | Histogram | `By` | Measures the size of HTTP request messages (compressed). |
<!-- endsemconv -->

<!-- semconv metric.http.client.request.size(full) -->
<!-- semconv metric.http.client.request.body.size(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Required |
Expand Down Expand Up @@ -508,19 +508,19 @@ SHOULD NOT be set if capturing it would require an extra DNS lookup.
| `_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 (compressed). |
| `http.client.response.body.size` | Histogram | `By` | Measures the size of HTTP response messages (compressed). |
<!-- endsemconv -->

<!-- semconv metric.http.client.response.size(full) -->
<!-- semconv metric.http.client.response.body.size(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Required |
Expand Down
26 changes: 16 additions & 10 deletions model/metrics/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,24 @@ 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
brief: "Measures the size of HTTP request messages (compressed)."
metric_name: http.server.request.body.size
brief: >
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.
instrument: histogram
unit: "By"
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
brief: "Measures the size of HTTP response messages (compressed)."
metric_name: http.server.response.body.size
brief: >
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.
instrument: histogram
unit: "By"
extends: metric_attributes.http.server
Expand All @@ -118,17 +124,17 @@ 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 (compressed)."
instrument: histogram
unit: "By"
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 (compressed)."
instrument: histogram
unit: "By"
Expand Down
4 changes: 4 additions & 0 deletions schema-next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ versions:
process.runtime.jvm.buffer.usage: jvm.buffer.usage
process.runtime.jvm.buffer.limit: jvm.buffer.limit
process.runtime.jvm.buffer.count: jvm.buffer.count
# https://github.com/open-telemetry/semantic-conventions/pull/999
- 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 2901149

Please sign in to comment.