netdevIgnoredDevices=kingpin.Flag("collector.netdev.device-blacklist","Regexp of net devices to blacklist (mutually exclusive to device-whitelist).").String()
netdevAcceptDevices=kingpin.Flag("collector.netdev.device-whitelist","Regexp of net devices to whitelist (mutually exclusive to device-blacklist).").String()
netdevDeviceInclude=kingpin.Flag("collector.netdev.device-include","Regexp of net devices to include (mutually exclusive to device-exclude).").String()
oldNetdevDeviceInclude=kingpin.Flag("collector.netdev.device-whitelist","DEPRECATED: Use collector.netdev.device-include").Hidden().String()
netdevDeviceExclude=kingpin.Flag("collector.netdev.device-exclude","Regexp of net devices to exclude (mutually exclusive to device-include).").String()
oldNetdevDeviceExclude=kingpin.Flag("collector.netdev.device-blacklist","DEPRECATED: Use collector.netdev.device-exclude").Hidden().String()
)
typenetDevCollectorstruct{
subsystemstring
ignoredDevicesPattern*regexp.Regexp
acceptDevicesPattern*regexp.Regexp
metricDescsmap[string]*prometheus.Desc
loggerlog.Logger
subsystemstring
deviceExcludePattern*regexp.Regexp
deviceIncludePattern*regexp.Regexp
metricDescsmap[string]*prometheus.Desc
loggerlog.Logger
}
funcinit(){
@ -46,31 +49,51 @@ func init() {
// NewNetDevCollector returns a new Collector exposing network device stats.
unitWhitelist=kingpin.Flag("collector.systemd.unit-whitelist","Regexp of systemd units to whitelist. Units must both match whitelist and not match blacklist to be included.").Default(".+").String()
unitBlacklist=kingpin.Flag("collector.systemd.unit-blacklist","Regexp of systemd units to blacklist. Units must both match whitelist and not match blacklist to be included.").Default(".+\\.(automount|device|mount|scope|slice)").String()
unitInclude=kingpin.Flag("collector.systemd.unit-include","Regexp of systemd units to include. Units must both match include and not match exclude to be included.").Default(".+").String()
oldUnitInclude=kingpin.Flag("collector.systemd.unit-whitelist","DEPRECATED: Use --collector.systemd.unit-include").Hidden().String()
unitExclude=kingpin.Flag("collector.systemd.unit-exclude","Regexp of systemd units to exclude. Units must both match include and not match exclude to be included.").Default(".+\\.(automount|device|mount|scope|slice)").String()
oldUnitExclude=kingpin.Flag("collector.systemd.unit-blacklist","DEPRECATED: Use collector.systemd.unit-exclude").Hidden().String()
systemdPrivate=kingpin.Flag("collector.systemd.private","Establish a private, direct connection to systemd without dbus (Strongly discouraged since it requires root. For testing purposes only).").Hidden().Bool()
enableTaskMetrics=kingpin.Flag("collector.systemd.enable-task-metrics","Enables service unit tasks metrics unit_tasks_current and unit_tasks_max").Bool()
enableRestartsMetrics=kingpin.Flag("collector.systemd.enable-restarts-metrics","Enables service unit metric service_restart_total").Bool()