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

Commit 97ebbc6

Browse files
authored
Merge branch 'master' into http-sampling
2 parents 7425601 + 18ddbd7 commit 97ebbc6

File tree

2 files changed

+51
-6
lines changed

2 files changed

+51
-6
lines changed

stats/Exemplars.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Exemplars
2+
3+
Exemplars are example data points for aggregated data. In particular, for distribution-type
4+
metrics, exemplars are points associated with each bucket in the distribution giving an
5+
example of what was aggregated into the bucket.
6+
7+
Exemplars consist of a value that was recorded, an exact timestamp of when that value
8+
was recorded, and a set of attachments.
9+
10+
## Attachments
11+
12+
Exemplars my have zero or more attachments. Attachments are key-value pairs that
13+
describe the context in which the exemplar was recored.
14+
15+
Implementations should provide an extensible mechanism to extract custom attachments
16+
from the context.
17+
18+
### Well-known attachment keys
19+
20+
We define the following types of attachments:
21+
22+
1. `trace_id`: lower-case base16 encoded trace ID
23+
2. `span_id`: lower-case base16 encoded span ID
24+
4. `tag:KEY`: tags that were active at the time of recording, regardless of whether
25+
they were ultimately added to views or not. `KEY` is the tag key, the value
26+
of the attachment is the tag value in effect.
27+
28+
If `trace_id` and `span_id` are provided, the associated trace should be sampled.
29+
30+
## Retention in views
31+
32+
Libraries should attempt to retain and export at least once exemplar per bucket per reporting
33+
period for distribution-type views. Libraries should not retain an unbounded number
34+
of exemplars.
35+
36+
Libraries should prefer retaining exemplars with
37+
[sampled traces](https://github.com/census-instrumentation/opencensus-specs/blob/master/trace/Sampling.md)
38+
associated with them.
39+
After considering associated trace, libraries should prefer exemplars with more attachments
40+
over exemplars with fewer or no attachments.
41+
42+
## Exporting
43+
44+
The interpretation of attachments is up to the exporter. Currently, only Stackdriver is known
45+
to support exemplars.

stats/HTTP.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Buckets for distributions in default views are as follows:
2222

2323
### Measures
2424

25-
Client stats are recorded for each individual HTTP request, including for each individual redirect (followed or not).
25+
Client stats are recorded for each individual HTTP request, including for each individual redirect (followed or not). All stats are recorded after request processing (usually after the response body has been fully read).
2626

2727
| Measure name | Unit | Description |
2828
|---------------------------------------------|------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -32,7 +32,7 @@ Client stats are recorded for each individual HTTP request, including for each i
3232

3333
### Tags
3434

35-
All client metrics should be tagged with the following.
35+
All client measures should be tagged with the following.
3636

3737
| Tag name | Description |
3838
|--------------------|----------------------------------------------------------------------------------------------------------|
@@ -55,9 +55,9 @@ The following set of views are considered minimum required to monitor client sid
5555

5656
| View name | Measure | Aggregation | Tags |
5757
|---------------------------------------------|---------------------------------------------|--------------|----------------------------------------|
58-
| opencensus.io/http/client/sent_bytes | opencensus.io/http/client/sent_bytes | distribution | http_client_method |
59-
| opencensus.io/http/client/received_bytes | opencensus.io/http/client/received_bytes | distribution | http_client_method |
60-
| opencensus.io/http/client/roundtrip_latency | opencensus.io/http/client/roundtrip_latency | distribution | http_client_method |
58+
| opencensus.io/http/client/sent_bytes | opencensus.io/http/client/sent_bytes | distribution | http_client_method, http_client_status |
59+
| opencensus.io/http/client/received_bytes | opencensus.io/http/client/received_bytes | distribution | http_client_method, http_client_status |
60+
| opencensus.io/http/client/roundtrip_latency | opencensus.io/http/client/roundtrip_latency | distribution | http_client_method, http_client_status |
6161
| opencensus.io/http/client/completed_count | opencensus.io/http/client/roundtrip_latency | count | http_client_method, http_client_status |
6262

6363
## Server
@@ -66,7 +66,7 @@ Server measures are recorded at the end of request processing.
6666

6767
### Measures
6868

69-
Server stats are recorded for each individual HTTP request, including for each redirect (followed or not).
69+
Server stats are recorded for each individual HTTP request handled. They are recorded at the end of request handling.
7070

7171
| Measure name | Unit | Description |
7272
|------------------------------------------|------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

0 commit comments

Comments
 (0)