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 metrics for http request and response size #2588

Merged
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 |
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
| `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