Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metric for currently-in-flight HTTP requests #1378

Merged
merged 10 commits into from
Mar 16, 2021
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
13 changes: 12 additions & 1 deletion specification/metrics/semantic_conventions/http-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
jmacd marked this conversation as resolved.
Show resolved Hide resolved

### HTTP Client

Expand All @@ -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 |
Expand All @@ -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:
jmacd marked this conversation as resolved.
Show resolved Hide resolved

| 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
Expand Down