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
This commit is contained in:
parent
3762191e66
commit
859a825bb8
58 changed files with 410 additions and 406 deletions
|
|
@ -21,7 +21,7 @@ import (
|
|||
)
|
||||
|
||||
func TestDefaultProcPath(t *testing.T) {
|
||||
if _, err := kingpin.CommandLine.Parse([]string{"--collector.procfs", procfs.DefaultMountPoint}); err != nil {
|
||||
if _, err := kingpin.CommandLine.Parse([]string{"--path.procfs", procfs.DefaultMountPoint}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ func TestDefaultProcPath(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCustomProcPath(t *testing.T) {
|
||||
if _, err := kingpin.CommandLine.Parse([]string{"--collector.procfs", "./../some/./place/"}); err != nil {
|
||||
if _, err := kingpin.CommandLine.Parse([]string{"--path.procfs", "./../some/./place/"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ func TestCustomProcPath(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDefaultSysPath(t *testing.T) {
|
||||
if _, err := kingpin.CommandLine.Parse([]string{"--collector.sysfs", "/sys"}); err != nil {
|
||||
if _, err := kingpin.CommandLine.Parse([]string{"--path.sysfs", "/sys"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ func TestDefaultSysPath(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCustomSysPath(t *testing.T) {
|
||||
if _, err := kingpin.CommandLine.Parse([]string{"--collector.sysfs", "./../some/./place/"}); err != nil {
|
||||
if _, err := kingpin.CommandLine.Parse([]string{"--path.sysfs", "./../some/./place/"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue