From f48794d07002332f1d0fc865d65192a81b24e0f2 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Sun, 13 Aug 2023 14:09:32 -0700 Subject: [PATCH 1/3] Rename http body size metrics to match attribute names --- CHANGELOG.md | 3 +++ docs/http/http-metrics.md | 40 +++++++++++++++++++-------------------- model/metrics/http.yaml | 26 +++++++++++++++---------- schema-next.yaml | 4 ++++ 4 files changed, 43 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9089400e69..caa82c76c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` + ([#247](https://github.com/open-telemetry/semantic-conventions/pull/247)) ## v1.21.0 (2023-07-13) diff --git a/docs/http/http-metrics.md b/docs/http/http-metrics.md index fe9c4da823..f0333d94d0 100644 --- a/docs/http/http-metrics.md +++ b/docs/http/http-metrics.md @@ -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) @@ -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. | -### Metric: `http.server.request.size` +### Metric: `http.server.request.body.size` **Status**: [Experimental][DocumentStatus] This metric is optional. - + | 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. | - + | 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 | @@ -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. | -### Metric: `http.server.response.size` +### Metric: `http.server.response.body.size` **Status**: [Experimental][DocumentStatus] This metric is optional. - + | 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. | - + | 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 | @@ -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. | -### Metric: `http.client.request.size` +### Metric: `http.client.request.body.size` **Status**: [Experimental][DocumentStatus] This metric is optional. - + | 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). | - + | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Required | @@ -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. | -### Metric: `http.client.response.size` +### Metric: `http.client.response.body.size` **Status**: [Experimental][DocumentStatus] This metric is optional. - + | 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). | - + | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Required | diff --git a/model/metrics/http.yaml b/model/metrics/http.yaml index 813179a005..8e8a0637e3 100644 --- a/model/metrics/http.yaml +++ b/model/metrics/http.yaml @@ -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 @@ -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" diff --git a/schema-next.yaml b/schema-next.yaml index 612200a0bc..2f94fe4dfd 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -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/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: From 1cbaf3d9945dbf5fc3d0bfdb9cd0f562ec6bc58c Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 20 Sep 2023 15:48:33 -0700 Subject: [PATCH 2/3] fix --- docs/http/http-metrics.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/http/http-metrics.md b/docs/http/http-metrics.md index b8d3e21499..b46935ddea 100644 --- a/docs/http/http-metrics.md +++ b/docs/http/http-metrics.md @@ -238,6 +238,9 @@ This metric is optional. | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | +| `http.server.request.body.size` | Histogram | `By` | Measures the size of HTTP request messages. [1] | + +**[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. @@ -337,6 +340,9 @@ This metric is optional. | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | +| `http.server.response.body.size` | Histogram | `By` | Measures the size of HTTP response messages. [1] | + +**[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. @@ -538,6 +544,9 @@ This metric is optional. | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | +| `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). @@ -631,6 +640,9 @@ This metric is optional. | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | +| `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). From 311b219e81299d80582308bdae238fccfc440981 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 20 Sep 2023 15:50:39 -0700 Subject: [PATCH 3/3] alsoclient --- docs/http/http-metrics.md | 4 ++-- model/metrics/http.yaml | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/http/http-metrics.md b/docs/http/http-metrics.md index b46935ddea..8cc48b775d 100644 --- a/docs/http/http-metrics.md +++ b/docs/http/http-metrics.md @@ -546,7 +546,7 @@ This metric is optional. | -------- | --------------- | ----------- | -------------- | | `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. @@ -642,7 +642,7 @@ This metric is optional. | -------- | --------------- | ----------- | -------------- | | `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. diff --git a/model/metrics/http.yaml b/model/metrics/http.yaml index a780995500..53ad230d28 100644 --- a/model/metrics/http.yaml +++ b/model/metrics/http.yaml @@ -172,7 +172,10 @@ groups: 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.body.size @@ -181,5 +184,8 @@ groups: 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