diff options
author | Calle Pettersson <carlpett@users.noreply.github.com> | 2017-09-28 15:06:26 +0200 |
---|---|---|
committer | Johannes 'fish' Ziemke <github@freigeist.org> | 2017-09-28 15:06:26 +0200 |
commit | 859a825bb84bf4fb911fcba445d410965945f088 (patch) | |
tree | 0726b08cf03c790bff3a34a085cecc01e3b927e2 /collector/systemd_linux.go | |
parent | 3762191e66e309106e930ab11f9c080fb4428001 (diff) | |
download | prometheus_node_collector-859a825bb84bf4fb911fcba445d410965945f088.tar.bz2 prometheus_node_collector-859a825bb84bf4fb911fcba445d410965945f088.tar.xz prometheus_node_collector-859a825bb84bf4fb911fcba445d410965945f088.zip |
Replace --collectors.enabled with per-collector flags (#640)
* Move NodeCollector into package collector
* Refactor collector enabling
* Update README with new collector enabled flags
* Fix out-of-date inline flag reference syntax
* Use new flags in end-to-end tests
* Add flag to disable all default collectors
* Track if a flag has been set explicitly
* Add --collectors.disable-defaults to README
* Revert disable-defaults flag
* Shorten flags
* Fixup timex collector registration
* Fix end-to-end tests
* Change procfs and sysfs path flags
* Fix review comments
Diffstat (limited to 'collector/systemd_linux.go')
-rw-r--r-- | collector/systemd_linux.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/collector/systemd_linux.go b/collector/systemd_linux.go index 136009c..7817421 100644 --- a/collector/systemd_linux.go +++ b/collector/systemd_linux.go | |||
@@ -41,7 +41,7 @@ type systemdCollector struct { | |||
41 | var unitStatesName = []string{"active", "activating", "deactivating", "inactive", "failed"} | 41 | var unitStatesName = []string{"active", "activating", "deactivating", "inactive", "failed"} |
42 | 42 | ||
43 | func init() { | 43 | func init() { |
44 | Factories["systemd"] = NewSystemdCollector | 44 | registerCollector("systemd", defaultDisabled, NewSystemdCollector) |
45 | } | 45 | } |
46 | 46 | ||
47 | // NewSystemdCollector returns a new Collector exposing systemd statistics. | 47 | // NewSystemdCollector returns a new Collector exposing systemd statistics. |
@@ -49,11 +49,11 @@ func NewSystemdCollector() (Collector, error) { | |||
49 | const subsystem = "systemd" | 49 | const subsystem = "systemd" |
50 | 50 | ||
51 | unitDesc := prometheus.NewDesc( | 51 | unitDesc := prometheus.NewDesc( |
52 | prometheus.BuildFQName(Namespace, subsystem, "unit_state"), | 52 | prometheus.BuildFQName(namespace, subsystem, "unit_state"), |
53 | "Systemd unit", []string{"name", "state"}, nil, | 53 | "Systemd unit", []string{"name", "state"}, nil, |
54 | ) | 54 | ) |
55 | systemRunningDesc := prometheus.NewDesc( | 55 | systemRunningDesc := prometheus.NewDesc( |
56 | prometheus.BuildFQName(Namespace, subsystem, "system_running"), | 56 | prometheus.BuildFQName(namespace, subsystem, "system_running"), |
57 | "Whether the system is operational (see 'systemctl is-system-running')", | 57 | "Whether the system is operational (see 'systemctl is-system-running')", |
58 | nil, nil, | 58 | nil, nil, |
59 | ) | 59 | ) |