Commit 3e8a4ef
committed
Support scraping of "global" scope
PR kumina#5 (itself based on kumina#4) introduced support to scrape the "global" scope,
however the format of these stats differs slightly from that of the
others.
As a result of this, combined with the silent return when `len(values)
!= len(columns)+1`, these metrics were being incorrectly exported as
mislabeled metrics with values of 0.
The changes in this PR accomodate for the format of the "global" scope
and now properly scrape those as well.
It will now also display an error when column counts mismatch, reducing
the likelihood of silent errors in the future.
Global metrics will now show up as:
```
dovecot_global_auth_cache_hits 0
dovecot_global_auth_cache_misses 0
dovecot_global_auth_db_tempfails 3
dovecot_global_auth_failures 6
dovecot_global_auth_master_successes 0
dovecot_global_auth_successes 228
dovecot_global_clock_time 0
dovecot_global_disk_input 0
dovecot_global_disk_output 0
dovecot_global_invol_cs 0
dovecot_global_last_update 1.516197189175826e+09
dovecot_global_mail_cache_hits 0
dovecot_global_mail_lookup_attr 0
dovecot_global_mail_lookup_path 0
dovecot_global_mail_read_bytes 0
dovecot_global_mail_read_count 0
dovecot_global_maj_faults 0
dovecot_global_min_faults 0
dovecot_global_num_cmds 0
dovecot_global_num_connected_sessions 234
dovecot_global_num_logins 234
dovecot_global_read_bytes 0
dovecot_global_read_count 0
dovecot_global_reset_timestamp 1.516190181e+09
dovecot_global_sys_cpu 0
dovecot_global_user_cpu 0
dovecot_global_vol_cs 0
dovecot_global_write_bytes 0
dovecot_global_write_count 0
dovecot_up{scope="global"} 1
```
...with the other scopes being unaffected.1 parent 9bbdcdb commit 3e8a4ef
1 file changed
Lines changed: 92 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
40 | 120 | | |
41 | 121 | | |
42 | 122 | | |
| |||
47 | 127 | | |
48 | 128 | | |
49 | 129 | | |
| 130 | + | |
50 | 131 | | |
51 | 132 | | |
52 | 133 | | |
| |||
58 | 139 | | |
59 | 140 | | |
60 | 141 | | |
61 | | - | |
62 | | - | |
| 142 | + | |
| 143 | + | |
63 | 144 | | |
64 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
65 | 152 | | |
66 | 153 | | |
67 | 154 | | |
| |||
77 | 164 | | |
78 | 165 | | |
79 | 166 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | 167 | | |
101 | 168 | | |
102 | 169 | | |
| |||
0 commit comments