|
1 | 1 | # HTTP Stats |
2 | 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. |
| 3 | +Any particular library might provide only a subset of these measures/views/tags. |
| 4 | +Check the language-specific documentation for the list of supported values. |
4 | 5 |
|
5 | 6 | All times (latencies) are measured in float64 fractions of microseconds. |
6 | 7 |
|
7 | 8 | There is no special support for multi-part HTTP requests and responses. These are just treated as one request. |
8 | 9 |
|
| 10 | +## Units |
| 11 | + |
| 12 | +Units are encoded according to the case-sensitive abbreviations from the [Unified Code for Units of Measure](http://unitsofmeasure.org/ucum.html): |
| 13 | + |
| 14 | +* Latencies are measures in float64 milliseconds, denoted "ms" |
| 15 | +* Sizes are measured in bytes, denoted "By" |
| 16 | +* Dimensionless values have unit "1" |
| 17 | + |
| 18 | +Buckets for distributions in default views are as follows: |
| 19 | + |
| 20 | +* Size in bytes: 0, 1024, 2048, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296 |
| 21 | +* Latency in ms: 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000 |
| 22 | + |
9 | 23 | ## Client |
10 | 24 |
|
11 | 25 | All views, measures and tags should have the prefix: "opencensus.io/http/client". For example: "opencensus.io/http/client/started". |
12 | 26 |
|
13 | 27 | ### Measures |
14 | 28 |
|
15 | 29 | Client stats are recorded for each individual HTTP request, including for each redirect (followed or not). |
| 30 | +Views are defined with the same name as the measure and the aggregation specified under Default View Aggregation. |
16 | 31 |
|
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 | |
| 32 | +| Measure suffix | Default View Aggregation | Description | |
| 33 | +|------------------------------------------|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 34 | +| opencensus.io/http/client/request_count | sum | Number of all client requests started | |
| 35 | +| opencensus.io/http/client/request_bytes | distribution | Total bytes sent in request body (not including headers). This is uncompressed bytes. | |
| 36 | +| opencensus.io/http/client/response_bytes | distribution | 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. | |
| 37 | +| opencensus.io/http/client/latency | distribution | Time between first byte of request headers sent to last byte of response received, or terminal error | |
27 | 38 |
|
28 | 39 | ### Tags |
29 | 40 |
|
30 | 41 | All client metrics should be tagged with the following. |
31 | 42 |
|
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 | |
| 43 | +| Tag suffix | Description | |
| 44 | +|-------------|----------------------------------------------------------------------| |
| 45 | +| http.method | HTTP method, capitalized (i.e. GET, POST, PUT, DELETE, etc.) | |
| 46 | +| http.status | HTTP status code, or "error" if no response status line was received | |
| 47 | +| http.path | URL path (not including query string) | |
| 48 | +| http.host | Value of the request Host header | |
41 | 49 |
|
42 | 50 | ### Default views |
43 | 51 |
|
44 | 52 | The following default views are also defined: |
45 | 53 |
|
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 | |
| 54 | +| View suffix | Measure suffix | Aggregation | Tags | |
| 55 | +|---------------------------------------------------------|----------------|-------------|-------------| |
| 56 | +| opencensus.io/http/client/response_count_by_status_code | latency | count | status_code | |
| 57 | +| opencensus.io/http/client/request_count_by_method | latency | count | method | |
51 | 58 |
|
52 | 59 | ## Server |
53 | 60 |
|
|
0 commit comments