@@ -19,7 +19,7 @@ s = Summary("request_latency_seconds", "Description of summary")
19
19
s.observe(4.7 )
20
20
```
21
21
22
- ### With labels
22
+ ### Usage with labels
23
23
24
24
``` python
25
25
from prometheus_summary import Summary
@@ -29,11 +29,13 @@ s.labels(method="GET", endpoint="/profile").observe(1.2)
29
29
s.labels(method = " POST" , endpoint = " /login" ).observe(3.4 )
30
30
```
31
31
32
- ### With custom quantiles and precisions
32
+ ### Usage with custom quantiles and precisions
33
+
34
+ By default, metrics are observed for the following (quantile, precision (inaccuracy)) pairs:
33
35
34
- By default, metrics are observed for next (quantile, precision (inaccuracy)) pairs
35
36
` ((0.50, 0.05), (0.90, 0.01), (0.99, 0.001)) `
36
- but you can provide your own values when creating the metric.
37
+
38
+ You can also provide your own values when creating the metric.
37
39
38
40
``` python
39
41
from prometheus_summary import Summary
@@ -45,13 +47,13 @@ s = Summary(
45
47
s.observe(4.7 )
46
48
```
47
49
48
- ### With custom time window settings
50
+ ### Usage with custom time window settings
49
51
50
52
Typically, you don't want to have a Summary representing the entire runtime of the application,
51
- but you want to look at a reasonable time interval. Summary metrics implement a configurable sliding time window.
53
+ but you want to look at a reasonable time interval. This Summary metric implement a configurable sliding time window.
52
54
53
55
The default is a time window of 10 minutes and 5 age buckets, i.e. the time window is 10 minutes wide, and
54
- we slide it forward every 2 minutes, but you can configure this values for your own purposes.
56
+ we slide it forward every 10 / 5 = 2 minutes, but you can configure this values for your own purposes.
55
57
56
58
``` python
57
59
from prometheus_summary import Summary
@@ -75,7 +77,7 @@ from prometheus_summary import Summary
75
77
s = Summary(" request_latency_seconds" , " Description of summary" , [" method" , " endpoint" ])
76
78
```
77
79
78
- To show request latency by ` method ` , ` endpoint ` and ` quantile ` use next query:
80
+ To show request latency by ` method ` , ` endpoint ` and ` quantile ` use the following PromQL query:
79
81
```
80
82
max by (method, endpoint, quantile) (request_latency_seconds)
81
83
```
0 commit comments