Correctly handle the new `collector.diskstats.device-exclude` flag to
avoid errors when using the old `collector.diskstats.ignored-devices`
flag.
Fixes: https://github.com/prometheus/node_exporter/issues/2486
Signed-off-by: Ben Kochie <superq@gmail.com>
diskstatsDeviceExclude=kingpin.Flag("collector.diskstats.device-exclude","Regexp of diskstats devices to exclude (mutually exclusive to device-include).").Default(diskstatsDefaultIgnoredDevices).String()
oldDiskstatsDeviceExclude=kingpin.Flag("collector.diskstats.ignored-devices","DEPRECATED: Use collector.diskstats.device-exclude").String()
diskstatsDeviceExcludeSetbool
diskstatsDeviceExclude=kingpin.Flag(
"collector.diskstats.device-exclude",
"Regexp of diskstats devices to exclude (mutually exclusive to device-include).",
"DEPRECATED: Use collector.diskstats.device-exclude",
).Hidden().String()
diskstatsDeviceInclude=kingpin.Flag("collector.diskstats.device-include","Regexp of diskstats devices to include (mutually exclusive to device-exclude).").String()
level.Warn(logger).Log("msg","--collector.diskstats.ignored-devices is DEPRECATED and will be removed in 2.0.0, use --collector.diskstats.device-exclude")