Skip to content

Commit

Permalink
Add metric for currently-in-flight HTTP requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Anderson committed Jan 26, 2021
1 parent 5b72cf3 commit 61c33a0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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 |

### 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:

| 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

0 comments on commit 61c33a0

Please sign in to comment.