@@ -9,6 +9,15 @@ dovecotlinks:
99 stats_group_by :
1010 hash : group-by
1111 text : " Statistics: Group By"
12+ stats_group_by_discrete :
13+ hash : discrete
14+ text : " Statistics: Group By: Discrete"
15+ stats_group_by_exponential :
16+ hash : exponential
17+ text : " Statistics: Group By: Exponential"
18+ stats_group_by_linear :
19+ hash : linear
20+ text : " Statistics: Group By: Linear"
1221---
1322
1423# Statistics
@@ -36,27 +45,24 @@ filter setting. You can also use `event=*` to match all named events.
3645
3746## Group By
3847
39- The ` group_by ` metric setting allows dynamic hierarchical metric
48+ The [[ setting,metric_group_by ]] setting allows dynamic hierarchical metric
4049generation based on event fields' values.
4150
42- Each field listed in the ` group_by ` generates one level of "sub-metrics".
51+ Each listed [[ setting,metric_group_by ]] generates one level of "sub-metrics".
4352These automatically generated metrics are indistinguishable from those
4453statically defined in the config file. "sub-metric" names can be up to
4554256 bytes in total.
4655
47- Dovecot supports a number of aggregation functions that can be used to
48- quantize a field's value before it is used to generate a metric.
49-
50- The format is always the same: the field name, a colon, the aggregation
51- function name, and optionally a colon followed by colon delimited parameters
52- to the aggregation function.
56+ Dovecot supports a number of aggregation methods that can be used to quantize
57+ a field's value before it is used to generate a metric.
5358
5459### ` discrete `
5560
56- The simplest aggregation function is to use the value as is. Because this
57- is a very common use case, not specifying an aggregation function is treated
58- as an alias for discrete aggregation. In other words, ` field ` and
59- ` field:discrete ` produce the same behavior.
61+ The simplest aggregation method is to use the value as is. Because this
62+ is a very common use case, this is the default aggregation method.
63+
64+ The value can be further modified by
65+ [[ setting,metric_group_by_method_discrete_modifier]] .
6066
6167[[ added,metric_group_by_discrete_modifiers_added]] An additional parameter
6268can be added to provide modifiers to the discrete value. This is done as
@@ -71,7 +77,10 @@ Example:
7177``` [dovecot.conf]
7278metric imap_command {
7379 filter = event=imap_command_finished
74- group_by = cmd_name tagged_reply_state
80+ group_by cmd_name {
81+ }
82+ group_by tagged_reply_state {
83+ }
7584}
7685metric login_domains {
7786 filter = event=auth_request_finished
@@ -102,21 +111,24 @@ when first observed.
102111
103112The field's integer value is quantized into exponentially sized ranges.
104113
105- The exponential aggregation function takes three colon delimited integer
106- arguments that define the set of ranges used: the minimum magnitude, the
107- maximum magnitude, and the base. The exact configuration syntax is:
108- ` field:exponential:min:max:base `
114+ The exponential aggregation method uses three settings:
109115
110- Note: Currently, only base 2 and base 10 are supported.
116+ * [[ setting,metric_group_by_method_exponential_min_magnitude]]
117+ * [[ setting,metric_group_by_method_exponential_max_magnitude]]
118+ * [[ setting,metric_group_by_method_exponential_base]]
119+ Note: Currently, only base 2 and base 10 are supported.
111120
112- The first range starts at negative infinity and ends at ` pow(base, min) ` .
113- The second range begins at ` pow(base, min) + 1 ` and ends at
114- ` pow(base, min + 1) ` , the next covers ` pow(base, min + 1) + 1 ` to
115- ` pow(base, min + 2) ` , and so on. The last range covers
116- ` pow(base, max) + 1 ` to positive infinity.
121+ The first range starts at negative infinity and ends at
122+ ` pow(base, min_magnitude) ` . The second range begins at
123+ ` pow(base, min_magnitude) + 1 ` and ends at ` pow(base, min_magnitude + 1) ` ,
124+ the next covers ` pow(base, min_magnitude + 1) + 1 ` to
125+ ` pow(base, min_magnitude + 2) ` , and so on. The last range covers
126+ ` pow(base, max_magnitude) + 1 ` to positive infinity.
117127
118- For example, given the specification ` duration:exponential:1:5:10 ` , the
119- ranges would be:
128+ For example, given the settings
129+ [[ setting,metric_group_by_method_exponential_min_magnitude,1]] ,
130+ [[ setting,metric_group_by_method_exponential_max_magnitude,5]] and
131+ [[ setting,metric_group_by_method_exponential_base,10]] , the ranges would be:
120132
121133* (-inf, 10]
122134* [ 11, 100]
@@ -125,8 +137,8 @@ ranges would be:
125137* [ 10001, 100000]
126138* [ 100001, +inf)
127139
128- Much like the metric names generated with the ` discrete ` aggregation
129- function , the ones generated by the ` exponential ` function include
140+ Much like the metric names generated with the [ discrete] ( #discrete ) aggregation
141+ method , the ones generated by the ` exponential ` method include
130142information about the value of the field. However, in this case it is the
131143range the value belongs to.
132144
@@ -138,7 +150,15 @@ Example:
138150``` [dovecot.conf]
139151metric imap_command {
140152 filter = event=imap_command_finished
141- group_by = cmd_name duration:exponential:1:5:10
153+ group_by cmd_name {
154+ }
155+ group_by duration {
156+ method exponential {
157+ min_magnitude = 1
158+ max_magnitude = 5
159+ base = 10
160+ }
161+ }
142162}
143163```
144164
@@ -157,7 +177,7 @@ for a `SELECT` IMAP command, the possible generated metric names are:
157177Note: Since the metric names cannot contain ` - ` , the string ` ninf ` is used
158178to denote negative infinity.
159179
160- Note: Much like in the ` discrete ` case, the metrics are allocated only
180+ Note: Much like in the [ discrete] ( #discrete ) case, the metrics are allocated only
161181when first observed.
162182
163183Finally, because all intermediate level metrics are generated as well. The
@@ -170,18 +190,20 @@ above example, will also generate all of the following metrics:
170190
171191The field's integer value is quantized into linearly sized ranges.
172192
173- The linear aggregation function takes three colon delimited integer
174- arguments that define the set of ranges used: the minimum value, the
175- maximum value, and the range step size. The exact configuration syntax is:
176- ` field:linear:min:max:step `
193+ The linear aggregation method uses three settings:
194+
195+ * [[ setting,metric_group_by_method_linear_min]]
196+ * [[ setting,metric_group_by_method_linear_max]]
197+ * [[ setting,metric_group_by_method_linear_step]]
177198
178199The first range starts at negative infinity and ends at ` min ` . The second
179200range begins at ` min + 1 ` and ends at ` min + step ` , the next covers
180201` min + step + 1 ` to ` min + (2 * step) ` , and so on. The last range
181202covers ` max + 1 ` to positive infinity.
182203
183- For example, given the specification ` net_out_bytes:linear:0:5000:1000 ` , the
184- ranges would be:
204+ For example, given settings [[ setting,metric_group_by_method_linear_min,0]] ,
205+ [[ setting,metric_group_by_method_linear_max,5000]] and
206+ [[ setting,metric_group_by_method_linear_step,1000]] , the ranges would be:
185207
186208* (-inf, 0]
187209* [ 1, 1000]
@@ -191,7 +213,7 @@ ranges would be:
191213* [ 4001, 5000]
192214* [ 5001, +inf)
193215
194- See the description of the [ exponential] ( #exponential ) aggregation function
216+ See the description of the [ exponential] ( #exponential ) aggregation method
195217for how metric names are formed from these ranges.
196218
197219## Listing Statistics
@@ -298,7 +320,8 @@ metric storage_http_gets {
298320# generate per-command metrics on successful commands
299321metric imap_command {
300322 filter = event=imap_command_finished AND tagged_reply_state=OK
301- group_by = cmd_name
323+ group_by cmd_name {
324+ }
302325}
303326```
304327
@@ -377,17 +400,34 @@ metric auth_success {
377400
378401metric imap_command {
379402 filter = event=imap_command_finished
380- group_by = cmd_name tagged_reply_state
403+ group_by cmd_name {
404+ }
405+ group_by tagged_reply_state {
406+ }
381407}
382408
383409metric smtp_command {
384410 filter = event=smtp_server_command_finished
385- group_by = cmd_name status_code duration:exponential:1:5:10
411+ group_by cmd_name {
412+ }
413+ group_by status_code {
414+ }
415+ group_by duration {
416+ method exponential {
417+ min_magnitude = 1
418+ max_magnitude = 5
419+ }
420+ }
386421}
387422
388423metric mail_delivery {
389424 filter = event=mail_delivery_finished
390- group_by = duration:exponential:1:5:10
425+ group_by duration {
426+ method exponential {
427+ min_magnitude = 1
428+ max_magnitude = 5
429+ }
430+ }
391431}
392432```
393433
0 commit comments