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{
unitIncludeSet=true
systemdUnitIncludeSetbool
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{
systemdUnitIncludeSet=true
returnnil
}).String()
oldUnitInclude=kingpin.Flag("collector.systemd.unit-whitelist","DEPRECATED: Use --collector.systemd.unit-include").Hidden().String()
unitExcludeSetbool
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{
unitExcludeSet=true
oldSystemdUnitInclude=kingpin.Flag("collector.systemd.unit-whitelist","DEPRECATED: Use --collector.systemd.unit-include").Hidden().String()
systemdUnitExcludeSetbool
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{
systemdUnitExcludeSet=true
returnnil
}).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()
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()
@ -75,9 +75,10 @@ type systemdCollector struct {
socketCurrentConnectionsDesc*prometheus.Desc
socketRefusedConnectionsDesc*prometheus.Desc
systemdVersionDesc*prometheus.Desc
unitIncludePattern*regexp.Regexp
unitExcludePattern*regexp.Regexp
loggerlog.Logger
// Use regexps for more flexability than device_filter.go allows