Skip to content

Commit

Permalink
Add metrics for http request and response size (#2588)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-berg committed Jun 30, 2022
1 parent 95d0d04 commit f4e290a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ release.
([#2617](https://github.com/open-telemetry/opentelemetry-specification/pull/2617))
- Add `rpc.grpc.status_code` to RPC metric semantic conventions
([#2604](https://github.com/open-telemetry/opentelemetry-specification/pull/2604)).
- Add `http.*.*.size` metric semantic conventions for tracking size of requests
/ responses for http servers / clients
([#2588](https://github.com/open-telemetry/opentelemetry-specification/pull/2588)).

### Compatibility

Expand Down
14 changes: 9 additions & 5 deletions specification/metrics/semantic_conventions/http-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,24 @@ Below is a table of HTTP server metric instruments.

| Name | Instrument Type ([*](README.md#instrument-types)) | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|-------------------------------|---------------------------------------------------|--------------|-------------------------------------------|------------------------------------------------------------------------------|
| `http.server.duration` | Histogram | milliseconds | `ms` | measures the duration of the inbound HTTP request |
| `http.server.duration` | Histogram | milliseconds | `ms` | measures the duration inbound HTTP requests |
| `http.server.request.size` | Histogram | bytes | `By` | measures the size of HTTP request messages (compressed) |
| `http.server.response.size` | Histogram | bytes | `By` | measures the size of HTTP response messages (compressed) |
| `http.server.active_requests` | UpDownCounter | requests | `{requests}` | measures the number of concurrent HTTP requests that are currently in-flight |

### HTTP Client

Below is a table of HTTP client metric instruments.

| Name | Instrument Type ([*](README.md#instrument-types)) | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|------------------------|---------------------------------------------------|--------------|-------------------------------------------|----------------------------------------------------|
| `http.client.duration` | Histogram | milliseconds | `ms` | measures the duration of the outbound HTTP request |
| Name | Instrument Type ([*](README.md#instrument-types)) | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|-----------------------------|---------------------------------------------------|--------------|-------------------------------------------|----------------------------------------------------------|
| `http.client.duration` | Histogram | milliseconds | `ms` | measures the duration outbound HTTP requests |
| `http.client.request.size` | Histogram | bytes | `By` | measures the size of HTTP request messages (compressed) |
| `http.client.response.size` | Histogram | bytes | `By` | measures the size of HTTP response messages (compressed) |

## Attributes

Below is a table of the attributes that SHOULD be included on `duration` metric events
Below is a table of the attributes that SHOULD be included on `duration` and `size` metric events
and whether they should be on server, client, or both types of HTTP metric events:

| Name | Type | Requirement Level | Notes and examples |
Expand Down

0 comments on commit f4e290a

Please sign in to comment.