Fields not showing in openmetrics statistics
Rybkin Vladimir
vrybkin at beget.ru
Wed Aug 17 12:45:48 UTC 2022
Hello
I'm trying to configure stats with openmetrics
Dovecot version: 2.3.19
I make the settings as follows:
```
# cat /home/beget/dovecot/conf/conf.d/90-openmetrics.conf | grep -v -E "^#"
service stats {
inet_listener http {
port = 9900
}
}
event_exporter log {
format = json
format_args = time-rfc3339
transport = log
}
metric imap_commands {
exporter = log
filter = event=*
}
metric imap_command {
filter = event=imap_command_finished
fields = bytes_in bytes_out
group_by = cmd_name tagged_reply_state
}
```
The problem is that no matter what configuration I do, the fields
parameter is not displayed in openmetrics
```
# curl http://192.168.20.252:9900/metrics | grep -v -E "^#\ " | grep
imap_command
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4891 100 4891 0 0 285k 0 --:--:-- --:--:--
--:--:-- 341k
dovecot_imap_commands_total 388
dovecot_imap_commands_duration_seconds_total 24.225760
dovecot_imap_command_total{cmd_name="NAMESPACE"} 1
dovecot_imap_command_total{cmd_name="NAMESPACE",tagged_reply_state="OK"} 1
dovecot_imap_command_total{cmd_name="ID"} 4
dovecot_imap_command_total{cmd_name="ID",tagged_reply_state="OK"} 4
dovecot_imap_command_total{cmd_name="ENABLE"} 4
dovecot_imap_command_total{cmd_name="ENABLE",tagged_reply_state="OK"} 4
dovecot_imap_command_total{cmd_name="SELECT"} 3
dovecot_imap_command_total{cmd_name="SELECT",tagged_reply_state="OK"} 3
dovecot_imap_command_total{cmd_name="GETQUOTAROOT"} 3
dovecot_imap_command_total{cmd_name="GETQUOTAROOT",tagged_reply_state="OK"}
3
dovecot_imap_command_total{cmd_name="UID FETCH"} 19
dovecot_imap_command_total{cmd_name="UID FETCH",tagged_reply_state="OK"} 19
dovecot_imap_command_total{cmd_name="LIST"} 2
dovecot_imap_command_total{cmd_name="LIST",tagged_reply_state="OK"} 2
dovecot_imap_command_total{cmd_name="IDLE"} 1
dovecot_imap_command_total{cmd_name="IDLE",tagged_reply_state="OK"} 1
dovecot_imap_command_total{cmd_name="STATUS"} 2
dovecot_imap_command_total{cmd_name="STATUS",tagged_reply_state="OK"} 2
dovecot_imap_command_count 39
dovecot_imap_command_duration_seconds_total{cmd_name="NAMESPACE"} 0.000218
dovecot_imap_command_duration_seconds_total{cmd_name="NAMESPACE",tagged_reply_state="OK"}
0.000218
dovecot_imap_command_duration_seconds_total{cmd_name="ID"} 0.000900
dovecot_imap_command_duration_seconds_total{cmd_name="ID",tagged_reply_state="OK"}
0.000900
dovecot_imap_command_duration_seconds_total{cmd_name="ENABLE"} 0.000332
dovecot_imap_command_duration_seconds_total{cmd_name="ENABLE",tagged_reply_state="OK"}
0.000332
dovecot_imap_command_duration_seconds_total{cmd_name="SELECT"} 0.028734
dovecot_imap_command_duration_seconds_total{cmd_name="SELECT",tagged_reply_state="OK"}
0.028734
dovecot_imap_command_duration_seconds_total{cmd_name="GETQUOTAROOT"}
0.127621
dovecot_imap_command_duration_seconds_total{cmd_name="GETQUOTAROOT",tagged_reply_state="OK"}
0.127621
dovecot_imap_command_duration_seconds_total{cmd_name="UID FETCH"} 0.097117
dovecot_imap_command_duration_seconds_total{cmd_name="UID
FETCH",tagged_reply_state="OK"} 0.097117
dovecot_imap_command_duration_seconds_total{cmd_name="LIST"} 0.003738
dovecot_imap_command_duration_seconds_total{cmd_name="LIST",tagged_reply_state="OK"}
0.003738
dovecot_imap_command_duration_seconds_total{cmd_name="IDLE"} 7.397259
dovecot_imap_command_duration_seconds_total{cmd_name="IDLE",tagged_reply_state="OK"}
7.397259
dovecot_imap_command_duration_seconds_total{cmd_name="STATUS"} 0.041169
dovecot_imap_command_duration_seconds_total{cmd_name="STATUS",tagged_reply_state="OK"}
0.041169
dovecot_imap_command_duration_seconds_sum 7.697088
```
It is displayed through doveadm
```
# altdocker exec $(altdocker ps -aq -f name=dove) doveadm stats dump
metric_name field count sum min max avg median
stddev %95
imap_commands duration 449 1043812019 20 116763630
2324748.37 2382 12137052.43 608328
imap_command duration 49 145807071 72 46020784
2975654.51 3381 11041798.07 46017747
imap_command bytes_in 49 1419 0 179 28.96 37
28.93 55
imap_command bytes_out 49 1867985 0 424616 38122.14
167 74553.96 158613
imap_command_NAMESPACE duration 1 218 218 218 218.00
218 0.00 218
imap_command_NAMESPACE bytes_in 1 0 0 0 0.00 0
0.00 0
imap_command_NAMESPACE bytes_out 1 86 86 86 86.00
86 0.00 86
imap_command_NAMESPACE_OK duration 1 218 218 218
218.00 218 0.00 218
imap_command_NAMESPACE_OK bytes_in 1 0 0 0 0.00 0
0.00 0
imap_command_NAMESPACE_OK bytes_out 1 86 86 86 86.00
86 0.00 86
imap_command_ID duration 4 900 145 288 225.00 233
59.07 288
imap_command_ID bytes_in 4 168 42 42 42.00 42
0.00 42
imap_command_ID bytes_out 4 275 66 75 68.75 67
3.63 75
imap_command_ID_OK duration 4 900 145 288 225.00
233 59.07 288
imap_command_ID_OK bytes_in 4 168 42 42 42.00 42
0.00 42
imap_command_ID_OK bytes_out 4 275 66 75 68.75 67
3.63 75
imap_command_ENABLE duration 4 332 72 110 83.00 75
15.65 110
imap_command_ENABLE bytes_in 4 44 11 11 11.00 11
0.00 11
imap_command_ENABLE bytes_out 4 147 36 37 36.75 37
0.44 37
imap_command_ENABLE_OK duration 4 332 72 110 83.00
75 15.65 110
imap_command_ENABLE_OK bytes_in 4 44 11 11 11.00 11
0.00 11
imap_command_ENABLE_OK bytes_out 4 147 36 37 36.75
37 0.44 37
imap_command_SELECT duration 3 28734 4662 16200
9578.00 7872 4862.39 16200
imap_command_SELECT bytes_in 3 33 7 14 11.00 12
2.94 14
imap_command_SELECT bytes_out 3 1034 309 416 344.67
309 50.44 416
imap_command_SELECT_OK duration 3 28734 4662 16200
9578.00 7872 4862.39 16200
imap_command_SELECT_OK bytes_in 3 33 7 14 11.00 12
2.94 14
imap_command_SELECT_OK bytes_out 3 1034 309 416 344.67
309 50.44 416
imap_command_GETQUOTAROOT duration 6 171676 12353 74871
28612.67 17219 22308.42 74871
imap_command_GETQUOTAROOT bytes_in 6 66 7 14 11.00
12 2.94 14
imap_command_GETQUOTAROOT bytes_out 6 983 159 167
163.83 165 3.18 167
imap_command_GETQUOTAROOT_OK duration 6 171676 12353
74871 28612.67 17219 22308.42 74871
imap_command_GETQUOTAROOT_OK bytes_in 6 66 7 14 11.00
12 2.94 14
imap_command_GETQUOTAROOT_OK bytes_out 6 983 159 167
163.83 165 3.18 167
imap_command_UID_FETCH duration 20 97998 881 16915
4899.90 3304 4306.81 13912
imap_command_UID_FETCH bytes_in 20 922 13 179 46.10
37 34.76 103
imap_command_UID_FETCH bytes_out 20 1864818 40 424616
93240.90 100838 92111.34 174020
imap_command_UID_FETCH_OK duration 20 97998 881 16915
4899.90 3304 4306.81 13912
imap_command_UID_FETCH_OK bytes_in 20 922 13 179 46.10
37 34.76 103
imap_command_UID_FETCH_OK bytes_out 20 1864818 40 424616
93240.90 100838 92111.34 174020
imap_command_LIST duration 2 3738 1715 2023 1869.00
1869 154.00 2023
imap_command_LIST bytes_in 2 56 10 46 28.00 28
18.00 46
imap_command_LIST bytes_out 2 315 85 230 157.50 157
72.50 230
imap_command_LIST_OK duration 2 3738 1715 2023 1869.00
1869 154.00 2023
imap_command_LIST_OK bytes_in 2 56 10 46 28.00 28
18.00 46
imap_command_LIST_OK bytes_out 2 315 85 230 157.50
157 72.50 230
imap_command_IDLE duration 4 145454703 7397259 46020784
36363675.75 46018330 16723768.54 46020784
imap_command_IDLE bytes_in 4 32 8 8 8.00 8 0.00 8
imap_command_IDLE bytes_out 4 91 10 27 22.75 27
7.36 27
imap_command_IDLE_OK duration 4 145454703 7397259
46020784 36363675.75 46018330 16723768.54 46020784
imap_command_IDLE_OK bytes_in 4 32 8 8 8.00 8 0.00 8
imap_command_IDLE_OK bytes_out 4 91 10 27 22.75 27
7.36 27
imap_command_STATUS duration 2 41169 16692 24477
20584.50 20584 3892.50 24477
imap_command_STATUS bytes_in 2 92 45 47 46.00 46
1.00 47
imap_command_STATUS bytes_out 2 236 117 119 118.00
118 1.00 119
imap_command_STATUS_OK duration 2 41169 16692 24477
20584.50 20584 3892.50 24477
imap_command_STATUS_OK bytes_in 2 92 45 47 46.00 46
1.00 47
imap_command_STATUS_OK bytes_out 2 236 117 119 118.00
118 1.00 119
imap_command_NOOP duration 3 7603 1654 3177 2534.33
2772 644.07 3177
imap_command_NOOP bytes_in 3 6 2 2 2.00 2 0.00 2
imap_command_NOOP bytes_out 3 0 0 0 0.00 0 0.00 0
imap_command_NOOP_OK duration 3 7603 1654 3177 2534.33
2772 644.07 3177
imap_command_NOOP_OK bytes_in 3 6 2 2 2.00 2 0.00 2
imap_command_NOOP_OK bytes_out 3 0 0 0 0.00 0 0.00 0
```
I can’t understand what I’m doing wrong so that field data is displayed
in openmetrics.
More information about the dovecot
mailing list