Metrics for IO errors on Mac. (#1636)
* Metrics for IO errors and retries on Mac. Signed-off-by: Tom Wilkie <tom@grafana.com>
This commit is contained in:
parent
48bb6f670c
commit
6496c24d61
10 changed files with 80 additions and 4 deletions
|
|
@ -125,6 +125,62 @@ func NewDiskstatsCollector(logger log.Logger) (Collector, error) {
|
|||
return float64(stat.BytesWritten)
|
||||
},
|
||||
},
|
||||
{
|
||||
typedDesc: typedDesc{
|
||||
desc: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(namespace, diskSubsystem, "read_errors_total"),
|
||||
"The total number of read errors.",
|
||||
diskLabelNames,
|
||||
nil,
|
||||
),
|
||||
valueType: prometheus.CounterValue,
|
||||
},
|
||||
value: func(stat *iostat.DriveStats) float64 {
|
||||
return float64(stat.ReadErrors)
|
||||
},
|
||||
},
|
||||
{
|
||||
typedDesc: typedDesc{
|
||||
desc: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(namespace, diskSubsystem, "write_errors_total"),
|
||||
"The total number of write errors.",
|
||||
diskLabelNames,
|
||||
nil,
|
||||
),
|
||||
valueType: prometheus.CounterValue,
|
||||
},
|
||||
value: func(stat *iostat.DriveStats) float64 {
|
||||
return float64(stat.WriteErrors)
|
||||
},
|
||||
},
|
||||
{
|
||||
typedDesc: typedDesc{
|
||||
desc: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(namespace, diskSubsystem, "read_retries_total"),
|
||||
"The total number of read retries.",
|
||||
diskLabelNames,
|
||||
nil,
|
||||
),
|
||||
valueType: prometheus.CounterValue,
|
||||
},
|
||||
value: func(stat *iostat.DriveStats) float64 {
|
||||
return float64(stat.ReadRetries)
|
||||
},
|
||||
},
|
||||
{
|
||||
typedDesc: typedDesc{
|
||||
desc: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(namespace, diskSubsystem, "write_retries_total"),
|
||||
"The total number of write retries.",
|
||||
diskLabelNames,
|
||||
nil,
|
||||
),
|
||||
valueType: prometheus.CounterValue,
|
||||
},
|
||||
value: func(stat *iostat.DriveStats) float64 {
|
||||
return float64(stat.WriteRetries)
|
||||
},
|
||||
},
|
||||
},
|
||||
logger: logger,
|
||||
}, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue