From efcce45c90dd3e63418d5386caa38dd1cf676997 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Wed, 18 Feb 2015 18:15:57 +0100 Subject: [PATCH] Make collector-specific flags consistent with others. This puts all collector-specific flags into their own namespace under "collector.", and moves from camel case to dashes, which is the standard in Prometheus land now. --- README.md | 11 ++++++----- collector/diskstats.go | 2 +- collector/filesystem.go | 2 +- collector/ntp.go | 2 +- collector/textfile.go | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d46a8f65..73d8bc6e 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ collectors. By default the build will include the native collectors that expose information from /proc. -Which collectors are used is controlled by the `--enabledCollectors` flag. +Which collectors are used is controlled by the `--collectors.enabled` flag. ### Enabled by default @@ -31,7 +31,7 @@ meminfo | Exposes memory statistics from /proc/meminfo. netdev | Exposes network interface statistics from /proc/netstat, such as bytes transferred. netstat | Exposes network statistics from /proc/net/netstat. This is the same information as `netstat -s`. stat | Exposes various statistics from /proc/stat. This includes CPU usage, boot time, forks and interrupts. -textfile | Exposes statistics read from local disk. The `--textfile.directory` flag must be set. +textfile | Exposes statistics read from local disk. The `--collector.textfile.directory` flag must be set. time | Exposes the current system time. @@ -55,9 +55,10 @@ to export static metrics, such as what role a machine has. The Pushgateway should be used for service-level metrics. The textfile module is for metrics that are tied to a machine. -To use set the `--textfile.directory` flag on the Node exporter. The collector -will parse all files in that directory matching the glob `*.prom` using the -[text format](http://prometheus.io/docs/instrumenting/exposition_formats/). +To use set the `--collector.textfile.directory` flag on the Node exporter. The +collector will parse all files in that directory matching the glob `*.prom` +using the [text +format](http://prometheus.io/docs/instrumenting/exposition_formats/). To atomically push completion time for a cron job: ``` diff --git a/collector/diskstats.go b/collector/diskstats.go index a0b37238..82927c43 100644 --- a/collector/diskstats.go +++ b/collector/diskstats.go @@ -22,7 +22,7 @@ const ( ) var ( - ignoredDevices = flag.String("diskstatsIgnoredDevices", "^(ram|loop|fd|(h|s|v|xv)d[a-z])\\d+$", "Regexp of devices to ignore for diskstats.") + ignoredDevices = flag.String("collector.diskstats.ignored-devices", "^(ram|loop|fd|(h|s|v|xv)d[a-z])\\d+$", "Regexp of devices to ignore for diskstats.") ) type diskstatsCollector struct { diff --git a/collector/filesystem.go b/collector/filesystem.go index fa618aab..e2b170fd 100644 --- a/collector/filesystem.go +++ b/collector/filesystem.go @@ -21,7 +21,7 @@ const ( ) var ( - ignoredMountPoints = flag.String("filesystemIgnoredMountPoints", "^/(sys|proc|dev)($|/)", "Regexp of mount points to ignore for filesystem collector.") + ignoredMountPoints = flag.String("collector.filesystem.ignored-mount-points", "^/(sys|proc|dev)($|/)", "Regexp of mount points to ignore for filesystem collector.") ) type filesystemCollector struct { diff --git a/collector/ntp.go b/collector/ntp.go index 1172ff79..ba57ee38 100644 --- a/collector/ntp.go +++ b/collector/ntp.go @@ -13,7 +13,7 @@ import ( ) var ( - ntpServer = flag.String("ntpServer", "", "NTP server to use for ntp collector.") + ntpServer = flag.String("collector.ntp.server", "", "NTP server to use for ntp collector.") ) type ntpCollector struct { diff --git a/collector/textfile.go b/collector/textfile.go index 82c97186..675a11bb 100644 --- a/collector/textfile.go +++ b/collector/textfile.go @@ -20,7 +20,7 @@ import ( ) var ( - textFileDirectory = flag.String("textfile.directory", "", "Directory to read text files with metrics from.") + textFileDirectory = flag.String("collector.textfile.directory", "", "Directory to read text files with metrics from.") ) type textFileCollector struct {