Update all Include and Exclude variables to use the systemdUnit naming (#2740)
prefix.
Leave an annotation about using regexps instead of device_filter.go, so
@SuperQ doesn't need to remember everything.
Signed-off-by: Conall O'Brien <conall@conall.net>
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(".+").PreAction(func(c*kingpin.ParseContext)error{
systemdUnitInclude=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(".+").PreAction(func(c*kingpin.ParseContext)error{
unitIncludeSet=true
systemdUnitIncludeSet=true
returnnil
returnnil
}).String()
}).String()
oldUnitInclude=kingpin.Flag("collector.systemd.unit-whitelist","DEPRECATED: Use --collector.systemd.unit-include").Hidden().String()
oldSystemdUnitInclude=kingpin.Flag("collector.systemd.unit-whitelist","DEPRECATED: Use --collector.systemd.unit-include").Hidden().String()
unitExcludeSetbool
systemdUnitExcludeSetbool
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)").PreAction(func(c*kingpin.ParseContext)error{
systemdUnitExclude=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)").PreAction(func(c*kingpin.ParseContext)error{
unitExcludeSet=true
systemdUnitExcludeSet=true
returnnil
returnnil
}).String()
}).String()
oldUnitExclude=kingpin.Flag("collector.systemd.unit-blacklist","DEPRECATED: Use collector.systemd.unit-exclude").Hidden().String()
oldSystemdUnitExclude=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()
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()
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()
enableRestartsMetrics=kingpin.Flag("collector.systemd.enable-restarts-metrics","Enables service unit metric service_restart_total").Bool()
@ -75,9 +75,10 @@ type systemdCollector struct {
socketCurrentConnectionsDesc*prometheus.Desc
socketCurrentConnectionsDesc*prometheus.Desc
socketRefusedConnectionsDesc*prometheus.Desc
socketRefusedConnectionsDesc*prometheus.Desc
systemdVersionDesc*prometheus.Desc
systemdVersionDesc*prometheus.Desc
unitIncludePattern*regexp.Regexp
// Use regexps for more flexability than device_filter.go allows