{"io_time_weighted",prometheus.NewCounter(),"The weighted # of milliseconds spent doing I/Os. See https://www.kernel.org/doc/Documentation/iostats.txt"},
diskStatsMetrics=[]prometheus.Collector{
prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace:Namespace,
Subsystem:diskSubsystem,
Name:"reads_completed",
Help:"The total number of reads completed successfully.",
},
diskLabelNames,
),
prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace:Namespace,
Subsystem:diskSubsystem,
Name:"reads_merged",
Help:"The number of reads merged. See https://www.kernel.org/doc/Documentation/iostats.txt.",
},
diskLabelNames,
),
prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace:Namespace,
Subsystem:diskSubsystem,
Name:"sectors_read",
Help:"The total number of sectors read successfully.",
},
diskLabelNames,
),
prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace:Namespace,
Subsystem:diskSubsystem,
Name:"read_time_ms",
Help:"The total number of milliseconds spent by all reads.",
},
diskLabelNames,
),
prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace:Namespace,
Subsystem:diskSubsystem,
Name:"writes_completed",
Help:"The total number of writes completed successfully.",
},
diskLabelNames,
),
prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace:Namespace,
Subsystem:diskSubsystem,
Name:"writes_merged",
Help:"The number of writes merged. See https://www.kernel.org/doc/Documentation/iostats.txt.",
},
diskLabelNames,
),
prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace:Namespace,
Subsystem:diskSubsystem,
Name:"sectors_written",
Help:"The total number of sectors written successfully.",
},
diskLabelNames,
),
prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace:Namespace,
Subsystem:diskSubsystem,
Name:"write_time_ms",
Help:"This is the total number of milliseconds spent by all writes.",
},
diskLabelNames,
),
prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace:Namespace,
Subsystem:diskSubsystem,
Name:"io_now",
Help:"The number of I/Os currently in progress.",
},
diskLabelNames,
),
prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace:Namespace,
Subsystem:diskSubsystem,
Name:"io_time_ms",
Help:"Milliseconds spent doing I/Os.",
},
diskLabelNames,
),
prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace:Namespace,
Subsystem:diskSubsystem,
Name:"io_time_weighted",
Help:"The weighted # of milliseconds spent doing I/Os. See https://www.kernel.org/doc/Documentation/iostats.txt.",
},
diskLabelNames,
),
}
)
typediskstatsCollectorstruct{
registryprometheus.Registry
configConfig
ignoredDevicesPattern*regexp.Regexp
}
@ -57,20 +141,16 @@ func init() {
// Takes a config struct and prometheus registry and returns a new Collector exposing
memProfile=flag.String("memprofile","","write memory profile to this file")
@ -28,8 +29,27 @@ var (
enabledCollectors=flag.String("enabledCollectors","attributes,diskstats,filesystem,loadavg,meminfo,stat,netdev","comma-seperated list of collectors to use")
printCollectors=flag.Bool("printCollectors",false,"If true, print available collectors and exit")