Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit a909b52

Browse files
author
Bogdan Drutu
authored
Update http stats instructions. Add server section, make documentation look like gRPC. (#81)
1 parent 213bba8 commit a909b52

1 file changed

Lines changed: 53 additions & 25 deletions

File tree

stats/HTTP.md

Lines changed: 53 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
Any particular library might provide only a subset of these measures/views/tags.
44
Check the language-specific documentation for the list of supported values.
55

6-
All times (latencies) are measured in float64 fractions of microseconds.
7-
86
There is no special support for multi-part HTTP requests and responses. These are just treated as one request.
97

108
## Units
@@ -22,42 +20,72 @@ Buckets for distributions in default views are as follows:
2220

2321
## Client
2422

25-
All views, measures and tags should have the prefix: "opencensus.io/http/client". For example: "opencensus.io/http/client/started".
26-
2723
### Measures
2824

2925
Client stats are recorded for each individual HTTP request, including for each redirect (followed or not).
3026

31-
| Measure suffix | Description |
32-
|------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
33-
| opencensus.io/http/client/started_count | Number of all client requests started |
34-
| opencensus.io/http/client/request_bytes | Total bytes sent in request body (not including headers). This is uncompressed bytes. |
35-
| opencensus.io/http/client/response_bytes | 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. |
36-
| opencensus.io/http/client/latency | Time between first byte of request headers sent to last byte of response received, or terminal error |
27+
| Measure name | Unit | Description |
28+
|------------------------------------------|------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
29+
| opencensus.io/http/client/started_count | 1 | Number of all client requests started |
30+
| opencensus.io/http/client/request_bytes | By | Total bytes sent in request body (not including headers). This is uncompressed bytes. |
31+
| opencensus.io/http/client/response_bytes | By | 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. |
32+
| opencensus.io/http/client/latency | ms | Time between first byte of request headers sent to last byte of response received, or terminal error |
3733

3834
### Tags
3935

4036
All client metrics should be tagged with the following.
4137

42-
| Tag suffix | Description |
43-
|-------------|----------------------------------------------------------------------|
44-
| http.method | HTTP method, capitalized (i.e. GET, POST, PUT, DELETE, etc.) |
45-
| http.status | HTTP status code, or "error" if no response status line was received |
46-
| http.path | URL path (not including query string) |
47-
| http.host | Value of the request Host header |
38+
| Tag suffix | Description |
39+
|--------------------|----------------------------------------------------------------------|
40+
| http.client_method | HTTP method, capitalized (i.e. GET, POST, PUT, DELETE, etc.) |
41+
| http.client_path | URL path (not including query string) |
42+
| http.client_status | HTTP status code, or "error" if no response status line was received |
43+
| http.client_host | Value of the request Host header |
4844

4945
### Default views
5046

51-
The following default views are defined:
47+
The following set of views are considered minimum required to monitor client side performance:
5248

53-
| View suffix | Measure suffix | Aggregation | Tags |
54-
|--------------------------------------------------------------------|----------------|--------------|----------------------|
55-
| opencensus.io/http/client/started_count | started_count | sum | method, path |
56-
| opencensus.io/http/client/request_bytes | request_bytes | distribution | method, path |
57-
| opencensus.io/http/client/response_bytes | response_bytes | distribution | method, path |
58-
| opencensus.io/http/client/latency | latency | distribution | method, path |
59-
| opencensus.io/http/client/finished_count | latency | count | method, path, status |
49+
| View name | Measure suffix | Aggregation | Tags suffix |
50+
|----------------------------------------------|----------------|--------------|-------------------------------------------|
51+
| opencensus.io/http/client/started_count | started_count | count | client_method, client_path |
52+
| opencensus.io/http/client/request_bytes | request_bytes | distribution | client_method, client_path |
53+
| opencensus.io/http/client/response_bytes | response_bytes | distribution | client_method, client_path |
54+
| opencensus.io/http/client/latency | latency | distribution | client_method, client_path |
55+
| opencensus.io/http/client/finished_count | latency | count | client_method, client_path, client_status |
6056

6157
## Server
6258

63-
TBD but most will mirror client metrics.
59+
### Measures
60+
61+
Server stats are recorded for each individual HTTP request, including for each redirect (followed or not).
62+
63+
| Measure name | Unit | Description |
64+
|------------------------------------------|------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
65+
| opencensus.io/http/server/started_count | 1 | Number of all server requests started. |
66+
| opencensus.io/http/server/request_bytes | By | Total bytes received in request body (not including headers). This is uncompressed bytes. |
67+
| opencensus.io/http/server/response_bytes | By | Total bytes sent 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. |
68+
| opencensus.io/http/server/latency | ms | Time between first byte of request headers sent to last byte of response received, or terminal error |
69+
70+
### Tags
71+
72+
All server metrics should be tagged with the following.
73+
74+
| Tag suffix | Description |
75+
|--------------------|----------------------------------------------------------------------|
76+
| http.server_method | HTTP method, capitalized (i.e. GET, POST, PUT, DELETE, etc.) |
77+
| http.server_path | URL path (not including query string) |
78+
| http.server_status | HTTP server status code. |
79+
| http.server_host | Value of the request Host header |
80+
81+
### Default views
82+
83+
The following set of views are considered minimum required to monitor server side performance:
84+
85+
| View name | Measure suffix | Aggregation | Tags suffix |
86+
|----------------------------------------------|----------------|--------------|-------------------------------------------|
87+
| opencensus.io/http/server/started_count | started_count | count | server_method, server_path |
88+
| opencensus.io/http/server/request_bytes | request_bytes | distribution | server_method, server_path |
89+
| opencensus.io/http/server/response_bytes | response_bytes | distribution | server_method, server_path |
90+
| opencensus.io/http/server/latency | latency | distribution | server_method, server_path |
91+
| opencensus.io/http/server/finished_count | latency | count | server_method, server_path, server_status |

0 commit comments

Comments
 (0)