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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 15 additions & 4 deletions specification/metrics/semantic_conventions/http-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

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