diff --git a/CHANGELOG.md b/CHANGELOG.md index c3e2f4ded6c..47b66683342 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,8 @@ New: Updates: +- Add `http.server.active_requests` to count in-flight HTTP requests + ([#1378](https://github.com/open-telemetry/opentelemetry-specification/pull/1378)) - Update default limit for span attributes, events, links to 128([#1419](https://github.com/open-telemetry/opentelemetry-specification/pull/1419)) - Update OT Trace propagator environment variable to match latest name([#1406](https://github.com/open-telemetry/opentelemetry-specification/pull/1406)) - Remove Metrics SDK specification to avoid confusion, clarify that Metrics API diff --git a/specification/metrics/semantic_conventions/http-metrics.md b/specification/metrics/semantic_conventions/http-metrics.md index 5b23b11b3b6..d563283b8a1 100644 --- a/specification/metrics/semantic_conventions/http-metrics.md +++ b/specification/metrics/semantic_conventions/http-metrics.md @@ -17,9 +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 | +| 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 @@ -31,7 +32,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 | @@ -48,6 +49,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.active_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