|
| 1 | +# HTTP Stats |
| 2 | + |
| 3 | +All views and measures have the prefix: "opencensus.io/http". Any particular library might provide only a subset of these measures/views/tags. |
| 4 | + |
| 5 | +All times (latencies) are measured in float64 fractions of microseconds. |
| 6 | + |
| 7 | +There is no special support for multi-part HTTP requests and responses. These are just treated as one request. |
| 8 | + |
| 9 | +## Client |
| 10 | + |
| 11 | +All views, measures and tags should have the prefix: "opencensus.io/http/client". For example: "opencensus.io/http/client/started". |
| 12 | + |
| 13 | +### Measures |
| 14 | + |
| 15 | +Client stats are recorded for each individual HTTP request, including for each redirect (followed or not). |
| 16 | + |
| 17 | +| Measure suffix | Default View Aggregation | Description | |
| 18 | +|--------------------|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 19 | +| started | sum | Number of all client requests started | |
| 20 | +| bytes_sent | sum | Total bytes sent in request body (not including headers). This is uncompressed bytes. | |
| 21 | +| bytes_recv | sum | Total bytes received in response bodies (not including headers but including error responses with bodies). Should be measured from actual bytes received and read, not the value of the Content-Length header. This is uncompressed bytes. Responses with no body should record 0 for this value. | |
| 22 | +| headers_sent | none | Total number of header lines sent in outgoing requests, not including trailing headers | |
| 23 | +| headers_recv | none | Total number of header lines received in responses, not including trailing headers | |
| 24 | +| latency | distribution | Time between first byte of request headers sent to last byte of response received, or terminal error | |
| 25 | +| connections_opened | count | Number of underlying transport (TCP/TLS) connections opened | |
| 26 | +| connections_closed | count | Number of underlying transport (TCP/TLS) connections closed | |
| 27 | + |
| 28 | +### Tags |
| 29 | + |
| 30 | +All client metrics should be tagged with the following. |
| 31 | + |
| 32 | +| Tag suffix | Description | |
| 33 | +|---------------|----------------------------------------------------------------| |
| 34 | +| method | HTTP method, capitalized (i.e. GET, POST, PUT, DELETE, etc.) | |
| 35 | +| status_code | HTTP status code, or 0 if no response status line was received | |
| 36 | +| response_type | Response media type, if applicable | |
| 37 | +| request_type | Request media type, if applicable | |
| 38 | +| version | HTTP version in request | |
| 39 | +| path | URL path (not including query string) | |
| 40 | +| host | Value of the request Host header | |
| 41 | + |
| 42 | +### Default views |
| 43 | + |
| 44 | +The following default views are also defined: |
| 45 | + |
| 46 | +| View suffix | Measure suffix | Aggregation | Tags | |
| 47 | +|----------------------|----------------|--------------|-------------| |
| 48 | +| count_by_status_code | latency | count | status-code | |
| 49 | +| ended | latency | count | none | |
| 50 | +| latency_by_path | latency | distribution | path | |
| 51 | + |
| 52 | +## Server |
| 53 | + |
| 54 | +TBD but most will mirror client metrics. |
0 commit comments