From 61c33a0f07a10f643e6394a0cc9b2d109c5465f1 Mon Sep 17 00:00:00 2001 From: Evan Anderson Date: Tue, 26 Jan 2021 09:52:53 -0800 Subject: [PATCH 1/5] Add metric for currently-in-flight HTTP requests --- CHANGELOG.md | 1 + .../metrics/semantic_conventions/http-metrics.md | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b10cc66b1c..d5beec80371 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ New: Updates: +- Add `http.server.requests` to count in-flight HTTP requests([#1378](https://github.com/open-telemetry/opentelemetry-specification/pull/1378)) - Versioning and stability guarantees for OpenTelemetry clients([#1291](https://github.com/open-telemetry/opentelemetry-specification/pull/1291)) - Additional Cassandra semantic attributes ([#1217](https://github.com/open-telemetry/opentelemetry-specification/pull/1217)) diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 5f81a2f6148..01cdf6964cb 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -18,6 +18,7 @@ Below is a table of HTTP server metric instruments. | Name | Instrument | Units | Description | |------------------------|---------------|--------------|-------------| | `http.server.duration` | ValueRecorder | milliseconds | measures the duration of the inbound HTTP request | +| `http.server.requests` | ValueObserver | requests | measures the number of concurrent HTTP requests handled | ### HTTP Client @@ -29,7 +30,7 @@ Below is a table of HTTP client metric instruments. ## Labels -Below is a table of the labels that SHOULD be included on metric events +Below is a table of the labels that SHOULD be included on `duration` metric events and whether they should be on server, client, or both types of HTTP metric events: | Name | Type | Recommended | Notes and examples | @@ -46,6 +47,16 @@ and whether they should be on server, client, or both types of HTTP metric event | `net.host.name` | `server` | see [2] in [label alternatives](#label-alternatives) | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | | `net.host.port` | `server` | see [2] in [label alternatives](#label-alternatives) | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | +The following labels SHOULD be included in the `http.server.requests` observation: + +| Name | Recommended | Notes and examples | +|--------------------|-------------|--------------------| +| `http.method` | Yes | The HTTP request method. E.g. `"GET"` | +| `http.host` | see [label alternatives](#label-alternatives) | The value of the [HTTP host header][]. When the header is empty or not present, this label should be the same | +| `http.scheme` | see [label alternatives](#label-alternatives) | The URI scheme identifying the used protocol in lowercase: `"http"` or `"https"` | +| `http.flavor` | Optional | Kind of HTTP protocol used: `"1.0"`, `"1.1"`, `"2"`, `"SPDY"` or `"QUIC"` | +| `http.server_name` | see [2] in [label alternatives](#label-alternatives) | The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this label MUST NOT be set ( `net.host.name` should be used instead). | + [HTTP host header]: https://tools.ietf.org/html/rfc7230#section-5.4 [HTTP response status code]: https://tools.ietf.org/html/rfc7231#section-6 [HTTP reason phrase]: https://tools.ietf.org/html/rfc7230#section-3.1.2 From 36fd79451ec54f4a664cc0c2b4eef4e346d0dd0d Mon Sep 17 00:00:00 2001 From: Evan Anderson Date: Thu, 4 Feb 2021 16:22:11 -0800 Subject: [PATCH 2/5] Update name to active_requests --- CHANGELOG.md | 2 +- .../metrics/semantic_conventions/http-metrics.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5beec80371..0e915c55964 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ New: Updates: -- Add `http.server.requests` to count in-flight HTTP requests([#1378](https://github.com/open-telemetry/opentelemetry-specification/pull/1378)) +- Add `http.server.active_requests` to count in-flight HTTP requests([#1378](https://github.com/open-telemetry/opentelemetry-specification/pull/1378)) - Versioning and stability guarantees for OpenTelemetry clients([#1291](https://github.com/open-telemetry/opentelemetry-specification/pull/1291)) - Additional Cassandra semantic attributes ([#1217](https://github.com/open-telemetry/opentelemetry-specification/pull/1217)) diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 01cdf6964cb..2f6b3ebacc7 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -15,10 +15,10 @@ type and units. Below is a table of HTTP server metric instruments. -| Name | Instrument | Units | Description | -|------------------------|---------------|--------------|-------------| -| `http.server.duration` | ValueRecorder | milliseconds | measures the duration of the inbound HTTP request | -| `http.server.requests` | ValueObserver | requests | measures the number of concurrent HTTP requests handled | +| Name | Instrument | Units | Description | +|-------------------------------|---------------|--------------|-------------| +| `http.server.duration` | ValueRecorder | milliseconds | measures the duration of the inbound HTTP request | +| `http.server.active_requests` | ValueObserver | requests | measures the number of concurrent HTTP requests handled | ### HTTP Client From c8064e2d089757bc28dbf5094a733dfccd227221 Mon Sep 17 00:00:00 2001 From: Evan Anderson Date: Sun, 14 Feb 2021 22:57:53 -0800 Subject: [PATCH 3/5] Fix missing rename noticed by anuraaga --- specification/metrics/semantic_conventions/http-metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index f27d1e0b57d..4c18cebbbf8 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -49,7 +49,7 @@ and whether they should be on server, client, or both types of HTTP metric event | `net.host.name` | `server` | see [2] in [label alternatives](#label-alternatives) | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | | `net.host.port` | `server` | see [2] in [label alternatives](#label-alternatives) | See [general network connection attributes](../../trace/semantic_conventions/span-general.md#general-network-connection-attributes) | -The following labels SHOULD be included in the `http.server.requests` observation: +The following labels SHOULD be included in the `http.server.active_requests` observation: | Name | Recommended | Notes and examples | |--------------------|-------------|--------------------| From 9af7a769829e3a124d1d602c4ea48412dbfb605a Mon Sep 17 00:00:00 2001 From: Evan Anderson Date: Thu, 25 Feb 2021 21:58:32 -0800 Subject: [PATCH 4/5] Clarify `active_requests` are in-flight Co-authored-by: Reiley Yang --- specification/metrics/semantic_conventions/http-metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 4c18cebbbf8..70f22b95b65 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -20,7 +20,7 @@ Below is a table of HTTP server metric instruments. | Name | Instrument | Units | Description | |-------------------------------|---------------|--------------|-------------| | `http.server.duration` | ValueRecorder | milliseconds | measures the duration of the inbound HTTP request | -| `http.server.active_requests` | ValueObserver | requests | measures the number of concurrent HTTP requests handled | +| `http.server.active_requests` | ValueObserver | requests | measures the number of concurrent HTTP requests that are currently in-flight | ### HTTP Client From 9a5e71a35e8a2fadc5aa8dcd1eaab7fa7af0148e Mon Sep 17 00:00:00 2001 From: Evan Anderson Date: Mon, 15 Mar 2021 18:37:10 -0700 Subject: [PATCH 5/5] Switch to UpDownSumObserver --- .../metrics/semantic_conventions/http-metrics.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 70f22b95b65..d563283b8a1 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -17,10 +17,10 @@ type and units. Below is a table of HTTP server metric instruments. -| Name | Instrument | Units | Description | -|-------------------------------|---------------|--------------|-------------| -| `http.server.duration` | ValueRecorder | milliseconds | measures the duration of the inbound HTTP request | -| `http.server.active_requests` | ValueObserver | requests | measures the number of concurrent HTTP requests that are currently in-flight | +| Name | Instrument | Units | Description | +|-------------------------------|-------------------|--------------|-------------| +| `http.server.duration` | ValueRecorder | milliseconds | measures the duration of the inbound HTTP request | +| `http.server.active_requests` | UpDownSumObserver | requests | measures the number of concurrent HTTP requests that are currently in-flight | ### HTTP Client