diff options
author | Tom Wilkie <tomwilkie@users.noreply.github.com> | 2020-03-22 01:35:38 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-21 21:05:38 +0100 |
commit | 6496c24d6105e79d97f042c0afaf2a9deafce25f (patch) | |
tree | 8c79862e65c267bc54ff7e96c1b23793c4ababac /collector | |
parent | 48bb6f670c6b8e1755312d19ab03686f8d555916 (diff) | |
download | prometheus_node_collector-6496c24d6105e79d97f042c0afaf2a9deafce25f.tar.bz2 prometheus_node_collector-6496c24d6105e79d97f042c0afaf2a9deafce25f.tar.xz prometheus_node_collector-6496c24d6105e79d97f042c0afaf2a9deafce25f.zip |
Metrics for IO errors on Mac. (#1636)
* Metrics for IO errors and retries on Mac.
Signed-off-by: Tom Wilkie <tom@grafana.com>
Diffstat (limited to 'collector')
-rw-r--r-- | collector/diskstats_darwin.go | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/collector/diskstats_darwin.go b/collector/diskstats_darwin.go index 8b11812..89622a3 100644 --- a/collector/diskstats_darwin.go +++ b/collector/diskstats_darwin.go | |||
@@ -125,6 +125,62 @@ func NewDiskstatsCollector(logger log.Logger) (Collector, error) { | |||
125 | return float64(stat.BytesWritten) | 125 | return float64(stat.BytesWritten) |
126 | }, | 126 | }, |
127 | }, | 127 | }, |
128 | { | ||
129 | typedDesc: typedDesc{ | ||
130 | desc: prometheus.NewDesc( | ||
131 | prometheus.BuildFQName(namespace, diskSubsystem, "read_errors_total"), | ||
132 | "The total number of read errors.", | ||
133 | diskLabelNames, | ||
134 | nil, | ||
135 | ), | ||
136 | valueType: prometheus.CounterValue, | ||
137 | }, | ||
138 | value: func(stat *iostat.DriveStats) float64 { | ||
139 | return float64(stat.ReadErrors) | ||
140 | }, | ||
141 | }, | ||
142 | { | ||
143 | typedDesc: typedDesc{ | ||
144 | desc: prometheus.NewDesc( | ||
145 | prometheus.BuildFQName(namespace, diskSubsystem, "write_errors_total"), | ||
146 | "The total number of write errors.", | ||
147 | diskLabelNames, | ||
148 | nil, | ||
149 | ), | ||
150 | valueType: prometheus.CounterValue, | ||
151 | }, | ||
152 | value: func(stat *iostat.DriveStats) float64 { | ||
153 | return float64(stat.WriteErrors) | ||
154 | }, | ||
155 | }, | ||
156 | { | ||
157 | typedDesc: typedDesc{ | ||
158 | desc: prometheus.NewDesc( | ||
159 | prometheus.BuildFQName(namespace, diskSubsystem, "read_retries_total"), | ||
160 | "The total number of read retries.", | ||
161 | diskLabelNames, | ||
162 | nil, | ||
163 | ), | ||
164 | valueType: prometheus.CounterValue, | ||
165 | }, | ||
166 | value: func(stat *iostat.DriveStats) float64 { | ||
167 | return float64(stat.ReadRetries) | ||
168 | }, | ||
169 | }, | ||
170 | { | ||
171 | typedDesc: typedDesc{ | ||
172 | desc: prometheus.NewDesc( | ||
173 | prometheus.BuildFQName(namespace, diskSubsystem, "write_retries_total"), | ||
174 | "The total number of write retries.", | ||
175 | diskLabelNames, | ||
176 | nil, | ||
177 | ), | ||
178 | valueType: prometheus.CounterValue, | ||
179 | }, | ||
180 | value: func(stat *iostat.DriveStats) float64 { | ||
181 | return float64(stat.WriteRetries) | ||
182 | }, | ||
183 | }, | ||
128 | }, | 184 | }, |
129 | logger: logger, | 185 | logger: logger, |
130 | }, nil | 186 | }, nil |