diff options
Diffstat (limited to 'src/go')
-rw-r--r-- | src/go/cmd/godplugin/main.go (renamed from src/go/collectors/go.d.plugin/cmd/godplugin/main.go) | 49 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/README.md | 227 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/agent/functions/manager.go | 136 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/config/go.d/snmp.conf | 48 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/chrony/charts.go | 148 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/chrony/client.go | 61 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/chrony/collect.go | 97 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/dnsmasq/collect.go | 126 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/init.go | 98 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/nvidia_smi/collect.go | 72 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/nvidia_smi/collect_csv.go | 198 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/nvidia_smi/exec.go | 78 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/nvidia_smi/nvidia_smi.go | 117 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/help-query-gpu.txt | 414 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/tesla-p100.csv | 2 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/snmp/charts.go | 116 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/snmp/collect.go | 55 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/snmp/init.go | 189 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/snmp/snmp.go | 201 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/snmp/snmp_test.go | 520 | ||||
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/vsphere/vsphere_test.go | 488 | ||||
-rw-r--r-- | src/go/go.mod (renamed from src/go/collectors/go.d.plugin/go.mod) | 71 | ||||
-rw-r--r-- | src/go/go.sum (renamed from src/go/collectors/go.d.plugin/go.sum) | 184 | ||||
-rw-r--r-- | src/go/logger/default.go (renamed from src/go/collectors/go.d.plugin/logger/default.go) | 0 | ||||
-rw-r--r-- | src/go/logger/handler.go (renamed from src/go/collectors/go.d.plugin/logger/handler.go) | 0 | ||||
-rw-r--r-- | src/go/logger/journal_linux.go | 33 | ||||
-rw-r--r-- | src/go/logger/journal_stub.go | 9 | ||||
-rw-r--r-- | src/go/logger/level.go (renamed from src/go/collectors/go.d.plugin/logger/level.go) | 0 | ||||
-rw-r--r-- | src/go/logger/logger.go (renamed from src/go/collectors/go.d.plugin/logger/logger.go) | 26 | ||||
-rw-r--r-- | src/go/logger/logger_test.go (renamed from src/go/collectors/go.d.plugin/logger/logger_test.go) | 0 | ||||
-rw-r--r-- | src/go/pkg/buildinfo/version.go (renamed from src/go/collectors/go.d.plugin/pkg/buildinfo/version.go) | 0 | ||||
-rw-r--r-- | src/go/pkg/executable/executable.go (renamed from src/go/collectors/go.d.plugin/agent/executable/executable.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/README.md | 244 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/README.md (renamed from src/go/collectors/go.d.plugin/agent/README.md) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/agent.go (renamed from src/go/collectors/go.d.plugin/agent/agent.go) | 24 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/agent_test.go (renamed from src/go/collectors/go.d.plugin/agent/agent_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/confgroup/cache.go (renamed from src/go/collectors/go.d.plugin/agent/confgroup/cache.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/confgroup/cache_test.go (renamed from src/go/collectors/go.d.plugin/agent/confgroup/cache_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/confgroup/config.go (renamed from src/go/collectors/go.d.plugin/agent/confgroup/config.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/confgroup/config_test.go (renamed from src/go/collectors/go.d.plugin/agent/confgroup/config_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/confgroup/group.go (renamed from src/go/collectors/go.d.plugin/agent/confgroup/group.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/confgroup/registry.go (renamed from src/go/collectors/go.d.plugin/agent/confgroup/registry.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/confgroup/registry_test.go (renamed from src/go/collectors/go.d.plugin/agent/confgroup/registry_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/config.go (renamed from src/go/collectors/go.d.plugin/agent/config.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/cache.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/cache.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/config.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/config.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/dummy/config.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/dummy/config.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/dummy/discovery.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/dummy/discovery.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/dummy/discovery_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/dummy/discovery_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/file/config.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/file/config.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/file/discovery.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/file/discovery.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/file/discovery_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/file/discovery_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/file/parse.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/file/parse.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/file/parse_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/file/parse_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/file/read.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/file/read.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/file/read_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/file/read_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/file/sim_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/file/sim_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/file/watch.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/file/watch.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/file/watch_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/file/watch_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/manager.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/manager.go) | 10 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/manager_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/manager_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/conffile.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/conffile.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/dockerd/docker.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/dockerd/docker.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/dockerd/dockerd_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/dockerd/dockerd_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/dockerd/sim_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/dockerd/sim_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/dockerd/target.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/dockerd/target.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/config.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/config.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/kubernetes.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/kubernetes.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/kubernetes_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/kubernetes_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/pod.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/pod.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/pod_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/pod_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/service.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/service.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/service_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/service_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/sim_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/sim_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/netlisteners/netlisteners.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/netlisteners/netlisteners.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/netlisteners/netlisteners_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/netlisteners/netlisteners_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/netlisteners/sim_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/netlisteners/sim_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/discoverer/netlisteners/target.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/netlisteners/target.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/model/discoverer.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/model/discoverer.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/model/tags.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/model/tags.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/model/tags_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/model/tags_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/model/target.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/model/target.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/accumulator.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/accumulator.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/classify.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/classify.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/classify_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/classify_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/compose.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/compose.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/compose_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/compose_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/config.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/config.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/funcmap.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/funcmap.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/funcmap_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/funcmap_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/pipeline.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/pipeline.go) | 14 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/pipeline_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/pipeline_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/promport.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/promport.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/selector.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/selector.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/selector_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/selector_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/pipeline/sim_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/sim_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/sd.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/sd.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/sd_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/sd_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sd/sim_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sd/sim_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/discovery/sim_test.go (renamed from src/go/collectors/go.d.plugin/agent/discovery/sim_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/filelock/filelock.go (renamed from src/go/collectors/go.d.plugin/agent/filelock/filelock.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/filelock/filelock_test.go (renamed from src/go/collectors/go.d.plugin/agent/filelock/filelock_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/filestatus/manager.go (renamed from src/go/collectors/go.d.plugin/agent/filestatus/manager.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/filestatus/manager_test.go (renamed from src/go/collectors/go.d.plugin/agent/filestatus/manager_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/filestatus/store.go (renamed from src/go/collectors/go.d.plugin/agent/filestatus/store.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/filestatus/store_test.go (renamed from src/go/collectors/go.d.plugin/agent/filestatus/store_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/functions/ext.go (renamed from src/go/collectors/go.d.plugin/agent/functions/ext.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/functions/function.go (renamed from src/go/collectors/go.d.plugin/agent/functions/function.go) | 30 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/functions/input.go | 35 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/functions/manager.go | 127 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/functions/manager_test.go (renamed from src/go/collectors/go.d.plugin/agent/functions/manager_test.go) | 25 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/hostinfo/hostinfo.go (renamed from src/go/collectors/go.d.plugin/agent/hostinfo/hostinfo.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/hostinfo/hostinfo_common.go (renamed from src/go/collectors/go.d.plugin/agent/hostinfo/hostinfo_common.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/hostinfo/hostinfo_linux.go (renamed from src/go/collectors/go.d.plugin/agent/hostinfo/hostinfo_linux.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/jobmgr/cache.go (renamed from src/go/collectors/go.d.plugin/agent/jobmgr/cache.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/jobmgr/di.go (renamed from src/go/collectors/go.d.plugin/agent/jobmgr/di.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/jobmgr/dyncfg.go (renamed from src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/jobmgr/manager.go (renamed from src/go/collectors/go.d.plugin/agent/jobmgr/manager.go) | 14 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/jobmgr/manager_test.go (renamed from src/go/collectors/go.d.plugin/agent/jobmgr/manager_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/jobmgr/noop.go (renamed from src/go/collectors/go.d.plugin/agent/jobmgr/noop.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/jobmgr/sim_test.go (renamed from src/go/collectors/go.d.plugin/agent/jobmgr/sim_test.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/module/charts.go (renamed from src/go/collectors/go.d.plugin/agent/module/charts.go) | 37 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/module/charts_test.go (renamed from src/go/collectors/go.d.plugin/agent/module/charts_test.go) | 3 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/module/job.go (renamed from src/go/collectors/go.d.plugin/agent/module/job.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/module/job_test.go (renamed from src/go/collectors/go.d.plugin/agent/module/job_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/module/mock.go (renamed from src/go/collectors/go.d.plugin/agent/module/mock.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/module/mock_test.go (renamed from src/go/collectors/go.d.plugin/agent/module/mock_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/module/module.go (renamed from src/go/collectors/go.d.plugin/agent/module/module.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/module/registry.go (renamed from src/go/collectors/go.d.plugin/agent/module/registry.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/module/registry_test.go (renamed from src/go/collectors/go.d.plugin/agent/module/registry_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/netdataapi/api.go (renamed from src/go/collectors/go.d.plugin/agent/netdataapi/api.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/netdataapi/api_test.go (renamed from src/go/collectors/go.d.plugin/agent/netdataapi/api_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/safewriter/writer.go (renamed from src/go/collectors/go.d.plugin/agent/safewriter/writer.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/setup.go (renamed from src/go/collectors/go.d.plugin/agent/setup.go) | 16 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/setup_test.go (renamed from src/go/collectors/go.d.plugin/agent/setup_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/testdata/agent-empty.conf (renamed from src/go/collectors/go.d.plugin/agent/testdata/agent-empty.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/testdata/agent-invalid-syntax.conf (renamed from src/go/collectors/go.d.plugin/agent/testdata/agent-invalid-syntax.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/testdata/agent-valid.conf (renamed from src/go/collectors/go.d.plugin/agent/testdata/agent-valid.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/ticker/ticker.go (renamed from src/go/collectors/go.d.plugin/agent/ticker/ticker.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/ticker/ticket_test.go (renamed from src/go/collectors/go.d.plugin/agent/ticker/ticket_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/vnodes/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/agent/vnodes/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/vnodes/vnodes.go (renamed from src/go/collectors/go.d.plugin/agent/vnodes/vnodes.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/agent/vnodes/vnodes_test.go (renamed from src/go/collectors/go.d.plugin/agent/vnodes/vnodes_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/cli/cli.go (renamed from src/go/collectors/go.d.plugin/cli/cli.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d.conf (renamed from src/go/collectors/go.d.plugin/config/go.d.conf) | 18 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/activemq.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/activemq.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/adaptec_raid.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/adaptec_raid.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/ap.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/apache.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/apache.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/beanstalk.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/bind.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/bind.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/cassandra.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/cassandra.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/chrony.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/chrony.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/clickhouse.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/clickhouse.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/cockroachdb.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/cockroachdb.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/consul.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/consul.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/coredns.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/coredns.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/couchbase.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/couchbase.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/couchdb.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/couchdb.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/dmcache.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/dmcache.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/dns_query.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/dns_query.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/dnsdist.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/dnsdist.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/dnsmasq.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/dnsmasq.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/dnsmasq_dhcp.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/dnsmasq_dhcp.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/docker.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/docker.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/docker_engine.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/docker_engine.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/dockerhub.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/dockerhub.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/dovecot.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/elasticsearch.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/elasticsearch.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/envoy.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/envoy.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/example.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/example.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/exim.conf | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/fail2ban.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/fail2ban.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/filecheck.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/filecheck.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/fluentd.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/fluentd.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/freeradius.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/freeradius.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/gearman.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/geth.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/geth.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/haproxy.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/haproxy.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/hddtemp.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/hddtemp.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/hdfs.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/hdfs.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/hpssa.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/hpssa.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/httpcheck.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/httpcheck.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/icecast.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/intelgpu.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/intelgpu.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/ipfs.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/isc_dhcpd.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/isc_dhcpd.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/k8s_kubelet.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/k8s_kubelet.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/k8s_kubeproxy.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/k8s_kubeproxy.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/k8s_state.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/k8s_state.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/lighttpd.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/lighttpd.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/litespeed.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/litespeed.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/logind.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/logind.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/logstash.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/logstash.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/lvm.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/lvm.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/megacli.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/megacli.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/memcached.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/mongodb.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/mongodb.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/monit.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/mysql.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/mysql.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/nginx.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/nginx.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/nginxplus.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/nginxplus.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/nginxvts.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/nginxvts.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/nsd.conf | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/ntpd.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/ntpd.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/nvidia_smi.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/nvidia_smi.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/nvme.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/nvme.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/openvpn.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/openvpn.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/openvpn_status_log.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/openvpn_status_log.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/pgbouncer.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/pgbouncer.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/phpdaemon.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/phpdaemon.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/phpfpm.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/phpfpm.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/pihole.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/pihole.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/pika.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/pika.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/ping.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/ping.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/portcheck.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/portcheck.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/postfix.conf | 12 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/postgres.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/postgres.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/powerdns.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/powerdns.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/powerdns_recursor.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/powerdns_recursor.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/prometheus.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/prometheus.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/proxysql.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/proxysql.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/pulsar.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/pulsar.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/puppet.conf | 7 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/rabbitmq.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/rabbitmq.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/redis.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/redis.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/rethinkdb.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/riakkv.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/rspamd.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/rspamd.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/scaleio.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/scaleio.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/sd/docker.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/sd/docker.conf) | 73 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/sd/net_listeners.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/sd/net_listeners.conf) | 102 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/sensors.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/sensors.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/smartctl.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/smartctl.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/snmp.conf | 10 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/squid.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/squidlog.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/squidlog.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/storcli.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/storcli.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/supervisord.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/supervisord.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/systemdunits.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/systemdunits.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/tengine.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/tengine.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/tomcat.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/tor.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/traefik.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/traefik.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/unbound.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/unbound.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/upsd.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/upsd.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/uwsgi.conf | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/vcsa.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/vcsa.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/vernemq.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/vernemq.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/vsphere.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/vsphere.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/web_log.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/web_log.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/whoisquery.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/whoisquery.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/windows.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/windows.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/wireguard.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/wireguard.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/x509check.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/x509check.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/zfspool.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/zfspool.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/config/go.d/zookeeper.conf (renamed from src/go/collectors/go.d.plugin/config/go.d/zookeeper.conf) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/docs/how-to-write-a-module.md (renamed from src/go/collectors/go.d.plugin/docs/how-to-write-a-module.md) | 33 | ||||
-rw-r--r-- | src/go/plugin/go.d/examples/simple/main.go (renamed from src/go/collectors/go.d.plugin/examples/simple/main.go) | 10 | ||||
-rwxr-xr-x | src/go/plugin/go.d/hack/go-build.sh (renamed from src/go/collectors/go.d.plugin/hack/go-build.sh) | 4 | ||||
-rwxr-xr-x | src/go/plugin/go.d/hack/go-fmt.sh (renamed from src/go/collectors/go.d.plugin/hack/go-fmt.sh) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/activemq/README.md (renamed from src/go/collectors/go.d.plugin/modules/activemq/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/activemq/activemq.go (renamed from src/go/collectors/go.d.plugin/modules/activemq/activemq.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/activemq/activemq_test.go (renamed from src/go/collectors/go.d.plugin/modules/activemq/activemq_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/activemq/apiclient.go (renamed from src/go/collectors/go.d.plugin/modules/activemq/apiclient.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/activemq/charts.go (renamed from src/go/collectors/go.d.plugin/modules/activemq/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/activemq/collect.go (renamed from src/go/collectors/go.d.plugin/modules/activemq/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/activemq/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/activemq/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/activemq/init.go (renamed from src/go/collectors/go.d.plugin/modules/activemq/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/activemq/integrations/activemq.md (renamed from src/go/collectors/go.d.plugin/modules/activemq/integrations/activemq.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/activemq/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/activemq/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/activemq/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/activemq/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/activemq/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/activemq/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/adaptecraid/README.md (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/adaptec.go (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/adaptec.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/adaptec_test.go (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/adaptec_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/charts.go (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/collect.go (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/collect_ld.go (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/collect_ld.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/collect_pd.go (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/collect_pd.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/exec.go (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/exec.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/init.go (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/integrations/adaptec_raid.md (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/integrations/adaptec_raid.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/testdata/getconfig-ld-current.txt (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/getconfig-ld-current.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/testdata/getconfig-ld-old.txt (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/getconfig-ld-old.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/testdata/getconfig-pd-current.txt (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/getconfig-pd-current.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/adaptecraid/testdata/getconfig-pd-old.txt (renamed from src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/getconfig-pd-old.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/ap/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/ap.go | 113 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/ap_test.go | 292 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/charts.go | 147 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/collect.go | 221 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/config_schema.json) | 16 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/exec.go | 56 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/init.go | 37 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/integrations/access_points.md | 202 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/metadata.yaml | 141 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/sensors/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/sensors/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/testdata/iw_dev_ap.txt | 25 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/testdata/iw_dev_managed.txt | 11 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ap/testdata/station_dump.txt | 58 | ||||
l--------- | src/go/plugin/go.d/modules/apache/README.md (renamed from src/go/collectors/go.d.plugin/modules/apache/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/apache.go (renamed from src/go/collectors/go.d.plugin/modules/apache/apache.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/apache_test.go (renamed from src/go/collectors/go.d.plugin/modules/apache/apache_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/charts.go (renamed from src/go/collectors/go.d.plugin/modules/apache/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/collect.go (renamed from src/go/collectors/go.d.plugin/modules/apache/collect.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/apache/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/init.go (renamed from src/go/collectors/go.d.plugin/modules/apache/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/integrations/apache.md (renamed from src/go/collectors/go.d.plugin/modules/apache/integrations/apache.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/integrations/httpd.md (renamed from src/go/collectors/go.d.plugin/modules/apache/integrations/httpd.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/apache/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/apache/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/apache/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/apache/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/testdata/extended-status-mpm-event.txt (renamed from src/go/collectors/go.d.plugin/modules/apache/testdata/extended-status-mpm-event.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/testdata/extended-status-mpm-prefork.txt (renamed from src/go/collectors/go.d.plugin/modules/apache/testdata/extended-status-mpm-prefork.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/testdata/lighttpd-status.txt (renamed from src/go/collectors/go.d.plugin/modules/apache/testdata/lighttpd-status.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/apache/testdata/simple-status-mpm-event.txt (renamed from src/go/collectors/go.d.plugin/modules/apache/testdata/simple-status-mpm-event.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/beanstalk/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/beanstalk.go | 123 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/beanstalk_test.go | 384 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/charts.go | 333 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/client.go | 249 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/collect.go | 118 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/config_schema.json | 54 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/init.go | 29 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/integrations/beanstalk.md | 253 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/metadata.yaml | 255 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/testdata/config.json | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/testdata/config.yaml | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/testdata/list-tubes.txt | 3 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/testdata/stats-tube-default.txt | 16 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/beanstalk/testdata/stats.txt | 50 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/bind/README.md (renamed from src/go/collectors/go.d.plugin/modules/bind/README.md) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/bind/bind.go (renamed from src/go/collectors/go.d.plugin/modules/bind/bind.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/bind/bind_test.go (renamed from src/go/collectors/go.d.plugin/modules/bind/bind_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/bind/charts.go (renamed from src/go/collectors/go.d.plugin/modules/bind/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/bind/collect.go (renamed from src/go/collectors/go.d.plugin/modules/bind/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/bind/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/bind/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/bind/init.go (renamed from src/go/collectors/go.d.plugin/modules/bind/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/bind/json_client.go (renamed from src/go/collectors/go.d.plugin/modules/bind/json_client.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/bind/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/bind/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/bind/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/bind/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/bind/testdata/query-server.json (renamed from src/go/collectors/go.d.plugin/modules/bind/testdata/query-server.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/bind/testdata/query-server.xml (renamed from src/go/collectors/go.d.plugin/modules/bind/testdata/query-server.xml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/bind/xml3_client.go (renamed from src/go/collectors/go.d.plugin/modules/bind/xml3_client.go) | 2 | ||||
l--------- | src/go/plugin/go.d/modules/cassandra/README.md (renamed from src/go/collectors/go.d.plugin/modules/cassandra/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cassandra/cassandra.go (renamed from src/go/collectors/go.d.plugin/modules/cassandra/cassandra.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cassandra/cassandra_test.go (renamed from src/go/collectors/go.d.plugin/modules/cassandra/cassandra_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cassandra/charts.go (renamed from src/go/collectors/go.d.plugin/modules/cassandra/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cassandra/collect.go (renamed from src/go/collectors/go.d.plugin/modules/cassandra/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cassandra/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/cassandra/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cassandra/init.go (renamed from src/go/collectors/go.d.plugin/modules/cassandra/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cassandra/integrations/cassandra.md (renamed from src/go/collectors/go.d.plugin/modules/cassandra/integrations/cassandra.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cassandra/jmx_exporter.yaml (renamed from src/go/collectors/go.d.plugin/modules/cassandra/jmx_exporter.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cassandra/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/cassandra/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cassandra/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/cassandra/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cassandra/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/cassandra/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cassandra/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/cassandra/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cassandra/testdata/metrics.txt (renamed from src/go/collectors/go.d.plugin/modules/cassandra/testdata/metrics.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/chrony/README.md (renamed from src/go/collectors/go.d.plugin/modules/chrony/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/chrony/charts.go | 320 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/chrony/chrony.go (renamed from src/go/collectors/go.d.plugin/modules/chrony/chrony.go) | 15 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/chrony/chrony_test.go (renamed from src/go/collectors/go.d.plugin/modules/chrony/chrony_test.go) | 33 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/chrony/client.go | 171 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/chrony/collect.go | 156 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/chrony/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/chrony/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/chrony/init.go (renamed from src/go/collectors/go.d.plugin/modules/chrony/init.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/chrony/integrations/chrony.md (renamed from src/go/collectors/go.d.plugin/modules/chrony/integrations/chrony.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/chrony/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/chrony/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/chrony/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/chrony/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/chrony/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/chrony/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/clickhouse/README.md (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/charts.go (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/clickhouse.go (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/clickhouse.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/clickhouse_test.go (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/clickhouse_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/collect.go (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/collect_system_async_metrics.go (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_async_metrics.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/collect_system_disks.go (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_disks.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/collect_system_events.go (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_events.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/collect_system_metrics.go (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_metrics.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/collect_system_parts.go (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_parts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/collect_system_processes.go (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_processes.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/init.go (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/integrations/clickhouse.md (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/integrations/clickhouse.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/testdata/resp_longest_query_time.csv (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_longest_query_time.csv) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_async_metrics.csv (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_async_metrics.csv) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_disks.csv (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_disks.csv) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_events.csv (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_events.csv) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_metrics.csv (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_metrics.csv) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_parts.csv (renamed from src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_parts.csv) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/cockroachdb/README.md (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cockroachdb/charts.go (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cockroachdb/cockroachdb.go (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/cockroachdb.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cockroachdb/cockroachdb_test.go (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/cockroachdb_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cockroachdb/collect.go (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/collect.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cockroachdb/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cockroachdb/init.go (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cockroachdb/integrations/cockroachdb.md (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/integrations/cockroachdb.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cockroachdb/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cockroachdb/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cockroachdb/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cockroachdb/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cockroachdb/testdata/metrics.txt (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/testdata/metrics.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/cockroachdb/testdata/non_cockroachdb.txt (renamed from src/go/collectors/go.d.plugin/modules/cockroachdb/testdata/non_cockroachdb.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/consul/README.md (renamed from src/go/collectors/go.d.plugin/modules/consul/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/charts.go (renamed from src/go/collectors/go.d.plugin/modules/consul/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/collect.go (renamed from src/go/collectors/go.d.plugin/modules/consul/collect.go) | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/collect_autopilot.go (renamed from src/go/collectors/go.d.plugin/modules/consul/collect_autopilot.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/collect_checks.go (renamed from src/go/collectors/go.d.plugin/modules/consul/collect_checks.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/collect_config.go (renamed from src/go/collectors/go.d.plugin/modules/consul/collect_config.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/collect_metrics.go (renamed from src/go/collectors/go.d.plugin/modules/consul/collect_metrics.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/collect_net_rtt.go (renamed from src/go/collectors/go.d.plugin/modules/consul/collect_net_rtt.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/consul/config_schema.json) | 9 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/consul.go (renamed from src/go/collectors/go.d.plugin/modules/consul/consul.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/consul_test.go (renamed from src/go/collectors/go.d.plugin/modules/consul/consul_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/init.go (renamed from src/go/collectors/go.d.plugin/modules/consul/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/integrations/consul.md (renamed from src/go/collectors/go.d.plugin/modules/consul/integrations/consul.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/consul/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.13.2/client_v1-agent-metrics.txt (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/client_v1-agent-metrics.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.13.2/client_v1-agent-self.json (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/client_v1-agent-self.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-metrics.txt (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-metrics.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-metrics_with_hostname.txt (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-metrics_with_hostname.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-self.json (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-self.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-self_cloud-managed.json (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-self_cloud-managed.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-self_disabled_prom.json (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-self_disabled_prom.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-self_with_hostname.json (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-self_with_hostname.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-coordinate-nodes.json (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-coordinate-nodes.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-operator-autopilot-health.json (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-operator-autopilot-health.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.13.2/v1-agent-checks.json (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/v1-agent-checks.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.14.3-cloud/server_v1-agent-metrics.txt (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.14.3-cloud/server_v1-agent-metrics.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.14.3-cloud/server_v1-agent-self.json (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.14.3-cloud/server_v1-agent-self.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.14.3-cloud/server_v1-coordinate-nodes.json (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.14.3-cloud/server_v1-coordinate-nodes.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/consul/testdata/v1.14.3-cloud/v1-agent-checks.json (renamed from src/go/collectors/go.d.plugin/modules/consul/testdata/v1.14.3-cloud/v1-agent-checks.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/coredns/README.md (renamed from src/go/collectors/go.d.plugin/modules/coredns/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/charts.go (renamed from src/go/collectors/go.d.plugin/modules/coredns/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/collect.go (renamed from src/go/collectors/go.d.plugin/modules/coredns/collect.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/coredns/config_schema.json) | 14 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/coredns.go (renamed from src/go/collectors/go.d.plugin/modules/coredns/coredns.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/coredns_test.go (renamed from src/go/collectors/go.d.plugin/modules/coredns/coredns_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/init.go (renamed from src/go/collectors/go.d.plugin/modules/coredns/init.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/integrations/coredns.md (renamed from src/go/collectors/go.d.plugin/modules/coredns/integrations/coredns.md) | 43 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/coredns/metadata.yaml) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/coredns/metrics.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/coredns/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/coredns/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/testdata/no_version/no_load.txt (renamed from src/go/collectors/go.d.plugin/modules/coredns/testdata/no_version/no_load.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/testdata/version169/no_load.txt (renamed from src/go/collectors/go.d.plugin/modules/coredns/testdata/version169/no_load.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/testdata/version169/some_load.txt (renamed from src/go/collectors/go.d.plugin/modules/coredns/testdata/version169/some_load.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/testdata/version170/no_load.txt (renamed from src/go/collectors/go.d.plugin/modules/coredns/testdata/version170/no_load.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/coredns/testdata/version170/some_load.txt (renamed from src/go/collectors/go.d.plugin/modules/coredns/testdata/version170/some_load.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/couchbase/README.md (renamed from src/go/collectors/go.d.plugin/modules/couchbase/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchbase/charts.go (renamed from src/go/collectors/go.d.plugin/modules/couchbase/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchbase/collect.go (renamed from src/go/collectors/go.d.plugin/modules/couchbase/collect.go) | 12 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchbase/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/couchbase/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchbase/couchbase.go (renamed from src/go/collectors/go.d.plugin/modules/couchbase/couchbase.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchbase/couchbase_test.go (renamed from src/go/collectors/go.d.plugin/modules/couchbase/couchbase_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchbase/init.go (renamed from src/go/collectors/go.d.plugin/modules/couchbase/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchbase/integrations/couchbase.md (renamed from src/go/collectors/go.d.plugin/modules/couchbase/integrations/couchbase.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchbase/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/couchbase/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchbase/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/couchbase/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchbase/testdata/6.6.0/buckets_basic_stats.json (renamed from src/go/collectors/go.d.plugin/modules/couchbase/testdata/6.6.0/buckets_basic_stats.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchbase/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/couchbase/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchbase/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/couchbase/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/couchdb/README.md (renamed from src/go/collectors/go.d.plugin/modules/couchdb/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/charts.go (renamed from src/go/collectors/go.d.plugin/modules/couchdb/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/collect.go (renamed from src/go/collectors/go.d.plugin/modules/couchdb/collect.go) | 24 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/couchdb/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/couchdb.go (renamed from src/go/collectors/go.d.plugin/modules/couchdb/couchdb.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/couchdb_test.go (renamed from src/go/collectors/go.d.plugin/modules/couchdb/couchdb_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/init.go (renamed from src/go/collectors/go.d.plugin/modules/couchdb/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/integrations/couchdb.md (renamed from src/go/collectors/go.d.plugin/modules/couchdb/integrations/couchdb.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/couchdb/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/couchdb/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/couchdb/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/couchdb/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/active_tasks.json (renamed from src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/active_tasks.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/dbs_info.json (renamed from src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/dbs_info.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/node_stats.json (renamed from src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/node_stats.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/node_system.json (renamed from src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/node_system.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/root.json (renamed from src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/root.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/dmcache/README.md (renamed from src/go/collectors/go.d.plugin/modules/dmcache/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dmcache/charts.go (renamed from src/go/collectors/go.d.plugin/modules/dmcache/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dmcache/collect.go (renamed from src/go/collectors/go.d.plugin/modules/dmcache/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dmcache/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/dmcache/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dmcache/dmcache.go (renamed from src/go/collectors/go.d.plugin/modules/dmcache/dmcache.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dmcache/dmcache_test.go (renamed from src/go/collectors/go.d.plugin/modules/dmcache/dmcache_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dmcache/exec.go (renamed from src/go/collectors/go.d.plugin/modules/dmcache/exec.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dmcache/init.go (renamed from src/go/collectors/go.d.plugin/modules/dmcache/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dmcache/integrations/dmcache_devices.md (renamed from src/go/collectors/go.d.plugin/modules/dmcache/integrations/dmcache_devices.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dmcache/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/dmcache/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dmcache/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/dmcache/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dmcache/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/dmcache/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/dnsdist/README.md (renamed from src/go/collectors/go.d.plugin/modules/dnsdist/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsdist/charts.go (renamed from src/go/collectors/go.d.plugin/modules/dnsdist/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsdist/collect.go (renamed from src/go/collectors/go.d.plugin/modules/dnsdist/collect.go) | 10 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsdist/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/dnsdist/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsdist/dnsdist.go (renamed from src/go/collectors/go.d.plugin/modules/dnsdist/dnsdist.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsdist/dnsdist_test.go (renamed from src/go/collectors/go.d.plugin/modules/dnsdist/dnsdist_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsdist/init.go (renamed from src/go/collectors/go.d.plugin/modules/dnsdist/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsdist/integrations/dnsdist.md (renamed from src/go/collectors/go.d.plugin/modules/dnsdist/integrations/dnsdist.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsdist/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/dnsdist/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsdist/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/dnsdist/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsdist/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/dnsdist/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsdist/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/dnsdist/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsdist/testdata/v1.5.1/jsonstat.json (renamed from src/go/collectors/go.d.plugin/modules/dnsdist/testdata/v1.5.1/jsonstat.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/dnsmasq/README.md (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq/charts.go (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq/collect.go | 139 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq/dnsmasq.go (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq/dnsmasq.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq/dnsmasq_test.go (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq/dnsmasq_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq/init.go (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq/integrations/dnsmasq.md (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq/integrations/dnsmasq.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/dnsmasq_dhcp/README.md (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/charts.go (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/collect.go (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/dhcp.go (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/dhcp.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/dhcp_test.go (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/dhcp_test.go) | 62 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/init.go (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/init.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/integrations/dnsmasq_dhcp.md (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/integrations/dnsmasq_dhcp.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/parse_configuration.go (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/parse_configuration.go) | 31 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.conf (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d/.dnsmasq.conf (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d/.dnsmasq.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d/dnsmasqv4.any (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d/dnsmasqv4.any) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d/dnsmasqv6.any (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d/dnsmasqv6.any) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/dnsmasqv4.any (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/dnsmasqv4.any) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/dnsmasqv6.any (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/dnsmasqv6.any) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/~dnsmasq.conf (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/~dnsmasq.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasq.bak (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasq.bak) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasqv4.any (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasqv4.any) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasqv6.any (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasqv6.any) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasq.other (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasq.other) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasqv4.conf (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasqv4.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasqv6.conf (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasqv6.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.leases (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.leases) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq2.conf (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq2.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq3.conf (renamed from src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq3.conf) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/dnsquery/README.md (renamed from src/go/collectors/go.d.plugin/modules/dnsquery/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsquery/charts.go (renamed from src/go/collectors/go.d.plugin/modules/dnsquery/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsquery/collect.go (renamed from src/go/collectors/go.d.plugin/modules/dnsquery/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsquery/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/dnsquery/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsquery/dnsquery.go (renamed from src/go/collectors/go.d.plugin/modules/dnsquery/dnsquery.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsquery/dnsquery_test.go (renamed from src/go/collectors/go.d.plugin/modules/dnsquery/dnsquery_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsquery/init.go (renamed from src/go/collectors/go.d.plugin/modules/dnsquery/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsquery/integrations/dns_query.md (renamed from src/go/collectors/go.d.plugin/modules/dnsquery/integrations/dns_query.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsquery/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/dnsquery/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsquery/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/dnsquery/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dnsquery/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/dnsquery/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/docker/README.md (renamed from src/go/collectors/go.d.plugin/modules/docker/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker/charts.go (renamed from src/go/collectors/go.d.plugin/modules/docker/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker/collect.go (renamed from src/go/collectors/go.d.plugin/modules/docker/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/docker/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker/docker.go (renamed from src/go/collectors/go.d.plugin/modules/docker/docker.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker/docker_test.go (renamed from src/go/collectors/go.d.plugin/modules/docker/docker_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker/integrations/docker.md (renamed from src/go/collectors/go.d.plugin/modules/docker/integrations/docker.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/docker/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/docker/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/docker/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/docker_engine/README.md (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/charts.go (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/collect.go (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/collect.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/docker_engine.go (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/docker_engine.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/docker_engine_test.go (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/docker_engine_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/init.go (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/integrations/docker_engine.md (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/integrations/docker_engine.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/testdata/non-docker-engine.txt (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/testdata/non-docker-engine.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/testdata/v17.05.0-ce.txt (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/testdata/v17.05.0-ce.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/testdata/v18.09.3-ce-swarm.txt (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/testdata/v18.09.3-ce-swarm.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/docker_engine/testdata/v18.09.3-ce.txt (renamed from src/go/collectors/go.d.plugin/modules/docker_engine/testdata/v18.09.3-ce.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/dockerhub/README.md (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/apiclient.go (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/apiclient.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/charts.go (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/collect.go (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/dockerhub.go (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/dockerhub.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/dockerhub_test.go (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/dockerhub_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/init.go (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/integrations/docker_hub_repository.md (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/integrations/docker_hub_repository.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/testdata/repo1.txt (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/testdata/repo1.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/testdata/repo2.txt (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/testdata/repo2.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dockerhub/testdata/repo3.txt (renamed from src/go/collectors/go.d.plugin/modules/dockerhub/testdata/repo3.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/dovecot/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dovecot/charts.go | 185 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dovecot/client.go | 54 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dovecot/collect.go | 89 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dovecot/config_schema.json | 47 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dovecot/dovecot.go | 101 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dovecot/dovecot_test.go | 281 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dovecot/integrations/dovecot.md | 244 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dovecot/metadata.yaml | 194 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dovecot/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/hddtemp/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dovecot/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/hddtemp/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/dovecot/testdata/export_global.txt | 2 | ||||
l--------- | src/go/plugin/go.d/modules/elasticsearch/README.md (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/charts.go (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/collect.go (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/collect.go) | 21 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/elasticsearch.go (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/elasticsearch.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/elasticsearch_test.go (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/elasticsearch_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/init.go (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/integrations/elasticsearch.md (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/integrations/elasticsearch.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/integrations/opensearch.md (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/integrations/opensearch.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/cat_indices_stats.json (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/cat_indices_stats.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/cluster_health.json (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/cluster_health.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/cluster_stats.json (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/cluster_stats.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/info.json (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/info.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/nodes_local_stats.json (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/nodes_local_stats.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/nodes_stats.json (renamed from src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/nodes_stats.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/envoy/README.md (renamed from src/go/collectors/go.d.plugin/modules/envoy/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/envoy/charts.go (renamed from src/go/collectors/go.d.plugin/modules/envoy/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/envoy/collect.go (renamed from src/go/collectors/go.d.plugin/modules/envoy/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/envoy/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/envoy/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/envoy/envoy.go (renamed from src/go/collectors/go.d.plugin/modules/envoy/envoy.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/envoy/envoy_test.go (renamed from src/go/collectors/go.d.plugin/modules/envoy/envoy_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/envoy/init.go (renamed from src/go/collectors/go.d.plugin/modules/envoy/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/envoy/integrations/envoy.md (renamed from src/go/collectors/go.d.plugin/modules/envoy/integrations/envoy.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/envoy/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/envoy/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/envoy/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/envoy/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/envoy/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/envoy/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/envoy/testdata/consul-dataplane.txt (renamed from src/go/collectors/go.d.plugin/modules/envoy/testdata/consul-dataplane.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/envoy/testdata/envoy.txt (renamed from src/go/collectors/go.d.plugin/modules/envoy/testdata/envoy.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/example/README.md (renamed from src/go/collectors/go.d.plugin/modules/example/README.md) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/example/charts.go (renamed from src/go/collectors/go.d.plugin/modules/example/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/example/collect.go (renamed from src/go/collectors/go.d.plugin/modules/example/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/example/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/example/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/example/example.go (renamed from src/go/collectors/go.d.plugin/modules/example/example.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/example/example_test.go (renamed from src/go/collectors/go.d.plugin/modules/example/example_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/example/init.go (renamed from src/go/collectors/go.d.plugin/modules/example/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/example/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/example/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/example/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/example/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/exim/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/exim/charts.go | 27 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/exim/collect.go | 43 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/exim/config_schema.json | 35 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/exim/exec.go | 47 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/exim/exim.go | 97 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/exim/exim_test.go | 217 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/exim/init.go | 23 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/exim/integrations/exim.md | 191 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/exim/metadata.yaml | 100 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/exim/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/exim/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/fail2ban/README.md (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fail2ban/charts.go (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fail2ban/collect.go (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fail2ban/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fail2ban/exec.go (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/exec.go) | 34 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fail2ban/fail2ban.go (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/fail2ban.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fail2ban/fail2ban_test.go (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/fail2ban_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fail2ban/init.go (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fail2ban/integrations/fail2ban.md (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/integrations/fail2ban.md) | 51 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fail2ban/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/metadata.yaml) | 11 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fail2ban/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/hpssa/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fail2ban/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/hpssa/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fail2ban/testdata/fail2ban-jail-status.txt (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/testdata/fail2ban-jail-status.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fail2ban/testdata/fail2ban-status.txt (renamed from src/go/collectors/go.d.plugin/modules/fail2ban/testdata/fail2ban-status.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/filecheck/README.md (renamed from src/go/collectors/go.d.plugin/modules/filecheck/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/cache.go (renamed from src/go/collectors/go.d.plugin/modules/filecheck/cache.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/charts.go (renamed from src/go/collectors/go.d.plugin/modules/filecheck/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/collect.go (renamed from src/go/collectors/go.d.plugin/modules/filecheck/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/collect_dirs.go (renamed from src/go/collectors/go.d.plugin/modules/filecheck/collect_dirs.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/collect_files.go (renamed from src/go/collectors/go.d.plugin/modules/filecheck/collect_files.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/filecheck/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/discover.go (renamed from src/go/collectors/go.d.plugin/modules/filecheck/discover.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/filecheck.go (renamed from src/go/collectors/go.d.plugin/modules/filecheck/filecheck.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/filecheck_test.go (renamed from src/go/collectors/go.d.plugin/modules/filecheck/filecheck_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/init.go (renamed from src/go/collectors/go.d.plugin/modules/filecheck/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/integrations/files_and_directories.md (renamed from src/go/collectors/go.d.plugin/modules/filecheck/integrations/files_and_directories.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/filecheck/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/filecheck/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/filecheck/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/testdata/dir/empty_file.log (renamed from src/go/collectors/go.d.plugin/modules/filecheck/testdata/dir/empty_file.log) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/testdata/dir/file.log (renamed from src/go/collectors/go.d.plugin/modules/filecheck/testdata/dir/file.log) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/testdata/dir/subdir/empty_file.log (renamed from src/go/collectors/go.d.plugin/modules/filecheck/testdata/dir/subdir/empty_file.log) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/testdata/empty_file.log (renamed from src/go/collectors/go.d.plugin/modules/filecheck/testdata/empty_file.log) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/filecheck/testdata/file.log (renamed from src/go/collectors/go.d.plugin/modules/filecheck/testdata/file.log) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/fluentd/README.md (renamed from src/go/collectors/go.d.plugin/modules/fluentd/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fluentd/apiclient.go (renamed from src/go/collectors/go.d.plugin/modules/fluentd/apiclient.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fluentd/charts.go (renamed from src/go/collectors/go.d.plugin/modules/fluentd/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fluentd/collect.go (renamed from src/go/collectors/go.d.plugin/modules/fluentd/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fluentd/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/fluentd/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fluentd/fluentd.go (renamed from src/go/collectors/go.d.plugin/modules/fluentd/fluentd.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fluentd/fluentd_test.go (renamed from src/go/collectors/go.d.plugin/modules/fluentd/fluentd_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fluentd/init.go (renamed from src/go/collectors/go.d.plugin/modules/fluentd/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fluentd/integrations/fluentd.md (renamed from src/go/collectors/go.d.plugin/modules/fluentd/integrations/fluentd.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fluentd/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/fluentd/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fluentd/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/fluentd/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fluentd/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/fluentd/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/fluentd/testdata/plugins.json (renamed from src/go/collectors/go.d.plugin/modules/fluentd/testdata/plugins.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/freeradius/README.md (renamed from src/go/collectors/go.d.plugin/modules/freeradius/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/freeradius/api/client.go (renamed from src/go/collectors/go.d.plugin/modules/freeradius/api/client.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/freeradius/api/client_test.go (renamed from src/go/collectors/go.d.plugin/modules/freeradius/api/client_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/freeradius/api/dictionary.go (renamed from src/go/collectors/go.d.plugin/modules/freeradius/api/dictionary.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/freeradius/charts.go (renamed from src/go/collectors/go.d.plugin/modules/freeradius/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/freeradius/collect.go (renamed from src/go/collectors/go.d.plugin/modules/freeradius/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/freeradius/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/freeradius/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/freeradius/freeradius.go (renamed from src/go/collectors/go.d.plugin/modules/freeradius/freeradius.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/freeradius/freeradius_test.go (renamed from src/go/collectors/go.d.plugin/modules/freeradius/freeradius_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/freeradius/init.go (renamed from src/go/collectors/go.d.plugin/modules/freeradius/init.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/freeradius/integrations/freeradius.md (renamed from src/go/collectors/go.d.plugin/modules/freeradius/integrations/freeradius.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/freeradius/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/freeradius/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/freeradius/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/freeradius/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/freeradius/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/freeradius/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/gearman/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/gearman/charts.go | 158 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/gearman/client.go | 80 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/gearman/collect.go | 221 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/gearman/config_schema.json | 44 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/gearman/gearman.go | 106 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/gearman/gearman_test.go | 326 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/gearman/integrations/gearman.md | 235 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/gearman/metadata.yaml | 152 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/gearman/testdata/config.json | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/gearman/testdata/config.yaml | 3 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/gearman/testdata/priority-status.txt | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/gearman/testdata/status.txt | 5 | ||||
l--------- | src/go/plugin/go.d/modules/geth/README.md (renamed from src/go/collectors/go.d.plugin/modules/geth/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/geth/charts.go (renamed from src/go/collectors/go.d.plugin/modules/geth/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/geth/collect.go (renamed from src/go/collectors/go.d.plugin/modules/geth/collect.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/geth/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/geth/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/geth/geth.go (renamed from src/go/collectors/go.d.plugin/modules/geth/geth.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/geth/geth_test.go (renamed from src/go/collectors/go.d.plugin/modules/geth/geth_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/geth/init.go (renamed from src/go/collectors/go.d.plugin/modules/geth/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/geth/integrations/go-ethereum.md (renamed from src/go/collectors/go.d.plugin/modules/geth/integrations/go-ethereum.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/geth/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/geth/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/geth/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/geth/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/geth/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/geth/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/geth/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/geth/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/geth/testdata/metrics_geth.txt (renamed from src/go/collectors/go.d.plugin/modules/geth/testdata/metrics_geth.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/haproxy/README.md (renamed from src/go/collectors/go.d.plugin/modules/haproxy/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/haproxy/charts.go (renamed from src/go/collectors/go.d.plugin/modules/haproxy/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/haproxy/collect.go (renamed from src/go/collectors/go.d.plugin/modules/haproxy/collect.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/haproxy/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/haproxy/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/haproxy/haproxy.go (renamed from src/go/collectors/go.d.plugin/modules/haproxy/haproxy.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/haproxy/haproxy_test.go (renamed from src/go/collectors/go.d.plugin/modules/haproxy/haproxy_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/haproxy/init.go (renamed from src/go/collectors/go.d.plugin/modules/haproxy/init.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/haproxy/integrations/haproxy.md (renamed from src/go/collectors/go.d.plugin/modules/haproxy/integrations/haproxy.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/haproxy/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/haproxy/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/haproxy/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/haproxy/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/haproxy/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/haproxy/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/haproxy/testdata/v2.3.10/metrics.txt (renamed from src/go/collectors/go.d.plugin/modules/haproxy/testdata/v2.3.10/metrics.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/hddtemp/README.md (renamed from src/go/collectors/go.d.plugin/modules/hddtemp/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hddtemp/charts.go (renamed from src/go/collectors/go.d.plugin/modules/hddtemp/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hddtemp/client.go (renamed from src/go/collectors/go.d.plugin/modules/hddtemp/client.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hddtemp/collect.go (renamed from src/go/collectors/go.d.plugin/modules/hddtemp/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hddtemp/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/hddtemp/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hddtemp/hddtemp.go (renamed from src/go/collectors/go.d.plugin/modules/hddtemp/hddtemp.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hddtemp/hddtemp_test.go (renamed from src/go/collectors/go.d.plugin/modules/hddtemp/hddtemp_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hddtemp/integrations/hdd_temperature.md (renamed from src/go/collectors/go.d.plugin/modules/hddtemp/integrations/hdd_temperature.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hddtemp/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/hddtemp/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hddtemp/testdata/config.json | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hddtemp/testdata/config.yaml | 3 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hddtemp/testdata/hddtemp-all-ok.txt (renamed from src/go/collectors/go.d.plugin/modules/hddtemp/testdata/hddtemp-all-ok.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hddtemp/testdata/hddtemp-all-sleep.txt (renamed from src/go/collectors/go.d.plugin/modules/hddtemp/testdata/hddtemp-all-sleep.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/hdfs/README.md (renamed from src/go/collectors/go.d.plugin/modules/hdfs/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/charts.go (renamed from src/go/collectors/go.d.plugin/modules/hdfs/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/client.go (renamed from src/go/collectors/go.d.plugin/modules/hdfs/client.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/collect.go (renamed from src/go/collectors/go.d.plugin/modules/hdfs/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/hdfs/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/hdfs.go (renamed from src/go/collectors/go.d.plugin/modules/hdfs/hdfs.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/hdfs_test.go (renamed from src/go/collectors/go.d.plugin/modules/hdfs/hdfs_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/init.go (renamed from src/go/collectors/go.d.plugin/modules/hdfs/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/integrations/hadoop_distributed_file_system_hdfs.md (renamed from src/go/collectors/go.d.plugin/modules/hdfs/integrations/hadoop_distributed_file_system_hdfs.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/hdfs/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/hdfs/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/raw_data.go (renamed from src/go/collectors/go.d.plugin/modules/hdfs/raw_data.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/hdfs/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/hdfs/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/testdata/datanode.json (renamed from src/go/collectors/go.d.plugin/modules/hdfs/testdata/datanode.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/testdata/namenode.json (renamed from src/go/collectors/go.d.plugin/modules/hdfs/testdata/namenode.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hdfs/testdata/unknownnode.json (renamed from src/go/collectors/go.d.plugin/modules/hdfs/testdata/unknownnode.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/hpssa/README.md (renamed from src/go/collectors/go.d.plugin/modules/hpssa/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/charts.go (renamed from src/go/collectors/go.d.plugin/modules/hpssa/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/collect.go (renamed from src/go/collectors/go.d.plugin/modules/hpssa/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/hpssa/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/exec.go (renamed from src/go/collectors/go.d.plugin/modules/hpssa/exec.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/hpssa.go (renamed from src/go/collectors/go.d.plugin/modules/hpssa/hpssa.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/hpssa_test.go (renamed from src/go/collectors/go.d.plugin/modules/hpssa/hpssa_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/init.go (renamed from src/go/collectors/go.d.plugin/modules/hpssa/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/integrations/hpe_smart_arrays.md (renamed from src/go/collectors/go.d.plugin/modules/hpssa/integrations/hpe_smart_arrays.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/hpssa/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/parse.go (renamed from src/go/collectors/go.d.plugin/modules/hpssa/parse.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/logind/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/logind/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/testdata/ssacli-P212_P410i.txt (renamed from src/go/collectors/go.d.plugin/modules/hpssa/testdata/ssacli-P212_P410i.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/testdata/ssacli-P400ar.txt (renamed from src/go/collectors/go.d.plugin/modules/hpssa/testdata/ssacli-P400ar.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/hpssa/testdata/ssacli-P400i-unassigned.txt (renamed from src/go/collectors/go.d.plugin/modules/hpssa/testdata/ssacli-P400i-unassigned.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/httpcheck/README.md (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/httpcheck/charts.go (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/httpcheck/collect.go (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/collect.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/httpcheck/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/config_schema.json) | 14 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/httpcheck/cookiejar.go (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/cookiejar.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/httpcheck/httpcheck.go (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/httpcheck.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/httpcheck/httpcheck_test.go (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/httpcheck_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/httpcheck/init.go (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/init.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/httpcheck/integrations/http_endpoints.md (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/integrations/http_endpoints.md) | 57 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/httpcheck/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/metadata.yaml) | 18 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/httpcheck/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/httpcheck/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/httpcheck/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/httpcheck/testdata/cookie.txt (renamed from src/go/collectors/go.d.plugin/modules/httpcheck/testdata/cookie.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/icecast/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/icecast/charts.go | 65 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/icecast/collect.go | 107 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/icecast/config_schema.json | 177 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/icecast/icecast.go | 118 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/icecast/icecast_test.go | 285 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/icecast/integrations/icecast.md | 226 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/icecast/metadata.yaml | 169 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/icecast/server_stats.go | 45 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/icecast/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/icecast/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/icecast/testdata/stats_multi_source.json | 46 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/icecast/testdata/stats_no_sources.json | 11 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/icecast/testdata/stats_single_source.json | 27 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/init.go | 116 | ||||
l--------- | src/go/plugin/go.d/modules/intelgpu/README.md (renamed from src/go/collectors/go.d.plugin/modules/intelgpu/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/intelgpu/charts.go (renamed from src/go/collectors/go.d.plugin/modules/intelgpu/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/intelgpu/collect.go (renamed from src/go/collectors/go.d.plugin/modules/intelgpu/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/intelgpu/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/intelgpu/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/intelgpu/exec.go (renamed from src/go/collectors/go.d.plugin/modules/intelgpu/exec.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/intelgpu/init.go (renamed from src/go/collectors/go.d.plugin/modules/intelgpu/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/intelgpu/integrations/intel_gpu.md (renamed from src/go/collectors/go.d.plugin/modules/intelgpu/integrations/intel_gpu.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/intelgpu/intelgpu.go (renamed from src/go/collectors/go.d.plugin/modules/intelgpu/intelgpu.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/intelgpu/intelgpu_test.go (renamed from src/go/collectors/go.d.plugin/modules/intelgpu/intelgpu_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/intelgpu/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/intelgpu/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/intelgpu/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/intelgpu/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/intelgpu/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/intelgpu/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/intelgpu/testdata/igt.json (renamed from src/go/collectors/go.d.plugin/modules/intelgpu/testdata/igt.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/ipfs/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ipfs/charts.go | 105 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ipfs/collect.go | 209 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ipfs/config_schema.json | 195 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ipfs/integrations/ipfs.md | 246 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ipfs/ipfs.go | 128 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ipfs/ipfs_test.go | 278 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ipfs/metadata.yaml | 224 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ipfs/testdata/api_v0_pin_ls.json | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ipfs/testdata/api_v0_stats_bw.json | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ipfs/testdata/api_v0_stats_repo.json | 7 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ipfs/testdata/api_v0_swarm_peers.json | 70 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ipfs/testdata/config.json | 22 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ipfs/testdata/config.yaml | 19 | ||||
l--------- | src/go/plugin/go.d/modules/isc_dhcpd/README.md (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/charts.go (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/collect.go (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/config_schema.json) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/init.go (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/integrations/isc_dhcp.md (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/integrations/isc_dhcp.md) | 41 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/isc_dhcpd.go (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/isc_dhcpd.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/isc_dhcpd_test.go (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/isc_dhcpd_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/metadata.yaml) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/parse.go (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/parse.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_empty (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_empty) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4 (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4_backup (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4_backup) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4_inactive (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4_inactive) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_ipv6 (renamed from src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_ipv6) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/k8s_kubelet/README.md (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubelet/charts.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubelet/collect.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/collect.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubelet/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubelet/init.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubelet/integrations/kubelet.md (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/integrations/kubelet.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubelet/kubelet.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/kubelet.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubelet/kubelet_test.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/kubelet_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubelet/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubelet/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/metrics.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubelet/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubelet/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubelet/testdata/metrics.txt (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/testdata/metrics.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubelet/testdata/token.txt (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubelet/testdata/token.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/k8s_kubeproxy/README.md (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubeproxy/charts.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubeproxy/collect.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/collect.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubeproxy/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubeproxy/init.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubeproxy/integrations/kubeproxy.md (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/integrations/kubeproxy.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubeproxy/kubeproxy.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/kubeproxy.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubeproxy/kubeproxy_test.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/kubeproxy_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubeproxy/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubeproxy/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/metrics.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubeproxy/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubeproxy/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_kubeproxy/testdata/metrics.txt (renamed from src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/testdata/metrics.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/k8s_state/README.md (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/charts.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/client.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/client.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/cluster_meta.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/cluster_meta.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/collect.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/collect.go) | 9 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/discover_kubernetes.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/discover_kubernetes.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/discover_node.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/discover_node.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/discover_pod.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/discover_pod.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/init.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/init.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/integrations/kubernetes_cluster_state.md (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/integrations/kubernetes_cluster_state.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/kube_state.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/kube_state.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/kube_state_test.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/kube_state_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/resource.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/resource.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/state.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/state.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/update_node_state.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/update_node_state.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/update_pod_state.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/update_pod_state.go) | 7 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/k8s_state/update_state.go (renamed from src/go/collectors/go.d.plugin/modules/k8s_state/update_state.go) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/lighttpd/README.md (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/apiclient.go (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/apiclient.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/charts.go (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/collect.go (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/init.go (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/integrations/lighttpd.md (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/integrations/lighttpd.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/lighttpd.go (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/lighttpd.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/lighttpd_test.go (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/lighttpd_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/testdata/apache-status.txt (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/testdata/apache-status.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/logstash/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/logstash/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lighttpd/testdata/status.txt (renamed from src/go/collectors/go.d.plugin/modules/lighttpd/testdata/status.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/litespeed/README.md (renamed from src/go/collectors/go.d.plugin/modules/litespeed/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/litespeed/charts.go (renamed from src/go/collectors/go.d.plugin/modules/litespeed/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/litespeed/collect.go (renamed from src/go/collectors/go.d.plugin/modules/litespeed/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/litespeed/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/litespeed/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/litespeed/integrations/litespeed.md (renamed from src/go/collectors/go.d.plugin/modules/litespeed/integrations/litespeed.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/litespeed/litespeed.go (renamed from src/go/collectors/go.d.plugin/modules/litespeed/litespeed.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/litespeed/litespeed_test.go (renamed from src/go/collectors/go.d.plugin/modules/litespeed/litespeed_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/litespeed/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/litespeed/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/litespeed/testdata/.rtreport (renamed from src/go/collectors/go.d.plugin/modules/litespeed/testdata/.rtreport) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/litespeed/testdata/.rtreport.2 (renamed from src/go/collectors/go.d.plugin/modules/litespeed/testdata/.rtreport.2) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/litespeed/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/litespeed/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/litespeed/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/litespeed/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/logind/README.md (renamed from src/go/collectors/go.d.plugin/modules/logind/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logind/charts.go (renamed from src/go/collectors/go.d.plugin/modules/logind/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logind/collect.go (renamed from src/go/collectors/go.d.plugin/modules/logind/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logind/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/logind/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logind/connection.go (renamed from src/go/collectors/go.d.plugin/modules/logind/connection.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logind/doc.go (renamed from src/go/collectors/go.d.plugin/modules/logind/doc.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logind/integrations/systemd-logind_users.md (renamed from src/go/collectors/go.d.plugin/modules/logind/integrations/systemd-logind_users.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logind/logind.go (renamed from src/go/collectors/go.d.plugin/modules/logind/logind.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logind/logind_test.go (renamed from src/go/collectors/go.d.plugin/modules/logind/logind_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logind/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/logind/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logind/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/lvm/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logind/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/lvm/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/logstash/README.md (renamed from src/go/collectors/go.d.plugin/modules/logstash/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logstash/charts.go (renamed from src/go/collectors/go.d.plugin/modules/logstash/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logstash/collect.go (renamed from src/go/collectors/go.d.plugin/modules/logstash/collect.go) | 10 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logstash/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/logstash/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logstash/integrations/logstash.md (renamed from src/go/collectors/go.d.plugin/modules/logstash/integrations/logstash.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logstash/logstash.go (renamed from src/go/collectors/go.d.plugin/modules/logstash/logstash.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logstash/logstash_test.go (renamed from src/go/collectors/go.d.plugin/modules/logstash/logstash_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logstash/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/logstash/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logstash/node_stats.go (renamed from src/go/collectors/go.d.plugin/modules/logstash/node_stats.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logstash/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/nginx/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logstash/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/nginx/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/logstash/testdata/stats.json (renamed from src/go/collectors/go.d.plugin/modules/logstash/testdata/stats.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/lvm/README.md (renamed from src/go/collectors/go.d.plugin/modules/lvm/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lvm/charts.go (renamed from src/go/collectors/go.d.plugin/modules/lvm/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lvm/collect.go (renamed from src/go/collectors/go.d.plugin/modules/lvm/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lvm/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/lvm/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lvm/exec.go (renamed from src/go/collectors/go.d.plugin/modules/lvm/exec.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lvm/init.go (renamed from src/go/collectors/go.d.plugin/modules/lvm/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lvm/integrations/lvm_logical_volumes.md (renamed from src/go/collectors/go.d.plugin/modules/lvm/integrations/lvm_logical_volumes.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lvm/lvm.go (renamed from src/go/collectors/go.d.plugin/modules/lvm/lvm.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lvm/lvm_test.go (renamed from src/go/collectors/go.d.plugin/modules/lvm/lvm_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lvm/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/lvm/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lvm/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/megacli/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lvm/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/megacli/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lvm/testdata/lvs-report-no-thin.json (renamed from src/go/collectors/go.d.plugin/modules/lvm/testdata/lvs-report-no-thin.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/lvm/testdata/lvs-report.json (renamed from src/go/collectors/go.d.plugin/modules/lvm/testdata/lvs-report.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/megacli/README.md (renamed from src/go/collectors/go.d.plugin/modules/megacli/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/charts.go (renamed from src/go/collectors/go.d.plugin/modules/megacli/charts.go) | 20 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/collect.go (renamed from src/go/collectors/go.d.plugin/modules/megacli/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/collect_bbu.go (renamed from src/go/collectors/go.d.plugin/modules/megacli/collect_bbu.go) | 58 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/collect_phys_drives.go (renamed from src/go/collectors/go.d.plugin/modules/megacli/collect_phys_drives.go) | 9 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/megacli/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/exec.go (renamed from src/go/collectors/go.d.plugin/modules/megacli/exec.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/init.go (renamed from src/go/collectors/go.d.plugin/modules/megacli/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/integrations/megacli_megaraid.md (renamed from src/go/collectors/go.d.plugin/modules/megacli/integrations/megacli_megaraid.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/megacli.go (renamed from src/go/collectors/go.d.plugin/modules/megacli/megacli.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/megacli_test.go (renamed from src/go/collectors/go.d.plugin/modules/megacli/megacli_test.go) | 7 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/megacli/metadata.yaml) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/nvme/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/nvme/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/testdata/mega-bbu-info-old.txt (renamed from src/go/collectors/go.d.plugin/modules/megacli/testdata/mega-bbu-info-old.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/testdata/mega-bbu-info-recent.txt (renamed from src/go/collectors/go.d.plugin/modules/megacli/testdata/mega-bbu-info-recent.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/megacli/testdata/mega-phys-drives-info.txt (renamed from src/go/collectors/go.d.plugin/modules/megacli/testdata/mega-phys-drives-info.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/memcached/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/charts.go | 229 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/client.go | 45 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/collect.go | 121 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/config_schema.json | 44 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/integrations/memcached.md | 231 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/memcached.go | 108 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/memcached_test.go | 296 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/metadata.yaml | 217 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/testdata/config.json | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/testdata/config.yaml | 3 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/memcached/testdata/stats.txt | 93 | ||||
l--------- | src/go/plugin/go.d/modules/mongodb/README.md (renamed from src/go/collectors/go.d.plugin/modules/mongodb/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/charts.go (renamed from src/go/collectors/go.d.plugin/modules/mongodb/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/client.go (renamed from src/go/collectors/go.d.plugin/modules/mongodb/client.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/collect.go (renamed from src/go/collectors/go.d.plugin/modules/mongodb/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/collect_dbstats.go (renamed from src/go/collectors/go.d.plugin/modules/mongodb/collect_dbstats.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/collect_replsetgetstatus.go (renamed from src/go/collectors/go.d.plugin/modules/mongodb/collect_replsetgetstatus.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/collect_serverstatus.go (renamed from src/go/collectors/go.d.plugin/modules/mongodb/collect_serverstatus.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/collect_sharding.go (renamed from src/go/collectors/go.d.plugin/modules/mongodb/collect_sharding.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/mongodb/config_schema.json) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/documents.go (renamed from src/go/collectors/go.d.plugin/modules/mongodb/documents.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/init.go (renamed from src/go/collectors/go.d.plugin/modules/mongodb/init.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/integrations/mongodb.md (renamed from src/go/collectors/go.d.plugin/modules/mongodb/integrations/mongodb.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/mongodb/metadata.yaml) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/mongodb.go (renamed from src/go/collectors/go.d.plugin/modules/mongodb/mongodb.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/mongodb_test.go (renamed from src/go/collectors/go.d.plugin/modules/mongodb/mongodb_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/mongodb/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/mongodb/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/testdata/v6.0.3/dbStats.json (renamed from src/go/collectors/go.d.plugin/modules/mongodb/testdata/v6.0.3/dbStats.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/testdata/v6.0.3/mongod-serverStatus.json (renamed from src/go/collectors/go.d.plugin/modules/mongodb/testdata/v6.0.3/mongod-serverStatus.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/testdata/v6.0.3/mongos-serverStatus.json (renamed from src/go/collectors/go.d.plugin/modules/mongodb/testdata/v6.0.3/mongos-serverStatus.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mongodb/testdata/v6.0.3/replSetGetStatus.json (renamed from src/go/collectors/go.d.plugin/modules/mongodb/testdata/v6.0.3/replSetGetStatus.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/monit/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/monit/charts.go | 91 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/monit/collect.go | 117 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/monit/config_schema.json | 185 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/monit/integrations/monit.md | 255 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/monit/metadata.yaml | 193 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/monit/monit.go | 117 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/monit/monit_test.go | 371 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/monit/status.go | 153 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/monit/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/monit/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/monit/testdata/v5.33.0/status.xml | 688 | ||||
l--------- | src/go/plugin/go.d/modules/mysql/README.md (renamed from src/go/collectors/go.d.plugin/modules/mysql/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/charts.go (renamed from src/go/collectors/go.d.plugin/modules/mysql/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/collect.go (renamed from src/go/collectors/go.d.plugin/modules/mysql/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/collect_global_status.go (renamed from src/go/collectors/go.d.plugin/modules/mysql/collect_global_status.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/collect_global_vars.go (renamed from src/go/collectors/go.d.plugin/modules/mysql/collect_global_vars.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/collect_process_list.go (renamed from src/go/collectors/go.d.plugin/modules/mysql/collect_process_list.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/collect_slave_status.go (renamed from src/go/collectors/go.d.plugin/modules/mysql/collect_slave_status.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/collect_user_statistics.go (renamed from src/go/collectors/go.d.plugin/modules/mysql/collect_user_statistics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/collect_version.go (renamed from src/go/collectors/go.d.plugin/modules/mysql/collect_version.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/mysql/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/disable_logging.go (renamed from src/go/collectors/go.d.plugin/modules/mysql/disable_logging.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/integrations/mariadb.md (renamed from src/go/collectors/go.d.plugin/modules/mysql/integrations/mariadb.md) | 45 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/integrations/mysql.md (renamed from src/go/collectors/go.d.plugin/modules/mysql/integrations/mysql.md) | 45 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/integrations/percona_mysql.md (renamed from src/go/collectors/go.d.plugin/modules/mysql/integrations/percona_mysql.md) | 45 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/mysql/metadata.yaml) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/mycnf.go (renamed from src/go/collectors/go.d.plugin/modules/mysql/mycnf.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/mycnf_test.go (renamed from src/go/collectors/go.d.plugin/modules/mysql/mycnf_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/mysql.go (renamed from src/go/collectors/go.d.plugin/modules/mysql/mysql.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/mysql_test.go (renamed from src/go/collectors/go.d.plugin/modules/mysql/mysql_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/global_status.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/global_status.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/global_variables.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/global_variables.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/process_list.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/process_list.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/user_statistics.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/user_statistics.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/version.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/version.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/all_slaves_status_multi_source.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/all_slaves_status_multi_source.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/all_slaves_status_single_source.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/all_slaves_status_single_source.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/global_status.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/global_status.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/global_variables.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/global_variables.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/process_list.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/process_list.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/user_statistics.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/user_statistics.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/version.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/version.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v5.5.64/global_status.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v5.5.64/global_status.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v5.5.64/global_variables.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v5.5.64/global_variables.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v5.5.64/process_list.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v5.5.64/process_list.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mariadb/v5.5.64/version.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v5.5.64/version.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/global_status.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/global_status.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/global_variables.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/global_variables.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/process_list.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/process_list.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/replica_status_multi_source.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/replica_status_multi_source.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/version.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/version.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/global_status.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/global_status.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/global_variables.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/global_variables.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/process_list.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/process_list.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/user_statistics.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/user_statistics.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/version.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/version.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/mysql/testdata/session_variables.txt (renamed from src/go/collectors/go.d.plugin/modules/mysql/testdata/session_variables.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/nginx/README.md (renamed from src/go/collectors/go.d.plugin/modules/nginx/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginx/apiclient.go (renamed from src/go/collectors/go.d.plugin/modules/nginx/apiclient.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginx/charts.go (renamed from src/go/collectors/go.d.plugin/modules/nginx/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginx/collect.go (renamed from src/go/collectors/go.d.plugin/modules/nginx/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginx/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/nginx/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginx/integrations/nginx.md (renamed from src/go/collectors/go.d.plugin/modules/nginx/integrations/nginx.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginx/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/nginx/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginx/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/nginx/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginx/nginx.go (renamed from src/go/collectors/go.d.plugin/modules/nginx/nginx.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginx/nginx_test.go (renamed from src/go/collectors/go.d.plugin/modules/nginx/nginx_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginx/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/nginxvts/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginx/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/nginxvts/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginx/testdata/status.txt (renamed from src/go/collectors/go.d.plugin/modules/nginx/testdata/status.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginx/testdata/tengine-status.txt (renamed from src/go/collectors/go.d.plugin/modules/nginx/testdata/tengine-status.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/nginxplus/README.md (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/cache.go (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/cache.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/charts.go (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/collect.go (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/integrations/nginx_plus.md (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/integrations/nginx_plus.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/nginx_http_api.go (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/nginx_http_api.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/nginx_http_api_query.go (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/nginx_http_api_query.go) | 47 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/nginxplus.go (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/nginxplus.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/nginxplus_test.go (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/nginxplus_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/404.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/404.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/api_versions.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/api_versions.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/connections.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/connections.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/endpoints_http.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/endpoints_http.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/endpoints_root.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/endpoints_root.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/endpoints_stream.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/endpoints_stream.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_caches.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_caches.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_location_zones.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_location_zones.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_requests.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_requests.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_server_zones.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_server_zones.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_upstreams.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_upstreams.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/nginx.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/nginx.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/resolvers.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/resolvers.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/ssl.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/ssl.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/stream_server_zones.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/stream_server_zones.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/api-8/stream_upstreams.json (renamed from src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/stream_upstreams.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxplus/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/nginxvts/README.md (renamed from src/go/collectors/go.d.plugin/modules/nginxvts/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxvts/charts.go (renamed from src/go/collectors/go.d.plugin/modules/nginxvts/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxvts/collect.go (renamed from src/go/collectors/go.d.plugin/modules/nginxvts/collect.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxvts/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/nginxvts/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxvts/init.go (renamed from src/go/collectors/go.d.plugin/modules/nginxvts/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxvts/integrations/nginx_vts.md (renamed from src/go/collectors/go.d.plugin/modules/nginxvts/integrations/nginx_vts.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxvts/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/nginxvts/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxvts/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/nginxvts/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxvts/nginxvts.go (renamed from src/go/collectors/go.d.plugin/modules/nginxvts/nginxvts.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxvts/nginxvts_test.go (renamed from src/go/collectors/go.d.plugin/modules/nginxvts/nginxvts_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxvts/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/powerdns/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxvts/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/powerdns/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nginxvts/testdata/vts-v0.1.18.json (renamed from src/go/collectors/go.d.plugin/modules/nginxvts/testdata/vts-v0.1.18.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/nsd/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nsd/charts.go | 249 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nsd/collect.go | 81 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nsd/config_schema.json | 35 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nsd/exec.go | 47 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nsd/init.go | 23 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nsd/integrations/nsd.md | 203 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nsd/metadata.yaml | 272 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nsd/nsd.go | 97 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nsd/nsd_test.go | 337 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nsd/stats_counters.go | 123 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nsd/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/storcli/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nsd/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/storcli/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nsd/testdata/stats.txt | 95 | ||||
l--------- | src/go/plugin/go.d/modules/ntpd/README.md (renamed from src/go/collectors/go.d.plugin/modules/ntpd/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ntpd/charts.go (renamed from src/go/collectors/go.d.plugin/modules/ntpd/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ntpd/client.go (renamed from src/go/collectors/go.d.plugin/modules/ntpd/client.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ntpd/collect.go (renamed from src/go/collectors/go.d.plugin/modules/ntpd/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ntpd/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/ntpd/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ntpd/integrations/ntpd.md (renamed from src/go/collectors/go.d.plugin/modules/ntpd/integrations/ntpd.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ntpd/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/ntpd/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ntpd/ntpd.go (renamed from src/go/collectors/go.d.plugin/modules/ntpd/ntpd.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ntpd/ntpd_test.go (renamed from src/go/collectors/go.d.plugin/modules/ntpd/ntpd_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ntpd/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/ntpd/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ntpd/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/ntpd/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/nvidia_smi/README.md (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/charts.go (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/charts.go) | 49 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/collect.go (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/collect_xml.go) | 177 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/config_schema.json | 56 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/exec.go | 213 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/gpu_info.go | 121 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/init.go (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/integrations/nvidia_gpu.md (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/integrations/nvidia_gpu.md) | 107 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/metadata.yaml) | 72 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/nvidia_smi.go | 114 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/nvidia_smi_test.go (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/nvidia_smi_test.go) | 236 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/testdata/a100-sxm4-mig.xml (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/a100-sxm4-mig.xml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/config.json) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/config.yaml) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/testdata/rtx-2080-win.xml (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/rtx-2080-win.xml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/testdata/rtx-3060.xml (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/rtx-3060.xml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/testdata/rtx-4090-driver-535.xml (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/rtx-4090-driver-535.xml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvidia_smi/testdata/tesla-p100.xml (renamed from src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/tesla-p100.xml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/nvme/README.md (renamed from src/go/collectors/go.d.plugin/modules/nvme/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/charts.go (renamed from src/go/collectors/go.d.plugin/modules/nvme/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/collect.go (renamed from src/go/collectors/go.d.plugin/modules/nvme/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/nvme/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/exec.go (renamed from src/go/collectors/go.d.plugin/modules/nvme/exec.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/init.go (renamed from src/go/collectors/go.d.plugin/modules/nvme/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/integrations/nvme_devices.md (renamed from src/go/collectors/go.d.plugin/modules/nvme/integrations/nvme_devices.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/nvme/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/nvme.go (renamed from src/go/collectors/go.d.plugin/modules/nvme/nvme.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/nvme_test.go (renamed from src/go/collectors/go.d.plugin/modules/nvme/nvme_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/testdata/config.json | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/testdata/config.yaml | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/testdata/nvme-list-empty.json (renamed from src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-list-empty.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/testdata/nvme-list.json (renamed from src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-list.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/testdata/nvme-smart-log-float.json (renamed from src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-smart-log-float.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/testdata/nvme-smart-log-string.json (renamed from src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-smart-log-string.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/nvme/testdata/nvme-smart-log.json (renamed from src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-smart-log.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/openvpn/README.md (renamed from src/go/collectors/go.d.plugin/modules/openvpn/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/charts.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/client/client.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn/client/client.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/client/client_test.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn/client/client_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/client/commands.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn/client/commands.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/client/testdata/load-stats.txt (renamed from src/go/collectors/go.d.plugin/modules/openvpn/client/testdata/load-stats.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/client/testdata/status3.txt (renamed from src/go/collectors/go.d.plugin/modules/openvpn/client/testdata/status3.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/client/testdata/version.txt (renamed from src/go/collectors/go.d.plugin/modules/openvpn/client/testdata/version.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/client/types.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn/client/types.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/collect.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/openvpn/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/init.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn/init.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/integrations/openvpn.md (renamed from src/go/collectors/go.d.plugin/modules/openvpn/integrations/openvpn.md) | 41 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/openvpn/metadata.yaml) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/openvpn.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn/openvpn.go) | 10 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/openvpn_test.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn/openvpn_test.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/openvpn/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/openvpn/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/openvpn_status_log/README.md (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/charts.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/collect.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/config_schema.json) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/init.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/integrations/openvpn_status_log.md (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/integrations/openvpn_status_log.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/metadata.yaml) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/openvpn.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/openvpn.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/openvpn_test.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/openvpn_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/parser.go (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/parser.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/testdata/empty.txt (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/empty.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/static-key.txt (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/static-key.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version1-no-clients.txt (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version1-no-clients.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version1.txt (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version1.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version2-no-clients.txt (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version2-no-clients.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version2.txt (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version2.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version3-no-clients.txt (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version3-no-clients.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version3.txt (renamed from src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version3.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/pgbouncer/README.md (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/charts.go (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/collect.go (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/init.go (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/init.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/integrations/pgbouncer.md (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/integrations/pgbouncer.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/pgbouncer.go (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/pgbouncer.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/pgbouncer_test.go (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/pgbouncer_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/config.txt (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/config.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/databases.txt (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/databases.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/pools.txt (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/pools.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/stats.txt (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/stats.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/version.txt (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/version.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pgbouncer/testdata/v1.7.0/version.txt (renamed from src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.7.0/version.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/phpdaemon/README.md (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpdaemon/charts.go (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpdaemon/client.go (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/client.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpdaemon/collect.go (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpdaemon/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpdaemon/init.go (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpdaemon/integrations/phpdaemon.md (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/integrations/phpdaemon.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpdaemon/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpdaemon/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpdaemon/phpdaemon.go (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/phpdaemon.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpdaemon/phpdaemon_test.go (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/phpdaemon_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpdaemon/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpdaemon/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpdaemon/testdata/fullstatus.json (renamed from src/go/collectors/go.d.plugin/modules/phpdaemon/testdata/fullstatus.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/phpfpm/README.md (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/charts.go (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/client.go (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/client.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/collect.go (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/decode.go (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/decode.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/init.go (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/integrations/php-fpm.md (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/integrations/php-fpm.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/phpfpm.go (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/phpfpm.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/phpfpm_test.go (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/phpfpm_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/testdata/status-full-no-idle.json (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status-full-no-idle.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/testdata/status-full.json (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status-full.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/testdata/status-full.txt (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status-full.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/testdata/status.json (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/phpfpm/testdata/status.txt (renamed from src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/pihole/README.md (renamed from src/go/collectors/go.d.plugin/modules/pihole/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/charts.go (renamed from src/go/collectors/go.d.plugin/modules/pihole/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/collect.go (renamed from src/go/collectors/go.d.plugin/modules/pihole/collect.go) | 14 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/pihole/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/init.go (renamed from src/go/collectors/go.d.plugin/modules/pihole/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/integrations/pi-hole.md (renamed from src/go/collectors/go.d.plugin/modules/pihole/integrations/pi-hole.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/pihole/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/pihole/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/pihole.go (renamed from src/go/collectors/go.d.plugin/modules/pihole/pihole.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/pihole_test.go (renamed from src/go/collectors/go.d.plugin/modules/pihole/pihole_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/pihole/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/pihole/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/testdata/getForwardDestinations.json (renamed from src/go/collectors/go.d.plugin/modules/pihole/testdata/getForwardDestinations.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/testdata/getQueryTypes.json (renamed from src/go/collectors/go.d.plugin/modules/pihole/testdata/getQueryTypes.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/testdata/setupVars.conf (renamed from src/go/collectors/go.d.plugin/modules/pihole/testdata/setupVars.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pihole/testdata/summaryRaw.json (renamed from src/go/collectors/go.d.plugin/modules/pihole/testdata/summaryRaw.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/pika/README.md (renamed from src/go/collectors/go.d.plugin/modules/pika/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pika/charts.go (renamed from src/go/collectors/go.d.plugin/modules/pika/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pika/collect.go (renamed from src/go/collectors/go.d.plugin/modules/pika/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pika/collect_info.go (renamed from src/go/collectors/go.d.plugin/modules/pika/collect_info.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pika/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/pika/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pika/init.go (renamed from src/go/collectors/go.d.plugin/modules/pika/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pika/integrations/pika.md (renamed from src/go/collectors/go.d.plugin/modules/pika/integrations/pika.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pika/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/pika/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pika/pika.go (renamed from src/go/collectors/go.d.plugin/modules/pika/pika.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pika/pika_test.go (renamed from src/go/collectors/go.d.plugin/modules/pika/pika_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pika/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/pika/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pika/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/pika/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pika/testdata/redis/info_all.txt (renamed from src/go/collectors/go.d.plugin/modules/pika/testdata/redis/info_all.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pika/testdata/v3.4.0/info_all.txt (renamed from src/go/collectors/go.d.plugin/modules/pika/testdata/v3.4.0/info_all.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/ping/README.md (renamed from src/go/collectors/go.d.plugin/modules/ping/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ping/charts.go (renamed from src/go/collectors/go.d.plugin/modules/ping/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ping/collect.go (renamed from src/go/collectors/go.d.plugin/modules/ping/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ping/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/ping/config_schema.json) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ping/init.go (renamed from src/go/collectors/go.d.plugin/modules/ping/init.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ping/integrations/ping.md (renamed from src/go/collectors/go.d.plugin/modules/ping/integrations/ping.md) | 41 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ping/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/ping/metadata.yaml) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ping/ping.go (renamed from src/go/collectors/go.d.plugin/modules/ping/ping.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ping/ping_test.go (renamed from src/go/collectors/go.d.plugin/modules/ping/ping_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ping/prober.go (renamed from src/go/collectors/go.d.plugin/modules/ping/prober.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ping/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/ping/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/ping/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/ping/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/portcheck/README.md (renamed from src/go/collectors/go.d.plugin/modules/portcheck/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/portcheck/charts.go (renamed from src/go/collectors/go.d.plugin/modules/portcheck/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/portcheck/collect.go (renamed from src/go/collectors/go.d.plugin/modules/portcheck/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/portcheck/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/portcheck/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/portcheck/init.go (renamed from src/go/collectors/go.d.plugin/modules/portcheck/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/portcheck/integrations/tcp_endpoints.md (renamed from src/go/collectors/go.d.plugin/modules/portcheck/integrations/tcp_endpoints.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/portcheck/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/portcheck/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/portcheck/portcheck.go (renamed from src/go/collectors/go.d.plugin/modules/portcheck/portcheck.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/portcheck/portcheck_test.go (renamed from src/go/collectors/go.d.plugin/modules/portcheck/portcheck_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/portcheck/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/portcheck/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/portcheck/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/portcheck/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/postfix/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postfix/charts.go | 44 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postfix/collect.go | 71 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postfix/config_schema.json | 47 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postfix/exec.go | 41 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postfix/init.go | 38 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postfix/integrations/postfix.md | 195 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postfix/metadata.yaml | 106 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postfix/postfix.go | 109 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postfix/postfix_test.go (renamed from src/go/collectors/go.d.plugin/modules/zfspool/zfspool_test.go) | 149 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postfix/testdata/config.json | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postfix/testdata/config.yaml | 3 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postfix/testdata/postqueue.txt | 34 | ||||
l--------- | src/go/plugin/go.d/modules/postgres/README.md (renamed from src/go/collectors/go.d.plugin/modules/postgres/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/charts.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/collect.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/collect.go) | 11 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/collect_metrics.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/collect_metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/postgres/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/do_query.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/do_query.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/do_query_bloat.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/do_query_bloat.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/do_query_columns.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/do_query_columns.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/do_query_databases.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/do_query_databases.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/do_query_global.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/do_query_global.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/do_query_indexes.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/do_query_indexes.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/do_query_misc.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/do_query_misc.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/do_query_replication.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/do_query_replication.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/do_query_tables.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/do_query_tables.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/init.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/integrations/postgresql.md (renamed from src/go/collectors/go.d.plugin/modules/postgres/integrations/postgresql.md) | 41 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/postgres/metadata.yaml) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/metrics.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/postgres.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/postgres.go) | 12 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/postgres_test.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/postgres_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/queries.go (renamed from src/go/collectors/go.d.plugin/modules/postgres/queries.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/autovacuum_workers.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/autovacuum_workers.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/bloat_tables.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/bloat_tables.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/catalog_relations.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/catalog_relations.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/checkpoints.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/checkpoints.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/database_conflicts.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/database_conflicts.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/database_locks.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/database_locks.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/database_size.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/database_size.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/database_stats.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/database_stats.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/is_super_user-false.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/is_super_user-false.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/is_super_user-true.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/is_super_user-true.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/pg_is_in_recovery-true.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/pg_is_in_recovery-true.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/queryable_database_list.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/queryable_database_list.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/replication_slot_files.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/replication_slot_files.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/replication_standby_app_wal_delta.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/replication_standby_app_wal_delta.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/replication_standby_app_wal_lag.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/replication_standby_app_wal_lag.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/server_connections_state.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/server_connections_state.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/server_current_connections.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/server_current_connections.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/server_version_num.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/server_version_num.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/settings_max_connections.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/settings_max_connections.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/settings_max_locks_held.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/settings_max_locks_held.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/stat_user_indexes_db_postgres.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/stat_user_indexes_db_postgres.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/stat_user_tables_db_postgres.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/stat_user_tables_db_postgres.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/statio_user_tables_db_postgres.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/statio_user_tables_db_postgres.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/table_columns_stats.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/table_columns_stats.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/txid_wraparound.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/txid_wraparound.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/uptime.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/uptime.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/wal_archive_files.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/wal_archive_files.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/wal_files.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/wal_files.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/wal_writes.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/wal_writes.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/postgres/testdata/v14.4/xact_query_running_time.txt (renamed from src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/xact_query_running_time.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/powerdns/README.md (renamed from src/go/collectors/go.d.plugin/modules/powerdns/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns/authoritativens.go (renamed from src/go/collectors/go.d.plugin/modules/powerdns/authoritativens.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns/authoritativens_test.go (renamed from src/go/collectors/go.d.plugin/modules/powerdns/authoritativens_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns/charts.go (renamed from src/go/collectors/go.d.plugin/modules/powerdns/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns/collect.go (renamed from src/go/collectors/go.d.plugin/modules/powerdns/collect.go) | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/powerdns/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns/init.go (renamed from src/go/collectors/go.d.plugin/modules/powerdns/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns/integrations/powerdns_authoritative_server.md (renamed from src/go/collectors/go.d.plugin/modules/powerdns/integrations/powerdns_authoritative_server.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/powerdns/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/powerdns/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/rspamd/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/rspamd/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns/testdata/recursor/statistics.json (renamed from src/go/collectors/go.d.plugin/modules/powerdns/testdata/recursor/statistics.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns/testdata/v4.3.0/statistics.json (renamed from src/go/collectors/go.d.plugin/modules/powerdns/testdata/v4.3.0/statistics.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/powerdns_recursor/README.md (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns_recursor/charts.go (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns_recursor/collect.go (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/collect.go) | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns_recursor/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns_recursor/init.go (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns_recursor/integrations/powerdns_recursor.md (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/integrations/powerdns_recursor.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns_recursor/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns_recursor/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns_recursor/recursor.go (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/recursor.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns_recursor/recursor_test.go (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/recursor_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns_recursor/testdata/authoritative/statistics.json (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/testdata/authoritative/statistics.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns_recursor/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/scaleio/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns_recursor/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/scaleio/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/powerdns_recursor/testdata/v4.3.1/statistics.json (renamed from src/go/collectors/go.d.plugin/modules/powerdns_recursor/testdata/v4.3.1/statistics.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/prometheus/README.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/cache.go (renamed from src/go/collectors/go.d.plugin/modules/prometheus/cache.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/charts.go (renamed from src/go/collectors/go.d.plugin/modules/prometheus/charts.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/collect.go (renamed from src/go/collectors/go.d.plugin/modules/prometheus/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/prometheus/config_schema.json) | 10 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/init.go (renamed from src/go/collectors/go.d.plugin/modules/prometheus/init.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/4d_server.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/4d_server.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/8430ft_modem.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/8430ft_modem.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/a10_acos_network_devices.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/a10_acos_network_devices.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/airthings_waveplus_air_sensor.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/airthings_waveplus_air_sensor.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/akamai_edge_dns_traffic.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/akamai_edge_dns_traffic.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/akamai_global_traffic_management.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/akamai_global_traffic_management.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/akami_cloudmonitor.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/akami_cloudmonitor.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/alamos_fe2_server.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/alamos_fe2_server.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/alibaba_cloud.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/alibaba_cloud.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/altaro_backup.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/altaro_backup.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/amd_cpu_&_gpu.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/amd_cpu_&_gpu.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/andrews_&_arnold_line_status.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/andrews_&_arnold_line_status.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/apache_airflow.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/apache_airflow.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/apache_flink.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/apache_flink.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/apicast.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/apicast.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/apple_time_machine.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/apple_time_machine.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/arm_hwcpipe.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/arm_hwcpipe.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/aruba_devices.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/aruba_devices.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/arvancloud_cdn.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/arvancloud_cdn.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/audisto.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/audisto.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/authlog.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/authlog.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/aws_ec2_compute_instances.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_ec2_compute_instances.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/aws_ec2_spot_instance.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_ec2_spot_instance.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/aws_ecs.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_ecs.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/aws_health_events.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_health_events.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/aws_instance_health.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_instance_health.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/aws_quota.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_quota.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/aws_rds.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_rds.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/aws_s3_buckets.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_s3_buckets.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/aws_sqs.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_sqs.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/azure_ad_app_passwords.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_ad_app_passwords.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/azure_application.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_application.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/azure_elastic_pool_sql.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_elastic_pool_sql.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/azure_resources.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_resources.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/azure_service_bus.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_service_bus.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/azure_sql.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_sql.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/bigquery.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/bigquery.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/bird_routing_daemon.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/bird_routing_daemon.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/blackbox.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/blackbox.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/bobcat_miner_300.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/bobcat_miner_300.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/borg_backup.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/borg_backup.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/bosh.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/bosh.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/bpftrace_variables.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/bpftrace_variables.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/bungeecord.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/bungeecord.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/cadvisor.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/cadvisor.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/celery.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/celery.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/certificate_transparency.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/certificate_transparency.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/checkpoint_device.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/checkpoint_device.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/chia.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/chia.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/christ_elektronik_clm5ip_power_panel.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/christ_elektronik_clm5ip_power_panel.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/cilium_agent.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/cilium_agent.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/cilium_operator.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/cilium_operator.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/cilium_proxy.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/cilium_proxy.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/cisco_aci.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/cisco_aci.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/citrix_netscaler.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/citrix_netscaler.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/clamav_daemon.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/clamav_daemon.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/clamscan_results.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/clamscan_results.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/clash.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/clash.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/cloud_foundry.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloud_foundry.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/cloud_foundry_firehose.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloud_foundry_firehose.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/cloudflare_pcap.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloudflare_pcap.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/cloudwatch.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloudwatch.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/clustercontrol_cmon.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/clustercontrol_cmon.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/collectd.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/collectd.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/concourse.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/concourse.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/craftbeerpi.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/craftbeerpi.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/crowdsec.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/crowdsec.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/crypto_exchanges.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/crypto_exchanges.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/cryptowatch.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/cryptowatch.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/custom_exporter.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/custom_exporter.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/cvmfs_clients.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/cvmfs_clients.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/ddwrt_routers.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/ddwrt_routers.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/dell_emc_ecs_cluster.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_emc_ecs_cluster.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/dell_emc_isilon_cluster.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_emc_isilon_cluster.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/dell_emc_xtremio_cluster.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_emc_xtremio_cluster.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/dell_powermax.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_powermax.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/dependency-track.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/dependency-track.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/digitalocean.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/digitalocean.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/discourse.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/discourse.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/dmarc.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/dmarc.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/dnsbl.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/dnsbl.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/dutch_electricity_smart_meter.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/dutch_electricity_smart_meter.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/dynatrace.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/dynatrace.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/eaton_ups.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/eaton_ups.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/elgato_key_light_devices..md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/elgato_key_light_devices..md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/energomera_smart_power_meters.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/energomera_smart_power_meters.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/eos.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/eos.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/etcd.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/etcd.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/excel_spreadsheet.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/excel_spreadsheet.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/fastd.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/fastd.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/fortigate_firewall.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/fortigate_firewall.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/freebsd_nfs.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/freebsd_nfs.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/freebsd_rctl-racct.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/freebsd_rctl-racct.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/freifunk_network.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/freifunk_network.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/fritzbox_network_devices.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/fritzbox_network_devices.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/frrouting.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/frrouting.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/gcp_gce.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/gcp_gce.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/gcp_quota.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/gcp_quota.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/generic_command_line_output.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/generic_command_line_output.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/generic_storage_enclosure_tool.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/generic_storage_enclosure_tool.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/github_api_rate_limit.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/github_api_rate_limit.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/github_repository.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/github_repository.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/gitlab_runner.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/gitlab_runner.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/gobetween.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/gobetween.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/google_cloud_platform.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/google_cloud_platform.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/google_pagespeed.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/google_pagespeed.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/google_stackdriver.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/google_stackdriver.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/gpsd.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/gpsd.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/grafana.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/grafana.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/graylog_server.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/graylog_server.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/gtp.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/gtp.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/halon.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/halon.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/hana.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/hana.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/hashicorp_vault_secrets.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/hashicorp_vault_secrets.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/hasura_graphql_server.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/hasura_graphql_server.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/hdsentinel.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/hdsentinel.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/helium_hotspot.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/helium_hotspot.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/helium_miner_validator.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/helium_miner_validator.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/hhvm.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/hhvm.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/hitron_cgn_series_cpe.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/hitron_cgn_series_cpe.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/hitron_coda_cable_modem.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/hitron_coda_cable_modem.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/homebridge.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/homebridge.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/homey.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/homey.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/honeypot.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/honeypot.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/hp_ilo.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/hp_ilo.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/huawei_devices.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/huawei_devices.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/hubble.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/hubble.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/ibm_aix_systems_njmon.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_aix_systems_njmon.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/ibm_cryptoexpress_cex_cards.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_cryptoexpress_cex_cards.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/ibm_mq.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_mq.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/ibm_spectrum.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_spectrum.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/ibm_spectrum_virtualize.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_spectrum_virtualize.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/ibm_z_hardware_management_console.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_z_hardware_management_console.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/influxdb.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/influxdb.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/iota_full_node.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/iota_full_node.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/ipmi_by_soundcloud.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/ipmi_by_soundcloud.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/iqair_airvisual_air_quality_monitors.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/iqair_airvisual_air_quality_monitors.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/jarvis_standing_desk.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/jarvis_standing_desk.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/jenkins.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/jenkins.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/jetbrains_floating_license_server.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/jetbrains_floating_license_server.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/jmx.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/jmx.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/jolokia.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/jolokia.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/journald.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/journald.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/kafka.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/kafka_connect.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka_connect.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/kafka_consumer_lag.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka_consumer_lag.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/kafka_zookeeper.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka_zookeeper.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/kannel.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/kannel.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/keepalived.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/keepalived.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/kubernetes_cluster_cloud_cost.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/kubernetes_cluster_cloud_cost.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/lagerist_disk_latency.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/lagerist_disk_latency.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/ldap.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/ldap.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/linode.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/linode.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/loki.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/loki.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/lustre_metadata.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/lustre_metadata.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/lynis_audit_reports.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/lynis_audit_reports.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/machbase.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/machbase.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/maildir.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/maildir.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/meilisearch.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/meilisearch.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/memcached_community.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/memcached_community.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/meraki_dashboard.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/meraki_dashboard.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/mesos.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/mesos.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/mikrotik_devices.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/mikrotik_devices.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/mikrotik_routeros_devices.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/mikrotik_routeros_devices.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/minecraft.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/minecraft.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/modbus_protocol.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/modbus_protocol.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/mogilefs.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/mogilefs.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/monnit_sensors_mqtt.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/monnit_sensors_mqtt.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/mosquitto.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/mosquitto.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/mp707_usb_thermometer.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/mp707_usb_thermometer.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/mqtt_blackbox.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/mqtt_blackbox.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/mtail.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/mtail.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/naemon.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/naemon.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/nagios.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/nagios.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/nature_remo_e_lite_devices.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/nature_remo_e_lite_devices.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/netapp_ontap_api.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/netapp_ontap_api.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/netapp_solidfire.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/netapp_solidfire.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/netatmo_sensors.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/netatmo_sensors.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/netflow.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/netflow.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/netmeter.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/netmeter.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/new_relic.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/new_relic.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/nextcloud_servers.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/nextcloud_servers.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/nextdns.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/nextdns.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/nftables.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/nftables.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/nrpe_daemon.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/nrpe_daemon.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/nsx-t.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/nsx-t.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/nvml.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/nvml.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/obs_studio.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/obs_studio.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/odbc.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/odbc.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/open_vswitch.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/open_vswitch.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/openhab.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/openhab.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/openldap_community.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/openldap_community.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/openrc.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/openrc.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/openrct2.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/openrct2.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/openroadm_devices.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/openroadm_devices.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/openstack.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/openstack.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/openvas.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/openvas.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/openweathermap.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/openweathermap.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/oracle_db_community.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/oracle_db_community.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/otrs.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/otrs.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/patroni.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/patroni.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/personal_weather_station.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/personal_weather_station.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/pgbackrest.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/pgbackrest.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/pgpool-ii.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/pgpool-ii.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/philips_hue.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/philips_hue.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/pimoroni_enviro+.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/pimoroni_enviro+.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/pingdom.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/pingdom.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/podman.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/podman.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/powerpal_devices.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/powerpal_devices.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/proftpd.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/proftpd.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/prometheus_endpoint.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/prometheus_endpoint.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/proxmox_ve.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/proxmox_ve.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/radio_thermostat.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/radio_thermostat.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/radius.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/radius.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/rancher.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/rancher.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/raritan_pdu.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/raritan_pdu.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/redis_queue.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/redis_queue.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/ripe_atlas.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/ripe_atlas.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/sabnzbd.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/sabnzbd.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/salicru_eqx_inverter.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/salicru_eqx_inverter.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/sense_energy.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/sense_energy.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/sentry.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/sentry.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/servertech.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/servertech.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/shell_command.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/shell_command.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/shelly_humidity_sensor.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/shelly_humidity_sensor.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/sia.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/sia.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/siemens_s7_plc.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/siemens_s7_plc.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/site_24x7.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/site_24x7.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/slurm.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/slurm.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/sma_inverters.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/sma_inverters.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/smart_meters_sml.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/smart_meters_sml.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/smartrg_808ac_cable_modem.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/smartrg_808ac_cable_modem.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/softether_vpn_server.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/softether_vpn_server.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/solar_logging_stick.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/solar_logging_stick.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/solaredge_inverters.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/solaredge_inverters.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/solis_ginlong_5g_inverters.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/solis_ginlong_5g_inverters.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/sonic_nos.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/sonic_nos.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/spacelift.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/spacelift.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/speedify_cli.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/speedify_cli.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/sphinx.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/sphinx.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/sql_database_agnostic.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/sql_database_agnostic.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/ssh.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/ssh.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/ssl_certificate.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/ssl_certificate.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/starlink_spacex.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/starlink_spacex.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/starwind_vsan_vsphere_edition.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/starwind_vsan_vsphere_edition.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/statuspage.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/statuspage.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/steam.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/steam.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/storidge.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/storidge.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/stream.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/stream.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/strongswan.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/strongswan.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/sunspec_solar_energy.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/sunspec_solar_energy.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/suricata.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/suricata.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/synology_activebackup.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/synology_activebackup.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/sysload.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/sysload.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/t-rex_nvidia_gpu_miner.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/t-rex_nvidia_gpu_miner.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/tacacs.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/tacacs.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/tado_smart_heating_solution.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/tado_smart_heating_solution.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/tankerkoenig_api.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/tankerkoenig_api.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/tesla_powerwall.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/tesla_powerwall.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/tesla_vehicle.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/tesla_vehicle.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/tesla_wall_connector.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/tesla_wall_connector.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/tp-link_p110.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/tp-link_p110.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/traceroute.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/traceroute.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/twincat_ads_web_service.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/twincat_ads_web_service.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/twitch.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/twitch.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/ubiquiti_ufiber_olt.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/ubiquiti_ufiber_olt.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/uptimerobot.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/uptimerobot.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/vault_pki.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/vault_pki.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/vertica.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/vertica.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/vscode.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/vscode.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/warp10.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/warp10.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/xiaomi_mi_flora.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/xiaomi_mi_flora.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/xmpp_server.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/xmpp_server.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/yourls_url_shortener.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/yourls_url_shortener.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/zerto.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/zerto.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/zulip.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/zulip.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/integrations/zyxel_gs1200-8.md (renamed from src/go/collectors/go.d.plugin/modules/prometheus/integrations/zyxel_gs1200-8.md) | 42 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml) | 3 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/prometheus.go (renamed from src/go/collectors/go.d.plugin/modules/prometheus/prometheus.go) | 10 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/prometheus_test.go (renamed from src/go/collectors/go.d.plugin/modules/prometheus/prometheus_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/prometheus/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/prometheus/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/prometheus/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/proxysql/README.md (renamed from src/go/collectors/go.d.plugin/modules/proxysql/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/cache.go (renamed from src/go/collectors/go.d.plugin/modules/proxysql/cache.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/charts.go (renamed from src/go/collectors/go.d.plugin/modules/proxysql/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/collect.go (renamed from src/go/collectors/go.d.plugin/modules/proxysql/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/proxysql/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/integrations/proxysql.md (renamed from src/go/collectors/go.d.plugin/modules/proxysql/integrations/proxysql.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/proxysql/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/proxysql.go (renamed from src/go/collectors/go.d.plugin/modules/proxysql/proxysql.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/proxysql_test.go (renamed from src/go/collectors/go.d.plugin/modules/proxysql/proxysql_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/proxysql/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/proxysql/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_memory_metrics.txt (renamed from src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_memory_metrics.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_mysql_commands_counters.txt (renamed from src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_mysql_commands_counters.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_mysql_connection_pool .txt (renamed from src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_mysql_connection_pool .txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_mysql_global.txt (renamed from src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_mysql_global.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_mysql_users.txt (renamed from src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_mysql_users.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/version.txt (renamed from src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/version.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/pulsar/README.md (renamed from src/go/collectors/go.d.plugin/modules/pulsar/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/cache.go (renamed from src/go/collectors/go.d.plugin/modules/pulsar/cache.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/charts.go (renamed from src/go/collectors/go.d.plugin/modules/pulsar/charts.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/collect.go (renamed from src/go/collectors/go.d.plugin/modules/pulsar/collect.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/pulsar/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/init.go (renamed from src/go/collectors/go.d.plugin/modules/pulsar/init.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/integrations/apache_pulsar.md (renamed from src/go/collectors/go.d.plugin/modules/pulsar/integrations/apache_pulsar.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/pulsar/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/pulsar/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/pulsar.go (renamed from src/go/collectors/go.d.plugin/modules/pulsar/pulsar.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/pulsar_test.go (renamed from src/go/collectors/go.d.plugin/modules/pulsar/pulsar_test.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/pulsar/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/pulsar/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/testdata/non-pulsar.txt (renamed from src/go/collectors/go.d.plugin/modules/pulsar/testdata/non-pulsar.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/testdata/standalone-v2.5.0-namespaces.txt (renamed from src/go/collectors/go.d.plugin/modules/pulsar/testdata/standalone-v2.5.0-namespaces.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/testdata/standalone-v2.5.0-topics-2.txt (renamed from src/go/collectors/go.d.plugin/modules/pulsar/testdata/standalone-v2.5.0-topics-2.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/pulsar/testdata/standalone-v2.5.0-topics.txt (renamed from src/go/collectors/go.d.plugin/modules/pulsar/testdata/standalone-v2.5.0-topics.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/puppet/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/puppet/charts.go | 93 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/puppet/collect.go | 75 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/puppet/config_schema.json | 177 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/puppet/integrations/puppet.md | 233 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/puppet/metadata.yaml | 184 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/puppet/puppet.go | 114 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/puppet/puppet_test.go | 252 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/puppet/response.go | 32 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/puppet/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/tengine/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/puppet/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/tengine/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/puppet/testdata/serviceStatusResponse.json | 497 | ||||
l--------- | src/go/plugin/go.d/modules/rabbitmq/README.md (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/charts.go (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/collect.go (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/collect.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/integrations/rabbitmq.md (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/integrations/rabbitmq.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/rabbitmq.go (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/rabbitmq.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/rabbitmq_test.go (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/rabbitmq_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/testdata/v3.11.5/api-nodes-node.json (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/v3.11.5/api-nodes-node.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/testdata/v3.11.5/api-overview.json (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/v3.11.5/api-overview.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/testdata/v3.11.5/api-queues.json (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/v3.11.5/api-queues.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rabbitmq/testdata/v3.11.5/api-vhosts.json (renamed from src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/v3.11.5/api-vhosts.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/redis/README.md (renamed from src/go/collectors/go.d.plugin/modules/redis/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/charts.go (renamed from src/go/collectors/go.d.plugin/modules/redis/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/collect.go (renamed from src/go/collectors/go.d.plugin/modules/redis/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/collect_info.go (renamed from src/go/collectors/go.d.plugin/modules/redis/collect_info.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/collect_ping_latency.go (renamed from src/go/collectors/go.d.plugin/modules/redis/collect_ping_latency.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/redis/config_schema.json) | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/init.go (renamed from src/go/collectors/go.d.plugin/modules/redis/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/integrations/redis.md (renamed from src/go/collectors/go.d.plugin/modules/redis/integrations/redis.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/redis/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/redis.go (renamed from src/go/collectors/go.d.plugin/modules/redis/redis.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/redis_test.go (renamed from src/go/collectors/go.d.plugin/modules/redis/redis_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/redis/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/redis/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/testdata/pika/info_all.txt (renamed from src/go/collectors/go.d.plugin/modules/redis/testdata/pika/info_all.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/redis/testdata/v6.0.9/info_all.txt (renamed from src/go/collectors/go.d.plugin/modules/redis/testdata/v6.0.9/info_all.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/rethinkdb/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rethinkdb/charts.go | 189 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rethinkdb/client.go | 72 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rethinkdb/collect.go | 123 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rethinkdb/config_schema.json | 82 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rethinkdb/integrations/rethinkdb.md | 257 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rethinkdb/metadata.yaml | 198 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rethinkdb/rethinkdb.go | 107 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rethinkdb/rethinkdb_test.go | 267 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rethinkdb/testdata/config.json | 7 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rethinkdb/testdata/config.yaml | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rethinkdb/testdata/v2.4.4/stats.txt | 4 | ||||
l--------- | src/go/plugin/go.d/modules/riakkv/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/riakkv/charts.go | 461 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/riakkv/collect.go | 74 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/riakkv/config_schema.json | 186 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/riakkv/integrations/riak_kv.md | 283 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/riakkv/metadata.yaml | 390 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/riakkv/riakkv.go | 122 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/riakkv/riakkv_test.go | 265 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/riakkv/stats.go | 112 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/riakkv/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/traefik/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/riakkv/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/traefik/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/riakkv/testdata/stats.json | 478 | ||||
l--------- | src/go/plugin/go.d/modules/rspamd/README.md (renamed from src/go/collectors/go.d.plugin/modules/rspamd/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rspamd/charts.go (renamed from src/go/collectors/go.d.plugin/modules/rspamd/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rspamd/collect.go (renamed from src/go/collectors/go.d.plugin/modules/rspamd/collect.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rspamd/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/rspamd/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rspamd/integrations/rspamd.md (renamed from src/go/collectors/go.d.plugin/modules/rspamd/integrations/rspamd.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rspamd/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/rspamd/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rspamd/rspamd.go (renamed from src/go/collectors/go.d.plugin/modules/rspamd/rspamd.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rspamd/rspamd_test.go (renamed from src/go/collectors/go.d.plugin/modules/rspamd/rspamd_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rspamd/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/vcsa/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rspamd/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/vcsa/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/rspamd/testdata/v3.4-stat.json (renamed from src/go/collectors/go.d.plugin/modules/rspamd/testdata/v3.4-stat.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/scaleio/README.md (renamed from src/go/collectors/go.d.plugin/modules/scaleio/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/charts.go (renamed from src/go/collectors/go.d.plugin/modules/scaleio/charts.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/client/client.go (renamed from src/go/collectors/go.d.plugin/modules/scaleio/client/client.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/client/client_test.go (renamed from src/go/collectors/go.d.plugin/modules/scaleio/client/client_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/client/server.go (renamed from src/go/collectors/go.d.plugin/modules/scaleio/client/server.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/client/types.go (renamed from src/go/collectors/go.d.plugin/modules/scaleio/client/types.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/collect.go (renamed from src/go/collectors/go.d.plugin/modules/scaleio/collect.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/collect_sdc.go (renamed from src/go/collectors/go.d.plugin/modules/scaleio/collect_sdc.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/collect_storage_pool.go (renamed from src/go/collectors/go.d.plugin/modules/scaleio/collect_storage_pool.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/collect_system.go (renamed from src/go/collectors/go.d.plugin/modules/scaleio/collect_system.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/scaleio/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/integrations/dell_emc_scaleio.md (renamed from src/go/collectors/go.d.plugin/modules/scaleio/integrations/dell_emc_scaleio.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/scaleio/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/scaleio/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/queries.go (renamed from src/go/collectors/go.d.plugin/modules/scaleio/queries.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/scaleio.go (renamed from src/go/collectors/go.d.plugin/modules/scaleio/scaleio.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/scaleio_test.go (renamed from src/go/collectors/go.d.plugin/modules/scaleio/scaleio_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/vernemq/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/vernemq/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/testdata/instances.json (renamed from src/go/collectors/go.d.plugin/modules/scaleio/testdata/instances.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/scaleio/testdata/selected_statistics.json (renamed from src/go/collectors/go.d.plugin/modules/scaleio/testdata/selected_statistics.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/sensors/README.md (renamed from src/go/collectors/go.d.plugin/modules/sensors/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/sensors/charts.go (renamed from src/go/collectors/go.d.plugin/modules/sensors/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/sensors/collect.go (renamed from src/go/collectors/go.d.plugin/modules/sensors/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/sensors/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/sensors/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/sensors/exec.go (renamed from src/go/collectors/go.d.plugin/modules/sensors/exec.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/sensors/init.go (renamed from src/go/collectors/go.d.plugin/modules/sensors/init.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/sensors/integrations/linux_sensors_lm-sensors.md (renamed from src/go/collectors/go.d.plugin/modules/sensors/integrations/linux_sensors_lm-sensors.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/sensors/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/sensors/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/sensors/sensors.go (renamed from src/go/collectors/go.d.plugin/modules/sensors/sensors.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/sensors/sensors_test.go (renamed from src/go/collectors/go.d.plugin/modules/sensors/sensors_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/sensors/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/zfspool/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/sensors/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/zfspool/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/sensors/testdata/sensors-temp-in-curr-power-fan.txt (renamed from src/go/collectors/go.d.plugin/modules/sensors/testdata/sensors-temp-in-curr-power-fan.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/sensors/testdata/sensors-temp.txt (renamed from src/go/collectors/go.d.plugin/modules/sensors/testdata/sensors-temp.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/smartctl/README.md (renamed from src/go/collectors/go.d.plugin/modules/smartctl/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/charts.go (renamed from src/go/collectors/go.d.plugin/modules/smartctl/charts.go) | 82 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/collect.go (renamed from src/go/collectors/go.d.plugin/modules/smartctl/collect.go) | 31 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/smartctl/config_schema.json) | 47 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/exec.go (renamed from src/go/collectors/go.d.plugin/modules/smartctl/exec.go) | 7 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/init.go (renamed from src/go/collectors/go.d.plugin/modules/smartctl/init.go) | 11 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/integrations/s.m.a.r.t..md (renamed from src/go/collectors/go.d.plugin/modules/smartctl/integrations/s.m.a.r.t..md) | 109 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/smartctl/metadata.yaml) | 81 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/scan.go (renamed from src/go/collectors/go.d.plugin/modules/smartctl/scan.go) | 66 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/smart_device.go (renamed from src/go/collectors/go.d.plugin/modules/smartctl/smart_device.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/smartctl.go (renamed from src/go/collectors/go.d.plugin/modules/smartctl/smartctl.go) | 32 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/smartctl_test.go (renamed from src/go/collectors/go.d.plugin/modules/smartctl/smartctl_test.go) | 84 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/smartctl/testdata/config.json) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/smartctl/testdata/config.yaml) | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/testdata/type-nvme/device-nvme0.json (renamed from src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-nvme/device-nvme0.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/testdata/type-nvme/device-nvme1.json | 113 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/testdata/type-nvme/scan.json (renamed from src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-nvme/scan.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/testdata/type-sat/device-hdd-sda.json (renamed from src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-sat/device-hdd-sda.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/testdata/type-sat/device-ssd-sdc.json (renamed from src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-sat/device-ssd-sdc.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/testdata/type-sat/scan.json (renamed from src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-sat/scan.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/testdata/type-scsi/device-sda.json | 128 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/smartctl/testdata/type-scsi/scan.json | 29 | ||||
l--------- | src/go/plugin/go.d/modules/snmp/README.md (renamed from src/go/collectors/go.d.plugin/modules/snmp/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/snmp/charts.go | 309 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/snmp/collect.go | 395 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/snmp/config.go | 52 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/snmp/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/snmp/config_schema.json) | 67 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/snmp/init.go | 175 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/snmp/integrations/snmp_devices.md (renamed from src/go/collectors/go.d.plugin/modules/snmp/integrations/snmp_devices.md) | 226 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/snmp/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/snmp/metadata.yaml) | 216 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/snmp/netif.go | 412 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/snmp/snmp.go | 155 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/snmp/snmp_test.go | 754 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/snmp/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/snmp/testdata/config.json) | 7 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/snmp/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/snmp/testdata/config.yaml) | 4 | ||||
l--------- | src/go/plugin/go.d/modules/squid/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squid/charts.go | 81 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squid/collect.go | 105 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squid/config_schema.json | 177 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squid/integrations/squid.md | 227 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squid/metadata.yaml | 195 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squid/squid.go | 114 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squid/squid_test.go | 223 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squid/testdata/config.json | 20 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squid/testdata/config.yaml | 17 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squid/testdata/counters.txt | 59 | ||||
l--------- | src/go/plugin/go.d/modules/squidlog/README.md (renamed from src/go/collectors/go.d.plugin/modules/squidlog/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/charts.go (renamed from src/go/collectors/go.d.plugin/modules/squidlog/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/collect.go (renamed from src/go/collectors/go.d.plugin/modules/squidlog/collect.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/squidlog/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/init.go (renamed from src/go/collectors/go.d.plugin/modules/squidlog/init.go) | 51 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/integrations/squid_log_files.md (renamed from src/go/collectors/go.d.plugin/modules/squidlog/integrations/squid_log_files.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/logline.go (renamed from src/go/collectors/go.d.plugin/modules/squidlog/logline.go) | 10 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/logline_test.go (renamed from src/go/collectors/go.d.plugin/modules/squidlog/logline_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/squidlog/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/squidlog/metrics.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/squidlog.go (renamed from src/go/collectors/go.d.plugin/modules/squidlog/squidlog.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/squidlog_test.go (renamed from src/go/collectors/go.d.plugin/modules/squidlog/squidlog_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/testdata/access.log (renamed from src/go/collectors/go.d.plugin/modules/squidlog/testdata/access.log) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/squidlog/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/squidlog/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/squidlog/testdata/unknown.log (renamed from src/go/collectors/go.d.plugin/modules/squidlog/testdata/unknown.log) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/storcli/README.md (renamed from src/go/collectors/go.d.plugin/modules/storcli/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/charts.go (renamed from src/go/collectors/go.d.plugin/modules/storcli/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/collect.go (renamed from src/go/collectors/go.d.plugin/modules/storcli/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/collect_controllers.go (renamed from src/go/collectors/go.d.plugin/modules/storcli/collect_controllers.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/collect_drives.go (renamed from src/go/collectors/go.d.plugin/modules/storcli/collect_drives.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/storcli/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/exec.go (renamed from src/go/collectors/go.d.plugin/modules/storcli/exec.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/init.go (renamed from src/go/collectors/go.d.plugin/modules/storcli/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/integrations/storecli_raid.md (renamed from src/go/collectors/go.d.plugin/modules/storcli/integrations/storecli_raid.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/storcli/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/storcli.go (renamed from src/go/collectors/go.d.plugin/modules/storcli/storcli.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/storcli_test.go (renamed from src/go/collectors/go.d.plugin/modules/storcli/storcli_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/testdata/config.json | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/testdata/config.yaml | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/testdata/megaraid-controllers-info.json (renamed from src/go/collectors/go.d.plugin/modules/storcli/testdata/megaraid-controllers-info.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/testdata/megaraid-drives-info.json (renamed from src/go/collectors/go.d.plugin/modules/storcli/testdata/megaraid-drives-info.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/storcli/testdata/mpt3sas-controllers-info.json (renamed from src/go/collectors/go.d.plugin/modules/storcli/testdata/mpt3sas-controllers-info.json) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/supervisord/README.md (renamed from src/go/collectors/go.d.plugin/modules/supervisord/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/supervisord/charts.go (renamed from src/go/collectors/go.d.plugin/modules/supervisord/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/supervisord/client.go (renamed from src/go/collectors/go.d.plugin/modules/supervisord/client.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/supervisord/collect.go (renamed from src/go/collectors/go.d.plugin/modules/supervisord/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/supervisord/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/supervisord/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/supervisord/init.go (renamed from src/go/collectors/go.d.plugin/modules/supervisord/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/supervisord/integrations/supervisor.md (renamed from src/go/collectors/go.d.plugin/modules/supervisord/integrations/supervisor.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/supervisord/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/supervisord/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/supervisord/supervisord.go (renamed from src/go/collectors/go.d.plugin/modules/supervisord/supervisord.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/supervisord/supervisord_test.go (renamed from src/go/collectors/go.d.plugin/modules/supervisord/supervisord_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/supervisord/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/supervisord/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/supervisord/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/supervisord/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/systemdunits/README.md (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/charts.go (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/client.go (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/client.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/collect.go (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/collect_unit_files.go (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/collect_unit_files.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/collect_units.go (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/collect_units.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/doc.go (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/doc.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/init.go (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/integrations/systemd_units.md (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/integrations/systemd_units.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/systemdunits.go (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/systemdunits.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/systemdunits_test.go (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/systemdunits_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/systemdunits/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/systemdunits/testdata/config.yaml) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/tengine/README.md (renamed from src/go/collectors/go.d.plugin/modules/tengine/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tengine/apiclient.go (renamed from src/go/collectors/go.d.plugin/modules/tengine/apiclient.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tengine/charts.go (renamed from src/go/collectors/go.d.plugin/modules/tengine/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tengine/collect.go (renamed from src/go/collectors/go.d.plugin/modules/tengine/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tengine/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/tengine/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tengine/integrations/tengine.md (renamed from src/go/collectors/go.d.plugin/modules/tengine/integrations/tengine.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tengine/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/tengine/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tengine/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/tengine/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tengine/tengine.go (renamed from src/go/collectors/go.d.plugin/modules/tengine/tengine.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tengine/tengine_test.go (renamed from src/go/collectors/go.d.plugin/modules/tengine/tengine_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tengine/testdata/config.json | 20 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tengine/testdata/config.yaml | 17 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tengine/testdata/status.txt (renamed from src/go/collectors/go.d.plugin/modules/tengine/testdata/status.txt) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/tomcat/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tomcat/charts.go | 196 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tomcat/collect.go | 130 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tomcat/config_schema.json | 183 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tomcat/init.go | 21 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tomcat/integrations/tomcat.md | 275 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tomcat/metadata.yaml | 241 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tomcat/status_response.go | 51 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tomcat/testdata/config.json | 20 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tomcat/testdata/config.yaml | 17 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tomcat/testdata/server_status.xml | 54 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tomcat/tomcat.go | 120 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tomcat/tomcat_test.go | 272 | ||||
l--------- | src/go/plugin/go.d/modules/tor/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tor/charts.go | 43 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tor/client.go | 117 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tor/collect.go | 65 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tor/config_schema.json | 53 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tor/integrations/tor.md | 225 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tor/metadata.yaml | 135 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tor/testdata/config.json | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tor/testdata/config.yaml | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tor/tor.go | 102 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/tor/tor_test.go | 328 | ||||
l--------- | src/go/plugin/go.d/modules/traefik/README.md (renamed from src/go/collectors/go.d.plugin/modules/traefik/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/traefik/charts.go (renamed from src/go/collectors/go.d.plugin/modules/traefik/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/traefik/collect.go (renamed from src/go/collectors/go.d.plugin/modules/traefik/collect.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/traefik/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/traefik/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/traefik/init.go (renamed from src/go/collectors/go.d.plugin/modules/traefik/init.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/traefik/integrations/traefik.md (renamed from src/go/collectors/go.d.plugin/modules/traefik/integrations/traefik.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/traefik/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/traefik/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/traefik/testdata/config.json | 20 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/traefik/testdata/config.yaml | 17 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/traefik/testdata/v2.2.1/metrics.txt (renamed from src/go/collectors/go.d.plugin/modules/traefik/testdata/v2.2.1/metrics.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/traefik/traefik.go (renamed from src/go/collectors/go.d.plugin/modules/traefik/traefik.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/traefik/traefik_test.go (renamed from src/go/collectors/go.d.plugin/modules/traefik/traefik_test.go) | 6 | ||||
l--------- | src/go/plugin/go.d/modules/unbound/README.md (renamed from src/go/collectors/go.d.plugin/modules/unbound/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/charts.go (renamed from src/go/collectors/go.d.plugin/modules/unbound/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/collect.go (renamed from src/go/collectors/go.d.plugin/modules/unbound/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/config.go (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/config.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/config_test.go (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/config_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/parse.go (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/parse.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/parse_test.go (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/parse_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/testdata/infinite_rec.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/testdata/infinite_rec.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/testdata/non_existent_glob_include.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/testdata/non_existent_glob_include.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/testdata/non_existent_include.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/testdata/non_existent_include.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/testdata/valid_glob.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_glob.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/testdata/valid_glob2.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_glob2.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/testdata/valid_glob3.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_glob3.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/testdata/valid_include.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/testdata/valid_include2.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include2.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/testdata/valid_include3.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include3.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/testdata/valid_include_toplevel.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include_toplevel.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/testdata/valid_include_toplevel2.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include_toplevel2.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config/testdata/valid_include_toplevel3.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include_toplevel3.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/unbound/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/init.go (renamed from src/go/collectors/go.d.plugin/modules/unbound/init.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/integrations/unbound.md (renamed from src/go/collectors/go.d.plugin/modules/unbound/integrations/unbound.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/unbound/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/unbound/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/unbound/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/testdata/stats/common.txt (renamed from src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/common.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/testdata/stats/extended.txt (renamed from src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/extended.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/cumulative/extended1.txt (renamed from src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/cumulative/extended1.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/cumulative/extended2.txt (renamed from src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/cumulative/extended2.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/cumulative/extended3.txt (renamed from src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/cumulative/extended3.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/reset/extended1.txt (renamed from src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/reset/extended1.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/reset/extended2.txt (renamed from src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/reset/extended2.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/reset/extended3.txt (renamed from src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/reset/extended3.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/testdata/unbound.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/testdata/unbound.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/testdata/unbound_disabled.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/testdata/unbound_disabled.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/testdata/unbound_empty.conf (renamed from src/go/collectors/go.d.plugin/modules/unbound/testdata/unbound_empty.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/unbound.go (renamed from src/go/collectors/go.d.plugin/modules/unbound/unbound.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/unbound/unbound_test.go (renamed from src/go/collectors/go.d.plugin/modules/unbound/unbound_test.go) | 6 | ||||
l--------- | src/go/plugin/go.d/modules/upsd/README.md (renamed from src/go/collectors/go.d.plugin/modules/upsd/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/upsd/charts.go (renamed from src/go/collectors/go.d.plugin/modules/upsd/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/upsd/client.go (renamed from src/go/collectors/go.d.plugin/modules/upsd/client.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/upsd/collect.go (renamed from src/go/collectors/go.d.plugin/modules/upsd/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/upsd/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/upsd/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/upsd/integrations/ups_nut.md (renamed from src/go/collectors/go.d.plugin/modules/upsd/integrations/ups_nut.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/upsd/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/upsd/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/upsd/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/upsd/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/upsd/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/upsd/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/upsd/upsd.go (renamed from src/go/collectors/go.d.plugin/modules/upsd/upsd.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/upsd/upsd_test.go (renamed from src/go/collectors/go.d.plugin/modules/upsd/upsd_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/upsd/variables.go (renamed from src/go/collectors/go.d.plugin/modules/upsd/variables.go) | 0 | ||||
l--------- | src/go/plugin/go.d/modules/uwsgi/README.md | 1 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/uwsgi/charts.go | 275 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/uwsgi/client.go | 64 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/uwsgi/collect.go | 128 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/uwsgi/config_schema.json | 44 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/uwsgi/init.go | 3 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/uwsgi/integrations/uwsgi.md | 248 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/uwsgi/metadata.yaml | 215 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/uwsgi/testdata/config.json | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/uwsgi/testdata/config.yaml | 3 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/uwsgi/testdata/stats.json | 117 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/uwsgi/testdata/stats_no_workers.json | 49 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/uwsgi/uwsgi.go | 98 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/uwsgi/uwsgi_test.go | 325 | ||||
l--------- | src/go/plugin/go.d/modules/vcsa/README.md (renamed from src/go/collectors/go.d.plugin/modules/vcsa/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vcsa/charts.go (renamed from src/go/collectors/go.d.plugin/modules/vcsa/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vcsa/client/client.go (renamed from src/go/collectors/go.d.plugin/modules/vcsa/client/client.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vcsa/client/client_test.go (renamed from src/go/collectors/go.d.plugin/modules/vcsa/client/client_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vcsa/collect.go (renamed from src/go/collectors/go.d.plugin/modules/vcsa/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vcsa/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/vcsa/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vcsa/init.go (renamed from src/go/collectors/go.d.plugin/modules/vcsa/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vcsa/integrations/vcenter_server_appliance.md (renamed from src/go/collectors/go.d.plugin/modules/vcsa/integrations/vcenter_server_appliance.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vcsa/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/vcsa/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vcsa/testdata/config.json | 20 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vcsa/testdata/config.yaml | 17 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vcsa/vcsa.go (renamed from src/go/collectors/go.d.plugin/modules/vcsa/vcsa.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vcsa/vcsa_test.go (renamed from src/go/collectors/go.d.plugin/modules/vcsa/vcsa_test.go) | 2 | ||||
l--------- | src/go/plugin/go.d/modules/vernemq/README.md (renamed from src/go/collectors/go.d.plugin/modules/vernemq/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vernemq/charts.go (renamed from src/go/collectors/go.d.plugin/modules/vernemq/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vernemq/collect.go (renamed from src/go/collectors/go.d.plugin/modules/vernemq/collect.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vernemq/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/vernemq/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vernemq/init.go (renamed from src/go/collectors/go.d.plugin/modules/vernemq/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vernemq/integrations/vernemq.md (renamed from src/go/collectors/go.d.plugin/modules/vernemq/integrations/vernemq.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vernemq/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/vernemq/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vernemq/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/vernemq/metrics.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vernemq/testdata/config.json | 20 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vernemq/testdata/config.yaml | 17 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vernemq/testdata/metrics-v1.10.1-mqtt5.txt (renamed from src/go/collectors/go.d.plugin/modules/vernemq/testdata/metrics-v1.10.1-mqtt5.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vernemq/testdata/non_vernemq.txt (renamed from src/go/collectors/go.d.plugin/modules/vernemq/testdata/non_vernemq.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vernemq/vernemq.go (renamed from src/go/collectors/go.d.plugin/modules/vernemq/vernemq.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vernemq/vernemq_test.go (renamed from src/go/collectors/go.d.plugin/modules/vernemq/vernemq_test.go) | 2 | ||||
l--------- | src/go/plugin/go.d/modules/vsphere/README.md (renamed from src/go/collectors/go.d.plugin/modules/vsphere/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/charts.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/charts.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/client/client.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/client/client.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/client/client_test.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/client/client_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/client/keepalive.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/client/keepalive.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/collect.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/vsphere/config_schema.json) | 9 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/discover.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/discover.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/discover/build.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/discover/build.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/discover/discover.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/discover/discover.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/discover/discover_test.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/discover/discover_test.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/discover/filter.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/discover/filter.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/discover/hierarchy.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/discover/hierarchy.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/discover/metric_lists.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/discover/metric_lists.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/init.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/init.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/integrations/vmware_vcenter_server.md (renamed from src/go/collectors/go.d.plugin/modules/vsphere/integrations/vmware_vcenter_server.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/match/match.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/match/match.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/match/match_test.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/match/match_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/vsphere/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/metrics.txt (renamed from src/go/collectors/go.d.plugin/modules/vsphere/metrics.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/resources/resources.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/resources/resources.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/scrape/scrape.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/scrape/scrape.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/scrape/scrape_test.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/scrape/scrape_test.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/scrape/throttled_caller.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/scrape/throttled_caller.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/scrape/throttled_caller_test.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/scrape/throttled_caller_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/task.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/task.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/task_test.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/task_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/vsphere/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/vsphere/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/vsphere.go (renamed from src/go/collectors/go.d.plugin/modules/vsphere/vsphere.go) | 8 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/vsphere/vsphere_test.go | 489 | ||||
l--------- | src/go/plugin/go.d/modules/weblog/README.md (renamed from src/go/collectors/go.d.plugin/modules/weblog/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/charts.go (renamed from src/go/collectors/go.d.plugin/modules/weblog/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/collect.go (renamed from src/go/collectors/go.d.plugin/modules/weblog/collect.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/weblog/config_schema.json) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/init.go (renamed from src/go/collectors/go.d.plugin/modules/weblog/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/integrations/web_server_log_files.md (renamed from src/go/collectors/go.d.plugin/modules/weblog/integrations/web_server_log_files.md) | 108 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/logline.go (renamed from src/go/collectors/go.d.plugin/modules/weblog/logline.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/logline_test.go (renamed from src/go/collectors/go.d.plugin/modules/weblog/logline_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/weblog/metadata.yaml) | 62 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/metrics.go (renamed from src/go/collectors/go.d.plugin/modules/weblog/metrics.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/parser.go (renamed from src/go/collectors/go.d.plugin/modules/weblog/parser.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/parser_test.go (renamed from src/go/collectors/go.d.plugin/modules/weblog/parser_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/testdata/common.log (renamed from src/go/collectors/go.d.plugin/modules/weblog/testdata/common.log) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/weblog/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/weblog/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/testdata/custom.log (renamed from src/go/collectors/go.d.plugin/modules/weblog/testdata/custom.log) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/testdata/custom_time_fields.log (renamed from src/go/collectors/go.d.plugin/modules/weblog/testdata/custom_time_fields.log) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/testdata/full.log (renamed from src/go/collectors/go.d.plugin/modules/weblog/testdata/full.log) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/testdata/u_ex221107.log (renamed from src/go/collectors/go.d.plugin/modules/weblog/testdata/u_ex221107.log) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/weblog.go (renamed from src/go/collectors/go.d.plugin/modules/weblog/weblog.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/weblog/weblog_test.go (renamed from src/go/collectors/go.d.plugin/modules/weblog/weblog_test.go) | 6 | ||||
l--------- | src/go/plugin/go.d/modules/whoisquery/README.md (renamed from src/go/collectors/go.d.plugin/modules/whoisquery/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/whoisquery/charts.go (renamed from src/go/collectors/go.d.plugin/modules/whoisquery/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/whoisquery/collect.go (renamed from src/go/collectors/go.d.plugin/modules/whoisquery/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/whoisquery/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/whoisquery/config_schema.json) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/whoisquery/init.go (renamed from src/go/collectors/go.d.plugin/modules/whoisquery/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/whoisquery/integrations/domain_expiration_date.md (renamed from src/go/collectors/go.d.plugin/modules/whoisquery/integrations/domain_expiration_date.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/whoisquery/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/whoisquery/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/whoisquery/provider.go (renamed from src/go/collectors/go.d.plugin/modules/whoisquery/provider.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/whoisquery/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/whoisquery/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/whoisquery/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/whoisquery/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/whoisquery/whoisquery.go (renamed from src/go/collectors/go.d.plugin/modules/whoisquery/whoisquery.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/whoisquery/whoisquery_test.go (renamed from src/go/collectors/go.d.plugin/modules/whoisquery/whoisquery_test.go) | 2 | ||||
l--------- | src/go/plugin/go.d/modules/windows/README.md (renamed from src/go/collectors/go.d.plugin/modules/windows/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/charts.go (renamed from src/go/collectors/go.d.plugin/modules/windows/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_ad.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_ad.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_adcs.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_adcs.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_adfs.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_adfs.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_collector.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_collector.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_cpu.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_cpu.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_exchange.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_exchange.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_hyperv.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_hyperv.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_iis.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_iis.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_logical_disk.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_logical_disk.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_logon.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_logon.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_memory.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_memory.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_mssql.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_mssql.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_net.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_net.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_netframework.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_netframework.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_os.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_os.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_process.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_process.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_service.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_service.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_system.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_system.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_tcp.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_tcp.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/collect_thermalzone.go (renamed from src/go/collectors/go.d.plugin/modules/windows/collect_thermalzone.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/windows/config_schema.json) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/init.go (renamed from src/go/collectors/go.d.plugin/modules/windows/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/integrations/active_directory.md (renamed from src/go/collectors/go.d.plugin/modules/windows/integrations/active_directory.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/integrations/hyperv.md (renamed from src/go/collectors/go.d.plugin/modules/windows/integrations/hyperv.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/integrations/ms_exchange.md (renamed from src/go/collectors/go.d.plugin/modules/windows/integrations/ms_exchange.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/integrations/ms_sql_server.md (renamed from src/go/collectors/go.d.plugin/modules/windows/integrations/ms_sql_server.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/integrations/net_framework.md (renamed from src/go/collectors/go.d.plugin/modules/windows/integrations/net_framework.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/integrations/windows.md (renamed from src/go/collectors/go.d.plugin/modules/windows/integrations/windows.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/windows/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/windows/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/windows/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/testdata/v0.20.0/metrics.txt (renamed from src/go/collectors/go.d.plugin/modules/windows/testdata/v0.20.0/metrics.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/windows.go (renamed from src/go/collectors/go.d.plugin/modules/windows/windows.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/windows/windows_test.go (renamed from src/go/collectors/go.d.plugin/modules/windows/windows_test.go) | 4 | ||||
l--------- | src/go/plugin/go.d/modules/wireguard/README.md (renamed from src/go/collectors/go.d.plugin/modules/wireguard/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/wireguard/charts.go (renamed from src/go/collectors/go.d.plugin/modules/wireguard/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/wireguard/collect.go (renamed from src/go/collectors/go.d.plugin/modules/wireguard/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/wireguard/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/wireguard/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/wireguard/integrations/wireguard.md (renamed from src/go/collectors/go.d.plugin/modules/wireguard/integrations/wireguard.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/wireguard/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/wireguard/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/wireguard/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/wireguard/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/wireguard/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/wireguard/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/wireguard/wireguard.go (renamed from src/go/collectors/go.d.plugin/modules/wireguard/wireguard.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/wireguard/wireguard_test.go (renamed from src/go/collectors/go.d.plugin/modules/wireguard/wireguard_test.go) | 2 | ||||
l--------- | src/go/plugin/go.d/modules/x509check/README.md (renamed from src/go/collectors/go.d.plugin/modules/x509check/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/x509check/charts.go (renamed from src/go/collectors/go.d.plugin/modules/x509check/charts.go) | 3 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/x509check/collect.go (renamed from src/go/collectors/go.d.plugin/modules/x509check/collect.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/x509check/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/x509check/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/x509check/init.go (renamed from src/go/collectors/go.d.plugin/modules/x509check/init.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/x509check/integrations/x.509_certificate.md (renamed from src/go/collectors/go.d.plugin/modules/x509check/integrations/x.509_certificate.md) | 45 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/x509check/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/x509check/metadata.yaml) | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/x509check/provider.go (renamed from src/go/collectors/go.d.plugin/modules/x509check/provider.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/x509check/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/x509check/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/x509check/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/x509check/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/x509check/x509check.go (renamed from src/go/collectors/go.d.plugin/modules/x509check/x509check.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/x509check/x509check_test.go (renamed from src/go/collectors/go.d.plugin/modules/x509check/x509check_test.go) | 4 | ||||
l--------- | src/go/plugin/go.d/modules/zfspool/README.md (renamed from src/go/collectors/go.d.plugin/modules/zfspool/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/charts.go (renamed from src/go/collectors/go.d.plugin/modules/zfspool/charts.go) | 96 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/collect.go | 27 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/collect_zpool_list.go (renamed from src/go/collectors/go.d.plugin/modules/zfspool/collect.go) | 87 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/collect_zpool_list_vdev.go | 138 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/zfspool/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/exec.go (renamed from src/go/collectors/go.d.plugin/modules/zfspool/exec.go) | 17 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/init.go (renamed from src/go/collectors/go.d.plugin/modules/zfspool/init.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/integrations/zfs_pools.md (renamed from src/go/collectors/go.d.plugin/modules/zfspool/integrations/zfs_pools.md) | 57 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/zfspool/metadata.yaml) | 24 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/testdata/config.json | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/testdata/config.yaml | 3 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/testdata/zpool-list-vdev-logs-cache.txt | 12 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/testdata/zpool-list-vdev.txt | 5 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/testdata/zpool-list.txt (renamed from src/go/collectors/go.d.plugin/modules/zfspool/testdata/zpool-list.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/zfspool.go (renamed from src/go/collectors/go.d.plugin/modules/zfspool/zfspool.go) | 13 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zfspool/zfspool_test.go | 546 | ||||
l--------- | src/go/plugin/go.d/modules/zookeeper/README.md (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/README.md) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/charts.go (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/charts.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/collect.go (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/collect.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/config_schema.json (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/config_schema.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/fetcher.go (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/fetcher.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/fetcher_test.go (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/fetcher_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/init.go (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/init.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/integrations/zookeeper.md (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/integrations/zookeeper.md) | 39 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/metadata.yaml (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/metadata.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/testdata/config.json (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/testdata/config.json) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/testdata/config.yaml (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/testdata/config.yaml) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/testdata/mntr.txt (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/testdata/mntr.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/testdata/mntr_notinwhitelist.txt (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/testdata/mntr_notinwhitelist.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/zookeeper.go (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/zookeeper.go) | 6 | ||||
-rw-r--r-- | src/go/plugin/go.d/modules/zookeeper/zookeeper_test.go (renamed from src/go/collectors/go.d.plugin/modules/zookeeper/zookeeper_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/README.md (renamed from src/go/collectors/go.d.plugin/pkg/README.md) | 18 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/dockerhost/dockerhost.go (renamed from src/go/collectors/go.d.plugin/pkg/dockerhost/dockerhost.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/iprange/README.md (renamed from src/go/collectors/go.d.plugin/pkg/iprange/README.md) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/iprange/parse.go (renamed from src/go/collectors/go.d.plugin/pkg/iprange/parse.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/iprange/parse_test.go (renamed from src/go/collectors/go.d.plugin/pkg/iprange/parse_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/iprange/pool.go (renamed from src/go/collectors/go.d.plugin/pkg/iprange/pool.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/iprange/pool_test.go (renamed from src/go/collectors/go.d.plugin/pkg/iprange/pool_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/iprange/range.go (renamed from src/go/collectors/go.d.plugin/pkg/iprange/range.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/iprange/range_test.go (renamed from src/go/collectors/go.d.plugin/pkg/iprange/range_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/k8sclient/k8sclient.go (renamed from src/go/collectors/go.d.plugin/pkg/k8sclient/k8sclient.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/csv.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/csv.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/csv_test.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/csv_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/json.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/json.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/json_test.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/json_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/lastline.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/lastline.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/lastline_test.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/lastline_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/ltsv.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/ltsv.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/ltsv_test.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/ltsv_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/parser.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/parser.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/parser_test.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/parser_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/reader.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/reader.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/reader_test.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/reader_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/regexp.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/regexp.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/logs/regexp_test.go (renamed from src/go/collectors/go.d.plugin/pkg/logs/regexp_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/README.md (renamed from src/go/collectors/go.d.plugin/pkg/matcher/README.md) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/cache.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/cache.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/cache_test.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/cache_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/doc.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/doc.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/doc_test.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/doc_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/expr.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/expr.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/expr_test.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/expr_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/glob.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/glob.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/glob_test.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/glob_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/logical.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/logical.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/logical_test.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/logical_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/matcher.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/matcher.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/matcher_test.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/matcher_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/regexp.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/regexp.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/regexp_test.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/regexp_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/simple_patterns.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/simple_patterns.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/simple_patterns_test.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/simple_patterns_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/string.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/string.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/matcher/string_test.go (renamed from src/go/collectors/go.d.plugin/pkg/matcher/string_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/metrics/counter.go (renamed from src/go/collectors/go.d.plugin/pkg/metrics/counter.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/metrics/counter_test.go (renamed from src/go/collectors/go.d.plugin/pkg/metrics/counter_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/metrics/gauge.go (renamed from src/go/collectors/go.d.plugin/pkg/metrics/gauge.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/metrics/gauge_test.go (renamed from src/go/collectors/go.d.plugin/pkg/metrics/gauge_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/metrics/histogram.go (renamed from src/go/collectors/go.d.plugin/pkg/metrics/histogram.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/metrics/histogram_test.go (renamed from src/go/collectors/go.d.plugin/pkg/metrics/histogram_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/metrics/metrics.go (renamed from src/go/collectors/go.d.plugin/pkg/metrics/metrics.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/metrics/summary.go (renamed from src/go/collectors/go.d.plugin/pkg/metrics/summary.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/metrics/summary_test.go (renamed from src/go/collectors/go.d.plugin/pkg/metrics/summary_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/metrics/unique_counter.go (renamed from src/go/collectors/go.d.plugin/pkg/metrics/unique_counter.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/metrics/unique_counter_test.go (renamed from src/go/collectors/go.d.plugin/pkg/metrics/unique_counter_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/multipath/multipath.go (renamed from src/go/collectors/go.d.plugin/pkg/multipath/multipath.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/multipath/multipath_test.go (renamed from src/go/collectors/go.d.plugin/pkg/multipath/multipath_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/multipath/testdata/data1/test-empty.conf (renamed from src/go/collectors/go.d.plugin/pkg/multipath/testdata/data1/test-empty.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/multipath/testdata/data1/test.conf (renamed from src/go/collectors/go.d.plugin/pkg/multipath/testdata/data1/test.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/multipath/testdata/data2/test-empty.conf (renamed from src/go/collectors/go.d.plugin/pkg/multipath/testdata/data2/test-empty.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/multipath/testdata/data2/test.conf (renamed from src/go/collectors/go.d.plugin/pkg/multipath/testdata/data2/test.conf) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/client.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/client.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/client_test.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/client_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/metric_family.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/metric_family.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/metric_family_test.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/metric_family_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/metric_series.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/metric_series.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/metric_series_test.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/metric_series_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/parse.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/parse.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/parse_test.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/parse_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/selector/README.md (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/selector/expr.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/selector/expr.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/selector/expr_test.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/selector/expr_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/selector/logical.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/selector/logical.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/selector/logical_test.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/selector/logical_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/selector/parse.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/selector/parse.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/selector/parse_test.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/selector/parse_test.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/selector/selector.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/selector/selector.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/selector/selector_test.go (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/selector/selector_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/testdata/counter-meta.txt (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/testdata/counter-meta.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/testdata/counter-no-meta.txt (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/testdata/counter-no-meta.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/testdata/gauge-meta.txt (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/testdata/gauge-meta.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/testdata/gauge-no-meta.txt (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/testdata/gauge-no-meta.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/testdata/histogram-meta.txt (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/testdata/histogram-meta.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/testdata/histogram-no-meta.txt (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/testdata/histogram-no-meta.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/testdata/multiline-help.txt (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/testdata/multiline-help.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/testdata/summary-meta.txt (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/testdata/summary-meta.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/testdata/summary-no-meta.txt (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/testdata/summary-no-meta.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/testdata/testdata.nometa.txt (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/testdata/testdata.nometa.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/prometheus/testdata/testdata.txt (renamed from src/go/collectors/go.d.plugin/pkg/prometheus/testdata/testdata.txt) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/socket/client.go (renamed from src/go/collectors/go.d.plugin/pkg/socket/client.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/socket/client_test.go (renamed from src/go/collectors/go.d.plugin/pkg/socket/client_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/socket/servers_test.go (renamed from src/go/collectors/go.d.plugin/pkg/socket/servers_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/socket/types.go (renamed from src/go/collectors/go.d.plugin/pkg/socket/types.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/socket/utils.go (renamed from src/go/collectors/go.d.plugin/pkg/socket/utils.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/stm/stm.go (renamed from src/go/collectors/go.d.plugin/pkg/stm/stm.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/stm/stm_test.go (renamed from src/go/collectors/go.d.plugin/pkg/stm/stm_test.go) | 4 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/tlscfg/config.go (renamed from src/go/collectors/go.d.plugin/pkg/tlscfg/config.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/tlscfg/config_test.go (renamed from src/go/collectors/go.d.plugin/pkg/tlscfg/config_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/web/client.go (renamed from src/go/collectors/go.d.plugin/pkg/web/client.go) | 2 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/web/client_test.go (renamed from src/go/collectors/go.d.plugin/pkg/web/client_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/web/doc.go (renamed from src/go/collectors/go.d.plugin/pkg/web/doc.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/web/doc_test.go (renamed from src/go/collectors/go.d.plugin/pkg/web/doc_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/web/duration.go (renamed from src/go/collectors/go.d.plugin/pkg/web/duration.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/web/duration_test.go (renamed from src/go/collectors/go.d.plugin/pkg/web/duration_test.go) | 0 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/web/request.go (renamed from src/go/collectors/go.d.plugin/pkg/web/request.go) | 17 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/web/request_test.go (renamed from src/go/collectors/go.d.plugin/pkg/web/request_test.go) | 28 | ||||
-rw-r--r-- | src/go/plugin/go.d/pkg/web/web.go (renamed from src/go/collectors/go.d.plugin/pkg/web/web.go) | 0 |
2406 files changed, 49525 insertions, 6996 deletions
diff --git a/src/go/collectors/go.d.plugin/cmd/godplugin/main.go b/src/go/cmd/godplugin/main.go index 5ff6c726..cae9fa1b 100644 --- a/src/go/collectors/go.d.plugin/cmd/godplugin/main.go +++ b/src/go/cmd/godplugin/main.go @@ -12,20 +12,22 @@ import ( "path/filepath" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" - "github.com/netdata/netdata/go/go.d.plugin/cli" - "github.com/netdata/netdata/go/go.d.plugin/logger" - "github.com/netdata/netdata/go/go.d.plugin/pkg/buildinfo" - "github.com/netdata/netdata/go/go.d.plugin/pkg/multipath" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/pkg/buildinfo" + "github.com/netdata/netdata/go/plugins/pkg/executable" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent" + "github.com/netdata/netdata/go/plugins/plugin/go.d/cli" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/multipath" "github.com/jessevdk/go-flags" "golang.org/x/net/http/httpproxy" - _ "github.com/netdata/netdata/go/go.d.plugin/modules" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules" ) var ( + cygwinBasePath = os.Getenv("NETDATA_CYGWIN_BASE_PATH") + name = "go.d" userDir = os.Getenv("NETDATA_USER_CONFIG_DIR") stockDir = os.Getenv("NETDATA_STOCK_CONFIG_DIR") @@ -35,6 +37,14 @@ var ( envLogLevel = os.Getenv("NETDATA_LOG_LEVEL") ) +func init() { + userDir = handleDirOnWin(userDir) + stockDir = handleDirOnWin(stockDir) + varLibDir = handleDirOnWin(varLibDir) + lockDir = handleDirOnWin(lockDir) + watchPath = handleDirOnWin(watchPath) +} + func confDir(opts *cli.Option) multipath.MultiPath { if len(opts.ConfDir) > 0 { return opts.ConfDir @@ -48,7 +58,10 @@ func confDir(opts *cli.Option) multipath.MultiPath { dirs = append(dirs, filepath.Join(executable.Directory, "/../../../../etc/netdata")) - for _, dir := range []string{"/etc/netdata", "/opt/netdata/etc/netdata"} { + for _, dir := range []string{ + handleDirOnWin("/etc/netdata"), + handleDirOnWin("/opt/netdata/etc/netdata"), + } { if isDirExists(dir) { dirs = append(dirs, dir) break @@ -57,7 +70,10 @@ func confDir(opts *cli.Option) multipath.MultiPath { dirs = append(dirs, filepath.Join(executable.Directory, "/../../../../usr/lib/netdata/conf.d")) - for _, dir := range []string{"/usr/lib/netdata/conf.d", "/opt/netdata/usr/lib/netdata/conf.d"} { + for _, dir := range []string{ + handleDirOnWin("/usr/lib/netdata/conf.d"), + handleDirOnWin("/opt/netdata/usr/lib/netdata/conf.d"), + } { if isDirExists(dir) { dirs = append(dirs, dir) break @@ -170,3 +186,18 @@ func isDirExists(dir string) bool { } return !errors.Is(err, fs.ErrNotExist) } + +func handleDirOnWin(path string) string { + base := cygwinBasePath + + // TODO: temp workaround for debug mode + if base == "" && strings.HasPrefix(executable.Directory, "C:\\msys64") { + base = "C:\\msys64" + } + + if base == "" || !strings.HasPrefix(path, "/") { + return path + } + + return filepath.Join(base, path) +} diff --git a/src/go/collectors/go.d.plugin/README.md b/src/go/collectors/go.d.plugin/README.md deleted file mode 100644 index 5100e518..00000000 --- a/src/go/collectors/go.d.plugin/README.md +++ /dev/null @@ -1,227 +0,0 @@ -<!-- -title: go.d.plugin -description: "go.d.plugin is an external plugin for Netdata, responsible for running individual data collectors written in Go." -custom_edit_url: "/src/go/collectors/go.d.plugin/README.md" -sidebar_label: "go.d.plugin" -learn_status: "Published" -learn_topic_type: "Tasks" -learn_rel_path: "Developers/External plugins/go.d.plugin" -sidebar_position: 1 ---> - -# go.d.plugin - -`go.d.plugin` is a [Netdata](https://github.com/netdata/netdata) external plugin. It is an **orchestrator** for data -collection modules written in `go`. - -1. It runs as an independent process (`ps fax` shows it). -2. It is started and stopped automatically by Netdata. -3. It communicates with Netdata via a unidirectional pipe (sending data to the Netdata daemon). -4. Supports any number of data collection modules. -5. Allows each module to have any number of data collection jobs. - -## Bug reports, feature requests, and questions - -Are welcome! We are using [netdata/netdata](https://github.com/netdata/netdata/) repository for bugs, feature requests, -and questions. - -- [GitHub Issues](https://github.com/netdata/netdata/issues/new/choose): report bugs or open a new feature request. -- [GitHub Discussions](https://github.com/netdata/netdata/discussions): ask a question or suggest a new idea. - -## Install - -Go.d.plugin is shipped with Netdata. - -### Required Linux capabilities - -All capabilities are set automatically during Netdata installation using -the [official installation method](/packaging/installer/README.md#install-on-linux-with-one-line-installer). -No further action required. If you have used a different installation method and need to set the capabilities manually, -see the appropriate collector readme. - -| Capability | Required by | -|:--------------------|:------------------------------------------------------------------------------------------------------------------:| -| CAP_NET_RAW | [Ping](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/ping#readme) | -| CAP_NET_ADMIN | [Wireguard](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/wireguard#readme) | -| CAP_DAC_READ_SEARCH | [Filecheck](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/filecheck#readme) | - -## Available modules - -| Name | Monitors | -|:------------------------------------------------------------------------------------------------------------------------------|:-----------------------------:| -| [adaptec_raid](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/adaptecraid) | Adaptec Hardware RAID | -| [activemq](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/activemq) | ActiveMQ | -| [apache](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/apache) | Apache | -| [bind](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/bind) | ISC Bind | -| [cassandra](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/cassandra) | Cassandra | -| [chrony](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/chrony) | Chrony | -| [clickhouse](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/clickhouse) | ClickHouse | -| [cockroachdb](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/cockroachdb) | CockroachDB | -| [consul](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/consul) | Consul | -| [coredns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/coredns) | CoreDNS | -| [couchbase](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/couchbase) | Couchbase | -| [couchdb](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/couchdb) | CouchDB | -| [dmcache](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/dmcache) | DMCache | -| [dnsdist](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/dnsdist) | Dnsdist | -| [dnsmasq](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/dnsmasq) | Dnsmasq DNS Forwarder | -| [dnsmasq_dhcp](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp) | Dnsmasq DHCP | -| [dns_query](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/dnsquery) | DNS Query RTT | -| [docker](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/docker) | Docker Engine | -| [docker_engine](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/docker_engine) | Docker Engine | -| [dockerhub](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/dockerhub) | Docker Hub | -| [elasticsearch](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/elasticsearch) | Elasticsearch/OpenSearch | -| [envoy](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/envoy) | Envoy | -| [example](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/example) | - | -| [fail2ban](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/fail2ban) | Fail2Ban Jails | -| [filecheck](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/filecheck) | Files and Directories | -| [fluentd](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/fluentd) | Fluentd | -| [freeradius](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/freeradius) | FreeRADIUS | -| [haproxy](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/haproxy) | HAProxy | -| [hddtemp](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/hddtemp) | Disks temperature | -| [hdfs](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/hdfs) | HDFS | -| [hpssa](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/hpssa) | HPE Smart Array | -| [httpcheck](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/httpcheck) | Any HTTP Endpoint | -| [intelgpu](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/intelgpu) | Intel integrated GPU | -| [isc_dhcpd](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/isc_dhcpd) | ISC DHCP | -| [k8s_kubelet](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/k8s_kubelet) | Kubelet | -| [k8s_kubeproxy](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy) | Kube-proxy | -| [k8s_state](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/k8s_state) | Kubernetes cluster state | -| [lighttpd](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/lighttpd) | Lighttpd | -| [litespeed](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/litespeed) | Litespeed | -| [logind](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/logind) | systemd-logind | -| [logstash](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/logstash) | Logstash | -| [lvm](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/lvm) | LVM logical volumes | -| [megacli](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/megacli) | MegaCli Hardware Raid | -| [mongoDB](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/mongodb) | MongoDB | -| [mysql](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/mysql) | MySQL | -| [nginx](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/nginx) | NGINX | -| [nginxplus](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/nginxplus) | NGINX Plus | -| [nginxvts](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/nginxvts) | NGINX VTS | -| [ntpd](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/ntpd) | NTP daemon | -| [nvme](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/nvme) | NVMe devices | -| [openvpn](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/openvpn) | OpenVPN | -| [openvpn_status_log](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/openvpn_status_log) | OpenVPN | -| [pgbouncer](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/pgbouncer) | PgBouncer | -| [phpdaemon](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/phpdaemon) | phpDaemon | -| [phpfpm](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/phpfpm) | PHP-FPM | -| [pihole](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/pihole) | Pi-hole | -| [pika](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/pika) | Pika | -| [ping](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/ping) | Any network host | -| [prometheus](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/prometheus) | Any Prometheus Endpoint | -| [portcheck](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/portcheck) | Any TCP Endpoint | -| [postgres](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/postgres) | PostgreSQL | -| [powerdns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/powerdns) | PowerDNS Authoritative Server | -| [powerdns_recursor](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/powerdns_recursor) | PowerDNS Recursor | -| [proxysql](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/proxysql) | ProxySQL | -| [pulsar](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/portcheck) | Apache Pulsar | -| [rabbitmq](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/rabbitmq) | RabbitMQ | -| [redis](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/redis) | Redis | -| [rspamd](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/rspamd) | Rspamd | -| [scaleio](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/scaleio) | Dell EMC ScaleIO | -| [sensors](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules) | Hardware Sensors | -| [SNMP](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/modules/snmp) | SNMP | -| [squidlog](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/squidlog) | Squid | -| [smartctl](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/smartctl) | S.M.A.R.T Storage Devices | -| [storcli](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/storcli) | Broadcom Hardware RAID | -| [supervisord](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/supervisord) | Supervisor | -| [systemdunits](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/systemdunits) | Systemd unit state | -| [tengine](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/tengine) | Tengine | -| [traefik](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/traefik) | Traefik | -| [upsd](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/upsd) | UPSd (Nut) | -| [unbound](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/unbound) | Unbound | -| [vcsa](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/vcsa) | vCenter Server Appliance | -| [vernemq](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/vernemq) | VerneMQ | -| [vsphere](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/vsphere) | VMware vCenter Server | -| [web_log](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/weblog) | Apache/NGINX | -| [wireguard](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/wireguard) | WireGuard | -| [whoisquery](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/whoisquery) | Domain Expiry | -| [windows](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/windows) | Windows | -| [x509check](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/x509check) | Digital Certificates | -| [zfspool](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/zfspool) | ZFS Pools | -| [zookeeper](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/zookeeper) | ZooKeeper | - -## Configuration - -Edit the `go.d.conf` configuration file using `edit-config` from the -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory), -which is typically at `/etc/netdata`. - -```bash -cd /etc/netdata # Replace this path with your Netdata config directory -sudo ./edit-config go.d.conf -``` - -Configurations are written in [YAML](http://yaml.org/). - -- [plugin configuration](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d.conf) -- [specific module configuration](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/config/go.d) - -### Enable a collector - -To enable a collector you should edit `go.d.conf` to uncomment the collector in question and change it from `no` -to `yes`. - -For example, to enable the `example` plugin you would need to update `go.d.conf` from something like: - -```yaml -modules: -# example: no -``` - -to - -```yaml -modules: - example: yes -``` - -Then [restart netdata](/packaging/installer/README.md#maintaining-a-netdata-agent-installation) -for the change to take effect. - -## Contributing - -If you want to contribute to this project, we are humbled. Please take a look at -our [contributing guidelines](https://github.com/netdata/.github/blob/main/CONTRIBUTING.md) and don't hesitate to -contact us in our forums. - -### How to develop a collector - -Read [how to write a Netdata collector in Go](/src/go/collectors/go.d.plugin/docs/how-to-write-a-module.md). - -## Troubleshooting - -Plugin CLI: - -```sh -Usage: - orchestrator [OPTIONS] [update every] - -Application Options: - -m, --modules= module name to run (default: all) - -c, --config-dir= config dir to read - -w, --watch-path= config path to watch - -d, --debug debug mode - -v, --version display the version and exit - -Help Options: - -h, --help Show this help message -``` - -To debug specific module: - -```sh -# become user netdata -sudo su -s /bin/bash netdata - -# run plugin in debug mode -./go.d.plugin -d -m <module name> -``` - -Change `<module name>` to the [module name](#available-modules) you want to debug. - -## Netdata Community - -This repository follows the Netdata Code of Conduct and is part of the Netdata Community. - -- [Community Forums](https://community.netdata.cloud) -- [Netdata Code of Conduct](https://github.com/netdata/.github/blob/main/CODE_OF_CONDUCT.md) diff --git a/src/go/collectors/go.d.plugin/agent/functions/manager.go b/src/go/collectors/go.d.plugin/agent/functions/manager.go deleted file mode 100644 index 365d0670..00000000 --- a/src/go/collectors/go.d.plugin/agent/functions/manager.go +++ /dev/null @@ -1,136 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package functions - -import ( - "bufio" - "context" - "encoding/json" - "fmt" - "io" - "log/slog" - "os" - "strconv" - "strings" - "sync" - "time" - - "github.com/netdata/netdata/go/go.d.plugin/agent/netdataapi" - "github.com/netdata/netdata/go/go.d.plugin/agent/safewriter" - "github.com/netdata/netdata/go/go.d.plugin/logger" - - "github.com/mattn/go-isatty" - "github.com/muesli/cancelreader" -) - -var isTerminal = isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsTerminal(os.Stdin.Fd()) - -func NewManager() *Manager { - return &Manager{ - Logger: logger.New().With( - slog.String("component", "functions manager"), - ), - Input: os.Stdin, - api: netdataapi.New(safewriter.Stdout), - mux: &sync.Mutex{}, - FunctionRegistry: make(map[string]func(Function)), - } -} - -type Manager struct { - *logger.Logger - - Input io.Reader - api *netdataapi.API - mux *sync.Mutex - FunctionRegistry map[string]func(Function) -} - -func (m *Manager) Run(ctx context.Context) { - m.Info("instance is started") - defer func() { m.Info("instance is stopped") }() - - if !isTerminal { - r, err := cancelreader.NewReader(m.Input) - if err != nil { - m.Errorf("fail to create cancel reader: %v", err) - return - } - - go func() { <-ctx.Done(); r.Cancel() }() - - var wg sync.WaitGroup - - wg.Add(1) - go func() { defer wg.Done(); m.run(r) }() - - wg.Wait() - _ = r.Close() - } - - <-ctx.Done() -} - -func (m *Manager) run(r io.Reader) { - sc := bufio.NewScanner(r) - - for sc.Scan() { - text := sc.Text() - - var fn *Function - var err error - - // FIXME: if we are waiting for FUNCTION_PAYLOAD_END and a new FUNCTION* appears, - // we need to discard the current one and switch to the new one - switch { - case strings.HasPrefix(text, "FUNCTION "): - fn, err = parseFunction(text) - case strings.HasPrefix(text, "FUNCTION_PAYLOAD "): - fn, err = parseFunctionWithPayload(text, sc) - case text == "": - continue - default: - m.Warningf("unexpected line: '%s'", text) - continue - } - - if err != nil { - m.Warningf("parse function: %v ('%s')", err, text) - continue - } - - function, ok := m.lookupFunction(fn.Name) - if !ok { - m.Infof("skipping execution of '%s': unregistered function", fn.Name) - m.respf(fn, 501, "unregistered function: %s", fn.Name) - continue - } - if function == nil { - m.Warningf("skipping execution of '%s': nil function registered", fn.Name) - m.respf(fn, 501, "nil function: %s", fn.Name) - continue - } - - function(*fn) - } -} - -func (m *Manager) lookupFunction(name string) (func(Function), bool) { - m.mux.Lock() - defer m.mux.Unlock() - - f, ok := m.FunctionRegistry[name] - return f, ok -} - -func (m *Manager) respf(fn *Function, code int, msgf string, a ...any) { - bs, _ := json.Marshal(struct { - Status int `json:"status"` - Message string `json:"message"` - }{ - Status: code, - Message: fmt.Sprintf(msgf, a...), - }) - ts := strconv.FormatInt(time.Now().Unix(), 10) - m.api.FUNCRESULT(fn.UID, "application/json", string(bs), strconv.Itoa(code), ts) -} diff --git a/src/go/collectors/go.d.plugin/config/go.d/snmp.conf b/src/go/collectors/go.d.plugin/config/go.d/snmp.conf deleted file mode 100644 index 32a4addb..00000000 --- a/src/go/collectors/go.d.plugin/config/go.d/snmp.conf +++ /dev/null @@ -1,48 +0,0 @@ -## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/snmp#readme - -#jobs: -# - name: switch -# update_every: 10 -# hostname: "192.0.2.1" -# community: public -# options: -# version: 2 -# user: -# name: "username" -# level: "authPriv" -# auth_proto: "sha256" -# auth_key: "auth_protocol_passphrase" -# priv_proto: "aes256" -# priv_key: "priv_protocol_passphrase" -# charts: -# - id: "bandwidth_port1" -# title: "Switch Bandwidth for port 1" -# units: "kilobits/s" -# type: "area" -# family: "ports" -# dimensions: -# - name: "in" -# oid: "1.3.6.1.2.1.2.2.1.10.1" -# algorithm: "incremental" -# multiplier: 8 -# divisor: 1000 -# - name: "out" -# oid: "1.3.6.1.2.1.2.2.1.16.1" -# multiplier: -8 -# divisor: 1000 -# - id: "bandwidth_port2" -# title: "Switch Bandwidth for port 2" -# units: "kilobits/s" -# type: "area" -# family: "ports" -# dimensions: -# - name: "in" -# oid: "1.3.6.1.2.1.2.2.1.10.2" -# algorithm: "incremental" -# multiplier: 8 -# divisor: 1000 -# - name: "out" -# oid: "1.3.6.1.2.1.2.2.1.16.2" -# multiplier: -8 -# divisor: 1000 diff --git a/src/go/collectors/go.d.plugin/modules/chrony/charts.go b/src/go/collectors/go.d.plugin/modules/chrony/charts.go deleted file mode 100644 index 6b8f4289..00000000 --- a/src/go/collectors/go.d.plugin/modules/chrony/charts.go +++ /dev/null @@ -1,148 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package chrony - -import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" -) - -var charts = module.Charts{ - { - ID: "stratum", - Title: "Distance to the reference clock", - Units: "level", - Fam: "stratum", - Ctx: "chrony.stratum", - Dims: module.Dims{ - {ID: "stratum", Name: "stratum"}, - }, - }, - { - ID: "current_correction", - Title: "Current correction", - Units: "seconds", - Fam: "correction", - Ctx: "chrony.current_correction", - Dims: module.Dims{ - {ID: "current_correction", Div: scaleFactor}, - }, - }, - { - ID: "root_delay", - Title: "Network path delay to stratum-1", - Units: "seconds", - Fam: "root", - Ctx: "chrony.root_delay", - Dims: module.Dims{ - {ID: "root_delay", Div: scaleFactor}, - }, - }, - { - ID: "root_dispersion", - Title: "Dispersion accumulated back to stratum-1", - Units: "seconds", - Fam: "root", - Ctx: "chrony.root_dispersion", - Dims: module.Dims{ - {ID: "root_dispersion", Div: scaleFactor}, - }, - }, - { - ID: "last_offset", - Title: "Offset on the last clock update", - Units: "seconds", - Fam: "offset", - Ctx: "chrony.last_offset", - Dims: module.Dims{ - {ID: "last_offset", Name: "offset", Div: scaleFactor}, - }, - }, - { - ID: "rms_offset", - Title: "Long-term average of the offset value", - Units: "seconds", - Fam: "offset", - Ctx: "chrony.rms_offset", - Dims: module.Dims{ - {ID: "rms_offset", Name: "offset", Div: scaleFactor}, - }, - }, - { - ID: "frequency", - Title: "Frequency", - Units: "ppm", - Fam: "frequency", - Ctx: "chrony.frequency", - Dims: module.Dims{ - {ID: "frequency", Div: scaleFactor}, - }, - }, - { - ID: "residual_frequency", - Title: "Residual frequency", - Units: "ppm", - Fam: "frequency", - Ctx: "chrony.residual_frequency", - Dims: module.Dims{ - {ID: "residual_frequency", Div: scaleFactor}, - }, - }, - { - ID: "skew", - Title: "Skew", - Units: "ppm", - Fam: "frequency", - Ctx: "chrony.skew", - Dims: module.Dims{ - {ID: "skew", Div: scaleFactor}, - }, - }, - { - ID: "update_interval", - Title: "Interval between the last two clock updates", - Units: "seconds", - Fam: "updates", - Ctx: "chrony.update_interval", - Dims: module.Dims{ - {ID: "update_interval", Div: scaleFactor}, - }, - }, - { - ID: "ref_measurement_time", - Title: "Time since the last measurement", - Units: "seconds", - Fam: "updates", - Ctx: "chrony.ref_measurement_time", - Dims: module.Dims{ - {ID: "ref_measurement_time"}, - }, - }, - { - ID: "leap_status", - Title: "Leap status", - Units: "status", - Fam: "leap status", - Ctx: "chrony.leap_status", - Dims: module.Dims{ - {ID: "leap_status_normal", Name: "normal"}, - {ID: "leap_status_insert_second", Name: "insert_second"}, - {ID: "leap_status_delete_second", Name: "delete_second"}, - {ID: "leap_status_unsynchronised", Name: "unsynchronised"}, - }, - }, - { - ID: "activity", - Title: "Peers activity", - Units: "sources", - Fam: "activity", - Ctx: "chrony.activity", - Type: module.Stacked, - Dims: module.Dims{ - {ID: "online_sources", Name: "online"}, - {ID: "offline_sources", Name: "offline"}, - {ID: "burst_online_sources", Name: "burst_online"}, - {ID: "burst_offline_sources", Name: "burst_offline"}, - {ID: "unresolved_sources", Name: "unresolved"}, - }, - }, -} diff --git a/src/go/collectors/go.d.plugin/modules/chrony/client.go b/src/go/collectors/go.d.plugin/modules/chrony/client.go deleted file mode 100644 index e850ff23..00000000 --- a/src/go/collectors/go.d.plugin/modules/chrony/client.go +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package chrony - -import ( - "fmt" - "net" - - "github.com/facebook/time/ntp/chrony" -) - -func newChronyClient(c Config) (chronyClient, error) { - conn, err := net.DialTimeout("udp", c.Address, c.Timeout.Duration()) - if err != nil { - return nil, err - } - - client := &simpleClient{ - conn: conn, - client: &chrony.Client{Connection: conn}, - } - return client, nil -} - -type simpleClient struct { - conn net.Conn - client *chrony.Client -} - -func (sc *simpleClient) Tracking() (*chrony.ReplyTracking, error) { - reply, err := sc.client.Communicate(chrony.NewTrackingPacket()) - if err != nil { - return nil, err - } - - tracking, ok := reply.(*chrony.ReplyTracking) - if !ok { - return nil, fmt.Errorf("unexpected reply type, want=%T, got=%T", &chrony.ReplyTracking{}, reply) - } - return tracking, nil -} - -func (sc *simpleClient) Activity() (*chrony.ReplyActivity, error) { - reply, err := sc.client.Communicate(chrony.NewActivityPacket()) - if err != nil { - return nil, err - } - - activity, ok := reply.(*chrony.ReplyActivity) - if !ok { - return nil, fmt.Errorf("unexpected reply type, want=%T, got=%T", &chrony.ReplyActivity{}, reply) - } - return activity, nil -} - -func (sc *simpleClient) Close() { - if sc.conn != nil { - _ = sc.conn.Close() - sc.conn = nil - } -} diff --git a/src/go/collectors/go.d.plugin/modules/chrony/collect.go b/src/go/collectors/go.d.plugin/modules/chrony/collect.go deleted file mode 100644 index 06a9ecc7..00000000 --- a/src/go/collectors/go.d.plugin/modules/chrony/collect.go +++ /dev/null @@ -1,97 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package chrony - -import ( - "fmt" - "time" -) - -const scaleFactor = 1000000000 - -func (c *Chrony) collect() (map[string]int64, error) { - if c.client == nil { - client, err := c.newClient(c.Config) - if err != nil { - return nil, err - } - c.client = client - } - - mx := make(map[string]int64) - - if err := c.collectTracking(mx); err != nil { - return nil, err - } - if err := c.collectActivity(mx); err != nil { - return mx, err - } - - return mx, nil -} - -const ( - // https://github.com/mlichvar/chrony/blob/7daf34675a5a2487895c74d1578241ca91a4eb70/ntp.h#L70-L75 - leapStatusNormal = 0 - leapStatusInsertSecond = 1 - leapStatusDeleteSecond = 2 - leapStatusUnsynchronised = 3 -) - -func (c *Chrony) collectTracking(mx map[string]int64) error { - reply, err := c.client.Tracking() - if err != nil { - return fmt.Errorf("error on collecting tracking: %v", err) - } - - mx["stratum"] = int64(reply.Stratum) - mx["leap_status_normal"] = boolToInt(reply.LeapStatus == leapStatusNormal) - mx["leap_status_insert_second"] = boolToInt(reply.LeapStatus == leapStatusInsertSecond) - mx["leap_status_delete_second"] = boolToInt(reply.LeapStatus == leapStatusDeleteSecond) - mx["leap_status_unsynchronised"] = boolToInt(reply.LeapStatus == leapStatusUnsynchronised) - mx["root_delay"] = int64(reply.RootDelay * scaleFactor) - mx["root_dispersion"] = int64(reply.RootDispersion * scaleFactor) - mx["skew"] = int64(reply.SkewPPM * scaleFactor) - mx["last_offset"] = int64(reply.LastOffset * scaleFactor) - mx["rms_offset"] = int64(reply.RMSOffset * scaleFactor) - mx["update_interval"] = int64(reply.LastUpdateInterval * scaleFactor) - // handle chrony restarts - if reply.RefTime.Year() != 1970 { - mx["ref_measurement_time"] = time.Now().Unix() - reply.RefTime.Unix() - } - mx["residual_frequency"] = int64(reply.ResidFreqPPM * scaleFactor) - // https://github.com/mlichvar/chrony/blob/5b04f3ca902e5d10aa5948fb7587d30b43941049/client.c#L1706 - mx["current_correction"] = abs(int64(reply.CurrentCorrection * scaleFactor)) - mx["frequency"] = abs(int64(reply.FreqPPM * scaleFactor)) - - return nil -} - -func (c *Chrony) collectActivity(mx map[string]int64) error { - reply, err := c.client.Activity() - if err != nil { - return fmt.Errorf("error on collecting activity: %v", err) - } - - mx["online_sources"] = int64(reply.Online) - mx["offline_sources"] = int64(reply.Offline) - mx["burst_online_sources"] = int64(reply.BurstOnline) - mx["burst_offline_sources"] = int64(reply.BurstOffline) - mx["unresolved_sources"] = int64(reply.Unresolved) - - return nil -} - -func boolToInt(v bool) int64 { - if v { - return 1 - } - return 0 -} - -func abs(v int64) int64 { - if v < 0 { - return -v - } - return v -} diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq/collect.go b/src/go/collectors/go.d.plugin/modules/dnsmasq/collect.go deleted file mode 100644 index 2561688d..00000000 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq/collect.go +++ /dev/null @@ -1,126 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package dnsmasq - -import ( - "fmt" - "strconv" - "strings" - - "github.com/miekg/dns" -) - -func (d *Dnsmasq) collect() (map[string]int64, error) { - r, err := d.queryCacheStatistics() - if err != nil { - return nil, err - } - - ms := make(map[string]int64) - if err = d.collectResponse(ms, r); err != nil { - return nil, err - } - - return ms, nil -} - -func (d *Dnsmasq) collectResponse(ms map[string]int64, resp *dns.Msg) error { - /* - ;; flags: qr aa rd ra; QUERY: 7, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 0 - - ;; QUESTION SECTION: - ;cachesize.bind. CH TXT - ;insertions.bind. CH TXT - ;evictions.bind. CH TXT - ;hits.bind. CH TXT - ;misses.bind. CH TXT - ;auth.bind. CH TXT - ;servers.bind. CH TXT - - ;; ANSWER SECTION: - cachesize.bind. 0 CH TXT "150" - insertions.bind. 0 CH TXT "1" - evictions.bind. 0 CH TXT "0" - hits.bind. 0 CH TXT "176" - misses.bind. 0 CH TXT "4" - auth.bind. 0 CH TXT "0" - servers.bind. 0 CH TXT "10.0.0.1#53 0 0" "1.1.1.1#53 4 3" "1.0.0.1#53 3 0" - */ - for _, a := range resp.Answer { - txt, ok := a.(*dns.TXT) - if !ok { - continue - } - - idx := strings.IndexByte(txt.Hdr.Name, '.') - if idx == -1 { - continue - } - - switch name := txt.Hdr.Name[:idx]; name { - case "servers": - for _, entry := range txt.Txt { - parts := strings.Fields(entry) - if len(parts) != 3 { - return fmt.Errorf("parse %s (%s): unexpected format", txt.Hdr.Name, entry) - } - queries, err := strconv.ParseFloat(parts[1], 64) - if err != nil { - return fmt.Errorf("parse '%s' (%s): %v", txt.Hdr.Name, entry, err) - } - failedQueries, err := strconv.ParseFloat(parts[2], 64) - if err != nil { - return fmt.Errorf("parse '%s' (%s): %v", txt.Hdr.Name, entry, err) - } - - ms["queries"] += int64(queries) - ms["failed_queries"] += int64(failedQueries) - } - case "cachesize", "insertions", "evictions", "hits", "misses", "auth": - if len(txt.Txt) != 1 { - return fmt.Errorf("parse '%s' (%v): unexpected format", txt.Hdr.Name, txt.Txt) - } - v, err := strconv.ParseFloat(txt.Txt[0], 64) - if err != nil { - return fmt.Errorf("parse '%s' (%s): %v", txt.Hdr.Name, txt.Txt[0], err) - } - - ms[name] = int64(v) - } - } - return nil -} - -func (d *Dnsmasq) queryCacheStatistics() (*dns.Msg, error) { - msg := &dns.Msg{ - MsgHdr: dns.MsgHdr{ - Id: dns.Id(), - RecursionDesired: true, - }, - Question: []dns.Question{ - {Name: "cachesize.bind.", Qtype: dns.TypeTXT, Qclass: dns.ClassCHAOS}, - {Name: "insertions.bind.", Qtype: dns.TypeTXT, Qclass: dns.ClassCHAOS}, - {Name: "evictions.bind.", Qtype: dns.TypeTXT, Qclass: dns.ClassCHAOS}, - {Name: "hits.bind.", Qtype: dns.TypeTXT, Qclass: dns.ClassCHAOS}, - {Name: "misses.bind.", Qtype: dns.TypeTXT, Qclass: dns.ClassCHAOS}, - // TODO: collect auth.bind if available - // auth.bind query is only supported if dnsmasq has been built - // to support running as an authoritative name server. See https://github.com/netdata/netdata/issues/13766 - //{Name: "auth.bind.", Qtype: dns.TypeTXT, Qclass: dns.ClassCHAOS}, - {Name: "servers.bind.", Qtype: dns.TypeTXT, Qclass: dns.ClassCHAOS}, - }, - } - - r, _, err := d.dnsClient.Exchange(msg, d.Address) - if err != nil { - return nil, err - } - if r == nil { - return nil, fmt.Errorf("'%s' returned an empty response", d.Address) - } - if r.Rcode != dns.RcodeSuccess { - s := dns.RcodeToString[r.Rcode] - return nil, fmt.Errorf("'%s' returned '%s' (%d) response code", d.Address, s, r.Rcode) - } - return r, nil -} diff --git a/src/go/collectors/go.d.plugin/modules/init.go b/src/go/collectors/go.d.plugin/modules/init.go deleted file mode 100644 index bd3b3950..00000000 --- a/src/go/collectors/go.d.plugin/modules/init.go +++ /dev/null @@ -1,98 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package modules - -import ( - _ "github.com/netdata/netdata/go/go.d.plugin/modules/activemq" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/adaptecraid" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/apache" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/bind" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/cassandra" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/chrony" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/clickhouse" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/cockroachdb" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/consul" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/coredns" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/couchbase" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/couchdb" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/dmcache" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/dnsdist" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/dnsmasq" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/dnsmasq_dhcp" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/dnsquery" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/docker" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/docker_engine" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/dockerhub" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/elasticsearch" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/envoy" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/example" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/fail2ban" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/filecheck" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/fluentd" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/freeradius" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/geth" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/haproxy" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/hddtemp" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/hdfs" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/hpssa" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/httpcheck" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/intelgpu" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/isc_dhcpd" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/k8s_kubelet" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/k8s_kubeproxy" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/k8s_state" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/lighttpd" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/litespeed" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/logind" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/logstash" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/lvm" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/megacli" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/mongodb" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/mysql" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/nginx" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/nginxplus" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/nginxvts" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/ntpd" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/nvidia_smi" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/nvme" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/openvpn" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/openvpn_status_log" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/pgbouncer" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/phpdaemon" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/phpfpm" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/pihole" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/pika" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/ping" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/portcheck" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/postgres" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/powerdns" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/powerdns_recursor" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/prometheus" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/proxysql" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/pulsar" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/rabbitmq" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/redis" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/rspamd" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/scaleio" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/sensors" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/smartctl" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/snmp" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/squidlog" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/storcli" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/supervisord" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/systemdunits" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/tengine" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/traefik" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/unbound" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/upsd" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/vcsa" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/vernemq" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/weblog" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/whoisquery" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/windows" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/wireguard" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/x509check" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/zfspool" - _ "github.com/netdata/netdata/go/go.d.plugin/modules/zookeeper" -) diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/collect.go b/src/go/collectors/go.d.plugin/modules/nvidia_smi/collect.go deleted file mode 100644 index 0830b54a..00000000 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/collect.go +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package nvidia_smi - -import ( - "errors" - "strconv" - "strings" -) - -func (nv *NvidiaSMI) collect() (map[string]int64, error) { - if nv.exec == nil { - return nil, errors.New("nvidia-smi exec is not initialized") - } - - mx := make(map[string]int64) - - if err := nv.collectGPUInfo(mx); err != nil { - return nil, err - } - - return mx, nil -} - -func (nv *NvidiaSMI) collectGPUInfo(mx map[string]int64) error { - if nv.UseCSVFormat { - return nv.collectGPUInfoCSV(mx) - } - return nv.collectGPUInfoXML(mx) -} - -func addMetric(mx map[string]int64, key, value string, mul int) { - if !isValidValue(value) { - return - } - - value = removeUnits(value) - - v, err := strconv.ParseFloat(value, 64) - if err != nil { - return - } - - if mul > 0 { - v *= float64(mul) - } - - mx[key] = int64(v) -} - -func isValidValue(v string) bool { - return v != "" && v != "N/A" && v != "[N/A]" -} - -func parseFloat(s string) float64 { - v, _ := strconv.ParseFloat(removeUnits(s), 64) - return v -} - -func removeUnits(s string) string { - if i := strings.IndexByte(s, ' '); i != -1 { - s = s[:i] - } - return s -} - -func boolToInt(v bool) int64 { - if v { - return 1 - } - return 0 -} diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/collect_csv.go b/src/go/collectors/go.d.plugin/modules/nvidia_smi/collect_csv.go deleted file mode 100644 index 2584aaff..00000000 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/collect_csv.go +++ /dev/null @@ -1,198 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package nvidia_smi - -import ( - "bufio" - "bytes" - "encoding/csv" - "errors" - "fmt" - "io" - "regexp" - "strconv" - "strings" -) - -// use of property aliases is not implemented ('"<property>" or "<alias>"' in help-query-gpu) -var knownProperties = map[string]bool{ - "uuid": true, - "name": true, - "fan.speed": true, - "pstate": true, - "utilization.gpu": true, - "utilization.memory": true, - "memory.used": true, - "memory.free": true, - "memory.reserved": true, - "temperature.gpu": true, - "clocks.current.graphics": true, - "clocks.current.video": true, - "clocks.current.sm": true, - "clocks.current.memory": true, - "power.draw": true, -} - -var reHelpProperty = regexp.MustCompile(`"([a-zA-Z_.]+)"`) - -func (nv *NvidiaSMI) collectGPUInfoCSV(mx map[string]int64) error { - if len(nv.gpuQueryProperties) == 0 { - bs, err := nv.exec.queryHelpQueryGPU() - if err != nil { - return err - } - - sc := bufio.NewScanner(bytes.NewBuffer(bs)) - - for sc.Scan() { - if !strings.HasPrefix(sc.Text(), "\"") { - continue - } - matches := reHelpProperty.FindAllString(sc.Text(), -1) - if len(matches) == 0 { - continue - } - for _, v := range matches { - if v = strings.Trim(v, "\""); knownProperties[v] { - nv.gpuQueryProperties = append(nv.gpuQueryProperties, v) - } - } - } - nv.Debugf("found query GPU properties: %v", nv.gpuQueryProperties) - } - - bs, err := nv.exec.queryGPUInfoCSV(nv.gpuQueryProperties) - if err != nil { - return err - } - - nv.Debugf("GPU info:\n%s", bs) - - r := csv.NewReader(bytes.NewBuffer(bs)) - r.Comma = ',' - r.ReuseRecord = true - r.TrimLeadingSpace = true - - // skip headers - if _, err := r.Read(); err != nil && err != io.EOF { - return err - } - - var gpusInfo []csvGPUInfo - for { - record, err := r.Read() - if err != nil { - if errors.Is(err, io.EOF) { - break - } - return err - } - - if len(record) != len(nv.gpuQueryProperties) { - return fmt.Errorf("record values (%d) != queried properties (%d)", len(record), len(nv.gpuQueryProperties)) - } - - var gpu csvGPUInfo - for i, v := range record { - switch nv.gpuQueryProperties[i] { - case "uuid": - gpu.uuid = v - case "name": - gpu.name = v - case "fan.speed": - gpu.fanSpeed = v - case "pstate": - gpu.pstate = v - case "utilization.gpu": - gpu.utilizationGPU = v - case "utilization.memory": - gpu.utilizationMemory = v - case "memory.used": - gpu.memoryUsed = v - case "memory.free": - gpu.memoryFree = v - case "memory.reserved": - gpu.memoryReserved = v - case "temperature.gpu": - gpu.temperatureGPU = v - case "clocks.current.graphics": - gpu.clocksCurrentGraphics = v - case "clocks.current.video": - gpu.clocksCurrentVideo = v - case "clocks.current.sm": - gpu.clocksCurrentSM = v - case "clocks.current.memory": - gpu.clocksCurrentMemory = v - case "power.draw": - gpu.powerDraw = v - } - } - gpusInfo = append(gpusInfo, gpu) - } - - seen := make(map[string]bool) - - for _, gpu := range gpusInfo { - if !isValidValue(gpu.uuid) || !isValidValue(gpu.name) { - continue - } - - px := "gpu_" + gpu.uuid + "_" - - seen[px] = true - - if !nv.gpus[px] { - nv.gpus[px] = true - nv.addGPUCSVCharts(gpu) - } - - addMetric(mx, px+"fan_speed_perc", gpu.fanSpeed, 0) - addMetric(mx, px+"gpu_utilization", gpu.utilizationGPU, 0) - addMetric(mx, px+"mem_utilization", gpu.utilizationMemory, 0) - addMetric(mx, px+"frame_buffer_memory_usage_free", gpu.memoryFree, 1024*1024) // MiB => bytes - addMetric(mx, px+"frame_buffer_memory_usage_used", gpu.memoryUsed, 1024*1024) // MiB => bytes - addMetric(mx, px+"frame_buffer_memory_usage_reserved", gpu.memoryReserved, 1024*1024) // MiB => bytes - addMetric(mx, px+"temperature", gpu.temperatureGPU, 0) - addMetric(mx, px+"graphics_clock", gpu.clocksCurrentGraphics, 0) - addMetric(mx, px+"video_clock", gpu.clocksCurrentVideo, 0) - addMetric(mx, px+"sm_clock", gpu.clocksCurrentSM, 0) - addMetric(mx, px+"mem_clock", gpu.clocksCurrentMemory, 0) - addMetric(mx, px+"power_draw", gpu.powerDraw, 0) - for i := 0; i < 16; i++ { - if s := "P" + strconv.Itoa(i); gpu.pstate == s { - mx[px+"performance_state_"+s] = 1 - } else { - mx[px+"performance_state_"+s] = 0 - } - } - } - - for px := range nv.gpus { - if !seen[px] { - delete(nv.gpus, px) - nv.removeCharts(px) - } - } - - return nil -} - -type ( - csvGPUInfo struct { - uuid string - name string - fanSpeed string - pstate string - utilizationGPU string - utilizationMemory string - memoryUsed string - memoryFree string - memoryReserved string - temperatureGPU string - clocksCurrentGraphics string - clocksCurrentVideo string - clocksCurrentSM string - clocksCurrentMemory string - powerDraw string - } -) diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/exec.go b/src/go/collectors/go.d.plugin/modules/nvidia_smi/exec.go deleted file mode 100644 index ff26f59c..00000000 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/exec.go +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package nvidia_smi - -import ( - "context" - "errors" - "fmt" - "os/exec" - "strings" - "time" - - "github.com/netdata/netdata/go/go.d.plugin/logger" -) - -func newNvidiaSMIExec(path string, cfg Config, log *logger.Logger) (*nvidiaSMIExec, error) { - return &nvidiaSMIExec{ - binPath: path, - timeout: cfg.Timeout.Duration(), - Logger: log, - }, nil -} - -type nvidiaSMIExec struct { - binPath string - timeout time.Duration - *logger.Logger -} - -func (e *nvidiaSMIExec) queryGPUInfoXML() ([]byte, error) { - ctx, cancel := context.WithTimeout(context.Background(), e.timeout) - defer cancel() - - cmd := exec.CommandContext(ctx, e.binPath, "-q", "-x") - - e.Debugf("executing '%s'", cmd) - bs, err := cmd.Output() - if err != nil { - return nil, fmt.Errorf("error on '%s': %v", cmd, err) - } - - return bs, nil -} - -func (e *nvidiaSMIExec) queryGPUInfoCSV(properties []string) ([]byte, error) { - if len(properties) == 0 { - return nil, errors.New("can not query CSV GPU Info without properties") - } - - ctx, cancel := context.WithTimeout(context.Background(), e.timeout) - defer cancel() - - cmd := exec.CommandContext(ctx, e.binPath, "--query-gpu="+strings.Join(properties, ","), "--format=csv,nounits") - - e.Debugf("executing '%s'", cmd) - - bs, err := cmd.Output() - if err != nil { - return nil, fmt.Errorf("error on '%s': %v", cmd, err) - } - - return bs, nil -} - -func (e *nvidiaSMIExec) queryHelpQueryGPU() ([]byte, error) { - ctx, cancel := context.WithTimeout(context.Background(), e.timeout) - defer cancel() - - cmd := exec.CommandContext(ctx, e.binPath, "--help-query-gpu") - - e.Debugf("executing '%s'", cmd) - bs, err := cmd.Output() - if err != nil { - return nil, fmt.Errorf("error on '%s': %v", cmd, err) - } - - return bs, err -} diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/nvidia_smi.go b/src/go/collectors/go.d.plugin/modules/nvidia_smi/nvidia_smi.go deleted file mode 100644 index 0002d4bf..00000000 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/nvidia_smi.go +++ /dev/null @@ -1,117 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package nvidia_smi - -import ( - _ "embed" - "errors" - "time" - - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" -) - -//go:embed "config_schema.json" -var configSchema string - -func init() { - module.Register("nvidia_smi", module.Creator{ - JobConfigSchema: configSchema, - Defaults: module.Defaults{ - Disabled: true, - UpdateEvery: 10, - }, - Create: func() module.Module { return New() }, - Config: func() any { return &Config{} }, - }) -} - -func New() *NvidiaSMI { - return &NvidiaSMI{ - Config: Config{ - Timeout: web.Duration(time.Second * 10), - UseCSVFormat: false, - }, - binName: "nvidia-smi", - charts: &module.Charts{}, - gpus: make(map[string]bool), - migs: make(map[string]bool), - } - -} - -type Config struct { - UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` - Timeout web.Duration `yaml:"timeout,omitempty" json:"timeout"` - BinaryPath string `yaml:"binary_path" json:"binary_path"` - UseCSVFormat bool `yaml:"use_csv_format" json:"use_csv_format"` -} - -type ( - NvidiaSMI struct { - module.Base - Config `yaml:",inline" json:""` - - charts *module.Charts - - exec nvidiaSMI - binName string - - gpuQueryProperties []string - - gpus map[string]bool - migs map[string]bool - } - nvidiaSMI interface { - queryGPUInfoXML() ([]byte, error) - queryGPUInfoCSV(properties []string) ([]byte, error) - queryHelpQueryGPU() ([]byte, error) - } -) - -func (nv *NvidiaSMI) Configuration() any { - return nv.Config -} - -func (nv *NvidiaSMI) Init() error { - if nv.exec == nil { - smi, err := nv.initNvidiaSMIExec() - if err != nil { - nv.Error(err) - return err - } - nv.exec = smi - } - - return nil -} - -func (nv *NvidiaSMI) Check() error { - mx, err := nv.collect() - if err != nil { - nv.Error(err) - return err - } - if len(mx) == 0 { - return errors.New("no metrics collected") - } - return nil -} - -func (nv *NvidiaSMI) Charts() *module.Charts { - return nv.charts -} - -func (nv *NvidiaSMI) Collect() map[string]int64 { - mx, err := nv.collect() - if err != nil { - nv.Error(err) - } - - if len(mx) == 0 { - return nil - } - return mx -} - -func (nv *NvidiaSMI) Cleanup() {} diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/help-query-gpu.txt b/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/help-query-gpu.txt deleted file mode 100644 index 2dd3285e..00000000 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/help-query-gpu.txt +++ /dev/null @@ -1,414 +0,0 @@ -List of valid properties to query for the switch "--query-gpu=": - -"timestamp" -The timestamp of when the query was made in format "YYYY/MM/DD HH:MM:SS.msec". - -"driver_version" -The version of the installed NVIDIA display driver. This is an alphanumeric string. - -"count" -The number of NVIDIA GPUs in the system. - -"name" or "gpu_name" -The official product name of the GPU. This is an alphanumeric string. For all products. - -"serial" or "gpu_serial" -This number matches the serial number physically printed on each board. It is a globally unique immutable alphanumeric value. - -"uuid" or "gpu_uuid" -This value is the globally unique immutable alphanumeric identifier of the GPU. It does not correspond to any physical label on the board. - -"pci.bus_id" or "gpu_bus_id" -PCI bus id as "domain:bus:device.function", in hex. - -"pci.domain" -PCI domain number, in hex. - -"pci.bus" -PCI bus number, in hex. - -"pci.device" -PCI device number, in hex. - -"pci.device_id" -PCI vendor device id, in hex - -"pci.sub_device_id" -PCI Sub System id, in hex - -"pcie.link.gen.current" -The current PCI-E link generation. These may be reduced when the GPU is not in use. - -"pcie.link.gen.max" -The maximum PCI-E link generation possible with this GPU and system configuration. For example, if the GPU supports a higher PCIe generation than the system supports then this reports the system PCIe generation. - -"pcie.link.width.current" -The current PCI-E link width. These may be reduced when the GPU is not in use. - -"pcie.link.width.max" -The maximum PCI-E link width possible with this GPU and system configuration. For example, if the GPU supports a higher PCIe generation than the system supports then this reports the system PCIe generation. - -"index" -Zero based index of the GPU. Can change at each boot. - -"display_mode" -A flag that indicates whether a physical display (e.g. monitor) is currently connected to any of the GPU's connectors. "Enabled" indicates an attached display. "Disabled" indicates otherwise. - -"display_active" -A flag that indicates whether a display is initialized on the GPU's (e.g. memory is allocated on the device for display). Display can be active even when no monitor is physically attached. "Enabled" indicates an active display. "Disabled" indicates otherwise. - -"persistence_mode" -A flag that indicates whether persistence mode is enabled for the GPU. Value is either "Enabled" or "Disabled". When persistence mode is enabled the NVIDIA driver remains loaded even when no active clients, such as X11 or nvidia-smi, exist. This minimizes the driver load latency associated with running dependent apps, such as CUDA programs. Linux only. - -"accounting.mode" -A flag that indicates whether accounting mode is enabled for the GPU. Value is either "Enabled" or "Disabled". When accounting is enabled statistics are calculated for each compute process running on the GPU.Statistics can be queried during the lifetime or after termination of the process.The execution time of process is reported as 0 while the process is in running state and updated to actualexecution time after the process has terminated. See --help-query-accounted-apps for more info. - -"accounting.buffer_size" -The size of the circular buffer that holds list of processes that can be queried for accounting stats. This is the maximum number of processes that accounting information will be stored for before information about oldest processes will get overwritten by information about new processes. - -Section about driver_model properties -On Windows, the TCC and WDDM driver models are supported. The driver model can be changed with the (-dm) or (-fdm) flags. The TCC driver model is optimized for compute applications. I.E. kernel launch times will be quicker with TCC. The WDDM driver model is designed for graphics applications and is not recommended for compute applications. Linux does not support multiple driver models, and will always have the value of "N/A". Only for selected products. Please see feature matrix in NVML documentation. - -"driver_model.current" -The driver model currently in use. Always "N/A" on Linux. - -"driver_model.pending" -The driver model that will be used on the next reboot. Always "N/A" on Linux. - -"vbios_version" -The BIOS of the GPU board. - -Section about inforom properties -Version numbers for each object in the GPU board's inforom storage. The inforom is a small, persistent store of configuration and state data for the GPU. All inforom version fields are numerical. It can be useful to know these version numbers because some GPU features are only available with inforoms of a certain version or higher. - -"inforom.img" or "inforom.image" -Global version of the infoROM image. Image version just like VBIOS version uniquely describes the exact version of the infoROM flashed on the board in contrast to infoROM object version which is only an indicator of supported features. - -"inforom.oem" -Version for the OEM configuration data. - -"inforom.ecc" -Version for the ECC recording data. - -"inforom.pwr" or "inforom.power" -Version for the power management data. - -Section about gom properties -GOM allows to reduce power usage and optimize GPU throughput by disabling GPU features. Each GOM is designed to meet specific user needs. -In "All On" mode everything is enabled and running at full speed. -The "Compute" mode is designed for running only compute tasks. Graphics operations are not allowed. -The "Low Double Precision" mode is designed for running graphics applications that don't require high bandwidth double precision. -GOM can be changed with the (--gom) flag. - -"gom.current" or "gpu_operation_mode.current" -The GOM currently in use. - -"gom.pending" or "gpu_operation_mode.pending" -The GOM that will be used on the next reboot. - -"fan.speed" -The fan speed value is the percent of the product's maximum noise tolerance fan speed that the device's fan is currently intended to run at. This value may exceed 100% in certain cases. Note: The reported speed is the intended fan speed. If the fan is physically blocked and unable to spin, this output will not match the actual fan speed. Many parts do not report fan speeds because they rely on cooling via fans in the surrounding enclosure. - -"pstate" -The current performance state for the GPU. States range from P0 (maximum performance) to P12 (minimum performance). - -Section about clocks_throttle_reasons properties -Retrieves information about factors that are reducing the frequency of clocks. If all throttle reasons are returned as "Not Active" it means that clocks are running as high as possible. - -"clocks_throttle_reasons.supported" -Bitmask of supported clock throttle reasons. See nvml.h for more details. - -"clocks_throttle_reasons.active" -Bitmask of active clock throttle reasons. See nvml.h for more details. - -"clocks_throttle_reasons.gpu_idle" -Nothing is running on the GPU and the clocks are dropping to Idle state. This limiter may be removed in a later release. - -"clocks_throttle_reasons.applications_clocks_setting" -GPU clocks are limited by applications clocks setting. E.g. can be changed by nvidia-smi --applications-clocks= - -"clocks_throttle_reasons.sw_power_cap" -SW Power Scaling algorithm is reducing the clocks below requested clocks because the GPU is consuming too much power. E.g. SW power cap limit can be changed with nvidia-smi --power-limit= - -"clocks_throttle_reasons.hw_slowdown" -HW Slowdown (reducing the core clocks by a factor of 2 or more) is engaged. This is an indicator of: - HW Thermal Slowdown: temperature being too high - HW Power Brake Slowdown: External Power Brake Assertion is triggered (e.g. by the system power supply) - * Power draw is too high and Fast Trigger protection is reducing the clocks - * May be also reported during PState or clock change - * This behavior may be removed in a later release - -"clocks_throttle_reasons.hw_thermal_slowdown" -HW Thermal Slowdown (reducing the core clocks by a factor of 2 or more) is engaged. This is an indicator of temperature being too high - -"clocks_throttle_reasons.hw_power_brake_slowdown" -HW Power Brake Slowdown (reducing the core clocks by a factor of 2 or more) is engaged. This is an indicator of External Power Brake Assertion being triggered (e.g. by the system power supply) - -"clocks_throttle_reasons.sw_thermal_slowdown" -SW Thermal capping algorithm is reducing clocks below requested clocks because GPU temperature is higher than Max Operating Temp. - -"clocks_throttle_reasons.sync_boost" -Sync Boost This GPU has been added to a Sync boost group with nvidia-smi or DCGM in - * order to maximize performance per watt. All GPUs in the sync boost group - * will boost to the minimum possible clocks across the entire group. Look at - * the throttle reasons for other GPUs in the system to see why those GPUs are - * holding this one at lower clocks. - -Section about memory properties -On-board memory information. Reported total memory is affected by ECC state. If ECC is enabled the total available memory is decreased by several percent, due to the requisite parity bits. The driver may also reserve a small amount of memory for internal use, even without active work on the GPU. - -"memory.total" -Total installed GPU memory. - -"memory.reserved" -Total memory reserved by the NVIDIA driver and firmware. - -"memory.used" -Total memory allocated by active contexts. - -"memory.free" -Total free memory. - -"compute_mode" -The compute mode flag indicates whether individual or multiple compute applications may run on the GPU. -"0: Default" means multiple contexts are allowed per device. -"1: Exclusive_Thread", deprecated, use Exclusive_Process instead -"2: Prohibited" means no contexts are allowed per device (no compute apps). -"3: Exclusive_Process" means only one context is allowed per device, usable from multiple threads at a time. - -"compute_cap" -The CUDA Compute Capability, represented as Major DOT Minor. - -Section about utilization properties -Utilization rates report how busy each GPU is over time, and can be used to determine how much an application is using the GPUs in the system. - -"utilization.gpu" -Percent of time over the past sample period during which one or more kernels was executing on the GPU. -The sample period may be between 1 second and 1/6 second depending on the product. - -"utilization.memory" -Percent of time over the past sample period during which global (device) memory was being read or written. -The sample period may be between 1 second and 1/6 second depending on the product. - -Section about encoder.stats properties -Encoder stats report number of encoder sessions, average FPS and average latency in us for given GPUs in the system. - -"encoder.stats.sessionCount" -Number of encoder sessions running on the GPU. - -"encoder.stats.averageFps" -Average FPS of all sessions running on the GPU. - -"encoder.stats.averageLatency" -Average latency in microseconds of all sessions running on the GPU. - -Section about ecc.mode properties -A flag that indicates whether ECC support is enabled. May be either "Enabled" or "Disabled". Changes to ECC mode require a reboot. Requires Inforom ECC object version 1.0 or higher. - -"ecc.mode.current" -The ECC mode that the GPU is currently operating under. - -"ecc.mode.pending" -The ECC mode that the GPU will operate under after the next reboot. - -Section about ecc.errors properties -NVIDIA GPUs can provide error counts for various types of ECC errors. Some ECC errors are either single or double bit, where single bit errors are corrected and double bit errors are uncorrectable. Texture memory errors may be correctable via resend or uncorrectable if the resend fails. These errors are available across two timescales (volatile and aggregate). Single bit ECC errors are automatically corrected by the HW and do not result in data corruption. Double bit errors are detected but not corrected. Please see the ECC documents on the web for information on compute application behavior when double bit errors occur. Volatile error counters track the number of errors detected since the last driver load. Aggregate error counts persist indefinitely and thus act as a lifetime counter. - -"ecc.errors.corrected.volatile.device_memory" -Errors detected in global device memory. - -"ecc.errors.corrected.volatile.dram" -Errors detected in global device memory. - -"ecc.errors.corrected.volatile.register_file" -Errors detected in register file memory. - -"ecc.errors.corrected.volatile.l1_cache" -Errors detected in the L1 cache. - -"ecc.errors.corrected.volatile.l2_cache" -Errors detected in the L2 cache. - -"ecc.errors.corrected.volatile.texture_memory" -Parity errors detected in texture memory. - -"ecc.errors.corrected.volatile.cbu" -Parity errors detected in CBU. - -"ecc.errors.corrected.volatile.sram" -Errors detected in global SRAMs. - -"ecc.errors.corrected.volatile.total" -Total errors detected across entire chip. - -"ecc.errors.corrected.aggregate.device_memory" -Errors detected in global device memory. - -"ecc.errors.corrected.aggregate.dram" -Errors detected in global device memory. - -"ecc.errors.corrected.aggregate.register_file" -Errors detected in register file memory. - -"ecc.errors.corrected.aggregate.l1_cache" -Errors detected in the L1 cache. - -"ecc.errors.corrected.aggregate.l2_cache" -Errors detected in the L2 cache. - -"ecc.errors.corrected.aggregate.texture_memory" -Parity errors detected in texture memory. - -"ecc.errors.corrected.aggregate.cbu" -Parity errors detected in CBU. - -"ecc.errors.corrected.aggregate.sram" -Errors detected in global SRAMs. - -"ecc.errors.corrected.aggregate.total" -Total errors detected across entire chip. - -"ecc.errors.uncorrected.volatile.device_memory" -Errors detected in global device memory. - -"ecc.errors.uncorrected.volatile.dram" -Errors detected in global device memory. - -"ecc.errors.uncorrected.volatile.register_file" -Errors detected in register file memory. - -"ecc.errors.uncorrected.volatile.l1_cache" -Errors detected in the L1 cache. - -"ecc.errors.uncorrected.volatile.l2_cache" -Errors detected in the L2 cache. - -"ecc.errors.uncorrected.volatile.texture_memory" -Parity errors detected in texture memory. - -"ecc.errors.uncorrected.volatile.cbu" -Parity errors detected in CBU. - -"ecc.errors.uncorrected.volatile.sram" -Errors detected in global SRAMs. - -"ecc.errors.uncorrected.volatile.total" -Total errors detected across entire chip. - -"ecc.errors.uncorrected.aggregate.device_memory" -Errors detected in global device memory. - -"ecc.errors.uncorrected.aggregate.dram" -Errors detected in global device memory. - -"ecc.errors.uncorrected.aggregate.register_file" -Errors detected in register file memory. - -"ecc.errors.uncorrected.aggregate.l1_cache" -Errors detected in the L1 cache. - -"ecc.errors.uncorrected.aggregate.l2_cache" -Errors detected in the L2 cache. - -"ecc.errors.uncorrected.aggregate.texture_memory" -Parity errors detected in texture memory. - -"ecc.errors.uncorrected.aggregate.cbu" -Parity errors detected in CBU. - -"ecc.errors.uncorrected.aggregate.sram" -Errors detected in global SRAMs. - -"ecc.errors.uncorrected.aggregate.total" -Total errors detected across entire chip. - -Section about retired_pages properties -NVIDIA GPUs can retire pages of GPU device memory when they become unreliable. This can happen when multiple single bit ECC errors occur for the same page, or on a double bit ECC error. When a page is retired, the NVIDIA driver will hide it such that no driver, or application memory allocations can access it. - -"retired_pages.single_bit_ecc.count" or "retired_pages.sbe" -The number of GPU device memory pages that have been retired due to multiple single bit ECC errors. - -"retired_pages.double_bit.count" or "retired_pages.dbe" -The number of GPU device memory pages that have been retired due to a double bit ECC error. - -"retired_pages.pending" -Checks if any GPU device memory pages are pending retirement on the next reboot. Pages that are pending retirement can still be allocated, and may cause further reliability issues. - -"temperature.gpu" - Core GPU temperature. in degrees C. - -"temperature.memory" - HBM memory temperature. in degrees C. - -"power.management" -A flag that indicates whether power management is enabled. Either "Supported" or "[Not Supported]". Requires Inforom PWR object version 3.0 or higher or Kepler device. - -"power.draw" -The last measured power draw for the entire board, in watts. Only available if power management is supported. This reading is accurate to within +/- 5 watts. - -"power.limit" -The software power limit in watts. Set by software like nvidia-smi. On Kepler devices Power Limit can be adjusted using [-pl | --power-limit=] switches. - -"enforced.power.limit" -The power management algorithm's power ceiling, in watts. Total board power draw is manipulated by the power management algorithm such that it stays under this value. This value is the minimum of various power limiters. - -"power.default_limit" -The default power management algorithm's power ceiling, in watts. Power Limit will be set back to Default Power Limit after driver unload. - -"power.min_limit" -The minimum value in watts that power limit can be set to. - -"power.max_limit" -The maximum value in watts that power limit can be set to. - -"clocks.current.graphics" or "clocks.gr" -Current frequency of graphics (shader) clock. - -"clocks.current.sm" or "clocks.sm" -Current frequency of SM (Streaming Multiprocessor) clock. - -"clocks.current.memory" or "clocks.mem" -Current frequency of memory clock. - -"clocks.current.video" or "clocks.video" -Current frequency of video encoder/decoder clock. - -Section about clocks.applications properties -User specified frequency at which applications will be running at. Can be changed with [-ac | --applications-clocks] switches. - -"clocks.applications.graphics" or "clocks.applications.gr" -User specified frequency of graphics (shader) clock. - -"clocks.applications.memory" or "clocks.applications.mem" -User specified frequency of memory clock. - -Section about clocks.default_applications properties -Default frequency at which applications will be running at. Application clocks can be changed with [-ac | --applications-clocks] switches. Application clocks can be set to default using [-rac | --reset-applications-clocks] switches. - -"clocks.default_applications.graphics" or "clocks.default_applications.gr" -Default frequency of applications graphics (shader) clock. - -"clocks.default_applications.memory" or "clocks.default_applications.mem" -Default frequency of applications memory clock. - -Section about clocks.max properties -Maximum frequency at which parts of the GPU are design to run. - -"clocks.max.graphics" or "clocks.max.gr" -Maximum frequency of graphics (shader) clock. - -"clocks.max.sm" or "clocks.max.sm" -Maximum frequency of SM (Streaming Multiprocessor) clock. - -"clocks.max.memory" or "clocks.max.mem" -Maximum frequency of memory clock. - -Section about mig.mode properties -A flag that indicates whether MIG mode is enabled. May be either "Enabled" or "Disabled". Changes to MIG mode require a GPU reset. - -"mig.mode.current" -The MIG mode that the GPU is currently operating under. - -"mig.mode.pending" -The MIG mode that the GPU will operate under after reset. - diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/tesla-p100.csv b/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/tesla-p100.csv deleted file mode 100644 index 9a4c1e1a..00000000 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/tesla-p100.csv +++ /dev/null @@ -1,2 +0,0 @@ -name, uuid, fan.speed [%], pstate, memory.reserved [MiB], memory.used [MiB], memory.free [MiB], utilization.gpu [%], utilization.memory [%], temperature.gpu, power.draw [W], clocks.current.graphics [MHz], clocks.current.sm [MHz], clocks.current.memory [MHz], clocks.current.video [MHz] -Tesla P100-PCIE-16GB, GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6, [N/A], P0, 103, 0, 16280, 0, 0, 37, 28.16, 405, 405, 715, 835
\ No newline at end of file diff --git a/src/go/collectors/go.d.plugin/modules/snmp/charts.go b/src/go/collectors/go.d.plugin/modules/snmp/charts.go deleted file mode 100644 index 9899ec7a..00000000 --- a/src/go/collectors/go.d.plugin/modules/snmp/charts.go +++ /dev/null @@ -1,116 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package snmp - -import ( - "fmt" - "strings" - - "github.com/netdata/netdata/go/go.d.plugin/agent/module" -) - -func newCharts(configs []ChartConfig) (*module.Charts, error) { - charts := &module.Charts{} - for _, cfg := range configs { - if len(cfg.IndexRange) == 2 { - cs, err := newChartsFromIndexRange(cfg) - if err != nil { - return nil, err - } - if err := charts.Add(*cs...); err != nil { - return nil, err - } - } else { - chart, err := newChart(cfg) - if err != nil { - return nil, err - } - if err = charts.Add(chart); err != nil { - return nil, err - } - } - } - return charts, nil -} - -func newChartsFromIndexRange(cfg ChartConfig) (*module.Charts, error) { - var addPrio int - charts := &module.Charts{} - for i := cfg.IndexRange[0]; i <= cfg.IndexRange[1]; i++ { - chart, err := newChartWithOIDIndex(i, cfg) - if err != nil { - return nil, err - } - chart.Priority += addPrio - addPrio += 1 - if err = charts.Add(chart); err != nil { - return nil, err - } - } - return charts, nil -} - -func newChartWithOIDIndex(oidIndex int, cfg ChartConfig) (*module.Chart, error) { - chart, err := newChart(cfg) - if err != nil { - return nil, err - } - - chart.ID = fmt.Sprintf("%s_%d", chart.ID, oidIndex) - chart.Title = fmt.Sprintf("%s %d", chart.Title, oidIndex) - for _, dim := range chart.Dims { - dim.ID = fmt.Sprintf("%s.%d", dim.ID, oidIndex) - } - - return chart, nil -} - -func newChart(cfg ChartConfig) (*module.Chart, error) { - chart := &module.Chart{ - ID: cfg.ID, - Title: cfg.Title, - Units: cfg.Units, - Fam: cfg.Family, - Ctx: fmt.Sprintf("snmp.%s", cfg.ID), - Type: module.ChartType(cfg.Type), - Priority: cfg.Priority, - } - - if chart.Title == "" { - chart.Title = "Untitled chart" - } - if chart.Units == "" { - chart.Units = "num" - } - if chart.Priority < module.Priority { - chart.Priority += module.Priority - } - - seen := make(map[string]struct{}) - var a string - for _, cfg := range cfg.Dimensions { - if cfg.Algorithm != "" { - seen[cfg.Algorithm] = struct{}{} - a = cfg.Algorithm - } - dim := &module.Dim{ - ID: strings.TrimPrefix(cfg.OID, "."), - Name: cfg.Name, - Algo: module.DimAlgo(cfg.Algorithm), - Mul: cfg.Multiplier, - Div: cfg.Divisor, - } - if err := chart.AddDim(dim); err != nil { - return nil, err - } - } - if len(seen) == 1 && a != "" && len(chart.Dims) > 1 { - for _, d := range chart.Dims { - if d.Algo == "" { - d.Algo = module.DimAlgo(a) - } - } - } - - return chart, nil -} diff --git a/src/go/collectors/go.d.plugin/modules/snmp/collect.go b/src/go/collectors/go.d.plugin/modules/snmp/collect.go deleted file mode 100644 index 9f0e78d7..00000000 --- a/src/go/collectors/go.d.plugin/modules/snmp/collect.go +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package snmp - -import ( - "github.com/gosnmp/gosnmp" -) - -func (s *SNMP) collect() (map[string]int64, error) { - collected := make(map[string]int64) - - if err := s.collectOIDs(collected); err != nil { - return nil, err - } - - return collected, nil -} - -func (s *SNMP) collectOIDs(collected map[string]int64) error { - for i, end := 0, 0; i < len(s.oids); i += s.Options.MaxOIDs { - if end = i + s.Options.MaxOIDs; end > len(s.oids) { - end = len(s.oids) - } - - oids := s.oids[i:end] - resp, err := s.snmpClient.Get(oids) - if err != nil { - s.Errorf("cannot get SNMP data: %v", err) - return err - } - - for i, oid := range oids { - if i >= len(resp.Variables) { - continue - } - - switch v := resp.Variables[i]; v.Type { - case gosnmp.Boolean, - gosnmp.Counter32, - gosnmp.Counter64, - gosnmp.Gauge32, - gosnmp.TimeTicks, - gosnmp.Uinteger32, - gosnmp.OpaqueFloat, - gosnmp.OpaqueDouble, - gosnmp.Integer: - collected[oid] = gosnmp.ToBigInt(v.Value).Int64() - default: - s.Debugf("skipping OID '%s' (unsupported type '%s')", oid, v.Type) - } - } - } - - return nil -} diff --git a/src/go/collectors/go.d.plugin/modules/snmp/init.go b/src/go/collectors/go.d.plugin/modules/snmp/init.go deleted file mode 100644 index 5802d668..00000000 --- a/src/go/collectors/go.d.plugin/modules/snmp/init.go +++ /dev/null @@ -1,189 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package snmp - -import ( - "errors" - "fmt" - "time" - - "github.com/gosnmp/gosnmp" -) - -var newSNMPClient = gosnmp.NewHandler - -func (s *SNMP) validateConfig() error { - if len(s.ChartsInput) == 0 { - return errors.New("'charts' are required but not set") - } - - if s.Options.Version == gosnmp.Version3.String() { - if s.User.Name == "" { - return errors.New("'user.name' is required when using SNMPv3 but not set") - } - if _, err := parseSNMPv3SecurityLevel(s.User.SecurityLevel); err != nil { - return err - } - if _, err := parseSNMPv3AuthProtocol(s.User.AuthProto); err != nil { - return err - } - if _, err := parseSNMPv3PrivProtocol(s.User.PrivProto); err != nil { - return err - } - } - - return nil -} - -func (s *SNMP) initSNMPClient() (gosnmp.Handler, error) { - client := newSNMPClient() - - if client.SetTarget(s.Hostname); client.Target() == "" { - s.Warningf("'hostname' not set, using the default value: '%s'", defaultHostname) - client.SetTarget(defaultHostname) - } - if client.SetPort(uint16(s.Options.Port)); client.Port() <= 0 || client.Port() > 65535 { - s.Warningf("'options.port' is invalid, changing to the default value: '%d' => '%d'", s.Options.Port, defaultPort) - client.SetPort(defaultPort) - } - if client.SetRetries(s.Options.Retries); client.Retries() < 1 || client.Retries() > 10 { - s.Warningf("'options.retries' is invalid, changing to the default value: '%d' => '%d'", s.Options.Retries, defaultRetries) - client.SetRetries(defaultRetries) - } - if client.SetTimeout(time.Duration(s.Options.Timeout) * time.Second); client.Timeout().Seconds() < 1 { - s.Warningf("'options.timeout' is invalid, changing to the default value: '%d' => '%d'", s.Options.Timeout, defaultTimeout) - client.SetTimeout(defaultTimeout * time.Second) - } - if client.SetMaxOids(s.Options.MaxOIDs); client.MaxOids() < 1 { - s.Warningf("'options.max_request_size' is invalid, changing to the default value: '%d' => '%d'", s.Options.MaxOIDs, defaultMaxOIDs) - client.SetMaxOids(defaultMaxOIDs) - } - - ver, err := parseSNMPVersion(s.Options.Version) - if err != nil { - s.Warningf("'options.version' is invalid, changing to the default value: '%s' => '%s'", - s.Options.Version, defaultVersion) - ver = defaultVersion - } - comm := s.Community - if comm == "" && (ver <= gosnmp.Version2c) { - s.Warningf("'community' not set, using the default value: '%s'", defaultCommunity) - comm = defaultCommunity - } - - switch ver { - case gosnmp.Version1: - client.SetCommunity(comm) - client.SetVersion(gosnmp.Version1) - case gosnmp.Version2c: - client.SetCommunity(comm) - client.SetVersion(gosnmp.Version2c) - case gosnmp.Version3: - client.SetVersion(gosnmp.Version3) - client.SetSecurityModel(gosnmp.UserSecurityModel) - client.SetMsgFlags(safeParseSNMPv3SecurityLevel(s.User.SecurityLevel)) - client.SetSecurityParameters(&gosnmp.UsmSecurityParameters{ - UserName: s.User.Name, - AuthenticationProtocol: safeParseSNMPv3AuthProtocol(s.User.AuthProto), - AuthenticationPassphrase: s.User.AuthKey, - PrivacyProtocol: safeParseSNMPv3PrivProtocol(s.User.PrivProto), - PrivacyPassphrase: s.User.PrivKey, - }) - default: - return nil, fmt.Errorf("invalid SNMP version: %s", s.Options.Version) - } - - return client, nil -} - -func (s *SNMP) initOIDs() (oids []string) { - for _, c := range *s.charts { - for _, d := range c.Dims { - oids = append(oids, d.ID) - } - } - return oids -} - -func parseSNMPVersion(version string) (gosnmp.SnmpVersion, error) { - switch version { - case "0", "1": - return gosnmp.Version1, nil - case "2", "2c", "": - return gosnmp.Version2c, nil - case "3": - return gosnmp.Version3, nil - default: - return gosnmp.Version2c, fmt.Errorf("invalid snmp version value (%s)", version) - } -} - -func safeParseSNMPv3SecurityLevel(level string) gosnmp.SnmpV3MsgFlags { - v, _ := parseSNMPv3SecurityLevel(level) - return v -} - -func parseSNMPv3SecurityLevel(level string) (gosnmp.SnmpV3MsgFlags, error) { - switch level { - case "1", "none", "noAuthNoPriv", "": - return gosnmp.NoAuthNoPriv, nil - case "2", "authNoPriv": - return gosnmp.AuthNoPriv, nil - case "3", "authPriv": - return gosnmp.AuthPriv, nil - default: - return gosnmp.NoAuthNoPriv, fmt.Errorf("invalid snmpv3 user security level value (%s)", level) - } -} - -func safeParseSNMPv3AuthProtocol(protocol string) gosnmp.SnmpV3AuthProtocol { - v, _ := parseSNMPv3AuthProtocol(protocol) - return v -} - -func parseSNMPv3AuthProtocol(protocol string) (gosnmp.SnmpV3AuthProtocol, error) { - switch protocol { - case "1", "none", "noAuth", "": - return gosnmp.NoAuth, nil - case "2", "md5": - return gosnmp.MD5, nil - case "3", "sha": - return gosnmp.SHA, nil - case "4", "sha224": - return gosnmp.SHA224, nil - case "5", "sha256": - return gosnmp.SHA256, nil - case "6", "sha384": - return gosnmp.SHA384, nil - case "7", "sha512": - return gosnmp.SHA512, nil - default: - return gosnmp.NoAuth, fmt.Errorf("invalid snmpv3 user auth protocol value (%s)", protocol) - } -} - -func safeParseSNMPv3PrivProtocol(protocol string) gosnmp.SnmpV3PrivProtocol { - v, _ := parseSNMPv3PrivProtocol(protocol) - return v -} - -func parseSNMPv3PrivProtocol(protocol string) (gosnmp.SnmpV3PrivProtocol, error) { - switch protocol { - case "1", "none", "noPriv", "": - return gosnmp.NoPriv, nil - case "2", "des": - return gosnmp.DES, nil - case "3", "aes": - return gosnmp.AES, nil - case "4", "aes192": - return gosnmp.AES192, nil - case "5", "aes256": - return gosnmp.AES256, nil - case "6", "aes192c": - return gosnmp.AES192C, nil - case "7", "aes256c": - return gosnmp.AES256C, nil - default: - return gosnmp.NoPriv, fmt.Errorf("invalid snmpv3 user priv protocol value (%s)", protocol) - } -} diff --git a/src/go/collectors/go.d.plugin/modules/snmp/snmp.go b/src/go/collectors/go.d.plugin/modules/snmp/snmp.go deleted file mode 100644 index 6f4081f5..00000000 --- a/src/go/collectors/go.d.plugin/modules/snmp/snmp.go +++ /dev/null @@ -1,201 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package snmp - -import ( - _ "embed" - "errors" - "fmt" - "strings" - - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - - "github.com/gosnmp/gosnmp" -) - -//go:embed "config_schema.json" -var configSchema string - -func init() { - module.Register("snmp", module.Creator{ - JobConfigSchema: configSchema, - Defaults: module.Defaults{ - UpdateEvery: defaultUpdateEvery, - }, - Create: func() module.Module { return New() }, - Config: func() any { return &Config{} }, - }) -} - -const ( - defaultUpdateEvery = 10 - defaultHostname = "127.0.0.1" - defaultCommunity = "public" - defaultVersion = gosnmp.Version2c - defaultPort = 161 - defaultRetries = 1 - defaultTimeout = defaultUpdateEvery - defaultMaxOIDs = 60 -) - -func New() *SNMP { - return &SNMP{ - Config: Config{ - Hostname: defaultHostname, - Community: defaultCommunity, - Options: Options{ - Port: defaultPort, - Retries: defaultRetries, - Timeout: defaultUpdateEvery, - Version: defaultVersion.String(), - MaxOIDs: defaultMaxOIDs, - }, - User: User{ - Name: "", - SecurityLevel: "authPriv", - AuthProto: "sha512", - AuthKey: "", - PrivProto: "aes192c", - PrivKey: "", - }, - }, - } -} - -type ( - Config struct { - UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` - Hostname string `yaml:"hostname" json:"hostname"` - Community string `yaml:"community,omitempty" json:"community"` - User User `yaml:"user,omitempty" json:"user"` - Options Options `yaml:"options,omitempty" json:"options"` - ChartsInput []ChartConfig `yaml:"charts,omitempty" json:"charts"` - } - User struct { - Name string `yaml:"name,omitempty" json:"name"` - SecurityLevel string `yaml:"level,omitempty" json:"level"` - AuthProto string `yaml:"auth_proto,omitempty" json:"auth_proto"` - AuthKey string `yaml:"auth_key,omitempty" json:"auth_key"` - PrivProto string `yaml:"priv_proto,omitempty" json:"priv_proto"` - PrivKey string `yaml:"priv_key,omitempty" json:"priv_key"` - } - Options struct { - Port int `yaml:"port,omitempty" json:"port"` - Retries int `yaml:"retries,omitempty" json:"retries"` - Timeout int `yaml:"timeout,omitempty" json:"timeout"` - Version string `yaml:"version,omitempty" json:"version"` - MaxOIDs int `yaml:"max_request_size,omitempty" json:"max_request_size"` - } - ChartConfig struct { - ID string `yaml:"id" json:"id"` - Title string `yaml:"title" json:"title"` - Units string `yaml:"units" json:"units"` - Family string `yaml:"family" json:"family"` - Type string `yaml:"type" json:"type"` - Priority int `yaml:"priority" json:"priority"` - IndexRange []int `yaml:"multiply_range,omitempty" json:"multiply_range"` - Dimensions []DimensionConfig `yaml:"dimensions" json:"dimensions"` - } - DimensionConfig struct { - OID string `yaml:"oid" json:"oid"` - Name string `yaml:"name" json:"name"` - Algorithm string `yaml:"algorithm" json:"algorithm"` - Multiplier int `yaml:"multiplier" json:"multiplier"` - Divisor int `yaml:"divisor" json:"divisor"` - } -) - -type SNMP struct { - module.Base - Config `yaml:",inline" json:""` - - charts *module.Charts - - snmpClient gosnmp.Handler - - oids []string -} - -func (s *SNMP) Configuration() any { - return s.Config -} - -func (s *SNMP) Init() error { - err := s.validateConfig() - if err != nil { - s.Errorf("config validation: %v", err) - return err - } - - snmpClient, err := s.initSNMPClient() - if err != nil { - s.Errorf("SNMP client initialization: %v", err) - return err - } - - s.Info(snmpClientConnInfo(snmpClient)) - - err = snmpClient.Connect() - if err != nil { - s.Errorf("SNMP client connect: %v", err) - return err - } - s.snmpClient = snmpClient - - charts, err := newCharts(s.ChartsInput) - if err != nil { - s.Errorf("Population of charts failed: %v", err) - return err - } - s.charts = charts - - s.oids = s.initOIDs() - - return nil -} - -func (s *SNMP) Check() error { - mx, err := s.collect() - if err != nil { - s.Error(err) - return err - } - if len(mx) == 0 { - return errors.New("no metrics collected") - } - return nil -} - -func (s *SNMP) Charts() *module.Charts { - return s.charts -} - -func (s *SNMP) Collect() map[string]int64 { - mx, err := s.collect() - if err != nil { - s.Error(err) - } - - if len(mx) == 0 { - return nil - } - return mx -} - -func (s *SNMP) Cleanup() { - if s.snmpClient != nil { - _ = s.snmpClient.Close() - } -} - -func snmpClientConnInfo(c gosnmp.Handler) string { - var info strings.Builder - info.WriteString(fmt.Sprintf("hostname=%s,port=%d,snmp_version=%s", c.Target(), c.Port(), c.Version())) - switch c.Version() { - case gosnmp.Version1, gosnmp.Version2c: - info.WriteString(fmt.Sprintf(",community=%s", c.Community())) - case gosnmp.Version3: - info.WriteString(fmt.Sprintf(",security_level=%d,%s", c.MsgFlags(), c.SecurityParameters().Description())) - } - return info.String() -} diff --git a/src/go/collectors/go.d.plugin/modules/snmp/snmp_test.go b/src/go/collectors/go.d.plugin/modules/snmp/snmp_test.go deleted file mode 100644 index 04d9db3f..00000000 --- a/src/go/collectors/go.d.plugin/modules/snmp/snmp_test.go +++ /dev/null @@ -1,520 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package snmp - -import ( - "errors" - "fmt" - "os" - "strings" - "testing" - - "github.com/golang/mock/gomock" - "github.com/gosnmp/gosnmp" - snmpmock "github.com/gosnmp/gosnmp/mocks" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -var ( - dataConfigJSON, _ = os.ReadFile("testdata/config.json") - dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") -) - -func Test_testDataIsValid(t *testing.T) { - for name, data := range map[string][]byte{ - "dataConfigJSON": dataConfigJSON, - "dataConfigYAML": dataConfigYAML, - } { - require.NotNil(t, data, name) - } -} - -func TestSNMP_ConfigurationSerialize(t *testing.T) { - module.TestConfigurationSerialize(t, &SNMP{}, dataConfigJSON, dataConfigYAML) -} - -func TestSNMP_Init(t *testing.T) { - tests := map[string]struct { - prepareSNMP func() *SNMP - wantFail bool - }{ - "fail with default config": { - wantFail: true, - prepareSNMP: func() *SNMP { - return New() - }, - }, - "fail when 'charts' not set": { - wantFail: true, - prepareSNMP: func() *SNMP { - snmp := New() - snmp.Config = prepareV2Config() - snmp.ChartsInput = nil - return snmp - }, - }, - "fail when using SNMPv3 but 'user.name' not set": { - wantFail: true, - prepareSNMP: func() *SNMP { - snmp := New() - snmp.Config = prepareV3Config() - snmp.User.Name = "" - return snmp - }, - }, - "fail when using SNMPv3 but 'user.level' is invalid": { - wantFail: true, - prepareSNMP: func() *SNMP { - snmp := New() - snmp.Config = prepareV3Config() - snmp.User.SecurityLevel = "invalid" - return snmp - }, - }, - "fail when using SNMPv3 but 'user.auth_proto' is invalid": { - wantFail: true, - prepareSNMP: func() *SNMP { - snmp := New() - snmp.Config = prepareV3Config() - snmp.User.AuthProto = "invalid" - return snmp - }, - }, - "fail when using SNMPv3 but 'user.priv_proto' is invalid": { - wantFail: true, - prepareSNMP: func() *SNMP { - snmp := New() - snmp.Config = prepareV3Config() - snmp.User.PrivProto = "invalid" - return snmp - }, - }, - "success when using SNMPv1 with valid config": { - wantFail: false, - prepareSNMP: func() *SNMP { - snmp := New() - snmp.Config = prepareV1Config() - return snmp - }, - }, - "success when using SNMPv2 with valid config": { - wantFail: false, - prepareSNMP: func() *SNMP { - snmp := New() - snmp.Config = prepareV2Config() - return snmp - }, - }, - "success when using SNMPv3 with valid config": { - wantFail: false, - prepareSNMP: func() *SNMP { - snmp := New() - snmp.Config = prepareV3Config() - return snmp - }, - }, - } - - for name, test := range tests { - t.Run(name, func(t *testing.T) { - snmp := test.prepareSNMP() - - if test.wantFail { - assert.Error(t, snmp.Init()) - } else { - assert.NoError(t, snmp.Init()) - } - }) - } -} - -func TestSNMP_Check(t *testing.T) { - tests := map[string]struct { - prepareSNMP func(m *snmpmock.MockHandler) *SNMP - wantFail bool - }{ - "success when 'max_request_size' > returned OIDs": { - wantFail: false, - prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { - snmp := New() - snmp.Config = prepareV2Config() - - m.EXPECT().Get(gomock.Any()).Return(&gosnmp.SnmpPacket{ - Variables: []gosnmp.SnmpPDU{ - {Value: 10, Type: gosnmp.Gauge32}, - {Value: 20, Type: gosnmp.Gauge32}, - }, - }, nil).Times(1) - - return snmp - }, - }, - "success when 'max_request_size' < returned OIDs": { - wantFail: false, - prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { - snmp := New() - snmp.Config = prepareV2Config() - snmp.Config.Options.MaxOIDs = 1 - - m.EXPECT().Get(gomock.Any()).Return(&gosnmp.SnmpPacket{ - Variables: []gosnmp.SnmpPDU{ - {Value: 10, Type: gosnmp.Gauge32}, - {Value: 20, Type: gosnmp.Gauge32}, - }, - }, nil).Times(2) - - return snmp - }, - }, - "success when using 'multiply_range'": { - wantFail: false, - prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { - snmp := New() - snmp.Config = prepareConfigWithIndexRange(prepareV2Config, 0, 1) - - m.EXPECT().Get(gomock.Any()).Return(&gosnmp.SnmpPacket{ - Variables: []gosnmp.SnmpPDU{ - {Value: 10, Type: gosnmp.Gauge32}, - {Value: 20, Type: gosnmp.Gauge32}, - {Value: 30, Type: gosnmp.Gauge32}, - {Value: 40, Type: gosnmp.Gauge32}, - }, - }, nil).Times(1) - - return snmp - }, - }, - "fail when snmp client Get fails": { - wantFail: true, - prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { - snmp := New() - snmp.Config = prepareV2Config() - - m.EXPECT().Get(gomock.Any()).Return(nil, errors.New("mock Get() error")).Times(1) - - return snmp - }, - }, - "fail when all OIDs type is unsupported": { - wantFail: true, - prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { - snmp := New() - snmp.Config = prepareV2Config() - - m.EXPECT().Get(gomock.Any()).Return(&gosnmp.SnmpPacket{ - Variables: []gosnmp.SnmpPDU{ - {Value: nil, Type: gosnmp.NoSuchInstance}, - {Value: nil, Type: gosnmp.NoSuchInstance}, - }, - }, nil).Times(1) - - return snmp - }, - }, - } - - for name, test := range tests { - t.Run(name, func(t *testing.T) { - mockSNMP, cleanup := mockInit(t) - defer cleanup() - - newSNMPClient = func() gosnmp.Handler { return mockSNMP } - defaultMockExpects(mockSNMP) - - snmp := test.prepareSNMP(mockSNMP) - require.NoError(t, snmp.Init()) - - if test.wantFail { - assert.Error(t, snmp.Check()) - } else { - assert.NoError(t, snmp.Check()) - } - }) - } -} - -func TestSNMP_Collect(t *testing.T) { - tests := map[string]struct { - prepareSNMP func(m *snmpmock.MockHandler) *SNMP - wantCollected map[string]int64 - }{ - "success when collecting supported type": { - prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { - snmp := New() - snmp.Config = prepareConfigWithIndexRange(prepareV2Config, 0, 3) - - m.EXPECT().Get(gomock.Any()).Return(&gosnmp.SnmpPacket{ - Variables: []gosnmp.SnmpPDU{ - {Value: 10, Type: gosnmp.Counter32}, - {Value: 20, Type: gosnmp.Counter64}, - {Value: 30, Type: gosnmp.Gauge32}, - {Value: 1, Type: gosnmp.Boolean}, - {Value: 40, Type: gosnmp.Gauge32}, - {Value: 50, Type: gosnmp.TimeTicks}, - {Value: 60, Type: gosnmp.Uinteger32}, - {Value: 70, Type: gosnmp.Integer}, - }, - }, nil).Times(1) - - return snmp - }, - wantCollected: map[string]int64{ - "1.3.6.1.2.1.2.2.1.10.0": 10, - "1.3.6.1.2.1.2.2.1.16.0": 20, - "1.3.6.1.2.1.2.2.1.10.1": 30, - "1.3.6.1.2.1.2.2.1.16.1": 1, - "1.3.6.1.2.1.2.2.1.10.2": 40, - "1.3.6.1.2.1.2.2.1.16.2": 50, - "1.3.6.1.2.1.2.2.1.10.3": 60, - "1.3.6.1.2.1.2.2.1.16.3": 70, - }, - }, - "success when collecting supported and unsupported type": { - prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { - snmp := New() - snmp.Config = prepareConfigWithIndexRange(prepareV2Config, 0, 2) - - m.EXPECT().Get(gomock.Any()).Return(&gosnmp.SnmpPacket{ - Variables: []gosnmp.SnmpPDU{ - {Value: 10, Type: gosnmp.Counter32}, - {Value: 20, Type: gosnmp.Counter64}, - {Value: 30, Type: gosnmp.Gauge32}, - {Value: nil, Type: gosnmp.NoSuchInstance}, - {Value: nil, Type: gosnmp.NoSuchInstance}, - {Value: nil, Type: gosnmp.NoSuchInstance}, - }, - }, nil).Times(1) - - return snmp - }, - wantCollected: map[string]int64{ - "1.3.6.1.2.1.2.2.1.10.0": 10, - "1.3.6.1.2.1.2.2.1.16.0": 20, - "1.3.6.1.2.1.2.2.1.10.1": 30, - }, - }, - "fails when collecting unsupported type": { - prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { - snmp := New() - snmp.Config = prepareConfigWithIndexRange(prepareV2Config, 0, 2) - - m.EXPECT().Get(gomock.Any()).Return(&gosnmp.SnmpPacket{ - Variables: []gosnmp.SnmpPDU{ - {Value: nil, Type: gosnmp.NoSuchInstance}, - {Value: nil, Type: gosnmp.NoSuchInstance}, - {Value: nil, Type: gosnmp.NoSuchObject}, - {Value: "192.0.2.0", Type: gosnmp.NsapAddress}, - {Value: []uint8{118, 101, 116}, Type: gosnmp.OctetString}, - {Value: ".1.3.6.1.2.1.4.32.1.5.2.1.4.10.19.0.0.16", Type: gosnmp.ObjectIdentifier}, - }, - }, nil).Times(1) - - return snmp - }, - wantCollected: nil, - }, - } - - for name, test := range tests { - t.Run(name, func(t *testing.T) { - mockSNMP, cleanup := mockInit(t) - defer cleanup() - - newSNMPClient = func() gosnmp.Handler { return mockSNMP } - defaultMockExpects(mockSNMP) - - snmp := test.prepareSNMP(mockSNMP) - require.NoError(t, snmp.Init()) - - collected := snmp.Collect() - - assert.Equal(t, test.wantCollected, collected) - }) - } -} - -func TestSNMP_Cleanup(t *testing.T) { - tests := map[string]struct { - prepareSNMP func(t *testing.T, m *snmpmock.MockHandler) *SNMP - }{ - "cleanup call if snmpClient initialized": { - prepareSNMP: func(t *testing.T, m *snmpmock.MockHandler) *SNMP { - snmp := New() - snmp.Config = prepareV2Config() - require.NoError(t, snmp.Init()) - - m.EXPECT().Close().Times(1) - - return snmp - }, - }, - "cleanup call does not panic if snmpClient not initialized": { - prepareSNMP: func(t *testing.T, m *snmpmock.MockHandler) *SNMP { - snmp := New() - snmp.Config = prepareV2Config() - require.NoError(t, snmp.Init()) - snmp.snmpClient = nil - - return snmp - }, - }, - } - - for name, test := range tests { - t.Run(name, func(t *testing.T) { - mockSNMP, cleanup := mockInit(t) - defer cleanup() - - newSNMPClient = func() gosnmp.Handler { return mockSNMP } - defaultMockExpects(mockSNMP) - - snmp := test.prepareSNMP(t, mockSNMP) - assert.NotPanics(t, snmp.Cleanup) - }) - } -} - -func TestSNMP_Charts(t *testing.T) { - tests := map[string]struct { - prepareSNMP func(t *testing.T, m *snmpmock.MockHandler) *SNMP - wantNumCharts int - }{ - "without 'multiply_range': got expected number of charts": { - wantNumCharts: 1, - prepareSNMP: func(t *testing.T, m *snmpmock.MockHandler) *SNMP { - snmp := New() - snmp.Config = prepareV2Config() - require.NoError(t, snmp.Init()) - - return snmp - }, - }, - "with 'multiply_range': got expected number of charts": { - wantNumCharts: 10, - prepareSNMP: func(t *testing.T, m *snmpmock.MockHandler) *SNMP { - snmp := New() - snmp.Config = prepareConfigWithIndexRange(prepareV2Config, 0, 9) - require.NoError(t, snmp.Init()) - - return snmp - }, - }, - } - - for name, test := range tests { - t.Run(name, func(t *testing.T) { - mockSNMP, cleanup := mockInit(t) - defer cleanup() - - newSNMPClient = func() gosnmp.Handler { return mockSNMP } - defaultMockExpects(mockSNMP) - - snmp := test.prepareSNMP(t, mockSNMP) - assert.Equal(t, test.wantNumCharts, len(*snmp.Charts())) - }) - } -} - -func mockInit(t *testing.T) (*snmpmock.MockHandler, func()) { - mockCtl := gomock.NewController(t) - cleanup := func() { mockCtl.Finish() } - mockSNMP := snmpmock.NewMockHandler(mockCtl) - - return mockSNMP, cleanup -} - -func defaultMockExpects(m *snmpmock.MockHandler) { - m.EXPECT().Target().AnyTimes() - m.EXPECT().Port().AnyTimes() - m.EXPECT().Retries().AnyTimes() - m.EXPECT().Timeout().AnyTimes() - m.EXPECT().MaxOids().AnyTimes() - m.EXPECT().Version().AnyTimes() - m.EXPECT().Community().AnyTimes() - m.EXPECT().SetTarget(gomock.Any()).AnyTimes() - m.EXPECT().SetPort(gomock.Any()).AnyTimes() - m.EXPECT().SetRetries(gomock.Any()).AnyTimes() - m.EXPECT().SetMaxOids(gomock.Any()).AnyTimes() - m.EXPECT().SetLogger(gomock.Any()).AnyTimes() - m.EXPECT().SetTimeout(gomock.Any()).AnyTimes() - m.EXPECT().SetCommunity(gomock.Any()).AnyTimes() - m.EXPECT().SetVersion(gomock.Any()).AnyTimes() - m.EXPECT().SetSecurityModel(gomock.Any()).AnyTimes() - m.EXPECT().SetMsgFlags(gomock.Any()).AnyTimes() - m.EXPECT().SetSecurityParameters(gomock.Any()).AnyTimes() - m.EXPECT().Connect().Return(nil).AnyTimes() -} - -func prepareConfigWithIndexRange(p func() Config, start, end int) Config { - if start > end || start < 0 || end < 1 { - panic(fmt.Sprintf("invalid index range ('%d'-'%d')", start, end)) - } - cfg := p() - for i := range cfg.ChartsInput { - cfg.ChartsInput[i].IndexRange = []int{start, end} - } - return cfg -} - -func prepareV3Config() Config { - cfg := prepareV2Config() - cfg.Options.Version = gosnmp.Version3.String() - cfg.User = User{ - Name: "name", - SecurityLevel: "authPriv", - AuthProto: strings.ToLower(gosnmp.MD5.String()), - AuthKey: "auth_key", - PrivProto: strings.ToLower(gosnmp.AES.String()), - PrivKey: "priv_key", - } - return cfg -} - -func prepareV2Config() Config { - cfg := prepareV1Config() - cfg.Options.Version = gosnmp.Version2c.String() - return cfg -} - -func prepareV1Config() Config { - return Config{ - UpdateEvery: defaultUpdateEvery, - Hostname: defaultHostname, - Community: defaultCommunity, - Options: Options{ - Port: defaultPort, - Retries: defaultRetries, - Timeout: defaultTimeout, - Version: gosnmp.Version1.String(), - MaxOIDs: defaultMaxOIDs, - }, - ChartsInput: []ChartConfig{ - { - ID: "test_chart1", - Title: "This is Test Chart1", - Units: "kilobits/s", - Family: "family", - Type: module.Area.String(), - Priority: module.Priority, - Dimensions: []DimensionConfig{ - { - OID: "1.3.6.1.2.1.2.2.1.10", - Name: "in", - Algorithm: module.Incremental.String(), - Multiplier: 8, - Divisor: 1000, - }, - { - OID: "1.3.6.1.2.1.2.2.1.16", - Name: "out", - Algorithm: module.Incremental.String(), - Multiplier: 8, - Divisor: 1000, - }, - }, - }, - }, - } -} diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/vsphere_test.go b/src/go/collectors/go.d.plugin/modules/vsphere/vsphere_test.go deleted file mode 100644 index 8c0045d8..00000000 --- a/src/go/collectors/go.d.plugin/modules/vsphere/vsphere_test.go +++ /dev/null @@ -1,488 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -package vsphere - -import ( - "crypto/tls" - "os" - "strings" - "testing" - "time" - - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/discover" - "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/match" - rs "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/vmware/govmomi/performance" - "github.com/vmware/govmomi/simulator" -) - -var ( - dataConfigJSON, _ = os.ReadFile("testdata/config.json") - dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") -) - -func Test_testDataIsValid(t *testing.T) { - for name, data := range map[string][]byte{ - "dataConfigJSON": dataConfigJSON, - "dataConfigYAML": dataConfigYAML, - } { - require.NotNil(t, data, name) - } -} - -func TestVSphere_ConfigurationSerialize(t *testing.T) { - module.TestConfigurationSerialize(t, &VSphere{}, dataConfigJSON, dataConfigYAML) -} - -func TestVSphere_Init(t *testing.T) { - vSphere, _, teardown := prepareVSphereSim(t) - defer teardown() - - assert.NoError(t, vSphere.Init()) - assert.NotNil(t, vSphere.discoverer) - assert.NotNil(t, vSphere.scraper) - assert.NotNil(t, vSphere.resources) - assert.NotNil(t, vSphere.discoveryTask) - assert.True(t, vSphere.discoveryTask.isRunning()) -} - -func TestVSphere_Init_ReturnsFalseIfURLNotSet(t *testing.T) { - vSphere, _, teardown := prepareVSphereSim(t) - defer teardown() - vSphere.URL = "" - - assert.Error(t, vSphere.Init()) -} - -func TestVSphere_Init_ReturnsFalseIfUsernameNotSet(t *testing.T) { - vSphere, _, teardown := prepareVSphereSim(t) - defer teardown() - vSphere.Username = "" - - assert.Error(t, vSphere.Init()) -} - -func TestVSphere_Init_ReturnsFalseIfPasswordNotSet(t *testing.T) { - vSphere, _, teardown := prepareVSphereSim(t) - defer teardown() - vSphere.Password = "" - - assert.Error(t, vSphere.Init()) -} - -func TestVSphere_Init_ReturnsFalseIfClientWrongTLSCA(t *testing.T) { - vSphere, _, teardown := prepareVSphereSim(t) - defer teardown() - vSphere.Client.TLSConfig.TLSCA = "testdata/tls" - - assert.Error(t, vSphere.Init()) -} - -func TestVSphere_Init_ReturnsFalseIfConnectionRefused(t *testing.T) { - vSphere, _, teardown := prepareVSphereSim(t) - defer teardown() - vSphere.URL = "http://127.0.0.1:32001" - - assert.Error(t, vSphere.Init()) -} - -func TestVSphere_Init_ReturnsFalseIfInvalidHostVMIncludeFormat(t *testing.T) { - vSphere, _, teardown := prepareVSphereSim(t) - defer teardown() - - vSphere.HostsInclude = match.HostIncludes{"invalid"} - assert.Error(t, vSphere.Init()) - - vSphere.HostsInclude = vSphere.HostsInclude[:0] - - vSphere.VMsInclude = match.VMIncludes{"invalid"} - assert.Error(t, vSphere.Init()) -} - -func TestVSphere_Check(t *testing.T) { - assert.NoError(t, New().Check()) -} - -func TestVSphere_Charts(t *testing.T) { - assert.NotNil(t, New().Charts()) -} - -func TestVSphere_Cleanup(t *testing.T) { - vSphere, _, teardown := prepareVSphereSim(t) - defer teardown() - - require.NoError(t, vSphere.Init()) - - vSphere.Cleanup() - time.Sleep(time.Second) - assert.True(t, vSphere.discoveryTask.isStopped()) - assert.False(t, vSphere.discoveryTask.isRunning()) -} - -func TestVSphere_Cleanup_NotPanicsIfNotInitialized(t *testing.T) { - assert.NotPanics(t, New().Cleanup) -} - -func TestVSphere_Collect(t *testing.T) { - vSphere, model, teardown := prepareVSphereSim(t) - defer teardown() - - require.NoError(t, vSphere.Init()) - - vSphere.scraper = mockScraper{vSphere.scraper} - - expected := map[string]int64{ - "host-20_cpu.usage.average": 100, - "host-20_disk.maxTotalLatency.latest": 100, - "host-20_disk.read.average": 100, - "host-20_disk.write.average": 100, - "host-20_mem.active.average": 100, - "host-20_mem.consumed.average": 100, - "host-20_mem.granted.average": 100, - "host-20_mem.shared.average": 100, - "host-20_mem.sharedcommon.average": 100, - "host-20_mem.swapinRate.average": 100, - "host-20_mem.swapoutRate.average": 100, - "host-20_mem.usage.average": 100, - "host-20_net.bytesRx.average": 100, - "host-20_net.bytesTx.average": 100, - "host-20_net.droppedRx.summation": 100, - "host-20_net.droppedTx.summation": 100, - "host-20_net.errorsRx.summation": 100, - "host-20_net.errorsTx.summation": 100, - "host-20_net.packetsRx.summation": 100, - "host-20_net.packetsTx.summation": 100, - "host-20_overall.status.gray": 1, - "host-20_overall.status.green": 0, - "host-20_overall.status.red": 0, - "host-20_overall.status.yellow": 0, - "host-20_sys.uptime.latest": 100, - "host-34_cpu.usage.average": 100, - "host-34_disk.maxTotalLatency.latest": 100, - "host-34_disk.read.average": 100, - "host-34_disk.write.average": 100, - "host-34_mem.active.average": 100, - "host-34_mem.consumed.average": 100, - "host-34_mem.granted.average": 100, - "host-34_mem.shared.average": 100, - "host-34_mem.sharedcommon.average": 100, - "host-34_mem.swapinRate.average": 100, - "host-34_mem.swapoutRate.average": 100, - "host-34_mem.usage.average": 100, - "host-34_net.bytesRx.average": 100, - "host-34_net.bytesTx.average": 100, - "host-34_net.droppedRx.summation": 100, - "host-34_net.droppedTx.summation": 100, - "host-34_net.errorsRx.summation": 100, - "host-34_net.errorsTx.summation": 100, - "host-34_net.packetsRx.summation": 100, - "host-34_net.packetsTx.summation": 100, - "host-34_overall.status.gray": 1, - "host-34_overall.status.green": 0, - "host-34_overall.status.red": 0, - "host-34_overall.status.yellow": 0, - "host-34_sys.uptime.latest": 100, - "host-42_cpu.usage.average": 100, - "host-42_disk.maxTotalLatency.latest": 100, - "host-42_disk.read.average": 100, - "host-42_disk.write.average": 100, - "host-42_mem.active.average": 100, - "host-42_mem.consumed.average": 100, - "host-42_mem.granted.average": 100, - "host-42_mem.shared.average": 100, - "host-42_mem.sharedcommon.average": 100, - "host-42_mem.swapinRate.average": 100, - "host-42_mem.swapoutRate.average": 100, - "host-42_mem.usage.average": 100, - "host-42_net.bytesRx.average": 100, - "host-42_net.bytesTx.average": 100, - "host-42_net.droppedRx.summation": 100, - "host-42_net.droppedTx.summation": 100, - "host-42_net.errorsRx.summation": 100, - "host-42_net.errorsTx.summation": 100, - "host-42_net.packetsRx.summation": 100, - "host-42_net.packetsTx.summation": 100, - "host-42_overall.status.gray": 1, - "host-42_overall.status.green": 0, - "host-42_overall.status.red": 0, - "host-42_overall.status.yellow": 0, - "host-42_sys.uptime.latest": 100, - "host-50_cpu.usage.average": 100, - "host-50_disk.maxTotalLatency.latest": 100, - "host-50_disk.read.average": 100, - "host-50_disk.write.average": 100, - "host-50_mem.active.average": 100, - "host-50_mem.consumed.average": 100, - "host-50_mem.granted.average": 100, - "host-50_mem.shared.average": 100, - "host-50_mem.sharedcommon.average": 100, - "host-50_mem.swapinRate.average": 100, - "host-50_mem.swapoutRate.average": 100, - "host-50_mem.usage.average": 100, - "host-50_net.bytesRx.average": 100, - "host-50_net.bytesTx.average": 100, - "host-50_net.droppedRx.summation": 100, - "host-50_net.droppedTx.summation": 100, - "host-50_net.errorsRx.summation": 100, - "host-50_net.errorsTx.summation": 100, - "host-50_net.packetsRx.summation": 100, - "host-50_net.packetsTx.summation": 100, - "host-50_overall.status.gray": 1, - "host-50_overall.status.green": 0, - "host-50_overall.status.red": 0, - "host-50_overall.status.yellow": 0, - "host-50_sys.uptime.latest": 100, - "vm-55_cpu.usage.average": 200, - "vm-55_disk.maxTotalLatency.latest": 200, - "vm-55_disk.read.average": 200, - "vm-55_disk.write.average": 200, - "vm-55_mem.active.average": 200, - "vm-55_mem.consumed.average": 200, - "vm-55_mem.granted.average": 200, - "vm-55_mem.shared.average": 200, - "vm-55_mem.swapinRate.average": 200, - "vm-55_mem.swapoutRate.average": 200, - "vm-55_mem.swapped.average": 200, - "vm-55_mem.usage.average": 200, - "vm-55_net.bytesRx.average": 200, - "vm-55_net.bytesTx.average": 200, - "vm-55_net.droppedRx.summation": 200, - "vm-55_net.droppedTx.summation": 200, - "vm-55_net.packetsRx.summation": 200, - "vm-55_net.packetsTx.summation": 200, - "vm-55_overall.status.gray": 0, - "vm-55_overall.status.green": 1, - "vm-55_overall.status.red": 0, - "vm-55_overall.status.yellow": 0, - "vm-55_sys.uptime.latest": 200, - "vm-58_cpu.usage.average": 200, - "vm-58_disk.maxTotalLatency.latest": 200, - "vm-58_disk.read.average": 200, - "vm-58_disk.write.average": 200, - "vm-58_mem.active.average": 200, - "vm-58_mem.consumed.average": 200, - "vm-58_mem.granted.average": 200, - "vm-58_mem.shared.average": 200, - "vm-58_mem.swapinRate.average": 200, - "vm-58_mem.swapoutRate.average": 200, - "vm-58_mem.swapped.average": 200, - "vm-58_mem.usage.average": 200, - "vm-58_net.bytesRx.average": 200, - "vm-58_net.bytesTx.average": 200, - "vm-58_net.droppedRx.summation": 200, - "vm-58_net.droppedTx.summation": 200, - "vm-58_net.packetsRx.summation": 200, - "vm-58_net.packetsTx.summation": 200, - "vm-58_overall.status.gray": 0, - "vm-58_overall.status.green": 1, - "vm-58_overall.status.red": 0, - "vm-58_overall.status.yellow": 0, - "vm-58_sys.uptime.latest": 200, - "vm-61_cpu.usage.average": 200, - "vm-61_disk.maxTotalLatency.latest": 200, - "vm-61_disk.read.average": 200, - "vm-61_disk.write.average": 200, - "vm-61_mem.active.average": 200, - "vm-61_mem.consumed.average": 200, - "vm-61_mem.granted.average": 200, - "vm-61_mem.shared.average": 200, - "vm-61_mem.swapinRate.average": 200, - "vm-61_mem.swapoutRate.average": 200, - "vm-61_mem.swapped.average": 200, - "vm-61_mem.usage.average": 200, - "vm-61_net.bytesRx.average": 200, - "vm-61_net.bytesTx.average": 200, - "vm-61_net.droppedRx.summation": 200, - "vm-61_net.droppedTx.summation": 200, - "vm-61_net.packetsRx.summation": 200, - "vm-61_net.packetsTx.summation": 200, - "vm-61_overall.status.gray": 0, - "vm-61_overall.status.green": 1, - "vm-61_overall.status.red": 0, - "vm-61_overall.status.yellow": 0, - "vm-61_sys.uptime.latest": 200, - "vm-64_cpu.usage.average": 200, - "vm-64_disk.maxTotalLatency.latest": 200, - "vm-64_disk.read.average": 200, - "vm-64_disk.write.average": 200, - "vm-64_mem.active.average": 200, - "vm-64_mem.consumed.average": 200, - "vm-64_mem.granted.average": 200, - "vm-64_mem.shared.average": 200, - "vm-64_mem.swapinRate.average": 200, - "vm-64_mem.swapoutRate.average": 200, - "vm-64_mem.swapped.average": 200, - "vm-64_mem.usage.average": 200, - "vm-64_net.bytesRx.average": 200, - "vm-64_net.bytesTx.average": 200, - "vm-64_net.droppedRx.summation": 200, - "vm-64_net.droppedTx.summation": 200, - "vm-64_net.packetsRx.summation": 200, - "vm-64_net.packetsTx.summation": 200, - "vm-64_overall.status.gray": 0, - "vm-64_overall.status.green": 1, - "vm-64_overall.status.red": 0, - "vm-64_overall.status.yellow": 0, - "vm-64_sys.uptime.latest": 200, - } - - collected := vSphere.Collect() - require.Equal(t, expected, collected) - - count := model.Count() - assert.Len(t, vSphere.discoveredHosts, count.Host) - assert.Len(t, vSphere.discoveredVMs, count.Machine) - assert.Len(t, vSphere.charted, count.Host+count.Machine) - - assert.Len(t, *vSphere.Charts(), count.Host*len(hostChartsTmpl)+count.Machine*len(vmChartsTmpl)) - ensureCollectedHasAllChartsDimsVarsIDs(t, vSphere, collected) -} - -func TestVSphere_Collect_RemoveHostsVMsInRuntime(t *testing.T) { - vSphere, _, teardown := prepareVSphereSim(t) - defer teardown() - - require.NoError(t, vSphere.Init()) - require.NoError(t, vSphere.Check()) - - okHostID := "host-50" - okVMID := "vm-64" - vSphere.discoverer.(*discover.Discoverer).HostMatcher = mockHostMatcher{okHostID} - vSphere.discoverer.(*discover.Discoverer).VMMatcher = mockVMMatcher{okVMID} - - require.NoError(t, vSphere.discoverOnce()) - - numOfRuns := 5 - for i := 0; i < numOfRuns; i++ { - vSphere.Collect() - } - - host := vSphere.resources.Hosts.Get(okHostID) - for k, v := range vSphere.discoveredHosts { - if k == host.ID { - assert.Equal(t, 0, v) - } else { - assert.Equal(t, numOfRuns, v) - } - } - - vm := vSphere.resources.VMs.Get(okVMID) - for id, fails := range vSphere.discoveredVMs { - if id == vm.ID { - assert.Equal(t, 0, fails) - } else { - assert.Equal(t, numOfRuns, fails) - } - - } - - for i := numOfRuns; i < failedUpdatesLimit; i++ { - vSphere.Collect() - } - - assert.Len(t, vSphere.discoveredHosts, 1) - assert.Len(t, vSphere.discoveredVMs, 1) - assert.Len(t, vSphere.charted, 2) - - for _, c := range *vSphere.Charts() { - if strings.HasPrefix(c.ID, okHostID) || strings.HasPrefix(c.ID, okVMID) { - assert.False(t, c.Obsolete) - } else { - assert.True(t, c.Obsolete) - } - } -} - -func TestVSphere_Collect_Run(t *testing.T) { - vSphere, model, teardown := prepareVSphereSim(t) - defer teardown() - - vSphere.DiscoveryInterval = web.Duration(time.Second * 2) - require.NoError(t, vSphere.Init()) - require.NoError(t, vSphere.Check()) - - runs := 20 - for i := 0; i < runs; i++ { - assert.True(t, len(vSphere.Collect()) > 0) - if i < 6 { - time.Sleep(time.Second) - } - } - - count := model.Count() - assert.Len(t, vSphere.discoveredHosts, count.Host) - assert.Len(t, vSphere.discoveredVMs, count.Machine) - assert.Len(t, vSphere.charted, count.Host+count.Machine) - assert.Len(t, *vSphere.charts, count.Host*len(hostChartsTmpl)+count.Machine*len(vmChartsTmpl)) -} - -func ensureCollectedHasAllChartsDimsVarsIDs(t *testing.T, vSphere *VSphere, collected map[string]int64) { - for _, chart := range *vSphere.Charts() { - for _, dim := range chart.Dims { - _, ok := collected[dim.ID] - assert.Truef(t, ok, "collected metrics has no data for dim '%s' chart '%s'", dim.ID, chart.ID) - } - for _, v := range chart.Vars { - _, ok := collected[v.ID] - assert.Truef(t, ok, "collected metrics has no data for var '%s' chart '%s'", v.ID, chart.ID) - } - } -} - -func prepareVSphereSim(t *testing.T) (vSphere *VSphere, model *simulator.Model, teardown func()) { - model, srv := createSim(t) - vSphere = New() - teardown = func() { model.Remove(); srv.Close(); vSphere.Cleanup() } - - vSphere.Username = "administrator" - vSphere.Password = "password" - vSphere.URL = srv.URL.String() - vSphere.TLSConfig.InsecureSkipVerify = true - - return vSphere, model, teardown -} - -func createSim(t *testing.T) (*simulator.Model, *simulator.Server) { - model := simulator.VPX() - err := model.Create() - require.NoError(t, err) - model.Service.TLS = new(tls.Config) - return model, model.Service.NewServer() -} - -type mockScraper struct { - scraper -} - -func (s mockScraper) ScrapeHosts(hosts rs.Hosts) []performance.EntityMetric { - ms := s.scraper.ScrapeHosts(hosts) - return populateMetrics(ms, 100) -} -func (s mockScraper) ScrapeVMs(vms rs.VMs) []performance.EntityMetric { - ms := s.scraper.ScrapeVMs(vms) - return populateMetrics(ms, 200) -} - -func populateMetrics(ms []performance.EntityMetric, value int64) []performance.EntityMetric { - for i := range ms { - for ii := range ms[i].Value { - v := &ms[i].Value[ii].Value - if *v == nil { - *v = append(*v, value) - } else { - (*v)[0] = value - } - } - } - return ms -} - -type mockHostMatcher struct{ name string } -type mockVMMatcher struct{ name string } - -func (m mockHostMatcher) Match(host *rs.Host) bool { return m.name == host.ID } -func (m mockVMMatcher) Match(vm *rs.VM) bool { return m.name == vm.ID } diff --git a/src/go/collectors/go.d.plugin/go.mod b/src/go/go.mod index 47802583..25153fc6 100644 --- a/src/go/collectors/go.d.plugin/go.mod +++ b/src/go/go.mod @@ -1,4 +1,4 @@ -module github.com/netdata/netdata/go/go.d.plugin +module github.com/netdata/netdata/go/plugins go 1.22.0 @@ -10,49 +10,50 @@ require ( github.com/Wing924/ltsv v0.3.1 github.com/apparentlymart/go-cidr v1.1.0 github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de - github.com/axiomhq/hyperloglog v0.0.0-20240319100328-84253e514e02 + github.com/axiomhq/hyperloglog v0.1.0 github.com/blang/semver/v4 v4.0.0 github.com/bmatcuk/doublestar/v4 v4.6.1 github.com/clbanning/rfile/v2 v2.0.0-20231024120205-ac3fca974b0e github.com/cloudflare/cfssl v1.6.5 github.com/coreos/go-systemd/v22 v22.5.0 - github.com/docker/docker v27.0.0+incompatible - github.com/facebook/time v0.0.0-20240419201005-e4f24e18edf7 + github.com/docker/docker v27.1.2+incompatible + github.com/facebook/time v0.0.0-20240626113945-18207c5d8ddc github.com/fsnotify/fsnotify v1.7.0 github.com/go-redis/redis/v8 v8.11.5 github.com/go-sql-driver/mysql v1.8.1 github.com/godbus/dbus/v5 v5.1.0 - github.com/gofrs/flock v0.8.1 + github.com/gofrs/flock v0.12.1 github.com/golang/mock v1.6.0 - github.com/gosnmp/gosnmp v1.37.0 + github.com/gosnmp/gosnmp v1.38.0 github.com/ilyam8/hashstructure v1.1.0 github.com/jackc/pgx/v4 v4.18.3 + github.com/jackc/pgx/v5 v5.6.0 github.com/jessevdk/go-flags v1.6.1 github.com/kanocz/fcgi_client v0.0.0-20210113082628-fff85c8adfb7 - github.com/likexian/whois v1.15.3 - github.com/likexian/whois-parser v1.24.16 - github.com/lmittmann/tint v1.0.4 + github.com/likexian/whois v1.15.4 + github.com/likexian/whois-parser v1.24.19 + github.com/lmittmann/tint v1.0.5 github.com/mattn/go-isatty v0.0.20 github.com/mattn/go-xmlrpc v0.0.3 - github.com/miekg/dns v1.1.61 + github.com/miekg/dns v1.1.62 github.com/mitchellh/go-homedir v1.1.0 - github.com/muesli/cancelreader v0.2.2 - github.com/prometheus-community/pro-bing v0.4.0 - github.com/prometheus/common v0.54.0 + github.com/prometheus-community/pro-bing v0.4.1 + github.com/prometheus/common v0.55.0 github.com/prometheus/prometheus v2.5.0+incompatible github.com/stretchr/testify v1.9.0 - github.com/tidwall/gjson v1.17.1 + github.com/tidwall/gjson v1.17.3 github.com/valyala/fastjson v1.6.4 - github.com/vmware/govmomi v0.37.3 - go.mongodb.org/mongo-driver v1.15.1 - golang.org/x/net v0.26.0 - golang.org/x/text v0.16.0 + github.com/vmware/govmomi v0.42.0 + go.mongodb.org/mongo-driver v1.16.1 + golang.org/x/net v0.28.0 + golang.org/x/text v0.17.0 golang.zx2c4.com/wireguard/wgctrl v0.0.0-20220504211119-3d4a969bb56b gopkg.in/ini.v1 v1.67.0 + gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.2 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.30.2 - k8s.io/apimachinery v0.30.2 - k8s.io/client-go v0.30.2 + k8s.io/api v0.31.0 + k8s.io/apimachinery v0.31.0 + k8s.io/client-go v0.31.0 layeh.com/radius v0.0.0-20190322222518-890bc1058917 ) @@ -70,9 +71,9 @@ require ( github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.20.0 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect @@ -86,6 +87,7 @@ require ( github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect + github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect github.com/huandu/xstrings v1.3.3 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect @@ -95,6 +97,7 @@ require ( github.com/jackc/pgproto3/v2 v2.3.3 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/pgtype v1.14.0 // indirect + github.com/jackc/puddle/v2 v2.2.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/josharian/native v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -109,10 +112,11 @@ require ( github.com/moby/docker-image-spec v1.3.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect + github.com/montanaflynn/stats v0.7.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.0.2 // indirect + github.com/opentracing/opentracing-go v1.1.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -122,6 +126,7 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect + github.com/x448/float16 v0.8.4 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect @@ -130,23 +135,25 @@ require ( go.opentelemetry.io/otel v1.22.0 // indirect go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/otel/trace v1.22.0 // indirect - golang.org/x/crypto v0.24.0 // indirect + golang.org/x/crypto v0.26.0 // indirect golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect golang.org/x/mod v0.18.0 // indirect - golang.org/x/oauth2 v0.19.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.23.0 // indirect + golang.org/x/term v0.23.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.22.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b // indirect - google.golang.org/protobuf v1.34.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/cenkalti/backoff.v2 v2.2.1 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect diff --git a/src/go/collectors/go.d.plugin/go.sum b/src/go/go.sum index b2eb24d0..c572aa7c 100644 --- a/src/go/collectors/go.d.plugin/go.sum +++ b/src/go/go.sum @@ -20,12 +20,16 @@ github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4t github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhPwqqXc4/vE0f7GvRjuAsbW+HOIe8KnA= github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw= -github.com/axiomhq/hyperloglog v0.0.0-20240319100328-84253e514e02 h1:bXAPYSbdYbS5VTy92NIUbeDI1qyggi+JYh5op9IFlcQ= -github.com/axiomhq/hyperloglog v0.0.0-20240319100328-84253e514e02/go.mod h1:k08r+Yj1PRAmuayFiRK6MYuR5Ve4IuZtTfxErMIh0+c= +github.com/axiomhq/hyperloglog v0.1.0 h1:1KGnEY6jlfxOVu4UF0MgILDt3izucjr4Hh9mQbYZ0hY= +github.com/axiomhq/hyperloglog v0.1.0/go.mod h1:k08r+Yj1PRAmuayFiRK6MYuR5Ve4IuZtTfxErMIh0+c= +github.com/bitly/go-hostpool v0.1.0 h1:XKmsF6k5el6xHG3WPJ8U0Ku/ye7njX7W81Ng7O2ioR0= +github.com/bitly/go-hostpool v0.1.0/go.mod h1:4gOCgp6+NZnVqlKyZ/iBZFTAJKembaVENUpMkpg42fw= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -54,27 +58,28 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/docker v27.0.0+incompatible h1:JRugTYuelmWlW0M3jakcIadDx2HUoUO6+Tf2C5jVfwA= -github.com/docker/docker v27.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v27.1.2+incompatible h1:AhGzR1xaQIy53qCkxARaFluI00WPGtXn0AJuoQsVYTY= +github.com/docker/docker v27.1.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= -github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/facebook/time v0.0.0-20240419201005-e4f24e18edf7 h1:ux8H/t/+FqQ5rB+GeBu4mfQmkn5ASu1sMVs2mdrTypQ= -github.com/facebook/time v0.0.0-20240419201005-e4f24e18edf7/go.mod h1:IzbLjofnIgln16a+BfuCTMi8IaC3PuBra2hi4jPPmNE= +github.com/facebook/time v0.0.0-20240626113945-18207c5d8ddc h1:0VQsg5ZXW9MPUxzemUHW7UBK8gfIO8K+YJGbdv4kBIM= +github.com/facebook/time v0.0.0-20240626113945-18207c5d8ddc/go.mod h1:2UFAomOuD2vAK1x68czUtCVjAqmyWCEnAXOlmGqf+G0= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= @@ -90,19 +95,21 @@ github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= +github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -117,19 +124,22 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20240117000934-35fc243c5815 h1:WzfWbQz/Ze8v6l++GGbGNFZnUShVpP/0xffCPLL+ax8= -github.com/google/pprof v0.0.0-20240117000934-35fc243c5815/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gosnmp/gosnmp v1.37.0 h1:/Tf8D3b9wrnNuf/SfbvO+44mPrjVphBhRtcGg22V07Y= -github.com/gosnmp/gosnmp v1.37.0/go.mod h1:GDH9vNqpsD7f2HvZhKs5dlqSEcAS6s6Qp099oZRCR+M= +github.com/gosnmp/gosnmp v1.38.0 h1:I5ZOMR8kb0DXAFg/88ACurnuwGwYkXWq3eLpJPHMEYc= +github.com/gosnmp/gosnmp v1.38.0/go.mod h1:FE+PEZvKrFz9afP9ii1W3cprXuVZ17ypCcyyfYuu5LY= github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd h1:PpuIBO5P3e9hpqBD0O/HjhShYuM6XE0i/lbE6J94kww= github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= +github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= +github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ilyam8/hashstructure v1.1.0 h1:N8t8hzzKLf2Da87XgC/DBYqXUmSbclgx+2cZxS5/klU= @@ -181,9 +191,13 @@ github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQ github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= github.com/jackc/pgx/v4 v4.18.3 h1:dE2/TrEsGX3RBprb3qryqSV9Y60iZN1C6i8IrmW9/BA= github.com/jackc/pgx/v4 v4.18.3/go.mod h1:Ey4Oru5tH5sB6tV7hDmfWFahwF15Eb7DNXlRKx2CkVw= +github.com/jackc/pgx/v5 v5.6.0 h1:SWJzexBzPL5jb0GEsrPMLIsi/3jOo7RHlzTjcAeDrPY= +github.com/jackc/pgx/v5 v5.6.0/go.mod h1:DNZ/vlrUnhWCoFGxHAG8U2ljioxukquj7utPDgtQdTw= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= +github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jessevdk/go-flags v1.6.1 h1:Cvu5U8UGrLay1rZfv/zP7iLpSHGUZ/Ou68T0iX1bBK4= github.com/jessevdk/go-flags v1.6.1/go.mod h1:Mk8T1hIAWpOiJiHa9rJASDK2UGWji0EuPGBnNLMooyc= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -218,12 +232,12 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/likexian/gokit v0.25.15 h1:QjospM1eXhdMMHwZRpMKKAHY/Wig9wgcREmLtf9NslY= github.com/likexian/gokit v0.25.15/go.mod h1:S2QisdsxLEHWeD/XI0QMVeggp+jbxYqUxMvSBil7MRg= -github.com/likexian/whois v1.15.3 h1:0emFSUSUj98Q12Wer3iM3eROPXjg+CyUBlibGPNbKHw= -github.com/likexian/whois v1.15.3/go.mod h1:a6sGAAKEb+O3JRBuW2x/QDM80l5hJ07p0+SjQkJ1c+0= -github.com/likexian/whois-parser v1.24.16 h1:WdHt6ICtapm/2M2ue84n541nHDbNBD7M8HsxgXKcEV8= -github.com/likexian/whois-parser v1.24.16/go.mod h1:k5zmKRZ7xPg1TLv3BGT4g/LOPRIMhvdNMeB0F53V/jk= -github.com/lmittmann/tint v1.0.4 h1:LeYihpJ9hyGvE0w+K2okPTGUdVLfng1+nDNVR4vWISc= -github.com/lmittmann/tint v1.0.4/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE= +github.com/likexian/whois v1.15.4 h1:r5En62c+S9HKFgJtdh2WsdmRGTcxE4WUtGBdZkSBXmM= +github.com/likexian/whois v1.15.4/go.mod h1:rXFTPcQdNlPQBJCQpPWTSIDGzzmgKBftmhdOOcLpwXk= +github.com/likexian/whois-parser v1.24.19 h1:vT8lWhnV8ogkdaYLyef6IvE5VTHVCwlUDG5BUXCx06k= +github.com/likexian/whois-parser v1.24.19/go.mod h1:rAtaofg2luol09H+ogDzGIfcG8ig1NtM5R16uQADDz4= +github.com/lmittmann/tint v1.0.5 h1:NQclAutOfYsqs2F1Lenue6OoWCajs5wJcP3DfWVpePw= +github.com/lmittmann/tint v1.0.5/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= @@ -242,8 +256,8 @@ github.com/mdlayher/netlink v1.7.2 h1:/UtM3ofJap7Vl4QWCPDGXY8d3GIY2UGSDbK+QWmY8/ github.com/mdlayher/netlink v1.7.2/go.mod h1:xraEF7uJbxLhc5fpHL4cPe221LI2bdttWlU+ZGLfQSw= github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U= github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA= -github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs= -github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ= +github.com/miekg/dns v1.1.62 h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ= +github.com/miekg/dns v1.1.62/go.mod h1:mvDlcItzm+br7MToIKqkglaGhlFMHJ9DTNNWONWXbNQ= github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721 h1:RlZweED6sbSArvlE924+mUcZuXKLBHA35U7LN621Bws= github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721/go.mod h1:Ickgr2WtCLZ2MDGd4Gr0geeCH5HybhRJbonOgQpvSxc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= @@ -262,44 +276,49 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE= +github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= -github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= -github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= -github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE= -github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus-community/pro-bing v0.4.0 h1:YMbv+i08gQz97OZZBwLyvmmQEEzyfyrrjEaAchdy3R4= -github.com/prometheus-community/pro-bing v0.4.0/go.mod h1:b7wRYZtCcPmt4Sz319BykUU241rWLe1VFXyiyWK/dH4= +github.com/prometheus-community/pro-bing v0.4.1 h1:aMaJwyifHZO0y+h8+icUz0xbToHbia0wdmzdVZ+Kl3w= +github.com/prometheus-community/pro-bing v0.4.1/go.mod h1:aLsw+zqCaDoa2RLVVSX3+UiCkBBXTMtZC3c7EkfWnAE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8= -github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/prometheus v0.50.1 h1:N2L+DYrxqPh4WZStU+o1p/gQlBaqFbcLBTjlp3vpdXw= github.com/prometheus/prometheus v0.50.1/go.mod h1:FvE8dtQ1Ww63IlyKBn1V4s+zMwF9kHkVNkQBR1pM4CU= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= @@ -308,6 +327,7 @@ github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7 github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= @@ -321,6 +341,8 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -331,16 +353,18 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U= -github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.17.3 h1:bwWLZU7icoKRG+C+0PNwIKC6FCJO/Q3p2pZvuP0jN94= +github.com/tidwall/gjson v1.17.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ= github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= -github.com/vmware/govmomi v0.37.3 h1:L2y2Ba09tYiZwdPtdF64Ox9QZeJ8vlCUGcAF9SdODn4= -github.com/vmware/govmomi v0.37.3/go.mod h1:mtGWtM+YhTADHlCgJBiskSRPOZRsN9MSjPzaZLte/oQ= +github.com/vmware/govmomi v0.42.0 h1:MbvAlVfjNBE1mHMaQ7yOSop1KLB0/93x6VAGuCtjqtI= +github.com/vmware/govmomi v0.42.0/go.mod h1:1H5LWwsBif8HKZqbFp0FdoKTHyJE4FzL6ACequMKYQg= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= @@ -354,8 +378,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -go.mongodb.org/mongo-driver v1.15.1 h1:l+RvoUOoMXFmADTLfYDm7On9dRm7p4T80/lEQM+r7HU= -go.mongodb.org/mongo-driver v1.15.1/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= +go.mongodb.org/mongo-driver v1.16.1 h1:rIVLL3q0IHM39dvE+z2ulZLp9ENZKThVfuvN/IiN4l8= +go.mongodb.org/mongo-driver v1.16.1/go.mod h1:oB6AhJQvFQL4LEHyXi6aJzQJtBiTQHiAd83l0GdFaiw= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= @@ -388,14 +412,15 @@ golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaE golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -407,6 +432,7 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -417,18 +443,20 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= -golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg= -golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -436,6 +464,7 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -449,14 +478,14 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -465,8 +494,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -504,21 +533,32 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= -google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4= -google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= +gopkg.in/cenkalti/backoff.v2 v2.2.1 h1:eJ9UAg01/HIHG987TwxvnzK2MgxXq97YY6rYDpY9aII= +gopkg.in/cenkalti/backoff.v2 v2.2.1/go.mod h1:S0QdOvT2AlerfSBkp0O+dk+bbIMaNbEmVk876gPCthU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.2 h1:tczPZjdz6soV2thcuq1IFOuNLrBUGonFyUXBbIWXWis= +gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.2/go.mod h1:c7Wo0IjB7JL9B9Avv0UZKorYJCUhiergpj3u1WtGT1E= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= @@ -529,18 +569,18 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= -k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= -k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= -k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= -k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs= -k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= -k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/api v0.31.0 h1:b9LiSjR2ym/SzTOlfMHm1tr7/21aD7fSkqgD/CVJBCo= +k8s.io/api v0.31.0/go.mod h1:0YiFF+JfFxMM6+1hQei8FY8M7s1Mth+z/q7eF1aJkTE= +k8s.io/apimachinery v0.31.0 h1:m9jOiSr3FoSSL5WO9bjm1n6B9KROYYgNZOb4tyZ1lBc= +k8s.io/apimachinery v0.31.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/client-go v0.31.0 h1:QqEJzNjbN2Yv1H79SsS+SWnXkBgVu4Pj3CJQgbx0gI8= +k8s.io/client-go v0.31.0/go.mod h1:Y9wvC76g4fLjmU0BA+rV+h2cncoadjvjjkkIGoTLcGU= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= layeh.com/radius v0.0.0-20190322222518-890bc1058917 h1:BDXFaFzUt5EIqe/4wrTc4AcYZWP6iC6Ult+jQWLh5eU= layeh.com/radius v0.0.0-20190322222518-890bc1058917/go.mod h1:fywZKyu//X7iRzaxLgPWsvc0L26IUpVvE/aeIL2JtIQ= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/src/go/collectors/go.d.plugin/logger/default.go b/src/go/logger/default.go index c8bfb4d4..c8bfb4d4 100644 --- a/src/go/collectors/go.d.plugin/logger/default.go +++ b/src/go/logger/default.go diff --git a/src/go/collectors/go.d.plugin/logger/handler.go b/src/go/logger/handler.go index 40282ead..40282ead 100644 --- a/src/go/collectors/go.d.plugin/logger/handler.go +++ b/src/go/logger/handler.go diff --git a/src/go/logger/journal_linux.go b/src/go/logger/journal_linux.go new file mode 100644 index 00000000..00f33507 --- /dev/null +++ b/src/go/logger/journal_linux.go @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +//go:build linux + +package logger + +import ( + "os" + "strconv" + "strings" + "syscall" +) + +func isStderrConnectedToJournal() bool { + stream := os.Getenv("JOURNAL_STREAM") + if stream == "" { + return false + } + + idx := strings.IndexByte(stream, ':') + if idx <= 0 { + return false + } + + dev, ino := stream[:idx], stream[idx+1:] + + var stat syscall.Stat_t + if err := syscall.Fstat(int(os.Stderr.Fd()), &stat); err != nil { + return false + } + + return dev == strconv.Itoa(int(stat.Dev)) && ino == strconv.FormatUint(stat.Ino, 10) +} diff --git a/src/go/logger/journal_stub.go b/src/go/logger/journal_stub.go new file mode 100644 index 00000000..6726a02d --- /dev/null +++ b/src/go/logger/journal_stub.go @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +//go:build !linux + +package logger + +func isStderrConnectedToJournal() bool { + return false +} diff --git a/src/go/collectors/go.d.plugin/logger/level.go b/src/go/logger/level.go index 97dccb20..97dccb20 100644 --- a/src/go/collectors/go.d.plugin/logger/level.go +++ b/src/go/logger/level.go diff --git a/src/go/collectors/go.d.plugin/logger/logger.go b/src/go/logger/logger.go index bccf3f0d..b32a00cc 100644 --- a/src/go/collectors/go.d.plugin/logger/logger.go +++ b/src/go/logger/logger.go @@ -7,12 +7,9 @@ import ( "fmt" "log/slog" "os" - "strconv" - "strings" "sync/atomic" - "syscall" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" + "github.com/netdata/netdata/go/plugins/pkg/executable" "github.com/mattn/go-isatty" ) @@ -81,24 +78,3 @@ func (l *Logger) mute(v bool) { func (l *Logger) isNil() bool { return l == nil || l.sl == nil } var nilLogger = New() - -func isStderrConnectedToJournal() bool { - stream := os.Getenv("JOURNAL_STREAM") - if stream == "" { - return false - } - - idx := strings.IndexByte(stream, ':') - if idx <= 0 { - return false - } - - dev, ino := stream[:idx], stream[idx+1:] - - var stat syscall.Stat_t - if err := syscall.Fstat(int(os.Stderr.Fd()), &stat); err != nil { - return false - } - - return dev == strconv.Itoa(int(stat.Dev)) && ino == strconv.FormatUint(stat.Ino, 10) -} diff --git a/src/go/collectors/go.d.plugin/logger/logger_test.go b/src/go/logger/logger_test.go index df7049d0..df7049d0 100644 --- a/src/go/collectors/go.d.plugin/logger/logger_test.go +++ b/src/go/logger/logger_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/buildinfo/version.go b/src/go/pkg/buildinfo/version.go index 55977a59..55977a59 100644 --- a/src/go/collectors/go.d.plugin/pkg/buildinfo/version.go +++ b/src/go/pkg/buildinfo/version.go diff --git a/src/go/collectors/go.d.plugin/agent/executable/executable.go b/src/go/pkg/executable/executable.go index cb09db1e..3f4e9e0d 100644 --- a/src/go/collectors/go.d.plugin/agent/executable/executable.go +++ b/src/go/pkg/executable/executable.go @@ -16,7 +16,6 @@ var ( func init() { path, err := os.Executable() if err != nil || path == "" { - Name = "go.d" return } @@ -27,7 +26,6 @@ func init() { Name = "test" } - // FIXME: can't use logger because of circular import fi, err := os.Lstat(path) if err != nil { return diff --git a/src/go/plugin/go.d/README.md b/src/go/plugin/go.d/README.md new file mode 100644 index 00000000..28f046ab --- /dev/null +++ b/src/go/plugin/go.d/README.md @@ -0,0 +1,244 @@ +<!-- +title: go.d.plugin +description: "go.d.plugin is an external plugin for Netdata, responsible for running individual data collectors written in Go." +custom_edit_url: "/src/go/plugin/go.d/README.md" +sidebar_label: "go.d.plugin" +learn_status: "Published" +learn_topic_type: "Tasks" +learn_rel_path: "Developers/External plugins/go.d.plugin" +sidebar_position: 1 +--> + +# go.d.plugin + +`go.d.plugin` is a [Netdata](https://github.com/netdata/netdata) external plugin. It is an **orchestrator** for data +collection modules written in `go`. + +1. It runs as an independent process (`ps fax` shows it). +2. It is started and stopped automatically by Netdata. +3. It communicates with Netdata via a unidirectional pipe (sending data to the Netdata daemon). +4. Supports any number of data collection modules. +5. Allows each module to have any number of data collection jobs. + +## Bug reports, feature requests, and questions + +Are welcome! We are using [netdata/netdata](https://github.com/netdata/netdata/) repository for bugs, feature requests, +and questions. + +- [GitHub Issues](https://github.com/netdata/netdata/issues/new/choose): report bugs or open a new feature request. +- [GitHub Discussions](https://github.com/netdata/netdata/discussions): ask a question or suggest a new idea. + +## Install + +Go.d.plugin is shipped with Netdata. + +### Required Linux capabilities + +All capabilities are set automatically during Netdata installation using +the [official installation method](/packaging/installer/methods/kickstart.md). +No further action required. If you have used a different installation method and need to set the capabilities manually, +see the appropriate collector readme. + +| Capability | Required by | +|:--------------------|:-------------------------------------------------------------------------------------------------------:| +| CAP_NET_RAW | [Ping](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/ping#readme) | +| CAP_NET_ADMIN | [Wireguard](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/wireguard#readme) | +| CAP_DAC_READ_SEARCH | [Filecheck](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/filecheck#readme) | + +## Available modules + +| Name | Monitors | +|:-------------------------------------------------------------------------------------------------------------------|:-----------------------------:| +| [adaptec_raid](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/adaptecraid) | Adaptec Hardware RAID | +| [activemq](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/activemq) | ActiveMQ | +| [ap](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/ap) | Wireless AP | +| [apache](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/apache) | Apache | +| [beanstalk](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/beanstalk) | Beanstalk | +| [bind](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/bind) | ISC Bind | +| [cassandra](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/cassandra) | Cassandra | +| [chrony](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/chrony) | Chrony | +| [clickhouse](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/clickhouse) | ClickHouse | +| [cockroachdb](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/cockroachdb) | CockroachDB | +| [consul](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/consul) | Consul | +| [coredns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/coredns) | CoreDNS | +| [couchbase](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/couchbase) | Couchbase | +| [couchdb](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/couchdb) | CouchDB | +| [dmcache](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dmcache) | DMCache | +| [dnsdist](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dnsdist) | Dnsdist | +| [dnsmasq](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dnsmasq) | Dnsmasq DNS Forwarder | +| [dnsmasq_dhcp](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dnsmasq_dhcp) | Dnsmasq DHCP | +| [dns_query](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dnsquery) | DNS Query RTT | +| [docker](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/docker) | Docker Engine | +| [docker_engine](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/docker_engine) | Docker Engine | +| [dockerhub](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dockerhub) | Docker Hub | +| [dovecot](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dovecot) | Dovecot | +| [elasticsearch](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/elasticsearch) | Elasticsearch/OpenSearch | +| [envoy](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/envoy) | Envoy | +| [example](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/example) | - | +| [exim](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/exim) | Exim | +| [fail2ban](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/fail2ban) | Fail2Ban Jails | +| [filecheck](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/filecheck) | Files and Directories | +| [fluentd](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/fluentd) | Fluentd | +| [freeradius](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/freeradius) | FreeRADIUS | +| [gearman](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/gearman) | Gearman | +| [haproxy](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/haproxy) | HAProxy | +| [hddtemp](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/hddtemp) | Disks temperature | +| [hdfs](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/hdfs) | HDFS | +| [hpssa](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/hpssa) | HPE Smart Array | +| [httpcheck](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/httpcheck) | Any HTTP Endpoint | +| [icecast](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/icecast) | Icecast | +| [intelgpu](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/intelgpu) | Intel integrated GPU | +| [ipfs](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/ipfs) | IPFS | +| [isc_dhcpd](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/isc_dhcpd) | ISC DHCP | +| [k8s_kubelet](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/k8s_kubelet) | Kubelet | +| [k8s_kubeproxy](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/k8s_kubeproxy) | Kube-proxy | +| [k8s_state](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/k8s_state) | Kubernetes cluster state | +| [lighttpd](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/lighttpd) | Lighttpd | +| [litespeed](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/litespeed) | Litespeed | +| [logind](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/logind) | systemd-logind | +| [logstash](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/logstash) | Logstash | +| [lvm](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/lvm) | LVM logical volumes | +| [megacli](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/megacli) | MegaCli Hardware Raid | +| [memcached](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/memcached) | Memcached | +| [mongoDB](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/mongodb) | MongoDB | +| [monit](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/monit) | Monit | +| [mysql](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/mysql) | MySQL | +| [nginx](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nginx) | NGINX | +| [nginxplus](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nginxplus) | NGINX Plus | +| [nginxvts](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nginxvts) | NGINX VTS | +| [nsd](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nsd) | NSD (NLnet Labs) | +| [ntpd](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/ntpd) | NTP daemon | +| [nvme](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nvme) | NVMe devices | +| [openvpn](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/openvpn) | OpenVPN | +| [openvpn_status_log](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/openvpn_status_log) | OpenVPN | +| [pgbouncer](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/pgbouncer) | PgBouncer | +| [phpdaemon](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/phpdaemon) | phpDaemon | +| [phpfpm](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/phpfpm) | PHP-FPM | +| [pihole](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/pihole) | Pi-hole | +| [pika](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/pika) | Pika | +| [ping](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/ping) | Any network host | +| [prometheus](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/prometheus) | Any Prometheus Endpoint | +| [portcheck](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/portcheck) | Any TCP Endpoint | +| [postgres](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/postgres) | PostgreSQL | +| [postfix](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/postfix) | Postfix | +| [powerdns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/powerdns) | PowerDNS Authoritative Server | +| [powerdns_recursor](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/powerdns_recursor) | PowerDNS Recursor | +| [proxysql](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/proxysql) | ProxySQL | +| [pulsar](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/pulsar) | Apache Pulsar | +| [puppet](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/puppet) | Puppet | +| [rabbitmq](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/rabbitmq) | RabbitMQ | +| [redis](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/redis) | Redis | +| [rethinkdb](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/rethinkdb) | RethinkDB | +| [riakkv](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/riakkv) | Riak KV | +| [rspamd](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/rspamd) | Rspamd | +| [scaleio](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/scaleio) | Dell EMC ScaleIO | +| [sensors](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/sensors) | Hardware Sensors | +| [SNMP](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/modules/snmp) | SNMP | +| [squid](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/squid) | Squid | +| [squidlog](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/squidlog) | Squid | +| [smartctl](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/smartctl) | S.M.A.R.T Storage Devices | +| [storcli](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/storcli) | Broadcom Hardware RAID | +| [supervisord](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/supervisord) | Supervisor | +| [systemdunits](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/systemdunits) | Systemd unit state | +| [tengine](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/tengine) | Tengine | +| [tomcat](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/tomcat) | Tomcat | +| [tor](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/tor) | Tor | +| [traefik](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/traefik) | Traefik | +| [upsd](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/upsd) | UPSd (Nut) | +| [unbound](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/unbound) | Unbound | +| [vcsa](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/vcsa) | vCenter Server Appliance | +| [vernemq](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/vernemq) | VerneMQ | +| [vsphere](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/vsphere) | VMware vCenter Server | +| [web_log](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/weblog) | Apache/NGINX | +| [wireguard](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/wireguard) | WireGuard | +| [whoisquery](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/whoisquery) | Domain Expiry | +| [windows](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/windows) | Windows | +| [x509check](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/x509check) | Digital Certificates | +| [zfspool](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/zfspool) | ZFS Pools | +| [zookeeper](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/zookeeper) | ZooKeeper | + +## Configuration + +Edit the `go.d.conf` configuration file using `edit-config` from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory), +which is typically at `/etc/netdata`. + +```bash +cd /etc/netdata # Replace this path with your Netdata config directory +sudo ./edit-config go.d.conf +``` + +Configurations are written in [YAML](http://yaml.org/). + +- [plugin configuration](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/config/go.d.conf) +- [specific module configuration](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/config/go.d) + +### Enable a collector + +To enable a collector you should edit `go.d.conf` to uncomment the collector in question and change it from `no` +to `yes`. + +For example, to enable the `example` plugin you would need to update `go.d.conf` from something like: + +```yaml +modules: +# example: no +``` + +to + +```yaml +modules: + example: yes +``` + +Then [restart netdata](/docs/netdata-agent/start-stop-restart.md) +for the change to take effect. + +## Contributing + +If you want to contribute to this project, we are humbled. Please take a look at +our [contributing guidelines](https://github.com/netdata/.github/blob/main/CONTRIBUTING.md) and don't hesitate to +contact us in our forums. + +### How to develop a collector + +Read [how to write a Netdata collector in Go](/src/go/plugin/go.d/docs/how-to-write-a-module.md). + +## Troubleshooting + +Plugin CLI: + +```sh +Usage: + orchestrator [OPTIONS] [update every] + +Application Options: + -m, --modules= module name to run (default: all) + -c, --config-dir= config dir to read + -w, --watch-path= config path to watch + -d, --debug debug mode + -v, --version display the version and exit + +Help Options: + -h, --help Show this help message +``` + +To debug specific module: + +```sh +# become user netdata +sudo su -s /bin/bash netdata + +# run plugin in debug mode +./go.d.plugin -d -m <module name> +``` + +Change `<module name>` to the [module name](#available-modules) you want to debug. + +## Netdata Community + +This repository follows the Netdata Code of Conduct and is part of the Netdata Community. + +- [Community Forums](https://community.netdata.cloud) +- [Netdata Code of Conduct](https://github.com/netdata/.github/blob/main/CODE_OF_CONDUCT.md) diff --git a/src/go/collectors/go.d.plugin/agent/README.md b/src/go/plugin/go.d/agent/README.md index ba44bfbd..9e065426 100644 --- a/src/go/collectors/go.d.plugin/agent/README.md +++ b/src/go/plugin/go.d/agent/README.md @@ -27,7 +27,7 @@ You are responsible only for __creating modules__. ## Custom plugin example -[Yep! So easy!](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/examples/simple/main.go) +[Yep! So easy!](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/examples/simple/main.go) ## How to write a Module @@ -71,7 +71,7 @@ func (b *Base) SetLogger(l *logger.Logger) { b.Logger = l } Since plugin is a set of modules all you need is: - write module(s) - - add module(s) to the plugins [registry](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/plugin/module/registry.go) + - add module(s) to the plugins [registry](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/plugin/module/registry.go) - start the plugin diff --git a/src/go/collectors/go.d.plugin/agent/agent.go b/src/go/plugin/go.d/agent/agent.go index caf260dc..2423e84e 100644 --- a/src/go/collectors/go.d.plugin/agent/agent.go +++ b/src/go/plugin/go.d/agent/agent.go @@ -12,18 +12,18 @@ import ( "syscall" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery" - "github.com/netdata/netdata/go/go.d.plugin/agent/filelock" - "github.com/netdata/netdata/go/go.d.plugin/agent/filestatus" - "github.com/netdata/netdata/go/go.d.plugin/agent/functions" - "github.com/netdata/netdata/go/go.d.plugin/agent/jobmgr" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/agent/netdataapi" - "github.com/netdata/netdata/go/go.d.plugin/agent/safewriter" - "github.com/netdata/netdata/go/go.d.plugin/agent/vnodes" - "github.com/netdata/netdata/go/go.d.plugin/logger" - "github.com/netdata/netdata/go/go.d.plugin/pkg/multipath" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/filelock" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/filestatus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/functions" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/jobmgr" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/netdataapi" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/safewriter" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/vnodes" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/multipath" "github.com/mattn/go-isatty" ) diff --git a/src/go/collectors/go.d.plugin/agent/agent_test.go b/src/go/plugin/go.d/agent/agent_test.go index 749d4579..9096b901 100644 --- a/src/go/collectors/go.d.plugin/agent/agent_test.go +++ b/src/go/plugin/go.d/agent/agent_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/agent/safewriter" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/safewriter" "github.com/stretchr/testify/assert" ) diff --git a/src/go/collectors/go.d.plugin/agent/confgroup/cache.go b/src/go/plugin/go.d/agent/confgroup/cache.go index 8b369e65..8b369e65 100644 --- a/src/go/collectors/go.d.plugin/agent/confgroup/cache.go +++ b/src/go/plugin/go.d/agent/confgroup/cache.go diff --git a/src/go/collectors/go.d.plugin/agent/confgroup/cache_test.go b/src/go/plugin/go.d/agent/confgroup/cache_test.go index a2bbd491..a2bbd491 100644 --- a/src/go/collectors/go.d.plugin/agent/confgroup/cache_test.go +++ b/src/go/plugin/go.d/agent/confgroup/cache_test.go diff --git a/src/go/collectors/go.d.plugin/agent/confgroup/config.go b/src/go/plugin/go.d/agent/confgroup/config.go index ee94b0da..8f0523f1 100644 --- a/src/go/collectors/go.d.plugin/agent/confgroup/config.go +++ b/src/go/plugin/go.d/agent/confgroup/config.go @@ -8,8 +8,8 @@ import ( "regexp" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/hostinfo" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/hostinfo" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/ilyam8/hashstructure" "gopkg.in/yaml.v2" diff --git a/src/go/collectors/go.d.plugin/agent/confgroup/config_test.go b/src/go/plugin/go.d/agent/confgroup/config_test.go index 00420234..98c6c3e7 100644 --- a/src/go/collectors/go.d.plugin/agent/confgroup/config_test.go +++ b/src/go/plugin/go.d/agent/confgroup/config_test.go @@ -5,7 +5,7 @@ package confgroup import ( "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" ) diff --git a/src/go/collectors/go.d.plugin/agent/confgroup/group.go b/src/go/plugin/go.d/agent/confgroup/group.go index b8e7bd77..b8e7bd77 100644 --- a/src/go/collectors/go.d.plugin/agent/confgroup/group.go +++ b/src/go/plugin/go.d/agent/confgroup/group.go diff --git a/src/go/collectors/go.d.plugin/agent/confgroup/registry.go b/src/go/plugin/go.d/agent/confgroup/registry.go index 295a7512..295a7512 100644 --- a/src/go/collectors/go.d.plugin/agent/confgroup/registry.go +++ b/src/go/plugin/go.d/agent/confgroup/registry.go diff --git a/src/go/collectors/go.d.plugin/agent/confgroup/registry_test.go b/src/go/plugin/go.d/agent/confgroup/registry_test.go index a63c0ceb..a63c0ceb 100644 --- a/src/go/collectors/go.d.plugin/agent/confgroup/registry_test.go +++ b/src/go/plugin/go.d/agent/confgroup/registry_test.go diff --git a/src/go/collectors/go.d.plugin/agent/config.go b/src/go/plugin/go.d/agent/config.go index fef68c7e..fef68c7e 100644 --- a/src/go/collectors/go.d.plugin/agent/config.go +++ b/src/go/plugin/go.d/agent/config.go diff --git a/src/go/collectors/go.d.plugin/agent/discovery/cache.go b/src/go/plugin/go.d/agent/discovery/cache.go index 31802aa9..032ccca3 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/cache.go +++ b/src/go/plugin/go.d/agent/discovery/cache.go @@ -3,7 +3,7 @@ package discovery import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" ) type cache map[string]*confgroup.Group // [Source] diff --git a/src/go/collectors/go.d.plugin/agent/discovery/config.go b/src/go/plugin/go.d/agent/discovery/config.go index 6cbd2db1..258d1b83 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/config.go +++ b/src/go/plugin/go.d/agent/discovery/config.go @@ -5,10 +5,10 @@ package discovery import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/dummy" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/file" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/dummy" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/file" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd" ) type Config struct { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/dummy/config.go b/src/go/plugin/go.d/agent/discovery/dummy/config.go index 4da80a8d..1e8e8f33 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/dummy/config.go +++ b/src/go/plugin/go.d/agent/discovery/dummy/config.go @@ -5,7 +5,7 @@ package dummy import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" ) type Config struct { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/dummy/discovery.go b/src/go/plugin/go.d/agent/discovery/dummy/discovery.go index fed257b2..6fad0f05 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/dummy/discovery.go +++ b/src/go/plugin/go.d/agent/discovery/dummy/discovery.go @@ -7,8 +7,8 @@ import ( "fmt" "log/slog" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" ) func NewDiscovery(cfg Config) (*Discovery, error) { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/dummy/discovery_test.go b/src/go/plugin/go.d/agent/discovery/dummy/discovery_test.go index e42ee204..2c908eb6 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/dummy/discovery_test.go +++ b/src/go/plugin/go.d/agent/discovery/dummy/discovery_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/file/config.go b/src/go/plugin/go.d/agent/discovery/file/config.go index cc19ee44..3836d201 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/file/config.go +++ b/src/go/plugin/go.d/agent/discovery/file/config.go @@ -5,7 +5,7 @@ package file import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" ) type Config struct { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/file/discovery.go b/src/go/plugin/go.d/agent/discovery/file/discovery.go index 97b437fc..527b1cbb 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/file/discovery.go +++ b/src/go/plugin/go.d/agent/discovery/file/discovery.go @@ -9,8 +9,8 @@ import ( "log/slog" "sync" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" ) var log = logger.New().With( diff --git a/src/go/collectors/go.d.plugin/agent/discovery/file/discovery_test.go b/src/go/plugin/go.d/agent/discovery/file/discovery_test.go index 2bdb669e..2bdb669e 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/file/discovery_test.go +++ b/src/go/plugin/go.d/agent/discovery/file/discovery_test.go diff --git a/src/go/collectors/go.d.plugin/agent/discovery/file/parse.go b/src/go/plugin/go.d/agent/discovery/file/parse.go index 412d2b73..5fd31f32 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/file/parse.go +++ b/src/go/plugin/go.d/agent/discovery/file/parse.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" "gopkg.in/yaml.v2" ) diff --git a/src/go/collectors/go.d.plugin/agent/discovery/file/parse_test.go b/src/go/plugin/go.d/agent/discovery/file/parse_test.go index 8b20210f..5790f565 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/file/parse_test.go +++ b/src/go/plugin/go.d/agent/discovery/file/parse_test.go @@ -5,8 +5,8 @@ package file import ( "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/file/read.go b/src/go/plugin/go.d/agent/discovery/file/read.go index 1b45b376..3e7869ba 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/file/read.go +++ b/src/go/plugin/go.d/agent/discovery/file/read.go @@ -9,8 +9,8 @@ import ( "path/filepath" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" ) type ( diff --git a/src/go/collectors/go.d.plugin/agent/discovery/file/read_test.go b/src/go/plugin/go.d/agent/discovery/file/read_test.go index d2404d54..1bde06c5 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/file/read_test.go +++ b/src/go/plugin/go.d/agent/discovery/file/read_test.go @@ -6,8 +6,8 @@ import ( "fmt" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" ) diff --git a/src/go/collectors/go.d.plugin/agent/discovery/file/sim_test.go b/src/go/plugin/go.d/agent/discovery/file/sim_test.go index cd9fa05a..3219c689 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/file/sim_test.go +++ b/src/go/plugin/go.d/agent/discovery/file/sim_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/file/watch.go b/src/go/plugin/go.d/agent/discovery/file/watch.go index a723b706..7adefd26 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/file/watch.go +++ b/src/go/plugin/go.d/agent/discovery/file/watch.go @@ -10,8 +10,8 @@ import ( "strings" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" "github.com/fsnotify/fsnotify" ) diff --git a/src/go/collectors/go.d.plugin/agent/discovery/file/watch_test.go b/src/go/plugin/go.d/agent/discovery/file/watch_test.go index 20e21e65..f29b5d57 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/file/watch_test.go +++ b/src/go/plugin/go.d/agent/discovery/file/watch_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" ) diff --git a/src/go/collectors/go.d.plugin/agent/discovery/manager.go b/src/go/plugin/go.d/agent/discovery/manager.go index ac9ee221..64661602 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/manager.go +++ b/src/go/plugin/go.d/agent/discovery/manager.go @@ -10,11 +10,11 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/dummy" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/file" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/dummy" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/file" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd" ) func NewManager(cfg Config) (*Manager, error) { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/manager_test.go b/src/go/plugin/go.d/agent/discovery/manager_test.go index 665fe561..5861b090 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/manager_test.go +++ b/src/go/plugin/go.d/agent/discovery/manager_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/file" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/file" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/conffile.go b/src/go/plugin/go.d/agent/discovery/sd/conffile.go index 73aef173..e08a4021 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/conffile.go +++ b/src/go/plugin/go.d/agent/discovery/sd/conffile.go @@ -6,8 +6,8 @@ import ( "context" "os" - "github.com/netdata/netdata/go/go.d.plugin/logger" - "github.com/netdata/netdata/go/go.d.plugin/pkg/multipath" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/multipath" ) type confFile struct { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/dockerd/docker.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/dockerd/docker.go index cca6b658..1cea014a 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/dockerd/docker.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/dockerd/docker.go @@ -11,10 +11,10 @@ import ( "strings" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" - "github.com/netdata/netdata/go/go.d.plugin/logger" - "github.com/netdata/netdata/go/go.d.plugin/pkg/dockerhost" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/dockerhost" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/docker/docker/api/types" typesContainer "github.com/docker/docker/api/types/container" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/dockerd/dockerd_test.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/dockerd/dockerd_test.go index d325f99d..630afb0f 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/dockerd/dockerd_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/dockerd/dockerd_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" "github.com/docker/docker/api/types" typesNetwork "github.com/docker/docker/api/types/network" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/dockerd/sim_test.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/dockerd/sim_test.go index 7b0b76ab..fcdbeb89 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/dockerd/sim_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/dockerd/sim_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" "github.com/docker/docker/api/types" typesContainer "github.com/docker/docker/api/types/container" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/dockerd/target.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/dockerd/target.go index 2422bc98..2cf0575b 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/dockerd/target.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/dockerd/target.go @@ -5,7 +5,7 @@ package dockerd import ( "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" ) type targetGroup struct { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/config.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/config.go index 15a1e474..15a1e474 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/config.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/config.go diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/kubernetes.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/kubernetes.go index aa153a34..439e2b69 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/kubernetes.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/kubernetes.go @@ -11,9 +11,9 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" - "github.com/netdata/netdata/go/go.d.plugin/logger" - "github.com/netdata/netdata/go/go.d.plugin/pkg/k8sclient" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/k8sclient" "github.com/ilyam8/hashstructure" corev1 "k8s.io/api/core/v1" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/kubernetes_test.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/kubernetes_test.go index 9743a0af..ba60a47b 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/kubernetes_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/kubernetes_test.go @@ -7,8 +7,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" - "github.com/netdata/netdata/go/go.d.plugin/pkg/k8sclient" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/k8sclient" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/pod.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/pod.go index a271e728..61708174 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/pod.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/pod.go @@ -9,8 +9,8 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" corev1 "k8s.io/api/core/v1" "k8s.io/client-go/tools/cache" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/pod_test.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/pod_test.go index ebe92d2f..838c2413 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/pod_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/pod_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/service.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/service.go index 4cfdd62f..1d5ae7cd 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/service.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/service.go @@ -9,8 +9,8 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" corev1 "k8s.io/api/core/v1" "k8s.io/client-go/tools/cache" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/service_test.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/service_test.go index d2e49601..c3e83e20 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/service_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/service_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/sim_test.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/sim_test.go index db986b85..99bdfae5 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/sim_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/kubernetes/sim_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/netlisteners/netlisteners.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/netlisteners/netlisteners.go index bfd7a99b..6f536c49 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/netlisteners/netlisteners.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/netlisteners/netlisteners.go @@ -18,9 +18,9 @@ import ( "strings" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/pkg/executable" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" "github.com/ilyam8/hashstructure" ) diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/netlisteners/netlisteners_test.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/netlisteners/netlisteners_test.go index a94879f0..9b3cae80 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/netlisteners/netlisteners_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/netlisteners/netlisteners_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" ) func TestDiscoverer_Discover(t *testing.T) { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/netlisteners/sim_test.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/netlisteners/sim_test.go index ad90f827..4cb65832 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/netlisteners/sim_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/netlisteners/sim_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/netlisteners/target.go b/src/go/plugin/go.d/agent/discovery/sd/discoverer/netlisteners/target.go index a36620f3..9d57d3cc 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/netlisteners/target.go +++ b/src/go/plugin/go.d/agent/discovery/sd/discoverer/netlisteners/target.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" ) type targetGroup struct { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/model/discoverer.go b/src/go/plugin/go.d/agent/discovery/sd/model/discoverer.go index 301322d3..301322d3 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/model/discoverer.go +++ b/src/go/plugin/go.d/agent/discovery/sd/model/discoverer.go diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/model/tags.go b/src/go/plugin/go.d/agent/discovery/sd/model/tags.go index 22517d77..22517d77 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/model/tags.go +++ b/src/go/plugin/go.d/agent/discovery/sd/model/tags.go diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/model/tags_test.go b/src/go/plugin/go.d/agent/discovery/sd/model/tags_test.go index 4f07bcbf..4f07bcbf 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/model/tags_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/model/tags_test.go diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/model/target.go b/src/go/plugin/go.d/agent/discovery/sd/model/target.go index eb2bd9d5..eb2bd9d5 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/model/target.go +++ b/src/go/plugin/go.d/agent/discovery/sd/model/target.go diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/accumulator.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/accumulator.go index a8421273..60c90149 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/accumulator.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/accumulator.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" ) func newAccumulator() *accumulator { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/classify.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/classify.go index bd686b30..a7490d2e 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/classify.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/classify.go @@ -8,8 +8,8 @@ import ( "strings" "text/template" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" ) func newTargetClassificator(cfg []ClassifyRuleConfig) (*targetClassificator, error) { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/classify_test.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/classify_test.go index 214c96cf..606e3411 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/classify_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/classify_test.go @@ -5,7 +5,7 @@ package pipeline import ( "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/compose.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/compose.go index de2ed21b..80830fd6 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/compose.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/compose.go @@ -8,9 +8,9 @@ import ( "fmt" "text/template" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" "gopkg.in/yaml.v2" ) diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/compose_test.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/compose_test.go index fa758bcd..1c56bf08 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/compose_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/compose_test.go @@ -5,8 +5,8 @@ package pipeline import ( "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/config.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/config.go index 4dac63f0..9df7ec59 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/config.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/config.go @@ -6,10 +6,10 @@ import ( "errors" "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/discoverer/dockerd" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/discoverer/kubernetes" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/discoverer/netlisteners" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/discoverer/dockerd" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/discoverer/kubernetes" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/discoverer/netlisteners" ) type Config struct { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/funcmap.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/funcmap.go index 8a9698b6..5ed188a5 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/funcmap.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/funcmap.go @@ -7,7 +7,7 @@ import ( "strconv" "text/template" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" "github.com/Masterminds/sprig/v3" "github.com/bmatcuk/doublestar/v4" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/funcmap_test.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/funcmap_test.go index 3de71ef7..3de71ef7 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/funcmap_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/funcmap_test.go diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/pipeline.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/pipeline.go index f69501c3..4d391d41 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/pipeline.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/pipeline.go @@ -9,13 +9,13 @@ import ( "log/slog" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/discoverer/dockerd" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/discoverer/kubernetes" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/discoverer/netlisteners" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" - "github.com/netdata/netdata/go/go.d.plugin/agent/hostinfo" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/discoverer/dockerd" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/discoverer/kubernetes" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/discoverer/netlisteners" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/hostinfo" ) func New(cfg Config) (*Pipeline, error) { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/pipeline_test.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/pipeline_test.go index 2dd53cf1..e67b6d7c 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/pipeline_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/pipeline_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" "github.com/ilyam8/hashstructure" "github.com/stretchr/testify/assert" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/promport.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/promport.go index 646e1abb..646e1abb 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/promport.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/promport.go diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/selector.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/selector.go index 8bb5fb06..cdd2cf00 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/selector.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/selector.go @@ -7,7 +7,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" ) type selector interface { diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/selector_test.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/selector_test.go index a4fcf304..bed2150e 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/selector_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/selector_test.go @@ -6,7 +6,7 @@ import ( "regexp" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" "github.com/stretchr/testify/assert" ) diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/sim_test.go b/src/go/plugin/go.d/agent/discovery/sd/pipeline/sim_test.go index 23a12075..65700947 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/sim_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/pipeline/sim_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/model" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/sd.go b/src/go/plugin/go.d/agent/discovery/sd/sd.go index ab84c979..687ebfba 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/sd.go +++ b/src/go/plugin/go.d/agent/discovery/sd/sd.go @@ -8,10 +8,10 @@ import ( "log/slog" "sync" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/pipeline" - "github.com/netdata/netdata/go/go.d.plugin/logger" - "github.com/netdata/netdata/go/go.d.plugin/pkg/multipath" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/pipeline" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/multipath" "gopkg.in/yaml.v2" ) diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/sd_test.go b/src/go/plugin/go.d/agent/discovery/sd/sd_test.go index 376c9f7e..4269bfd3 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/sd_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/sd_test.go @@ -5,7 +5,7 @@ package sd import ( "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/pipeline" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/pipeline" "gopkg.in/yaml.v2" ) diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/sim_test.go b/src/go/plugin/go.d/agent/discovery/sd/sim_test.go index 7741221d..930c4012 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sd/sim_test.go +++ b/src/go/plugin/go.d/agent/discovery/sd/sim_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd/pipeline" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd/pipeline" "github.com/stretchr/testify/assert" ) diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sim_test.go b/src/go/plugin/go.d/agent/discovery/sim_test.go index 0b777f39..b20344c3 100644 --- a/src/go/collectors/go.d.plugin/agent/discovery/sim_test.go +++ b/src/go/plugin/go.d/agent/discovery/sim_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/src/go/collectors/go.d.plugin/agent/filelock/filelock.go b/src/go/plugin/go.d/agent/filelock/filelock.go index f266e010..f266e010 100644 --- a/src/go/collectors/go.d.plugin/agent/filelock/filelock.go +++ b/src/go/plugin/go.d/agent/filelock/filelock.go diff --git a/src/go/collectors/go.d.plugin/agent/filelock/filelock_test.go b/src/go/plugin/go.d/agent/filelock/filelock_test.go index 6ffc794e..6ffc794e 100644 --- a/src/go/collectors/go.d.plugin/agent/filelock/filelock_test.go +++ b/src/go/plugin/go.d/agent/filelock/filelock_test.go diff --git a/src/go/collectors/go.d.plugin/agent/filestatus/manager.go b/src/go/plugin/go.d/agent/filestatus/manager.go index 4f4f03f8..03e0dd2f 100644 --- a/src/go/collectors/go.d.plugin/agent/filestatus/manager.go +++ b/src/go/plugin/go.d/agent/filestatus/manager.go @@ -8,8 +8,8 @@ import ( "os" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" ) func NewManager(path string) *Manager { diff --git a/src/go/collectors/go.d.plugin/agent/filestatus/manager_test.go b/src/go/plugin/go.d/agent/filestatus/manager_test.go index 7d45c64a..1c7b3288 100644 --- a/src/go/collectors/go.d.plugin/agent/filestatus/manager_test.go +++ b/src/go/plugin/go.d/agent/filestatus/manager_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/agent/filestatus/store.go b/src/go/plugin/go.d/agent/filestatus/store.go index faeedff3..3f500dec 100644 --- a/src/go/collectors/go.d.plugin/agent/filestatus/store.go +++ b/src/go/plugin/go.d/agent/filestatus/store.go @@ -9,7 +9,7 @@ import ( "slices" "sync" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" ) func LoadStore(path string) (*Store, error) { diff --git a/src/go/collectors/go.d.plugin/agent/filestatus/store_test.go b/src/go/plugin/go.d/agent/filestatus/store_test.go index fbf7d339..d8e18539 100644 --- a/src/go/collectors/go.d.plugin/agent/filestatus/store_test.go +++ b/src/go/plugin/go.d/agent/filestatus/store_test.go @@ -5,7 +5,7 @@ package filestatus import ( "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" "github.com/stretchr/testify/assert" ) diff --git a/src/go/collectors/go.d.plugin/agent/functions/ext.go b/src/go/plugin/go.d/agent/functions/ext.go index 28c717d8..28c717d8 100644 --- a/src/go/collectors/go.d.plugin/agent/functions/ext.go +++ b/src/go/plugin/go.d/agent/functions/ext.go diff --git a/src/go/collectors/go.d.plugin/agent/functions/function.go b/src/go/plugin/go.d/agent/functions/function.go index b2fd4293..b65d3d71 100644 --- a/src/go/collectors/go.d.plugin/agent/functions/function.go +++ b/src/go/plugin/go.d/agent/functions/function.go @@ -3,8 +3,8 @@ package functions import ( - "bufio" "bytes" + "context" "encoding/csv" "fmt" "strconv" @@ -67,22 +67,30 @@ func parseFunction(s string) (*Function, error) { return fn, nil } -func parseFunctionWithPayload(s string, sc *bufio.Scanner) (*Function, error) { +func parseFunctionWithPayload(ctx context.Context, s string, in input) (*Function, error) { fn, err := parseFunction(s) if err != nil { return nil, err } - var n int var buf bytes.Buffer - for sc.Scan() && sc.Text() != "FUNCTION_PAYLOAD_END" { - if n++; n > 1 { - buf.WriteString("\n") + + for { + select { + case <-ctx.Done(): + return nil, nil + case line, ok := <-in.lines(): + if !ok { + return nil, nil + } + if line == "FUNCTION_PAYLOAD_END" { + fn.Payload = append(fn.Payload, buf.Bytes()...) + return fn, nil + } + if buf.Len() > 0 { + buf.WriteString("\n") + } + buf.WriteString(line) } - buf.WriteString(sc.Text()) } - - fn.Payload = append(fn.Payload, buf.Bytes()...) - - return fn, nil } diff --git a/src/go/plugin/go.d/agent/functions/input.go b/src/go/plugin/go.d/agent/functions/input.go new file mode 100644 index 00000000..cb50c54d --- /dev/null +++ b/src/go/plugin/go.d/agent/functions/input.go @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package functions + +import ( + "bufio" + "os" +) + +type input interface { + lines() chan string +} + +var stdinInput = func() input { + r := &stdinReader{chLines: make(chan string)} + go r.run() + return r +}() + +type stdinReader struct { + chLines chan string +} + +func (in *stdinReader) run() { + sc := bufio.NewScanner(bufio.NewReader(os.Stdin)) + + for sc.Scan() { + text := sc.Text() + in.chLines <- text + } +} + +func (in *stdinReader) lines() chan string { + return in.chLines +} diff --git a/src/go/plugin/go.d/agent/functions/manager.go b/src/go/plugin/go.d/agent/functions/manager.go new file mode 100644 index 00000000..b7cdecd6 --- /dev/null +++ b/src/go/plugin/go.d/agent/functions/manager.go @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package functions + +import ( + "context" + "encoding/json" + "fmt" + "log/slog" + "strconv" + "strings" + "sync" + "time" + + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/netdataapi" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/safewriter" +) + +func NewManager() *Manager { + return &Manager{ + Logger: logger.New().With( + slog.String("component", "functions manager"), + ), + api: netdataapi.New(safewriter.Stdout), + input: stdinInput, + mux: &sync.Mutex{}, + FunctionRegistry: make(map[string]func(Function)), + } +} + +type Manager struct { + *logger.Logger + + api *netdataapi.API + + input input + + mux *sync.Mutex + FunctionRegistry map[string]func(Function) +} + +func (m *Manager) Run(ctx context.Context) { + m.Info("instance is started") + defer func() { m.Info("instance is stopped") }() + + var wg sync.WaitGroup + + wg.Add(1) + go func() { defer wg.Done(); m.run(ctx) }() + + wg.Wait() + + <-ctx.Done() +} + +func (m *Manager) run(ctx context.Context) { + for { + select { + case <-ctx.Done(): + return + case line, ok := <-m.input.lines(): + if !ok { + return + } + + var fn *Function + var err error + + // FIXME: if we are waiting for FUNCTION_PAYLOAD_END and a new FUNCTION* appears, + // we need to discard the current one and switch to the new one + switch { + case strings.HasPrefix(line, "FUNCTION "): + fn, err = parseFunction(line) + case strings.HasPrefix(line, "FUNCTION_PAYLOAD "): + fn, err = parseFunctionWithPayload(ctx, line, m.input) + case line == "": + continue + default: + m.Warningf("unexpected line: '%s'", line) + continue + } + + if err != nil { + m.Warningf("parse function: %v ('%s')", err, line) + continue + } + if fn == nil { + continue + } + + function, ok := m.lookupFunction(fn.Name) + if !ok { + m.Infof("skipping execution of '%s': unregistered function", fn.Name) + m.respf(fn, 501, "unregistered function: %s", fn.Name) + continue + } + if function == nil { + m.Warningf("skipping execution of '%s': nil function registered", fn.Name) + m.respf(fn, 501, "nil function: %s", fn.Name) + continue + } + + function(*fn) + } + } +} + +func (m *Manager) lookupFunction(name string) (func(Function), bool) { + m.mux.Lock() + defer m.mux.Unlock() + + f, ok := m.FunctionRegistry[name] + return f, ok +} + +func (m *Manager) respf(fn *Function, code int, msgf string, a ...any) { + bs, _ := json.Marshal(struct { + Status int `json:"status"` + Message string `json:"message"` + }{ + Status: code, + Message: fmt.Sprintf(msgf, a...), + }) + ts := strconv.FormatInt(time.Now().Unix(), 10) + m.api.FUNCRESULT(fn.UID, "application/json", string(bs), strconv.Itoa(code), ts) +} diff --git a/src/go/collectors/go.d.plugin/agent/functions/manager_test.go b/src/go/plugin/go.d/agent/functions/manager_test.go index 26a8cdd0..c19519bc 100644 --- a/src/go/collectors/go.d.plugin/agent/functions/manager_test.go +++ b/src/go/plugin/go.d/agent/functions/manager_test.go @@ -3,6 +3,7 @@ package functions import ( + "bufio" "context" "sort" "strings" @@ -15,7 +16,7 @@ import ( func TestNewManager(t *testing.T) { mgr := NewManager() - assert.NotNilf(t, mgr.Input, "Input") + assert.NotNilf(t, mgr.input, "Input") assert.NotNilf(t, mgr.FunctionRegistry, "FunctionRegistry") } @@ -261,7 +262,7 @@ FUNCTION_PAYLOAD_END t.Run(name, func(t *testing.T) { mgr := NewManager() - mgr.Input = strings.NewReader(test.input) + mgr.input = newMockInput(test.input) mock := &mockFunctionExecutor{} for _, v := range test.register { @@ -297,3 +298,23 @@ type mockFunctionExecutor struct { func (m *mockFunctionExecutor) execute(fn Function) { m.executed = append(m.executed, fn) } + +func newMockInput(data string) *mockInput { + m := &mockInput{chLines: make(chan string)} + sc := bufio.NewScanner(strings.NewReader(data)) + go func() { + for sc.Scan() { + m.chLines <- sc.Text() + } + close(m.chLines) + }() + return m +} + +type mockInput struct { + chLines chan string +} + +func (m *mockInput) lines() chan string { + return m.chLines +} diff --git a/src/go/collectors/go.d.plugin/agent/hostinfo/hostinfo.go b/src/go/plugin/go.d/agent/hostinfo/hostinfo.go index 48508a1c..48508a1c 100644 --- a/src/go/collectors/go.d.plugin/agent/hostinfo/hostinfo.go +++ b/src/go/plugin/go.d/agent/hostinfo/hostinfo.go diff --git a/src/go/collectors/go.d.plugin/agent/hostinfo/hostinfo_common.go b/src/go/plugin/go.d/agent/hostinfo/hostinfo_common.go index 69bbf5c7..69bbf5c7 100644 --- a/src/go/collectors/go.d.plugin/agent/hostinfo/hostinfo_common.go +++ b/src/go/plugin/go.d/agent/hostinfo/hostinfo_common.go diff --git a/src/go/collectors/go.d.plugin/agent/hostinfo/hostinfo_linux.go b/src/go/plugin/go.d/agent/hostinfo/hostinfo_linux.go index db2005f0..db2005f0 100644 --- a/src/go/collectors/go.d.plugin/agent/hostinfo/hostinfo_linux.go +++ b/src/go/plugin/go.d/agent/hostinfo/hostinfo_linux.go diff --git a/src/go/collectors/go.d.plugin/agent/jobmgr/cache.go b/src/go/plugin/go.d/agent/jobmgr/cache.go index 2cef1dc8..8ea16ce9 100644 --- a/src/go/collectors/go.d.plugin/agent/jobmgr/cache.go +++ b/src/go/plugin/go.d/agent/jobmgr/cache.go @@ -6,8 +6,8 @@ import ( "context" "sync" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func newDiscoveredConfigsCache() *discoveredConfigs { diff --git a/src/go/collectors/go.d.plugin/agent/jobmgr/di.go b/src/go/plugin/go.d/agent/jobmgr/di.go index 844e10c1..466fcdf9 100644 --- a/src/go/collectors/go.d.plugin/agent/jobmgr/di.go +++ b/src/go/plugin/go.d/agent/jobmgr/di.go @@ -3,9 +3,9 @@ package jobmgr import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/functions" - "github.com/netdata/netdata/go/go.d.plugin/agent/vnodes" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/functions" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/vnodes" ) type FileLocker interface { diff --git a/src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go b/src/go/plugin/go.d/agent/jobmgr/dyncfg.go index 404f4bf3..da6d6748 100644 --- a/src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go +++ b/src/go/plugin/go.d/agent/jobmgr/dyncfg.go @@ -14,9 +14,9 @@ import ( "time" "unicode" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/functions" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/functions" "gopkg.in/yaml.v2" ) diff --git a/src/go/collectors/go.d.plugin/agent/jobmgr/manager.go b/src/go/plugin/go.d/agent/jobmgr/manager.go index f4d55fcf..59947be7 100644 --- a/src/go/collectors/go.d.plugin/agent/jobmgr/manager.go +++ b/src/go/plugin/go.d/agent/jobmgr/manager.go @@ -11,13 +11,13 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/functions" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/agent/netdataapi" - "github.com/netdata/netdata/go/go.d.plugin/agent/safewriter" - "github.com/netdata/netdata/go/go.d.plugin/agent/ticker" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/functions" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/netdataapi" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/safewriter" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/ticker" "github.com/mattn/go-isatty" "gopkg.in/yaml.v2" diff --git a/src/go/collectors/go.d.plugin/agent/jobmgr/manager_test.go b/src/go/plugin/go.d/agent/jobmgr/manager_test.go index b41ea178..1b55a830 100644 --- a/src/go/collectors/go.d.plugin/agent/jobmgr/manager_test.go +++ b/src/go/plugin/go.d/agent/jobmgr/manager_test.go @@ -7,8 +7,8 @@ import ( "fmt" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/functions" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/functions" ) func TestManager_Run(t *testing.T) { diff --git a/src/go/collectors/go.d.plugin/agent/jobmgr/noop.go b/src/go/plugin/go.d/agent/jobmgr/noop.go index c64d0786..adeacf90 100644 --- a/src/go/collectors/go.d.plugin/agent/jobmgr/noop.go +++ b/src/go/plugin/go.d/agent/jobmgr/noop.go @@ -3,10 +3,10 @@ package jobmgr import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/functions" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/functions" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/vnodes" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/vnodes" ) type noop struct{} diff --git a/src/go/collectors/go.d.plugin/agent/jobmgr/sim_test.go b/src/go/plugin/go.d/agent/jobmgr/sim_test.go index fcdb9add..9fe67175 100644 --- a/src/go/collectors/go.d.plugin/agent/jobmgr/sim_test.go +++ b/src/go/plugin/go.d/agent/jobmgr/sim_test.go @@ -10,10 +10,10 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/agent/netdataapi" - "github.com/netdata/netdata/go/go.d.plugin/agent/safewriter" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/netdataapi" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/safewriter" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/src/go/collectors/go.d.plugin/agent/module/charts.go b/src/go/plugin/go.d/agent/module/charts.go index 2b9c35c3..b60b3bac 100644 --- a/src/go/collectors/go.d.plugin/agent/module/charts.go +++ b/src/go/plugin/go.d/agent/module/charts.go @@ -6,7 +6,10 @@ import ( "errors" "fmt" "strings" + "testing" "unicode" + + "github.com/stretchr/testify/assert" ) type ( @@ -436,7 +439,7 @@ func checkDim(d *Dim) error { if d.ID == "" { return errors.New("empty dim ID") } - if id := checkID(d.ID); id != -1 { + if id := checkID(d.ID); id != -1 && (d.Name == "" || checkID(d.Name) != -1) { return fmt.Errorf("unacceptable symbol in dim ID '%s' : '%c'", d.ID, id) } return nil @@ -460,3 +463,35 @@ func checkID(id string) int { } return -1 } + +func TestMetricsHasAllChartsDims(t *testing.T, charts *Charts, mx map[string]int64) { + for _, chart := range *charts { + if chart.Obsolete { + continue + } + for _, dim := range chart.Dims { + _, ok := mx[dim.ID] + assert.Truef(t, ok, "missing data for dimension '%s' in chart '%s'", dim.ID, chart.ID) + } + for _, v := range chart.Vars { + _, ok := mx[v.ID] + assert.Truef(t, ok, "missing data for variable '%s' in chart '%s'", v.ID, chart.ID) + } + } +} + +func TestMetricsHasAllChartsDimsSkip(t *testing.T, charts *Charts, mx map[string]int64, skip func(chart *Chart) bool) { + for _, chart := range *charts { + if chart.Obsolete || (skip != nil && skip(chart)) { + continue + } + for _, dim := range chart.Dims { + _, ok := mx[dim.ID] + assert.Truef(t, ok, "missing data for dimension '%s' in chart '%s'", dim.ID, chart.ID) + } + for _, v := range chart.Vars { + _, ok := mx[v.ID] + assert.Truef(t, ok, "missing data for variable '%s' in chart '%s'", v.ID, chart.ID) + } + } +} diff --git a/src/go/collectors/go.d.plugin/agent/module/charts_test.go b/src/go/plugin/go.d/agent/module/charts_test.go index 7c35bb33..b0dcf806 100644 --- a/src/go/collectors/go.d.plugin/agent/module/charts_test.go +++ b/src/go/plugin/go.d/agent/module/charts_test.go @@ -341,6 +341,9 @@ func TestDim_check(t *testing.T) { dim = &Dim{ID: "id"} dim.ID = "invalid id" assert.Error(t, checkDim(dim)) + + dim = &Dim{ID: "i d", Name: "id"} + assert.NoError(t, checkDim(dim)) } func TestVar_check(t *testing.T) { diff --git a/src/go/collectors/go.d.plugin/agent/module/job.go b/src/go/plugin/go.d/agent/module/job.go index cb15fdc2..67fae8aa 100644 --- a/src/go/collectors/go.d.plugin/agent/module/job.go +++ b/src/go/plugin/go.d/agent/module/job.go @@ -15,9 +15,9 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/netdataapi" - "github.com/netdata/netdata/go/go.d.plugin/agent/vnodes" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/netdataapi" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/vnodes" ) var obsoleteLock = &sync.Mutex{} @@ -40,7 +40,7 @@ var reSpace = regexp.MustCompile(`\s+`) var ndInternalMonitoringDisabled = os.Getenv("NETDATA_INTERNALS_MONITORING") == "NO" func newRuntimeChart(pluginName string) *Chart { - // this is needed to keep the same name as we had before https://github.com/netdata/netdata/go/go.d.plugin/issues/650 + // this is needed to keep the same name as we had before https://github.com/netdata/netdata/go/plugins/plugin/go.d/issues/650 ctxName := pluginName if ctxName == "go.d" { ctxName = "go" diff --git a/src/go/collectors/go.d.plugin/agent/module/job_test.go b/src/go/plugin/go.d/agent/module/job_test.go index c87f840d..c87f840d 100644 --- a/src/go/collectors/go.d.plugin/agent/module/job_test.go +++ b/src/go/plugin/go.d/agent/module/job_test.go diff --git a/src/go/collectors/go.d.plugin/agent/module/mock.go b/src/go/plugin/go.d/agent/module/mock.go index f83c7dbc..f83c7dbc 100644 --- a/src/go/collectors/go.d.plugin/agent/module/mock.go +++ b/src/go/plugin/go.d/agent/module/mock.go diff --git a/src/go/collectors/go.d.plugin/agent/module/mock_test.go b/src/go/plugin/go.d/agent/module/mock_test.go index d7521911..d7521911 100644 --- a/src/go/collectors/go.d.plugin/agent/module/mock_test.go +++ b/src/go/plugin/go.d/agent/module/mock_test.go diff --git a/src/go/collectors/go.d.plugin/agent/module/module.go b/src/go/plugin/go.d/agent/module/module.go index 2ed82b79..13e20f2a 100644 --- a/src/go/collectors/go.d.plugin/agent/module/module.go +++ b/src/go/plugin/go.d/agent/module/module.go @@ -6,7 +6,7 @@ import ( "encoding/json" "testing" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/agent/module/registry.go b/src/go/plugin/go.d/agent/module/registry.go index 1d2aa947..1d2aa947 100644 --- a/src/go/collectors/go.d.plugin/agent/module/registry.go +++ b/src/go/plugin/go.d/agent/module/registry.go diff --git a/src/go/collectors/go.d.plugin/agent/module/registry_test.go b/src/go/plugin/go.d/agent/module/registry_test.go index c9f31105..c9f31105 100644 --- a/src/go/collectors/go.d.plugin/agent/module/registry_test.go +++ b/src/go/plugin/go.d/agent/module/registry_test.go diff --git a/src/go/collectors/go.d.plugin/agent/netdataapi/api.go b/src/go/plugin/go.d/agent/netdataapi/api.go index 4f2b7a9b..4f2b7a9b 100644 --- a/src/go/collectors/go.d.plugin/agent/netdataapi/api.go +++ b/src/go/plugin/go.d/agent/netdataapi/api.go diff --git a/src/go/collectors/go.d.plugin/agent/netdataapi/api_test.go b/src/go/plugin/go.d/agent/netdataapi/api_test.go index e5087839..e5087839 100644 --- a/src/go/collectors/go.d.plugin/agent/netdataapi/api_test.go +++ b/src/go/plugin/go.d/agent/netdataapi/api_test.go diff --git a/src/go/collectors/go.d.plugin/agent/safewriter/writer.go b/src/go/plugin/go.d/agent/safewriter/writer.go index 533c1055..533c1055 100644 --- a/src/go/collectors/go.d.plugin/agent/safewriter/writer.go +++ b/src/go/plugin/go.d/agent/safewriter/writer.go diff --git a/src/go/collectors/go.d.plugin/agent/setup.go b/src/go/plugin/go.d/agent/setup.go index d4f321e8..12da5938 100644 --- a/src/go/collectors/go.d.plugin/agent/setup.go +++ b/src/go/plugin/go.d/agent/setup.go @@ -7,14 +7,14 @@ import ( "os" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/confgroup" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/dummy" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/file" - "github.com/netdata/netdata/go/go.d.plugin/agent/discovery/sd" - "github.com/netdata/netdata/go/go.d.plugin/agent/hostinfo" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/agent/vnodes" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/confgroup" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/dummy" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/file" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/discovery/sd" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/hostinfo" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/vnodes" "gopkg.in/yaml.v2" ) diff --git a/src/go/collectors/go.d.plugin/agent/setup_test.go b/src/go/plugin/go.d/agent/setup_test.go index 36ec6827..148b822c 100644 --- a/src/go/collectors/go.d.plugin/agent/setup_test.go +++ b/src/go/plugin/go.d/agent/setup_test.go @@ -5,7 +5,7 @@ package agent import ( "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/agent/testdata/agent-empty.conf b/src/go/plugin/go.d/agent/testdata/agent-empty.conf index e69de29b..e69de29b 100644 --- a/src/go/collectors/go.d.plugin/agent/testdata/agent-empty.conf +++ b/src/go/plugin/go.d/agent/testdata/agent-empty.conf diff --git a/src/go/collectors/go.d.plugin/agent/testdata/agent-invalid-syntax.conf b/src/go/plugin/go.d/agent/testdata/agent-invalid-syntax.conf index c4a0b914..c4a0b914 100644 --- a/src/go/collectors/go.d.plugin/agent/testdata/agent-invalid-syntax.conf +++ b/src/go/plugin/go.d/agent/testdata/agent-invalid-syntax.conf diff --git a/src/go/collectors/go.d.plugin/agent/testdata/agent-valid.conf b/src/go/plugin/go.d/agent/testdata/agent-valid.conf index ec5e1d06..ec5e1d06 100644 --- a/src/go/collectors/go.d.plugin/agent/testdata/agent-valid.conf +++ b/src/go/plugin/go.d/agent/testdata/agent-valid.conf diff --git a/src/go/collectors/go.d.plugin/agent/ticker/ticker.go b/src/go/plugin/go.d/agent/ticker/ticker.go index e4228fe4..e4228fe4 100644 --- a/src/go/collectors/go.d.plugin/agent/ticker/ticker.go +++ b/src/go/plugin/go.d/agent/ticker/ticker.go diff --git a/src/go/collectors/go.d.plugin/agent/ticker/ticket_test.go b/src/go/plugin/go.d/agent/ticker/ticket_test.go index 19308536..19308536 100644 --- a/src/go/collectors/go.d.plugin/agent/ticker/ticket_test.go +++ b/src/go/plugin/go.d/agent/ticker/ticket_test.go diff --git a/src/go/collectors/go.d.plugin/agent/vnodes/testdata/config.yaml b/src/go/plugin/go.d/agent/vnodes/testdata/config.yaml index db256d32..db256d32 100644 --- a/src/go/collectors/go.d.plugin/agent/vnodes/testdata/config.yaml +++ b/src/go/plugin/go.d/agent/vnodes/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/agent/vnodes/vnodes.go b/src/go/plugin/go.d/agent/vnodes/vnodes.go index 2c59f2ad..9272f151 100644 --- a/src/go/collectors/go.d.plugin/agent/vnodes/vnodes.go +++ b/src/go/plugin/go.d/agent/vnodes/vnodes.go @@ -9,7 +9,7 @@ import ( "os" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" "gopkg.in/yaml.v2" ) diff --git a/src/go/collectors/go.d.plugin/agent/vnodes/vnodes_test.go b/src/go/plugin/go.d/agent/vnodes/vnodes_test.go index fc2c2ef3..fc2c2ef3 100644 --- a/src/go/collectors/go.d.plugin/agent/vnodes/vnodes_test.go +++ b/src/go/plugin/go.d/agent/vnodes/vnodes_test.go diff --git a/src/go/collectors/go.d.plugin/cli/cli.go b/src/go/plugin/go.d/cli/cli.go index 646bdf12..646bdf12 100644 --- a/src/go/collectors/go.d.plugin/cli/cli.go +++ b/src/go/plugin/go.d/cli/cli.go diff --git a/src/go/collectors/go.d.plugin/config/go.d.conf b/src/go/plugin/go.d/config/go.d.conf index 8a5ac82e..198bcd08 100644 --- a/src/go/collectors/go.d.plugin/config/go.d.conf +++ b/src/go/plugin/go.d/config/go.d.conf @@ -17,7 +17,9 @@ max_procs: 0 modules: # adaptec_raid: yes # activemq: yes +# ap: yes # apache: yes +# beanstalk: yes # bind: yes # chrony: yes # clickhouse: yes @@ -34,19 +36,24 @@ modules: # docker: yes # docker_engine: yes # dockerhub: yes +# dovecot: yes # elasticsearch: yes # envoy: yes # example: no +# exim: yes # fail2ban: yes # filecheck: yes # fluentd: yes # freeradius: yes +# gearman: yes # haproxy: yes # hddtemp: yes # hdfs: yes # hpssa: yes # httpcheck: yes +# icecast: yes # intelgpu: yes +# ipfs: yes # isc_dhcpd: yes # k8s_kubelet: yes # k8s_kubeproxy: yes @@ -56,11 +63,14 @@ modules: # logstash: yes # lvm: yes # megacli: yes +# memcached: yes # mongodb: yes +# monit: yes # mysql: yes # nginx: yes # nginxplus: yes # nginxvts: yes +# nsd: yes # ntpd: yes # nvme: yes # nvidia_smi: no @@ -74,25 +84,33 @@ modules: # pika: yes # portcheck: yes # postgres: yes +# postfix: yes # powerdns: yes # powerdns_recursor: yes # prometheus: yes # pulsar: yes +# puppet: yes # rabbitmq: yes # redis: yes +# rethinkdb: yes +# riakkv: yes # rspamd: yes # scaleio: yes # sensors: yes # snmp: yes +# squid: yes # squidlog: yes # smartctl: yes # storcli: yes # supervisord: yes # systemdunits: yes # tengine: yes +# tomcat: yes +# tor: yes # traefik: yes # upsd: yes # unbound: yes +# uwsgi: yes # vernemq: yes # vcsa: yes # vsphere: yes diff --git a/src/go/collectors/go.d.plugin/config/go.d/activemq.conf b/src/go/plugin/go.d/config/go.d/activemq.conf index 69d7ce14..9bae9cc5 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/activemq.conf +++ b/src/go/plugin/go.d/config/go.d/activemq.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/activemq#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/activemq#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/adaptec_raid.conf b/src/go/plugin/go.d/config/go.d/adaptec_raid.conf index 21c548f2..eafbd030 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/adaptec_raid.conf +++ b/src/go/plugin/go.d/config/go.d/adaptec_raid.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/adaptecraid#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/adaptecraid#readme jobs: - name: adaptec_raid diff --git a/src/go/plugin/go.d/config/go.d/ap.conf b/src/go/plugin/go.d/config/go.d/ap.conf new file mode 100644 index 00000000..ef8f2d9f --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/ap.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/ap#readme + +jobs: + - name: local + binary_path: /usr/sbin/iw diff --git a/src/go/collectors/go.d.plugin/config/go.d/apache.conf b/src/go/plugin/go.d/config/go.d/apache.conf index d52c1f67..86f4a75c 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/apache.conf +++ b/src/go/plugin/go.d/config/go.d/apache.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/apache#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/apache#readme #jobs: # - name: local diff --git a/src/go/plugin/go.d/config/go.d/beanstalk.conf b/src/go/plugin/go.d/config/go.d/beanstalk.conf new file mode 100644 index 00000000..45e2254b --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/beanstalk.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/beanstalk#readme + +#jobs: +# - name: local +# address: 127.0.0.1:11300 diff --git a/src/go/collectors/go.d.plugin/config/go.d/bind.conf b/src/go/plugin/go.d/config/go.d/bind.conf index 4302013c..9e970e60 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/bind.conf +++ b/src/go/plugin/go.d/config/go.d/bind.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/bind#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/bind#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/cassandra.conf b/src/go/plugin/go.d/config/go.d/cassandra.conf index 84de0b1c..93283ee6 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/cassandra.conf +++ b/src/go/plugin/go.d/config/go.d/cassandra.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/cassandra#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/cassandra#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/chrony.conf b/src/go/plugin/go.d/config/go.d/chrony.conf index 69d9b1c3..099ba358 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/chrony.conf +++ b/src/go/plugin/go.d/config/go.d/chrony.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/chrony#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/chrony#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/clickhouse.conf b/src/go/plugin/go.d/config/go.d/clickhouse.conf index e8d6725e..4f416138 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/clickhouse.conf +++ b/src/go/plugin/go.d/config/go.d/clickhouse.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/clickhouse#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/clickhouse#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/cockroachdb.conf b/src/go/plugin/go.d/config/go.d/cockroachdb.conf index 83cc91a9..8d04dbfe 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/cockroachdb.conf +++ b/src/go/plugin/go.d/config/go.d/cockroachdb.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/cockroachdb#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/cockroachdb#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/consul.conf b/src/go/plugin/go.d/config/go.d/consul.conf index 60aea123..624b9a6d 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/consul.conf +++ b/src/go/plugin/go.d/config/go.d/consul.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/consul#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/consul#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/coredns.conf b/src/go/plugin/go.d/config/go.d/coredns.conf index 3037b9db..9b9d6ef9 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/coredns.conf +++ b/src/go/plugin/go.d/config/go.d/coredns.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/coredns#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/coredns#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/couchbase.conf b/src/go/plugin/go.d/config/go.d/couchbase.conf index 77ecf3f1..aec5c342 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/couchbase.conf +++ b/src/go/plugin/go.d/config/go.d/couchbase.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/couchbase#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/couchbase#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/couchdb.conf b/src/go/plugin/go.d/config/go.d/couchdb.conf index 8527f6b8..5b62ad19 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/couchdb.conf +++ b/src/go/plugin/go.d/config/go.d/couchdb.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/couchdb#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/couchdb#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/dmcache.conf b/src/go/plugin/go.d/config/go.d/dmcache.conf index a17e6db7..8b39726c 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/dmcache.conf +++ b/src/go/plugin/go.d/config/go.d/dmcache.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/dmcache#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dmcache#readme jobs: - name: dmcache diff --git a/src/go/collectors/go.d.plugin/config/go.d/dns_query.conf b/src/go/plugin/go.d/config/go.d/dns_query.conf index 4fd374a8..ca24265b 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/dns_query.conf +++ b/src/go/plugin/go.d/config/go.d/dns_query.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/dnsquery#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dnsquery#readme #jobs: # - name: example diff --git a/src/go/collectors/go.d.plugin/config/go.d/dnsdist.conf b/src/go/plugin/go.d/config/go.d/dnsdist.conf index 6da0539c..cc991e01 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/dnsdist.conf +++ b/src/go/plugin/go.d/config/go.d/dnsdist.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/dnsdist#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dnsdist#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/dnsmasq.conf b/src/go/plugin/go.d/config/go.d/dnsmasq.conf index 47c94940..3b9b3d32 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/dnsmasq.conf +++ b/src/go/plugin/go.d/config/go.d/dnsmasq.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/dnsmasq#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dnsmasq#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/dnsmasq_dhcp.conf b/src/go/plugin/go.d/config/go.d/dnsmasq_dhcp.conf index f3ca29fe..1f51415d 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/dnsmasq_dhcp.conf +++ b/src/go/plugin/go.d/config/go.d/dnsmasq_dhcp.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dnsmasq_dhcp#readme jobs: - name: dnsmasq_dhcp diff --git a/src/go/collectors/go.d.plugin/config/go.d/docker.conf b/src/go/plugin/go.d/config/go.d/docker.conf index 4701e2e8..084373f7 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/docker.conf +++ b/src/go/plugin/go.d/config/go.d/docker.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/docker#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/docker#readme jobs: - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/docker_engine.conf b/src/go/plugin/go.d/config/go.d/docker_engine.conf index 1a5de15e..ba7342a7 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/docker_engine.conf +++ b/src/go/plugin/go.d/config/go.d/docker_engine.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/docker_engine#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/docker_engine#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/dockerhub.conf b/src/go/plugin/go.d/config/go.d/dockerhub.conf index 6d4ee5d6..96b29e26 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/dockerhub.conf +++ b/src/go/plugin/go.d/config/go.d/dockerhub.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/dockerhub#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dockerhub#readme #jobs: # - name: dockerhub diff --git a/src/go/plugin/go.d/config/go.d/dovecot.conf b/src/go/plugin/go.d/config/go.d/dovecot.conf new file mode 100644 index 00000000..5dd31bd7 --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/dovecot.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/dovecot#readme + +jobs: + - name: local + address: unix:///var/run/dovecot/old-stats diff --git a/src/go/collectors/go.d.plugin/config/go.d/elasticsearch.conf b/src/go/plugin/go.d/config/go.d/elasticsearch.conf index b641d6c3..26ff2c9c 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/elasticsearch.conf +++ b/src/go/plugin/go.d/config/go.d/elasticsearch.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/elasticsearch#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/elasticsearch#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/envoy.conf b/src/go/plugin/go.d/config/go.d/envoy.conf index b4a801cf..fc30a350 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/envoy.conf +++ b/src/go/plugin/go.d/config/go.d/envoy.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/envoy#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/envoy#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/example.conf b/src/go/plugin/go.d/config/go.d/example.conf index b9937092..f92669a6 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/example.conf +++ b/src/go/plugin/go.d/config/go.d/example.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/example#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/example#readme jobs: - name: example diff --git a/src/go/plugin/go.d/config/go.d/exim.conf b/src/go/plugin/go.d/config/go.d/exim.conf new file mode 100644 index 00000000..db881315 --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/exim.conf @@ -0,0 +1,5 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/exim#readme + +jobs: + - name: exim diff --git a/src/go/collectors/go.d.plugin/config/go.d/fail2ban.conf b/src/go/plugin/go.d/config/go.d/fail2ban.conf index 56f4a59e..ac3d126b 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/fail2ban.conf +++ b/src/go/plugin/go.d/config/go.d/fail2ban.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/fail2ban#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/fail2ban#readme jobs: - name: fail2ban diff --git a/src/go/collectors/go.d.plugin/config/go.d/filecheck.conf b/src/go/plugin/go.d/config/go.d/filecheck.conf index 16b9c228..ed33675e 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/filecheck.conf +++ b/src/go/plugin/go.d/config/go.d/filecheck.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/filecheck#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/filecheck#readme #jobs: # - name: files_example diff --git a/src/go/collectors/go.d.plugin/config/go.d/fluentd.conf b/src/go/plugin/go.d/config/go.d/fluentd.conf index 6a1507f1..a75dde61 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/fluentd.conf +++ b/src/go/plugin/go.d/config/go.d/fluentd.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/fluentd#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/fluentd#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/freeradius.conf b/src/go/plugin/go.d/config/go.d/freeradius.conf index 67cda5cc..ba8b066d 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/freeradius.conf +++ b/src/go/plugin/go.d/config/go.d/freeradius.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/freeradius#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/freeradius#readme #jobs: # - name: local diff --git a/src/go/plugin/go.d/config/go.d/gearman.conf b/src/go/plugin/go.d/config/go.d/gearman.conf new file mode 100644 index 00000000..b816f27d --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/gearman.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/gearman#readme + +#jobs: +# - name: local +# address: 127.0.0.1:4730 diff --git a/src/go/collectors/go.d.plugin/config/go.d/geth.conf b/src/go/plugin/go.d/config/go.d/geth.conf index 1b564743..e09fc055 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/geth.conf +++ b/src/go/plugin/go.d/config/go.d/geth.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/geth#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/geth#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/haproxy.conf b/src/go/plugin/go.d/config/go.d/haproxy.conf index 0802a8f0..f2f8011e 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/haproxy.conf +++ b/src/go/plugin/go.d/config/go.d/haproxy.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/haproxy#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/haproxy#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/hddtemp.conf b/src/go/plugin/go.d/config/go.d/hddtemp.conf index a2ea8452..6a9830a8 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/hddtemp.conf +++ b/src/go/plugin/go.d/config/go.d/hddtemp.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/hddtemp#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/hddtemp#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/hdfs.conf b/src/go/plugin/go.d/config/go.d/hdfs.conf index 2e3e24b6..93a6d24b 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/hdfs.conf +++ b/src/go/plugin/go.d/config/go.d/hdfs.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/hdfs#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/hdfs#readme #jobs: # - name: namenode diff --git a/src/go/collectors/go.d.plugin/config/go.d/hpssa.conf b/src/go/plugin/go.d/config/go.d/hpssa.conf index c5abeb48..6638b616 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/hpssa.conf +++ b/src/go/plugin/go.d/config/go.d/hpssa.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/hpssa#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/hpssa#readme jobs: - name: hpssa diff --git a/src/go/collectors/go.d.plugin/config/go.d/httpcheck.conf b/src/go/plugin/go.d/config/go.d/httpcheck.conf index 908433e0..6aba8dca 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/httpcheck.conf +++ b/src/go/plugin/go.d/config/go.d/httpcheck.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/httpcheck#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/httpcheck#readme #jobs: # - name: jira diff --git a/src/go/plugin/go.d/config/go.d/icecast.conf b/src/go/plugin/go.d/config/go.d/icecast.conf new file mode 100644 index 00000000..aba3e1d2 --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/icecast.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/icecast#readme + +#jobs: +# - name: local +# url: http://localhost:8000 diff --git a/src/go/collectors/go.d.plugin/config/go.d/intelgpu.conf b/src/go/plugin/go.d/config/go.d/intelgpu.conf index 3639076f..a8b3144f 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/intelgpu.conf +++ b/src/go/plugin/go.d/config/go.d/intelgpu.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/intelgpu#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/intelgpu#readme jobs: - name: intelgpu diff --git a/src/go/plugin/go.d/config/go.d/ipfs.conf b/src/go/plugin/go.d/config/go.d/ipfs.conf new file mode 100644 index 00000000..127006de --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/ipfs.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/ipfs#readme + +#jobs: +# - name: local +# url: http://localhost:5001 diff --git a/src/go/collectors/go.d.plugin/config/go.d/isc_dhcpd.conf b/src/go/plugin/go.d/config/go.d/isc_dhcpd.conf index aef14430..17a577bb 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/isc_dhcpd.conf +++ b/src/go/plugin/go.d/config/go.d/isc_dhcpd.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/isc_dhcpd#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/isc_dhcpd#readme #jobs: # - name: ipv4_example diff --git a/src/go/collectors/go.d.plugin/config/go.d/k8s_kubelet.conf b/src/go/plugin/go.d/config/go.d/k8s_kubelet.conf index 37a8ba6c..1c0f8cd1 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/k8s_kubelet.conf +++ b/src/go/plugin/go.d/config/go.d/k8s_kubelet.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/k8s_kubelet#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/k8s_kubelet#readme #jobs: # - url: http://127.0.0.1:10255/metrics diff --git a/src/go/collectors/go.d.plugin/config/go.d/k8s_kubeproxy.conf b/src/go/plugin/go.d/config/go.d/k8s_kubeproxy.conf index 2563f7b6..a0b9ee24 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/k8s_kubeproxy.conf +++ b/src/go/plugin/go.d/config/go.d/k8s_kubeproxy.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/k8s_kubeproxy#readme #jobs: # - url: http://127.0.0.1:10249/metrics diff --git a/src/go/collectors/go.d.plugin/config/go.d/k8s_state.conf b/src/go/plugin/go.d/config/go.d/k8s_state.conf index 3389d42b..fd1c305e 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/k8s_state.conf +++ b/src/go/plugin/go.d/config/go.d/k8s_state.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/k8s_state#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/k8s_state#readme jobs: - name: k8s_state diff --git a/src/go/collectors/go.d.plugin/config/go.d/lighttpd.conf b/src/go/plugin/go.d/config/go.d/lighttpd.conf index 1a7c29bb..51866bfb 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/lighttpd.conf +++ b/src/go/plugin/go.d/config/go.d/lighttpd.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/lighttpd#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/lighttpd#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/litespeed.conf b/src/go/plugin/go.d/config/go.d/litespeed.conf index aa321ad2..c525ff0a 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/litespeed.conf +++ b/src/go/plugin/go.d/config/go.d/litespeed.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/litespeed#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/litespeed#readme jobs: - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/logind.conf b/src/go/plugin/go.d/config/go.d/logind.conf index 170c400b..219b37ae 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/logind.conf +++ b/src/go/plugin/go.d/config/go.d/logind.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/logind#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/logind#readme jobs: - name: logind diff --git a/src/go/collectors/go.d.plugin/config/go.d/logstash.conf b/src/go/plugin/go.d/config/go.d/logstash.conf index f1586e6a..c67819e1 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/logstash.conf +++ b/src/go/plugin/go.d/config/go.d/logstash.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/logstash#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/logstash#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/lvm.conf b/src/go/plugin/go.d/config/go.d/lvm.conf index 883c37cf..54da37b1 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/lvm.conf +++ b/src/go/plugin/go.d/config/go.d/lvm.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/lvm#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/lvm#readme jobs: - name: lvm diff --git a/src/go/collectors/go.d.plugin/config/go.d/megacli.conf b/src/go/plugin/go.d/config/go.d/megacli.conf index db0d43e4..8d26763b 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/megacli.conf +++ b/src/go/plugin/go.d/config/go.d/megacli.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/megacli#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/megacli#readme jobs: - name: megacli diff --git a/src/go/plugin/go.d/config/go.d/memcached.conf b/src/go/plugin/go.d/config/go.d/memcached.conf new file mode 100644 index 00000000..60603be2 --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/memcached.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/memcached#readme + +#jobs: +# - name: local +# address: 127.0.0.1:11211 diff --git a/src/go/collectors/go.d.plugin/config/go.d/mongodb.conf b/src/go/plugin/go.d/config/go.d/mongodb.conf index 1e5c024a..ae41e4c7 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/mongodb.conf +++ b/src/go/plugin/go.d/config/go.d/mongodb.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/mongodb#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/mongodb#readme #jobs: # - name: local diff --git a/src/go/plugin/go.d/config/go.d/monit.conf b/src/go/plugin/go.d/config/go.d/monit.conf new file mode 100644 index 00000000..e7768d61 --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/monit.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/monit#readme + +#jobs: +# - name: local +# url: http://127.0.0.1:2812 diff --git a/src/go/collectors/go.d.plugin/config/go.d/mysql.conf b/src/go/plugin/go.d/config/go.d/mysql.conf index 036d797e..bdba6df7 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/mysql.conf +++ b/src/go/plugin/go.d/config/go.d/mysql.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/mysql#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/mysql#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/nginx.conf b/src/go/plugin/go.d/config/go.d/nginx.conf index 2c9346b8..03b56d23 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/nginx.conf +++ b/src/go/plugin/go.d/config/go.d/nginx.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/nginx#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nginx#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/nginxplus.conf b/src/go/plugin/go.d/config/go.d/nginxplus.conf index d10141c8..f0c02285 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/nginxplus.conf +++ b/src/go/plugin/go.d/config/go.d/nginxplus.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/nginxplus#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nginxplus#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/nginxvts.conf b/src/go/plugin/go.d/config/go.d/nginxvts.conf index 9b8dcde0..1b4ea7f1 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/nginxvts.conf +++ b/src/go/plugin/go.d/config/go.d/nginxvts.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/nginxvts#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nginxvts#readme #jobs: # - name: local diff --git a/src/go/plugin/go.d/config/go.d/nsd.conf b/src/go/plugin/go.d/config/go.d/nsd.conf new file mode 100644 index 00000000..b3c0a786 --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/nsd.conf @@ -0,0 +1,5 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nsd#readme + +jobs: + - name: nsd diff --git a/src/go/collectors/go.d.plugin/config/go.d/ntpd.conf b/src/go/plugin/go.d/config/go.d/ntpd.conf index c999fa2f..d607450a 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/ntpd.conf +++ b/src/go/plugin/go.d/config/go.d/ntpd.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/ntpd#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/ntpd#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/nvidia_smi.conf b/src/go/plugin/go.d/config/go.d/nvidia_smi.conf index e166d789..4c1e01a4 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/nvidia_smi.conf +++ b/src/go/plugin/go.d/config/go.d/nvidia_smi.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/nvidia_smi#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nvidia_smi#readme jobs: - name: nvidia_smi diff --git a/src/go/collectors/go.d.plugin/config/go.d/nvme.conf b/src/go/plugin/go.d/config/go.d/nvme.conf index c419b6a0..ef014626 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/nvme.conf +++ b/src/go/plugin/go.d/config/go.d/nvme.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/nvme#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nvme#readme jobs: - name: nvme diff --git a/src/go/collectors/go.d.plugin/config/go.d/openvpn.conf b/src/go/plugin/go.d/config/go.d/openvpn.conf index 297244bf..0bc65018 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/openvpn.conf +++ b/src/go/plugin/go.d/config/go.d/openvpn.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/openvpn#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/openvpn#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/openvpn_status_log.conf b/src/go/plugin/go.d/config/go.d/openvpn_status_log.conf index 47e723e0..ae401780 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/openvpn_status_log.conf +++ b/src/go/plugin/go.d/config/go.d/openvpn_status_log.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/openvpn_status_log#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/openvpn_status_log#readme jobs: - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/pgbouncer.conf b/src/go/plugin/go.d/config/go.d/pgbouncer.conf index de4f2dc9..fdc067d7 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/pgbouncer.conf +++ b/src/go/plugin/go.d/config/go.d/pgbouncer.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/pgbouncer#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/pgbouncer#readme jobs: - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/phpdaemon.conf b/src/go/plugin/go.d/config/go.d/phpdaemon.conf index 3663fc18..2bd8c139 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/phpdaemon.conf +++ b/src/go/plugin/go.d/config/go.d/phpdaemon.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/phpdaemon#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/phpdaemon#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/phpfpm.conf b/src/go/plugin/go.d/config/go.d/phpfpm.conf index 476f9ab1..a159a5e4 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/phpfpm.conf +++ b/src/go/plugin/go.d/config/go.d/phpfpm.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/phpfpm#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/phpfpm#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/pihole.conf b/src/go/plugin/go.d/config/go.d/pihole.conf index f92c39e8..3ff57d9a 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/pihole.conf +++ b/src/go/plugin/go.d/config/go.d/pihole.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/pihole#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/pihole#readme #jobs: # - name: pihole diff --git a/src/go/collectors/go.d.plugin/config/go.d/pika.conf b/src/go/plugin/go.d/config/go.d/pika.conf index 893b5520..9f23d860 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/pika.conf +++ b/src/go/plugin/go.d/config/go.d/pika.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/pika#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/pika#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/ping.conf b/src/go/plugin/go.d/config/go.d/ping.conf index 4e84d34e..b87719ce 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/ping.conf +++ b/src/go/plugin/go.d/config/go.d/ping.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/ping#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/ping#readme #jobs: # - name: example diff --git a/src/go/collectors/go.d.plugin/config/go.d/portcheck.conf b/src/go/plugin/go.d/config/go.d/portcheck.conf index ffa794ff..0800c9ee 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/portcheck.conf +++ b/src/go/plugin/go.d/config/go.d/portcheck.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/portcheck#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/portcheck#readme #jobs: # - name: job1 diff --git a/src/go/plugin/go.d/config/go.d/postfix.conf b/src/go/plugin/go.d/config/go.d/postfix.conf new file mode 100644 index 00000000..5eda5965 --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/postfix.conf @@ -0,0 +1,12 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/postfix#readme + +jobs: + - name: local + binary_path: /usr/sbin/postqueue + + - name: local + binary_path: /usr/local/sbin/postqueue # FreeBSD + + - name: local + binary_path: postqueue diff --git a/src/go/collectors/go.d.plugin/config/go.d/postgres.conf b/src/go/plugin/go.d/config/go.d/postgres.conf index b684b70e..8911d82b 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/postgres.conf +++ b/src/go/plugin/go.d/config/go.d/postgres.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/postgres#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/postgres#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/powerdns.conf b/src/go/plugin/go.d/config/go.d/powerdns.conf index ad449f8f..dd543c8a 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/powerdns.conf +++ b/src/go/plugin/go.d/config/go.d/powerdns.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/powerdns#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/powerdns#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/powerdns_recursor.conf b/src/go/plugin/go.d/config/go.d/powerdns_recursor.conf index 73592fb4..19f044c6 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/powerdns_recursor.conf +++ b/src/go/plugin/go.d/config/go.d/powerdns_recursor.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/powerdns_recursor#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/powerdns_recursor#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf b/src/go/plugin/go.d/config/go.d/prometheus.conf index 4934e2f6..ef051dff 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf +++ b/src/go/plugin/go.d/config/go.d/prometheus.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/prometheus#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/prometheus#readme #jobs: # - name: node_exporter_local diff --git a/src/go/collectors/go.d.plugin/config/go.d/proxysql.conf b/src/go/plugin/go.d/config/go.d/proxysql.conf index 36687b24..d97bf328 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/proxysql.conf +++ b/src/go/plugin/go.d/config/go.d/proxysql.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/proxysql#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/proxysql#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/pulsar.conf b/src/go/plugin/go.d/config/go.d/pulsar.conf index 607c966c..5dea6ade 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/pulsar.conf +++ b/src/go/plugin/go.d/config/go.d/pulsar.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/pulsar#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/pulsar#readme #jobs: # - name: local diff --git a/src/go/plugin/go.d/config/go.d/puppet.conf b/src/go/plugin/go.d/config/go.d/puppet.conf new file mode 100644 index 00000000..09e64b7d --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/puppet.conf @@ -0,0 +1,7 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/puppet#readme + +#jobs: +# - name: local +# url: https://127.0.0.1:8140 +# tls_skip_verify: yes
\ No newline at end of file diff --git a/src/go/collectors/go.d.plugin/config/go.d/rabbitmq.conf b/src/go/plugin/go.d/config/go.d/rabbitmq.conf index 44c5db88..e64a7566 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/rabbitmq.conf +++ b/src/go/plugin/go.d/config/go.d/rabbitmq.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/rabbitmq#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/rabbitmq#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/redis.conf b/src/go/plugin/go.d/config/go.d/redis.conf index f06742d6..8910b154 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/redis.conf +++ b/src/go/plugin/go.d/config/go.d/redis.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/redis#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/redis#readme jobs: - name: local diff --git a/src/go/plugin/go.d/config/go.d/rethinkdb.conf b/src/go/plugin/go.d/config/go.d/rethinkdb.conf new file mode 100644 index 00000000..7d0502ac --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/rethinkdb.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/rethinkdb#readme + +#jobs: +# - name: local +# address: 127.0.0.1:28015 diff --git a/src/go/plugin/go.d/config/go.d/riakkv.conf b/src/go/plugin/go.d/config/go.d/riakkv.conf new file mode 100644 index 00000000..35f3b468 --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/riakkv.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/riakkv#readme + +#jobs: +# - name: local +# url: http://127.0.0.1:8098/stats diff --git a/src/go/collectors/go.d.plugin/config/go.d/rspamd.conf b/src/go/plugin/go.d/config/go.d/rspamd.conf index fe442476..f4db129c 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/rspamd.conf +++ b/src/go/plugin/go.d/config/go.d/rspamd.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/rspamd#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/rspamd#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/scaleio.conf b/src/go/plugin/go.d/config/go.d/scaleio.conf index d2f4d838..9db85cc4 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/scaleio.conf +++ b/src/go/plugin/go.d/config/go.d/scaleio.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/scaleio#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/scaleio#readme #jobs: # - name : local diff --git a/src/go/collectors/go.d.plugin/config/go.d/sd/docker.conf b/src/go/plugin/go.d/config/go.d/sd/docker.conf index b0f1a3aa..c93fbef8 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/sd/docker.conf +++ b/src/go/plugin/go.d/config/go.d/sd/docker.conf @@ -26,6 +26,8 @@ classify: match: - tags: "apache" expr: '{{ match "sp" .Image "httpd httpd:* */apache */apache:* */apache2 */apache2:*" }}' + - tags: "beanstalk" + expr: '{{ match "sp" .Image "*/beanstalkd */beanstalkd:*" }}' - tags: "cockroachdb" expr: '{{ match "sp" .Image "cockroachdb/cockroach cockroachdb/cockroach:*" }}' - tags: "consul" @@ -36,10 +38,18 @@ classify: expr: '{{ or (eq .PrivatePort "8091") (match "sp" .Image "couchbase couchbase:*") }}' - tags: "couchdb" expr: '{{ or (eq .PrivatePort "5984") (match "sp" .Image "couchdb couchdb:*") }}' + - tags: "dovecot" + expr: '{{ or (eq .PrivatePort "24242") (match "sp" .Image "*/dovecot */dovecot:*") }}' - tags: "elasticsearch" expr: '{{ or (eq .PrivatePort "9200") (match "sp" .Image "elasticsearch elasticsearch:* */elasticsearch */elasticsearch:* */opensearch */opensearch:*") }}' + - tags: "gearman" + expr: '{{ and (eq .PrivatePort "4730") (match "sp" .Image "*/gearmand */gearmand:*") }}' + - tags: "ipfs" + expr: '{{ and (eq .PrivatePort "5001") (match "sp" .Image "ipfs/kubo ipfs/kubo:*") }}' - tags: "lighttpd" expr: '{{ match "sp" .Image "*/lighttpd */lighttpd:*" }}' + - tags: "memcached" + expr: '{{ or (eq .PrivatePort "11211") (match "sp" .Image "memcached memcached:* */memcached */memcached:*") }}' - tags: "mongodb" expr: '{{ or (eq .PrivatePort "27017") (match "sp" .Image "mongo mongo:* */mongodb */mongodb:* */mongodb-community-server */mongodb-community-server:*") }}' - tags: "mysql" @@ -54,12 +64,22 @@ classify: expr: '{{ or (eq .PrivatePort "5432") (match "sp" .Image "postgres postgres:* */postgres */postgres:* */postgresql */postgresql:*") }}' - tags: "proxysql" expr: '{{ or (eq .PrivatePort "6032") (match "sp" .Image "*/proxysql */proxysql:*") }}' + - tags: "puppet" + expr: '{{ or (eq .PrivatePort "8140") (match "sp" .Image "puppet/puppetserver puppet/puppetserver:*") }}' - tags: "rabbitmq" expr: '{{ or (eq .PrivatePort "15672") (match "sp" .Image "rabbitmq rabbitmq:* */rabbitmq */rabbitmq:*") }}' - tags: "redis" expr: '{{ or (eq .PrivatePort "6379") (match "sp" .Image "redis redis:* */redis */redis:*") }}' + - tags: "rethinkdb" + expr: '{{ and (eq .PrivatePort "28015") (match "sp" .Image "rethinkdb rethinkdb:* */rethinkdb */rethinkdb:*") }}' + - tags: "squid" + expr: '{{ match "sp" .Image "*/squid */squid:*" }}' - tags: "tengine" expr: '{{ match "sp" .Image "*/tengine */tengine:*" }}' + - tags: "tor" + expr: '{{ and (eq .PrivatePort "9051") (match "sp" .Image "*/tor */tor:*") }}' + - tags: "tomcat" + expr: '{{ match "sp" .Image "tomcat tomcat:* */tomcat */tomcat:*" }}' - tags: "vernemq" expr: '{{ match "sp" .Image "*/vernemq */vernemq:*" }}' - tags: "zookeeper" @@ -73,6 +93,11 @@ compose: module: apache name: docker_{{.Name}} url: http://{{.Address}}/server-status?auto + - selector: "beanstalk" + template: | + module: beanstalk + name: docker_{{.Name}} + address: {{.Address}} - selector: "cockroachdb" template: | module: cockroachdb @@ -103,6 +128,11 @@ compose: module: couchdb name: docker_{{.Name}} url: http://{{.Address}} + - selector: "dovecot" + template: | + module: dovecot + name: docker_{{.Name}} + address: {{.Address}} - selector: "elasticsearch" template: | module: elasticsearch @@ -115,11 +145,26 @@ compose: username: admin password: admin {{ end -}} + - selector: "gearman" + template: | + module: gearman + name: docker_{{.Name}} + address: {{.Address}} + - selector: "ipfs" + template: | + module: ipfs + name: docker_{{.Name}} + url: http://{{.Address}} - selector: "lighttpd" template: | module: lighttpd name: docker_{{.Name}} url: http://{{.Address}}/server-status?auto + - selector: "memcached" + template: | + module: memcached + name: docker_{{.Name}} + address: {{.Address}} - selector: "mongodb" template: | module: mongodb @@ -154,6 +199,11 @@ compose: module: pika name: docker_{{.Name}} address: redis://@{{.Address}} + - selector: "rethinkdb" + template: | + module: rethinkdb + name: docker_{{.Name}} + address: {{.Address}} - selector: "postgres" template: | module: postgres @@ -164,6 +214,12 @@ compose: module: proxysql name: docker_{{.Name}} dsn: stats:stats@tcp({{.Address}})/ + - selector: "puppet" + template: | + module: puppet + name: docker_{{.Name}} + url: https://{{.Address}} + tls_skip_verify: yes - selector: "rabbitmq" template: | module: rabbitmq @@ -174,11 +230,26 @@ compose: module: redis name: docker_{{.Name}} address: redis://@{{.Address}} + - selector: "squid" + template: | + module: squid + name: docker_{{.Name}} + url: http://{{.Address}} - selector: "tengine" template: | module: tengine name: docker_{{.Name}} url: http://{{.Address}}/us + - selector: "tomcat" + template: | + module: tomcat + name: docker_{{.Name}} + url: http://{{.Address}} + - selector: "tor" + template: | + module: tor + name: docker_{{.Name}} + address: {{.Address}} - selector: "vernemq" template: | module: vernemq @@ -186,6 +257,6 @@ compose: url: http://{{.Address}}/metrics - selector: "zookeeper" template: | - module: vernemq + module: zookeeper name: docker_{{.Name}} address: {{.Address}} diff --git a/src/go/collectors/go.d.plugin/config/go.d/sd/net_listeners.conf b/src/go/plugin/go.d/config/go.d/sd/net_listeners.conf index 8d59c0dc..4462fc11 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/sd/net_listeners.conf +++ b/src/go/plugin/go.d/config/go.d/sd/net_listeners.conf @@ -16,6 +16,8 @@ classify: expr: '{{ and (eq .Port "8161") (eq .Comm "activemq") }}' - tags: "apache" expr: '{{ and (eq .Port "80" "8080") (eq .Comm "apache" "apache2" "httpd") }}' + - tags: "beanstalk" + expr: '{{ or (eq .Port "11300") (eq .Comm "beanstalkd") }}' - tags: "bind" expr: '{{ and (eq .Port "8653") (eq .Comm "bind" "named") }}' - tags: "cassandra" @@ -40,6 +42,8 @@ classify: expr: '{{ and (eq .Protocol "UDP") (eq .Port "53") (eq .Comm "dnsmasq") }}' - tags: "docker_engine" expr: '{{ and (eq .Port "9323") (eq .Comm "dockerd") }}' + - tags: "dovecot" + expr: '{{ and (eq .Port "24242") (eq .Comm "dovecot") }}' - tags: "elasticsearch" expr: '{{ or (eq .Port "9200") (glob .Cmdline "*elasticsearch*" "*opensearch*") }}' - tags: "envoy" @@ -48,6 +52,8 @@ classify: expr: '{{ and (eq .Port "24220") (glob .Cmdline "*fluentd*") }}' - tags: "freeradius" expr: '{{ and (eq .Port "18121") (eq .Comm "freeradius") }}' + - tags: "gearman" + expr: '{{ or (eq .Port "4730") (eq .Comm "gearmand") }}' - tags: "geth" expr: '{{ and (eq .Port "6060") (eq .Comm "geth") }}' - tags: "haproxy" @@ -58,6 +64,10 @@ classify: expr: '{{ and (eq .Port "9870") (eq .Comm "hadoop") }}' - tags: "hdfs_datanode" expr: '{{ and (eq .Port "9864") (eq .Comm "hadoop") }}' + - tags: "icecast" + expr: '{{ and (eq .Port "8000") (eq .Comm "icecast") }}' + - tags: "ipfs" + expr: '{{ and (eq .Port "5001") (eq .Comm "ipfs") }}' - tags: "kubelet" expr: '{{ and (eq .Port "10250" "10255") (eq .Comm "kubelet") }}' - tags: "kubeproxy" @@ -66,8 +76,12 @@ classify: expr: '{{ and (eq .Port "80" "8080") (eq .Comm "lighttpd") }}' - tags: "logstash" expr: '{{ and (eq .Port "9600") (glob .Cmdline "*logstash*") }}' + - tags: "memcached" + expr: '{{ or (eq .Port "11211") (eq .Comm "memcached") }}' - tags: "mongodb" expr: '{{ or (eq .Port "27017") (eq .Comm "mongod") }}' + - tags: "monit" + expr: '{{ or (eq .Port "2812") (eq .Comm "monit") }}' - tags: "mysql" expr: '{{ or (eq .Port "3306") (eq .Comm "mysqld" "mariadbd") }}' - tags: "nginx" @@ -90,20 +104,34 @@ classify: expr: '{{ and (eq .Port "8081") (eq .Comm "pdns_recursor") }}' - tags: "proxysql" expr: '{{ or (eq .Port "6032") (eq .Comm "proxysql") }}' + - tags: "puppet" + expr: '{{ or (eq .Port "8140") (glob .Cmdline "*puppet-server*") }}' - tags: "rabbitmq" expr: '{{ or (eq .Port "15672") (glob .Cmdline "*rabbitmq*") }}' - tags: "redis" expr: '{{ or (eq .Port "6379") (eq .Comm "redis-server") }}' + - tags: "rethinkdb" + expr: '{{ and (eq .Port "28015") (eq .Comm "rethinkdb") }}' + - tags: "riak" + expr: '{{ and (eq .Port "8098") (glob .Cmdline "*riak*") }}' - tags: "rspamd" expr: '{{ and (eq .Port "11334") (eq .Comm "rspamd") }}' + - tags: "squid" + expr: '{{ and (eq .Port "3128") (eq .Comm "squid") }}' - tags: "supervisord" expr: '{{ and (eq .Port "9001") (eq .Comm "supervisord") }}' + - tags: "tomcat" + expr: '{{ and (eq .Port "8080") (glob .Cmdline "*tomcat*") }}' + - tags: "tor" + expr: '{{ and (eq .Port "9051") (eq .Comm "tor") }}' - tags: "traefik" expr: '{{ and (eq .Port "80" "8080") (eq .Comm "traefik") }}' - tags: "unbound" expr: '{{ and (eq .Port "8953") (eq .Comm "unbound") }}' - tags: "upsd" expr: '{{ or (eq .Port "3493") (eq .Comm "upsd") }}' + - tags: "uwsgi" + expr: '{{ and (eq .Port "1717") (eq .Comm "uwsgi") }}' - tags: "vernemq" expr: '{{ and (eq .Port "8888") (glob .Cmdline "*vernemq*") }}' - tags: "zookeeper" @@ -129,6 +157,11 @@ compose: module: apache name: local url: http://{{.Address}}/server-status?auto + - selector: "beanstalk" + template: | + module: beanstalk + name: local + address: {{.Address}} - selector: "bind" template: | module: bind @@ -193,6 +226,11 @@ compose: module: docker_engine name: local url: http://{{.Address}}/metrics + - selector: "dovecot" + template: | + module: dovecot + name: local + address: {{.Address}} - selector: "elasticsearch" template: | module: elasticsearch @@ -227,6 +265,11 @@ compose: address: {{.IPAddress}} port: {{.Port}} secret: adminsecret + - selector: "gearman" + template: | + module: gearman + name: local + address: {{.Address}} - selector: "geth" template: | module: geth @@ -252,6 +295,16 @@ compose: module: hdfs name: datanode_local url: http://{{.Address}}/jmx + - selector: "icecast" + template: | + module: icecast + name: local + url: http://{{.Address}} + - selector: "ipfs" + template: | + module: ipfs + name: local + url: http://{{.Address}} - selector: "kubelet" template: | module: k8s_kubelet @@ -277,11 +330,23 @@ compose: module: logstash name: local url: http://{{.Address}} + - selector: "memcached" + template: | + module: memcached + name: local + address: {{.Address}} - selector: "mongodb" template: | module: mongodb name: local uri: mongodb://{{.Address}} + - selector: "monit" + template: | + module: monit + name: local + url: http://{{.Address}} + username: admin + password: monit - selector: "mysql" template: | - module: mysql @@ -330,6 +395,16 @@ compose: module: pika name: local address: redis://@{{.IPAddress}}:{{.Port}} + - selector: "rethinkdb" + template: | + module: rethinkdb + name: local + address: {{.Address}} + - selector: "riak" + template: | + module: riakkv + name: local + url: http://{{.Address}}/stats - selector: "rspamd" template: | module: rspamd @@ -365,6 +440,12 @@ compose: module: proxysql name: local dsn: stats:stats@tcp({{.Address}})/ + - selector: "puppet" + template: | + module: puppet + name: local + url: https://{{.Address}} + tls_skip_verify: yes - selector: "rabbitmq" template: | module: rabbitmq @@ -378,6 +459,11 @@ compose: module: redis name: local address: redis://@{{.Address}} + - selector: "squid" + template: | + module: squid + name: local + url: http://{{.Address}} - selector: "supervisord" template: | module: supervisord @@ -388,11 +474,16 @@ compose: module: traefik name: local url: http://{{.Address}}/metrics - - selector: "traefik" + - selector: "tomcat" template: | - module: traefik + module: tomcat name: local - url: http://{{.Address}}/metrics + url: http://{{.Address}} + - selector: "tor" + template: | + module: tor + name: local + address: {{.Address}} - selector: "unbound" template: | module: unbound @@ -403,6 +494,11 @@ compose: module: upsd name: local address: {{.Address}} + - selector: "uwsgi" + template: | + module: uwsgi + name: local + address: {{.Address}} - selector: "vernemq" template: | module: vernemq diff --git a/src/go/collectors/go.d.plugin/config/go.d/sensors.conf b/src/go/plugin/go.d/config/go.d/sensors.conf index 3b8febde..d1b4c4f1 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/sensors.conf +++ b/src/go/plugin/go.d/config/go.d/sensors.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/sensors#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/sensors#readme jobs: - name: sensors diff --git a/src/go/collectors/go.d.plugin/config/go.d/smartctl.conf b/src/go/plugin/go.d/config/go.d/smartctl.conf index dea5116b..7f8ca5ad 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/smartctl.conf +++ b/src/go/plugin/go.d/config/go.d/smartctl.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/smartctl#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/smartctl#readme jobs: - name: smartctl diff --git a/src/go/plugin/go.d/config/go.d/snmp.conf b/src/go/plugin/go.d/config/go.d/snmp.conf new file mode 100644 index 00000000..395fb0f0 --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/snmp.conf @@ -0,0 +1,10 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/snmp#readme + +#jobs: +# - name: switch +# update_every: 10 +# hostname: "192.0.2.1" +# community: public +# options: +# version: 2 diff --git a/src/go/plugin/go.d/config/go.d/squid.conf b/src/go/plugin/go.d/config/go.d/squid.conf new file mode 100644 index 00000000..21c711d3 --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/squid.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/squid#readme + +#jobs: +# - name: local +# url: http://localhost:3128 diff --git a/src/go/collectors/go.d.plugin/config/go.d/squidlog.conf b/src/go/plugin/go.d/config/go.d/squidlog.conf index a008feab..4c85e384 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/squidlog.conf +++ b/src/go/plugin/go.d/config/go.d/squidlog.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/squidlog#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/squidlog#readme jobs: - name: squidlog diff --git a/src/go/collectors/go.d.plugin/config/go.d/storcli.conf b/src/go/plugin/go.d/config/go.d/storcli.conf index a4a9e3e0..704f7579 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/storcli.conf +++ b/src/go/plugin/go.d/config/go.d/storcli.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/storcli#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/storcli#readme jobs: - name: storcli diff --git a/src/go/collectors/go.d.plugin/config/go.d/supervisord.conf b/src/go/plugin/go.d/config/go.d/supervisord.conf index 3031e505..5d3969b7 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/supervisord.conf +++ b/src/go/plugin/go.d/config/go.d/supervisord.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/supervisord#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/supervisord#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/systemdunits.conf b/src/go/plugin/go.d/config/go.d/systemdunits.conf index 5c94fc00..7aefd37e 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/systemdunits.conf +++ b/src/go/plugin/go.d/config/go.d/systemdunits.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/systemdunits#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/systemdunits#readme jobs: - name: service-units diff --git a/src/go/collectors/go.d.plugin/config/go.d/tengine.conf b/src/go/plugin/go.d/config/go.d/tengine.conf index 186d55c6..aefaf2ac 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/tengine.conf +++ b/src/go/plugin/go.d/config/go.d/tengine.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/tengine#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/tengine#readme #jobs: # - name: local diff --git a/src/go/plugin/go.d/config/go.d/tomcat.conf b/src/go/plugin/go.d/config/go.d/tomcat.conf new file mode 100644 index 00000000..cae77e86 --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/tomcat.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/tomcat#readme + +#jobs: +# - name: local +# url: http://127.0.0.1:8080 diff --git a/src/go/plugin/go.d/config/go.d/tor.conf b/src/go/plugin/go.d/config/go.d/tor.conf new file mode 100644 index 00000000..7aa949d9 --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/tor.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/tor#readme + +#jobs: +# - name: local +# address: 127.0.0.1:9051 diff --git a/src/go/collectors/go.d.plugin/config/go.d/traefik.conf b/src/go/plugin/go.d/config/go.d/traefik.conf index 69f5bb53..8c005db0 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/traefik.conf +++ b/src/go/plugin/go.d/config/go.d/traefik.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/traefik#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/traefik#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/unbound.conf b/src/go/plugin/go.d/config/go.d/unbound.conf index e6497c23..06552bfd 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/unbound.conf +++ b/src/go/plugin/go.d/config/go.d/unbound.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/unbound#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/unbound#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/upsd.conf b/src/go/plugin/go.d/config/go.d/upsd.conf index 5abc3f40..6f7b3109 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/upsd.conf +++ b/src/go/plugin/go.d/config/go.d/upsd.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/upsd#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/upsd#readme #jobs: # - name: upsd diff --git a/src/go/plugin/go.d/config/go.d/uwsgi.conf b/src/go/plugin/go.d/config/go.d/uwsgi.conf new file mode 100644 index 00000000..f3189180 --- /dev/null +++ b/src/go/plugin/go.d/config/go.d/uwsgi.conf @@ -0,0 +1,6 @@ +## All available configuration options, their descriptions and default values: +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/uwsgi#readme + +#jobs: +# - name: local +# address: 127.0.0.1:1717 diff --git a/src/go/collectors/go.d.plugin/config/go.d/vcsa.conf b/src/go/plugin/go.d/config/go.d/vcsa.conf index 84749fbd..39ee86d9 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/vcsa.conf +++ b/src/go/plugin/go.d/config/go.d/vcsa.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/vcsa#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/vcsa#readme #jobs: # - name : vcsa1 diff --git a/src/go/collectors/go.d.plugin/config/go.d/vernemq.conf b/src/go/plugin/go.d/config/go.d/vernemq.conf index 24717a82..c954074f 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/vernemq.conf +++ b/src/go/plugin/go.d/config/go.d/vernemq.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/vernemq#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/vernemq#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/config/go.d/vsphere.conf b/src/go/plugin/go.d/config/go.d/vsphere.conf index a83c2783..cbc58a35 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/vsphere.conf +++ b/src/go/plugin/go.d/config/go.d/vsphere.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/vsphere#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/vsphere#readme #jobs: # - name : vcenter1 diff --git a/src/go/collectors/go.d.plugin/config/go.d/web_log.conf b/src/go/plugin/go.d/config/go.d/web_log.conf index 49687885..502fece4 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/web_log.conf +++ b/src/go/plugin/go.d/config/go.d/web_log.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/web_log#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/web_log#readme jobs: # NGINX diff --git a/src/go/collectors/go.d.plugin/config/go.d/whoisquery.conf b/src/go/plugin/go.d/config/go.d/whoisquery.conf index 57c031bc..41f7232d 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/whoisquery.conf +++ b/src/go/plugin/go.d/config/go.d/whoisquery.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/whoisquery#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/whoisquery#readme #jobs: # - name: example diff --git a/src/go/collectors/go.d.plugin/config/go.d/windows.conf b/src/go/plugin/go.d/config/go.d/windows.conf index 73d4b062..4671c20b 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/windows.conf +++ b/src/go/plugin/go.d/config/go.d/windows.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/windows#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/windows#readme #jobs: # - name: win_server1 diff --git a/src/go/collectors/go.d.plugin/config/go.d/wireguard.conf b/src/go/plugin/go.d/config/go.d/wireguard.conf index 225de4d6..07ed61d0 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/wireguard.conf +++ b/src/go/plugin/go.d/config/go.d/wireguard.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/wireguard#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/wireguard#readme jobs: - name: wireguard diff --git a/src/go/collectors/go.d.plugin/config/go.d/x509check.conf b/src/go/plugin/go.d/config/go.d/x509check.conf index d0141747..5231b105 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/x509check.conf +++ b/src/go/plugin/go.d/config/go.d/x509check.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/x509check#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/x509check#readme #jobs: # - name: my_site_cert diff --git a/src/go/collectors/go.d.plugin/config/go.d/zfspool.conf b/src/go/plugin/go.d/config/go.d/zfspool.conf index f18ff54e..e961d197 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/zfspool.conf +++ b/src/go/plugin/go.d/config/go.d/zfspool.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/zfspool#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/zfspool#readme jobs: - name: zfspool diff --git a/src/go/collectors/go.d.plugin/config/go.d/zookeeper.conf b/src/go/plugin/go.d/config/go.d/zookeeper.conf index e6ed5052..f200c789 100644 --- a/src/go/collectors/go.d.plugin/config/go.d/zookeeper.conf +++ b/src/go/plugin/go.d/config/go.d/zookeeper.conf @@ -1,5 +1,5 @@ ## All available configuration options, their descriptions and default values: -## https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/zookeeper#readme +## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/zookeeper#readme #jobs: # - name: local diff --git a/src/go/collectors/go.d.plugin/docs/how-to-write-a-module.md b/src/go/plugin/go.d/docs/how-to-write-a-module.md index b5416149..bf7d3bc6 100644 --- a/src/go/collectors/go.d.plugin/docs/how-to-write-a-module.md +++ b/src/go/plugin/go.d/docs/how-to-write-a-module.md @@ -1,7 +1,7 @@ <!-- title: "How to write a Netdata collector in Go" description: "This guide will walk you through the technical implementation of writing a new Netdata collector in Golang, with tips on interfaces, structure, configuration files, and more." -custom_edit_url: "/src/go/collectors/go.d.plugin/docs/how-to-write-a-module.md" +custom_edit_url: "/src/go/plugin/go.d/docs/how-to-write-a-module.md" sidebar_label: "How to write a Netdata collector in Go" learn_status: "Published" learn_topic_type: "Tasks" @@ -23,7 +23,7 @@ sidebar_position: 20 ## Write and test a simple collector > :exclamation: You can skip most of these steps if you first experiment directy with the existing -> [example module](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/example), which +> [example module](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/example), which > will > give you an idea of how things work. @@ -32,18 +32,18 @@ Let's assume you want to write a collector named `example2`. The steps are: - Add the source code - to [`modules/example2/`](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules). + to [`modules/example2/`](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules). - [module interface](#module-interface). - [suggested module layout](#module-layout). - [helper packages](#helper-packages). - Add the configuration - to [`config/go.d/example2.conf`](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/config/go.d). + to [`config/go.d/example2.conf`](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/config/go.d). - Add the module - to [`config/go.d.conf`](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d.conf). + to [`config/go.d.conf`](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/config/go.d.conf). - Import the module - in [`modules/init.go`](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/modules/init.go). + in [`modules/init.go`](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/modules/init.go). - Update - the [`available modules list`](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin#available-modules). + the [`available modules list`](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d#available-modules). - To build it, run `make` from the plugin root dir. This will create a new `go.d.plugin` binary that includes your newly developed collector. It will be placed into the `bin` directory (e.g `go.d.plugin/bin`) - Run it in the debug mode `bin/godplugin -d -m <MODULE_NAME>`. This will output the `STDOUT` of the collector, the same @@ -51,10 +51,7 @@ The steps are: our [documentation](/src/collectors/plugins.d/README.md#external-plugins-api). - If you want to test the collector with the actual Netdata Agent, you need to replace the `go.d.plugin` binary that exists in the Netdata Agent installation directory with the one you just compiled. Once - you [restart](/packaging/installer/README.md#maintaining-a-netdata-agent-installation) - the Netdata Agent, it will detect and run - it, creating all the charts. It is advised not to remove the default `go.d.plugin` binary, but simply rename it - to `go.d.plugin.old` so that the Agent doesn't run it, but you can easily rename it back once you are done. + you restart the Netdata Agent, it will detect and run it, creating all the charts. It is advised not to remove the default `go.d.plugin` binary, but simply rename it to `go.d.plugin.old` so that the Agent doesn't run it, but you can easily rename it back once you are done. - Run `make clean` when you are done with testing. ## Module Interface @@ -125,7 +122,7 @@ func (e *Example) Check() bool { produces [`charts`](/src/collectors/plugins.d/README.md#chart), not raw metrics. -Use [`agent/module`](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/agent/module/charts.go) +Use [`agent/module`](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/agent/module/charts.go) package to create them, it contains charts and dimensions structs. @@ -205,7 +202,7 @@ Suggested minimal layout: ### File `module_name.go` > :exclamation: See the -> example [`example.go`](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/modules/example/example.go). +> example [`example.go`](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/modules/example/example.go). Don't overload this file with the implementation details. @@ -218,14 +215,14 @@ Usually it contains only: ### File `charts.go` > :exclamation: See the -> example: [`charts.go`](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/modules/example/charts.go). +> example: [`charts.go`](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/modules/example/charts.go). Put charts, charts templates and charts constructor functions in this file. ### File `init.go` > :exclamation: See the -> example: [`init.go`](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/modules/example/init.go). +> example: [`init.go`](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/modules/example/init.go). All the module initialization details should go in this file. @@ -252,7 +249,7 @@ func (e *Example) initSomeValue() error { ### File `collect.go` > :exclamation: See the -> example: [`collect.go`](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/modules/example/collect.go). +> example: [`collect.go`](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/modules/example/collect.go). This file is the entry point for the metrics collection. @@ -275,7 +272,7 @@ func (e *Example) collect() (map[string]int64, error) { ### File `module_name_test.go` > :exclamation: See the -> example: [`example_test.go`](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/modules/example/example_test.go). +> example: [`example_test.go`](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/modules/example/example_test.go). > if you have no experience in testing we recommend starting > with [testing package documentation](https://golang.org/pkg/testing/). @@ -300,6 +297,6 @@ be [`testdata`](https://golang.org/cmd/go/#hdr-Package_lists_and_patterns). ## Helper packages -There are [some helper packages](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg) for +There are [some helper packages](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg) for writing a module. diff --git a/src/go/collectors/go.d.plugin/examples/simple/main.go b/src/go/plugin/go.d/examples/simple/main.go index 4fa93d69..215e91f1 100644 --- a/src/go/collectors/go.d.plugin/examples/simple/main.go +++ b/src/go/plugin/go.d/examples/simple/main.go @@ -10,11 +10,11 @@ import ( "os" "path" - "github.com/netdata/netdata/go/go.d.plugin/agent" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/cli" - "github.com/netdata/netdata/go/go.d.plugin/logger" - "github.com/netdata/netdata/go/go.d.plugin/pkg/multipath" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/cli" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/multipath" "github.com/jessevdk/go-flags" ) diff --git a/src/go/collectors/go.d.plugin/hack/go-build.sh b/src/go/plugin/go.d/hack/go-build.sh index c211cff4..0b451f9c 100755 --- a/src/go/collectors/go.d.plugin/hack/go-build.sh +++ b/src/go/plugin/go.d/hack/go-build.sh @@ -36,11 +36,11 @@ WHICH="$1" VERSION="${TRAVIS_TAG:-$(git describe --tags --always --dirty)}" GOLDFLAGS=${GLDFLAGS:-} -GOLDFLAGS="$GOLDFLAGS -w -s -X github.com/netdata/netdata/go/go.d.plugin/pkg/buildinfo.Version=$VERSION" +GOLDFLAGS="$GOLDFLAGS -w -s -X github.com/netdata/netdata/go/plugins/pkg/buildinfo.Version=$VERSION" build() { echo "Building ${GOOS}/${GOARCH}" - CGO_ENABLED=0 GOOS="$1" GOARCH="$2" go build -ldflags "${GOLDFLAGS}" -o "$3" "github.com/netdata/netdata/go/go.d.plugin/cmd/godplugin" + CGO_ENABLED=0 GOOS="$1" GOARCH="$2" go build -ldflags "${GOLDFLAGS}" -o "$3" "github.com/netdata/netdata/go/plugins/cmd/godplugin" } create_config_archives() { diff --git a/src/go/collectors/go.d.plugin/hack/go-fmt.sh b/src/go/plugin/go.d/hack/go-fmt.sh index fcc9e2d5..fcc9e2d5 100755 --- a/src/go/collectors/go.d.plugin/hack/go-fmt.sh +++ b/src/go/plugin/go.d/hack/go-fmt.sh diff --git a/src/go/collectors/go.d.plugin/modules/activemq/README.md b/src/go/plugin/go.d/modules/activemq/README.md index de893d1d..de893d1d 120000 --- a/src/go/collectors/go.d.plugin/modules/activemq/README.md +++ b/src/go/plugin/go.d/modules/activemq/README.md diff --git a/src/go/collectors/go.d.plugin/modules/activemq/activemq.go b/src/go/plugin/go.d/modules/activemq/activemq.go index 46953bb9..bf47be72 100644 --- a/src/go/collectors/go.d.plugin/modules/activemq/activemq.go +++ b/src/go/plugin/go.d/modules/activemq/activemq.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/activemq/activemq_test.go b/src/go/plugin/go.d/modules/activemq/activemq_test.go index 19f28fee..e2640f44 100644 --- a/src/go/collectors/go.d.plugin/modules/activemq/activemq_test.go +++ b/src/go/plugin/go.d/modules/activemq/activemq_test.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/activemq/apiclient.go b/src/go/plugin/go.d/modules/activemq/apiclient.go index b721f617..7f99c9ba 100644 --- a/src/go/collectors/go.d.plugin/modules/activemq/apiclient.go +++ b/src/go/plugin/go.d/modules/activemq/apiclient.go @@ -10,7 +10,7 @@ import ( "net/url" "path" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) type topics struct { diff --git a/src/go/collectors/go.d.plugin/modules/activemq/charts.go b/src/go/plugin/go.d/modules/activemq/charts.go index fd715970..a169da01 100644 --- a/src/go/collectors/go.d.plugin/modules/activemq/charts.go +++ b/src/go/plugin/go.d/modules/activemq/charts.go @@ -2,7 +2,7 @@ package activemq -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( // Charts is an alias for module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/activemq/collect.go b/src/go/plugin/go.d/modules/activemq/collect.go index 0dbaf554..0dbaf554 100644 --- a/src/go/collectors/go.d.plugin/modules/activemq/collect.go +++ b/src/go/plugin/go.d/modules/activemq/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/activemq/config_schema.json b/src/go/plugin/go.d/modules/activemq/config_schema.json index 421354ca..df71bcad 100644 --- a/src/go/collectors/go.d.plugin/modules/activemq/config_schema.json +++ b/src/go/plugin/go.d/modules/activemq/config_schema.json @@ -218,6 +218,12 @@ "topics_filter": { "ui:help": "Use `*` to collect all topics. To exclude all topics from collection, use `!*`." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/activemq/init.go b/src/go/plugin/go.d/modules/activemq/init.go index 43cdb2e9..e48dacad 100644 --- a/src/go/collectors/go.d.plugin/modules/activemq/init.go +++ b/src/go/plugin/go.d/modules/activemq/init.go @@ -4,7 +4,7 @@ package activemq import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" ) func (a *ActiveMQ) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/activemq/integrations/activemq.md b/src/go/plugin/go.d/modules/activemq/integrations/activemq.md index 64802875..fc215bfb 100644 --- a/src/go/collectors/go.d.plugin/modules/activemq/integrations/activemq.md +++ b/src/go/plugin/go.d/modules/activemq/integrations/activemq.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/activemq/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/activemq/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/activemq/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/activemq/metadata.yaml" sidebar_label: "ActiveMQ" learn_status: "Published" learn_rel_path: "Collecting Metrics/Message Brokers" @@ -208,6 +208,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `activemq` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -230,4 +232,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m activemq ``` +### Getting Logs + +If you're encountering problems with the `activemq` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep activemq +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep activemq /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep activemq +``` + diff --git a/src/go/collectors/go.d.plugin/modules/activemq/metadata.yaml b/src/go/plugin/go.d/modules/activemq/metadata.yaml index 5bbb0e5a..5bbb0e5a 100644 --- a/src/go/collectors/go.d.plugin/modules/activemq/metadata.yaml +++ b/src/go/plugin/go.d/modules/activemq/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/activemq/testdata/config.json b/src/go/plugin/go.d/modules/activemq/testdata/config.json index 13327dd3..13327dd3 100644 --- a/src/go/collectors/go.d.plugin/modules/activemq/testdata/config.json +++ b/src/go/plugin/go.d/modules/activemq/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/activemq/testdata/config.yaml b/src/go/plugin/go.d/modules/activemq/testdata/config.yaml index dbb4232e..dbb4232e 100644 --- a/src/go/collectors/go.d.plugin/modules/activemq/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/activemq/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/README.md b/src/go/plugin/go.d/modules/adaptecraid/README.md index 0a156618..0a156618 120000 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/README.md +++ b/src/go/plugin/go.d/modules/adaptecraid/README.md diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/adaptec.go b/src/go/plugin/go.d/modules/adaptecraid/adaptec.go index a1c1f23e..264390e1 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/adaptec.go +++ b/src/go/plugin/go.d/modules/adaptecraid/adaptec.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/adaptec_test.go b/src/go/plugin/go.d/modules/adaptecraid/adaptec_test.go index b93ec51a..9abe5c98 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/adaptec_test.go +++ b/src/go/plugin/go.d/modules/adaptecraid/adaptec_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/charts.go b/src/go/plugin/go.d/modules/adaptecraid/charts.go index 2a6c9933..65be2019 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/charts.go +++ b/src/go/plugin/go.d/modules/adaptecraid/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strconv" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/collect.go b/src/go/plugin/go.d/modules/adaptecraid/collect.go index b4439ba8..b4439ba8 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/collect.go +++ b/src/go/plugin/go.d/modules/adaptecraid/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/collect_ld.go b/src/go/plugin/go.d/modules/adaptecraid/collect_ld.go index 180f9749..180f9749 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/collect_ld.go +++ b/src/go/plugin/go.d/modules/adaptecraid/collect_ld.go diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/collect_pd.go b/src/go/plugin/go.d/modules/adaptecraid/collect_pd.go index 272266b4..272266b4 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/collect_pd.go +++ b/src/go/plugin/go.d/modules/adaptecraid/collect_pd.go diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/config_schema.json b/src/go/plugin/go.d/modules/adaptecraid/config_schema.json index ad54f158..ad54f158 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/config_schema.json +++ b/src/go/plugin/go.d/modules/adaptecraid/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/exec.go b/src/go/plugin/go.d/modules/adaptecraid/exec.go index 3a34840c..0577e623 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/exec.go +++ b/src/go/plugin/go.d/modules/adaptecraid/exec.go @@ -8,7 +8,7 @@ import ( "os/exec" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" ) func newArcconfCliExec(ndsudoPath string, timeout time.Duration, log *logger.Logger) *arcconfCliExec { diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/init.go b/src/go/plugin/go.d/modules/adaptecraid/init.go index fe26f7bf..de8acc27 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/init.go +++ b/src/go/plugin/go.d/modules/adaptecraid/init.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" + "github.com/netdata/netdata/go/plugins/pkg/executable" ) func (a *AdaptecRaid) initArcconfCliExec() (arcconfCli, error) { diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/integrations/adaptec_raid.md b/src/go/plugin/go.d/modules/adaptecraid/integrations/adaptec_raid.md index d97203fc..a38207ff 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/integrations/adaptec_raid.md +++ b/src/go/plugin/go.d/modules/adaptecraid/integrations/adaptec_raid.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/adaptecraid/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/adaptecraid/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/adaptecraid/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/adaptecraid/metadata.yaml" sidebar_label: "Adaptec RAID" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -169,6 +169,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `adaptec_raid` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -191,4 +193,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m adaptec_raid ``` +### Getting Logs + +If you're encountering problems with the `adaptec_raid` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep adaptec_raid +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep adaptec_raid /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep adaptec_raid +``` + diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/metadata.yaml b/src/go/plugin/go.d/modules/adaptecraid/metadata.yaml index e573994f..e573994f 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/metadata.yaml +++ b/src/go/plugin/go.d/modules/adaptecraid/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/config.json b/src/go/plugin/go.d/modules/adaptecraid/testdata/config.json index 291ecee3..291ecee3 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/config.json +++ b/src/go/plugin/go.d/modules/adaptecraid/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/config.yaml b/src/go/plugin/go.d/modules/adaptecraid/testdata/config.yaml index 25b0b4c7..25b0b4c7 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/adaptecraid/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/getconfig-ld-current.txt b/src/go/plugin/go.d/modules/adaptecraid/testdata/getconfig-ld-current.txt index b5a14b66..b5a14b66 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/getconfig-ld-current.txt +++ b/src/go/plugin/go.d/modules/adaptecraid/testdata/getconfig-ld-current.txt diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/getconfig-ld-old.txt b/src/go/plugin/go.d/modules/adaptecraid/testdata/getconfig-ld-old.txt index 0c3b4691..0c3b4691 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/getconfig-ld-old.txt +++ b/src/go/plugin/go.d/modules/adaptecraid/testdata/getconfig-ld-old.txt diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/getconfig-pd-current.txt b/src/go/plugin/go.d/modules/adaptecraid/testdata/getconfig-pd-current.txt index 62beff83..62beff83 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/getconfig-pd-current.txt +++ b/src/go/plugin/go.d/modules/adaptecraid/testdata/getconfig-pd-current.txt diff --git a/src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/getconfig-pd-old.txt b/src/go/plugin/go.d/modules/adaptecraid/testdata/getconfig-pd-old.txt index 2114df6b..2114df6b 100644 --- a/src/go/collectors/go.d.plugin/modules/adaptecraid/testdata/getconfig-pd-old.txt +++ b/src/go/plugin/go.d/modules/adaptecraid/testdata/getconfig-pd-old.txt diff --git a/src/go/plugin/go.d/modules/ap/README.md b/src/go/plugin/go.d/modules/ap/README.md new file mode 120000 index 00000000..5b6e7513 --- /dev/null +++ b/src/go/plugin/go.d/modules/ap/README.md @@ -0,0 +1 @@ +integrations/access_points.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/ap/ap.go b/src/go/plugin/go.d/modules/ap/ap.go new file mode 100644 index 00000000..93dd06d0 --- /dev/null +++ b/src/go/plugin/go.d/modules/ap/ap.go @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package ap + +import ( + _ "embed" + "errors" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("ap", module.Creator{ + JobConfigSchema: configSchema, + Defaults: module.Defaults{ + UpdateEvery: 10, + }, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *AP { + return &AP{ + Config: Config{ + BinaryPath: "/usr/sbin/iw", + Timeout: web.Duration(time.Second * 2), + }, + charts: &module.Charts{}, + seenIfaces: make(map[string]*iwInterface), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Timeout web.Duration `yaml:"timeout,omitempty" json:"timeout"` + BinaryPath string `yaml:"binary_path,omitempty" json:"binary_path"` +} + +type ( + AP struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + exec iwBinary + + seenIfaces map[string]*iwInterface + } + iwBinary interface { + devices() ([]byte, error) + stationStatistics(ifaceName string) ([]byte, error) + } +) + +func (a *AP) Configuration() any { + return a.Config +} + +func (a *AP) Init() error { + if err := a.validateConfig(); err != nil { + a.Errorf("config validation: %s", err) + return err + } + + iw, err := a.initIwExec() + if err != nil { + a.Errorf("iw dev exec initialization: %v", err) + return err + } + a.exec = iw + + return nil +} + +func (a *AP) Check() error { + mx, err := a.collect() + if err != nil { + a.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (a *AP) Charts() *module.Charts { + return a.charts +} + +func (a *AP) Collect() map[string]int64 { + mx, err := a.collect() + if err != nil { + a.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (a *AP) Cleanup() {} diff --git a/src/go/plugin/go.d/modules/ap/ap_test.go b/src/go/plugin/go.d/modules/ap/ap_test.go new file mode 100644 index 00000000..237e00e9 --- /dev/null +++ b/src/go/plugin/go.d/modules/ap/ap_test.go @@ -0,0 +1,292 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package ap + +import ( + "errors" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataIwDevManaged, _ = os.ReadFile("testdata/iw_dev_managed.txt") + + dataIwDevAP, _ = os.ReadFile("testdata/iw_dev_ap.txt") + dataIwStationDump, _ = os.ReadFile("testdata/station_dump.txt") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + "dataIwDevManaged": dataIwDevManaged, + "dataIwDevAP": dataIwDevAP, + "dataIwStationDump": dataIwStationDump, + } { + require.NotNil(t, data, name) + } +} + +func TestAP_Configuration(t *testing.T) { + module.TestConfigurationSerialize(t, &AP{}, dataConfigJSON, dataConfigYAML) +} + +func TestAP_Init(t *testing.T) { + tests := map[string]struct { + config Config + wantFail bool + }{ + "fails if 'binary_path' is not set": { + wantFail: true, + config: Config{ + BinaryPath: "", + }, + }, + "fails if failed to find binary": { + wantFail: true, + config: Config{ + BinaryPath: "iw!!!", + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + pf := New() + pf.Config = test.config + + if test.wantFail { + assert.Error(t, pf.Init()) + } else { + assert.NoError(t, pf.Init()) + } + }) + } +} + +func TestAP_Cleanup(t *testing.T) { + tests := map[string]struct { + prepare func() *AP + }{ + "not initialized exec": { + prepare: func() *AP { + return New() + }, + }, + "after check": { + prepare: func() *AP { + ap := New() + ap.exec = prepareMockOk() + _ = ap.Check() + return ap + }, + }, + "after collect": { + prepare: func() *AP { + ap := New() + ap.exec = prepareMockOk() + _ = ap.Collect() + return ap + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + pf := test.prepare() + + assert.NotPanics(t, pf.Cleanup) + }) + } +} + +func TestAP_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestAP_Check(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockIwExec + wantFail bool + }{ + "success case": { + wantFail: false, + prepareMock: prepareMockOk, + }, + "no ap devices": { + wantFail: true, + prepareMock: prepareMockNoAPDevices, + }, + "error on devices call": { + wantFail: true, + prepareMock: prepareMockErrOnDevices, + }, + "error on station stats call": { + wantFail: true, + prepareMock: prepareMockErrOnStationStats, + }, + "unexpected response": { + wantFail: true, + prepareMock: prepareMockUnexpectedResponse, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + ap := New() + ap.exec = test.prepareMock() + + if test.wantFail { + assert.Error(t, ap.Check()) + } else { + assert.NoError(t, ap.Check()) + } + }) + } +} + +func TestAP_Collect(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockIwExec + wantMetrics map[string]int64 + wantCharts int + }{ + "success case": { + prepareMock: prepareMockOk, + wantCharts: len(apChartsTmpl) * 2, + wantMetrics: map[string]int64{ + "ap_wlp1s0_testing_average_signal": -34000, + "ap_wlp1s0_testing_bitrate_receive": 65500, + "ap_wlp1s0_testing_bitrate_transmit": 65000, + "ap_wlp1s0_testing_bw_received": 95117, + "ap_wlp1s0_testing_bw_sent": 8270, + "ap_wlp1s0_testing_clients": 2, + "ap_wlp1s0_testing_issues_failures": 1, + "ap_wlp1s0_testing_issues_retries": 1, + "ap_wlp1s0_testing_packets_received": 2531, + "ap_wlp1s0_testing_packets_sent": 38, + "ap_wlp1s1_testing_average_signal": -34000, + "ap_wlp1s1_testing_bitrate_receive": 65500, + "ap_wlp1s1_testing_bitrate_transmit": 65000, + "ap_wlp1s1_testing_bw_received": 95117, + "ap_wlp1s1_testing_bw_sent": 8270, + "ap_wlp1s1_testing_clients": 2, + "ap_wlp1s1_testing_issues_failures": 1, + "ap_wlp1s1_testing_issues_retries": 1, + "ap_wlp1s1_testing_packets_received": 2531, + "ap_wlp1s1_testing_packets_sent": 38, + }, + }, + "no ap devices": { + prepareMock: prepareMockNoAPDevices, + wantMetrics: nil, + }, + "error on devices call": { + prepareMock: prepareMockErrOnDevices, + wantMetrics: nil, + }, + "error on statis stats call": { + prepareMock: prepareMockErrOnStationStats, + wantMetrics: nil, + }, + "unexpected response": { + prepareMock: prepareMockUnexpectedResponse, + wantMetrics: nil, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + ap := New() + ap.exec = test.prepareMock() + + mx := ap.Collect() + + assert.Equal(t, test.wantMetrics, mx) + assert.Equal(t, test.wantCharts, len(*ap.Charts()), "Charts") + testMetricsHasAllChartsDims(t, ap, mx) + }) + } +} + +func testMetricsHasAllChartsDims(t *testing.T, ap *AP, mx map[string]int64) { + for _, chart := range *ap.Charts() { + if chart.Obsolete { + continue + } + for _, dim := range chart.Dims { + _, ok := mx[dim.ID] + assert.Truef(t, ok, "collected metrics has no data for dim '%s' chart '%s'", dim.ID, chart.ID) + } + for _, v := range chart.Vars { + _, ok := mx[v.ID] + assert.Truef(t, ok, "collected metrics has no data for var '%s' chart '%s'", v.ID, chart.ID) + } + } +} + +func prepareMockOk() *mockIwExec { + return &mockIwExec{ + devicesData: dataIwDevAP, + stationStatsData: dataIwStationDump, + } +} + +func prepareMockNoAPDevices() *mockIwExec { + return &mockIwExec{ + devicesData: dataIwDevManaged, + } +} + +func prepareMockErrOnDevices() *mockIwExec { + return &mockIwExec{ + errOnDevices: true, + } +} + +func prepareMockErrOnStationStats() *mockIwExec { + return &mockIwExec{ + devicesData: dataIwDevAP, + errOnStationStats: true, + } +} + +func prepareMockUnexpectedResponse() *mockIwExec { + return &mockIwExec{ + devicesData: []byte(` +Lorem ipsum dolor sit amet, consectetur adipiscing elit. +Nulla malesuada erat id magna mattis, eu viverra tellus rhoncus. +Fusce et felis pulvinar, posuere sem non, porttitor eros. +`), + } +} + +type mockIwExec struct { + errOnDevices bool + errOnStationStats bool + devicesData []byte + stationStatsData []byte +} + +func (m *mockIwExec) devices() ([]byte, error) { + if m.errOnDevices { + return nil, errors.New("mock.devices() error") + } + + return m.devicesData, nil +} + +func (m *mockIwExec) stationStatistics(_ string) ([]byte, error) { + if m.errOnStationStats { + return nil, errors.New("mock.stationStatistics() error") + } + return m.stationStatsData, nil +} diff --git a/src/go/plugin/go.d/modules/ap/charts.go b/src/go/plugin/go.d/modules/ap/charts.go new file mode 100644 index 00000000..b8c51c43 --- /dev/null +++ b/src/go/plugin/go.d/modules/ap/charts.go @@ -0,0 +1,147 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package ap + +import ( + "fmt" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioClients = module.Priority + iota + prioBandwidth + prioPackets + prioIssues + prioSignal + prioBitrate +) + +var apChartsTmpl = module.Charts{ + apClientsChartTmpl.Copy(), + apBandwidthChartTmpl.Copy(), + apPacketsChartTmpl.Copy(), + apIssuesChartTmpl.Copy(), + apSignalChartTmpl.Copy(), + apBitrateChartTmpl.Copy(), +} + +var ( + apClientsChartTmpl = module.Chart{ + ID: "ap_%s_%s_clients", + Title: "Connected clients", + Fam: "clients", + Units: "clients", + Ctx: "ap.clients", + Type: module.Line, + Priority: prioClients, + Dims: module.Dims{ + {ID: "ap_%s_%s_clients", Name: "clients"}, + }, + } + + apBandwidthChartTmpl = module.Chart{ + ID: "ap_%s_%s_bandwidth", + Title: "Bandwidth", + Units: "kilobits/s", + Fam: "traffic", + Ctx: "ap.net", + Type: module.Area, + Priority: prioBandwidth, + Dims: module.Dims{ + {ID: "ap_%s_%s_bw_received", Name: "received", Algo: module.Incremental, Mul: 8, Div: 1000}, + {ID: "ap_%s_%s_bw_sent", Name: "sent", Algo: module.Incremental, Mul: -8, Div: 1000}, + }, + } + + apPacketsChartTmpl = module.Chart{ + ID: "ap_%s_%s_packets", + Title: "Packets", + Fam: "packets", + Units: "packets/s", + Ctx: "ap.packets", + Type: module.Line, + Priority: prioPackets, + Dims: module.Dims{ + {ID: "ap_%s_%s_packets_received", Name: "received", Algo: module.Incremental}, + {ID: "ap_%s_%s_packets_sent", Name: "sent", Algo: module.Incremental, Mul: -1}, + }, + } + + apIssuesChartTmpl = module.Chart{ + ID: "ap_%s_%s_issues", + Title: "Transmit issues", + Fam: "issues", + Units: "issues/s", + Ctx: "ap.issues", + Type: module.Line, + Priority: prioIssues, + Dims: module.Dims{ + {ID: "ap_%s_%s_issues_retries", Name: "tx retries", Algo: module.Incremental}, + {ID: "ap_%s_%s_issues_failures", Name: "tx failures", Algo: module.Incremental, Mul: -1}, + }, + } + + apSignalChartTmpl = module.Chart{ + ID: "ap_%s_%s_signal", + Title: "Average Signal", + Units: "dBm", + Fam: "signal", + Ctx: "ap.signal", + Type: module.Line, + Priority: prioSignal, + Dims: module.Dims{ + {ID: "ap_%s_%s_average_signal", Name: "average signal", Div: precision}, + }, + } + + apBitrateChartTmpl = module.Chart{ + ID: "ap_%s_%s_bitrate", + Title: "Bitrate", + Units: "Mbps", + Fam: "bitrate", + Ctx: "ap.bitrate", + Type: module.Line, + Priority: prioBitrate, + Dims: module.Dims{ + {ID: "ap_%s_%s_bitrate_receive", Name: "receive", Div: precision}, + {ID: "ap_%s_%s_bitrate_transmit", Name: "transmit", Mul: -1, Div: precision}, + }, + } +) + +func (a *AP) addInterfaceCharts(dev *iwInterface) { + charts := apChartsTmpl.Copy() + + for _, chart := range *charts { + chart.ID = fmt.Sprintf(chart.ID, dev.name, cleanSSID(dev.ssid)) + chart.Labels = []module.Label{ + {Key: "device", Value: dev.name}, + {Key: "ssid", Value: dev.ssid}, + } + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf(dim.ID, dev.name, dev.ssid) + } + } + + if err := a.Charts().Add(*charts...); err != nil { + a.Warning(err) + } + +} + +func (a *AP) removeInterfaceCharts(dev *iwInterface) { + px := fmt.Sprintf("ap_%s_%s_", dev.name, cleanSSID(dev.ssid)) + for _, chart := range *a.Charts() { + if strings.HasPrefix(chart.ID, px) { + chart.MarkRemove() + chart.MarkNotCreated() + } + } +} + +func cleanSSID(ssid string) string { + r := strings.NewReplacer(" ", "_", ".", "_") + return r.Replace(ssid) +} diff --git a/src/go/plugin/go.d/modules/ap/collect.go b/src/go/plugin/go.d/modules/ap/collect.go new file mode 100644 index 00000000..ba32f3ef --- /dev/null +++ b/src/go/plugin/go.d/modules/ap/collect.go @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package ap + +import ( + "bufio" + "bytes" + "errors" + "fmt" + "strconv" + "strings" +) + +const precision = 1000 + +type iwInterface struct { + name string + ssid string + typ string +} + +type stationStats struct { + clients int64 + rxBytes int64 + rxPackets int64 + txBytes int64 + txPackets int64 + txRetries int64 + txFailed int64 + signalAvg int64 + txBitrate float64 + rxBitrate float64 +} + +func (a *AP) collect() (map[string]int64, error) { + bs, err := a.exec.devices() + if err != nil { + return nil, err + } + + // TODO: call this periodically, not on every data collection + apInterfaces, err := parseIwDevices(bs) + if err != nil { + return nil, fmt.Errorf("parsing AP interfaces: %v", err) + } + + if len(apInterfaces) == 0 { + return nil, errors.New("no type AP interfaces found") + } + + mx := make(map[string]int64) + seen := make(map[string]bool) + + for _, iface := range apInterfaces { + bs, err = a.exec.stationStatistics(iface.name) + if err != nil { + return nil, fmt.Errorf("getting station statistics for %s: %v", iface, err) + } + + stats, err := parseIwStationStatistics(bs) + if err != nil { + return nil, fmt.Errorf("parsing station statistics for %s: %v", iface, err) + } + + key := fmt.Sprintf("%s-%s", iface.name, iface.ssid) + + seen[key] = true + + if _, ok := a.seenIfaces[key]; !ok { + a.seenIfaces[key] = iface + a.addInterfaceCharts(iface) + } + + px := fmt.Sprintf("ap_%s_%s_", iface.name, iface.ssid) + + mx[px+"clients"] = stats.clients + mx[px+"bw_received"] = stats.rxBytes + mx[px+"bw_sent"] = stats.txBytes + mx[px+"packets_received"] = stats.rxPackets + mx[px+"packets_sent"] = stats.txPackets + mx[px+"issues_retries"] = stats.txRetries + mx[px+"issues_failures"] = stats.txFailed + mx[px+"average_signal"], mx[px+"bitrate_receive"], mx[px+"bitrate_transmit"] = 0, 0, 0 + if clients := float64(stats.clients); clients > 0 { + mx[px+"average_signal"] = int64(float64(stats.signalAvg) / clients * precision) + mx[px+"bitrate_receive"] = int64(stats.rxBitrate / clients * precision) + mx[px+"bitrate_transmit"] = int64(stats.txBitrate / clients * precision) + } + } + + for key, iface := range a.seenIfaces { + if !seen[key] { + delete(a.seenIfaces, key) + a.removeInterfaceCharts(iface) + } + } + + return mx, nil +} + +func parseIwDevices(resp []byte) ([]*iwInterface, error) { + ifaces := make(map[string]*iwInterface) + var iface *iwInterface + + sc := bufio.NewScanner(bytes.NewReader(resp)) + + for sc.Scan() { + line := strings.TrimSpace(sc.Text()) + + switch { + case strings.HasPrefix(line, "Interface"): + parts := strings.Fields(line) + if len(parts) != 2 { + return nil, fmt.Errorf("invalid interface line: '%s'", line) + } + name := parts[1] + if _, ok := ifaces[name]; !ok { + iface = &iwInterface{name: name} + ifaces[name] = iface + } + case strings.HasPrefix(line, "ssid") && iface != nil: + parts := strings.Fields(line) + if len(parts) != 2 { + return nil, fmt.Errorf("invalid ssid line: '%s'", line) + } + iface.ssid = parts[1] + case strings.HasPrefix(line, "type") && iface != nil: + parts := strings.Fields(line) + if len(parts) != 2 { + return nil, fmt.Errorf("invalid type line: '%s'", line) + } + iface.typ = parts[1] + } + } + + var apIfaces []*iwInterface + + for _, iface := range ifaces { + if strings.ToLower(iface.typ) == "ap" { + apIfaces = append(apIfaces, iface) + } + } + + return apIfaces, nil +} + +func parseIwStationStatistics(resp []byte) (*stationStats, error) { + var stats stationStats + + sc := bufio.NewScanner(bytes.NewReader(resp)) + + for sc.Scan() { + line := strings.TrimSpace(sc.Text()) + + var v float64 + var err error + + switch { + case strings.HasPrefix(line, "Station"): + stats.clients++ + case strings.HasPrefix(line, "rx bytes:"): + if v, err = get3rdValue(line); err == nil { + stats.rxBytes += int64(v) + } + case strings.HasPrefix(line, "rx packets:"): + if v, err = get3rdValue(line); err == nil { + stats.rxPackets += int64(v) + } + case strings.HasPrefix(line, "tx bytes:"): + if v, err = get3rdValue(line); err == nil { + stats.txBytes += int64(v) + } + case strings.HasPrefix(line, "tx packets:"): + if v, err = get3rdValue(line); err == nil { + stats.txPackets += int64(v) + } + case strings.HasPrefix(line, "tx retries:"): + if v, err = get3rdValue(line); err == nil { + stats.txRetries += int64(v) + } + case strings.HasPrefix(line, "tx failed:"): + if v, err = get3rdValue(line); err == nil { + stats.txFailed += int64(v) + } + case strings.HasPrefix(line, "signal avg:"): + if v, err = get3rdValue(line); err == nil { + stats.signalAvg += int64(v) + } + case strings.HasPrefix(line, "tx bitrate:"): + if v, err = get3rdValue(line); err == nil { + stats.txBitrate += v + } + case strings.HasPrefix(line, "rx bitrate:"): + if v, err = get3rdValue(line); err == nil { + stats.rxBitrate += v + } + default: + continue + } + + if err != nil { + return nil, fmt.Errorf("parsing line '%s': %v", line, err) + } + } + + return &stats, nil +} + +func get3rdValue(line string) (float64, error) { + parts := strings.Fields(line) + if len(parts) < 3 { + return 0.0, errors.New("invalid format") + } + + v := parts[2] + + if v == "-" { + return 0.0, nil + } + return strconv.ParseFloat(v, 64) +} diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/config_schema.json b/src/go/plugin/go.d/modules/ap/config_schema.json index 0f4bb5a6..4566247f 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/config_schema.json +++ b/src/go/plugin/go.d/modules/ap/config_schema.json @@ -1,7 +1,7 @@ { "jsonSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "NVIDIA SMI collector configuration.", + "title": "Access Point collector configuration.", "type": "object", "properties": { "update_every": { @@ -13,22 +13,16 @@ }, "binary_path": { "title": "Binary path", - "description": "Path to the `nvidia-smi` binary.", + "description": "Path to the `iw` binary.", "type": "string", - "default": "nvidia-smi" + "default": "/usr/sbin/iw" }, "timeout": { "title": "Timeout", "description": "Timeout for executing the binary, specified in seconds.", "type": "number", "minimum": 0.5, - "default": 10 - }, - "use_csv_format": { - "title": "Use CSV format", - "description": "Determines the format used for requesting GPU information. If set, CSV format is used, otherwise XML.", - "type": "boolean", - "default": false + "default": 2 } }, "required": [ @@ -50,4 +44,4 @@ "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." } } -} +}
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/ap/exec.go b/src/go/plugin/go.d/modules/ap/exec.go new file mode 100644 index 00000000..8c25f677 --- /dev/null +++ b/src/go/plugin/go.d/modules/ap/exec.go @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package ap + +import ( + "context" + "fmt" + "os/exec" + "time" + + "github.com/netdata/netdata/go/plugins/logger" +) + +func newIwExec(binPath string, timeout time.Duration) *iwCliExec { + return &iwCliExec{ + binPath: binPath, + timeout: timeout, + } +} + +type iwCliExec struct { + *logger.Logger + + binPath string + timeout time.Duration +} + +func (e *iwCliExec) devices() ([]byte, error) { + ctx, cancel := context.WithTimeout(context.Background(), e.timeout) + defer cancel() + + cmd := exec.CommandContext(ctx, e.binPath, "dev") + e.Debugf("executing '%s'", cmd) + + bs, err := cmd.Output() + if err != nil { + return nil, fmt.Errorf("error on '%s': %v", cmd, err) + } + + return bs, nil +} + +func (e *iwCliExec) stationStatistics(ifaceName string) ([]byte, error) { + ctx, cancel := context.WithTimeout(context.Background(), e.timeout) + defer cancel() + + cmd := exec.CommandContext(ctx, e.binPath, ifaceName, "station", "dump") + e.Debugf("executing '%s'", cmd) + + bs, err := cmd.Output() + if err != nil { + return nil, fmt.Errorf("error on '%s': %v", cmd, err) + } + + return bs, nil +} diff --git a/src/go/plugin/go.d/modules/ap/init.go b/src/go/plugin/go.d/modules/ap/init.go new file mode 100644 index 00000000..6031f6ca --- /dev/null +++ b/src/go/plugin/go.d/modules/ap/init.go @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package ap + +import ( + "errors" + "os" + "os/exec" + "strings" +) + +func (a *AP) validateConfig() error { + if a.BinaryPath == "" { + return errors.New("no iw binary path specified") + } + return nil +} + +func (a *AP) initIwExec() (iwBinary, error) { + binPath := a.BinaryPath + + if !strings.HasPrefix(binPath, "/") { + path, err := exec.LookPath(binPath) + if err != nil { + return nil, err + } + binPath = path + } + + if _, err := os.Stat(binPath); err != nil { + return nil, err + } + + iw := newIwExec(binPath, a.Timeout.Duration()) + + return iw, nil +} diff --git a/src/go/plugin/go.d/modules/ap/integrations/access_points.md b/src/go/plugin/go.d/modules/ap/integrations/access_points.md new file mode 100644 index 00000000..fa2134ed --- /dev/null +++ b/src/go/plugin/go.d/modules/ap/integrations/access_points.md @@ -0,0 +1,202 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/ap/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/ap/metadata.yaml" +sidebar_label: "Access Points" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Linux Systems/Network" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Access Points + + +<img src="https://netdata.cloud/img/network-wired.svg" width="150"/> + + +Plugin: go.d.plugin +Module: ap + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +This collector monitors various wireless access point metrics like connected clients, bandwidth, packets, transmit issues, signal strength, and bitrate for each device and its associated SSID. + + +This tool uses the `iw` command-line utility to discover nearby access points. It starts by running `iw dev`, which provides information about all wireless interfaces. Then, for each interface identified as an access point (type AP), the `iw INTERFACE station dump` command is executed to gather relevant metrics. + + +This collector is only supported on the following platforms: + +- Linux + +This collector only supports collecting metrics from a single instance of this integration. + + +### Default Behavior + +#### Auto-Detection + +The plugin is able to auto-detect any access points on your Linux machine. + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per wireless device + +These metrics refer to the entire monitored application. + +Labels: + +| Label | Description | +|:-----------|:----------------| +| device | Wireless interface name | +| ssid | SSID | + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| ap.clients | clients | clients | +| ap.net | received, sent | kilobits/s | +| ap.packets | received, sent | packets/s | +| ap.issues | retries, failures | issues/s | +| ap.signal | average signal | dBm | +| ap.bitrate | receive, transmit | Mbps | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +#### `iw` utility. + +Make sure the `iw` utility is installed. + + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/ap.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/ap.conf +``` +#### Options + +The following options can be defined globally: update_every. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 10 | no | +| binary_path | Path to the `iw` binary. If an absolute path is provided, the collector will use it directly; otherwise, it will search for the binary in directories specified in the PATH environment variable. | /usr/sbin/iw | yes | +| timeout | Timeout for executing the binary, specified in seconds. | 2 | no | + +</details> + +#### Examples + +##### Custom binary path + +The executable is not in the directories specified in the PATH environment variable. + +```yaml +jobs: + - name: custom_iw + binary_path: /usr/local/sbin/iw + +``` + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `ap` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m ap + ``` + +### Getting Logs + +If you're encountering problems with the `ap` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep ap +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep ap /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep ap +``` + + diff --git a/src/go/plugin/go.d/modules/ap/metadata.yaml b/src/go/plugin/go.d/modules/ap/metadata.yaml new file mode 100644 index 00000000..848684d3 --- /dev/null +++ b/src/go/plugin/go.d/modules/ap/metadata.yaml @@ -0,0 +1,141 @@ +plugin_name: go.d.plugin +modules: + - meta: + plugin_name: go.d.plugin + module_name: ap + monitored_instance: + name: Access Points + link: "" + categories: + - data-collection.linux-systems.network-metrics + icon_filename: "network-wired.svg" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - ap + - access + - point + - wireless + - network + most_popular: false + overview: + data_collection: + metrics_description: | + This collector monitors various wireless access point metrics like connected clients, bandwidth, packets, transmit issues, signal strength, and bitrate for each device and its associated SSID. + method_description: > + This tool uses the `iw` command-line utility to discover nearby access points. + It starts by running `iw dev`, which provides information about all wireless interfaces. + Then, for each interface identified as an access point (type AP), the `iw INTERFACE station dump` command is executed to gather relevant metrics. + supported_platforms: + include: [Linux] + exclude: [] + multi_instance: false + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: "The plugin is able to auto-detect any access points on your Linux machine." + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: + - title: "`iw` utility." + description: "Make sure the `iw` utility is installed." + configuration: + file: + name: go.d/ap.conf + options: + description: | + The following options can be defined globally: update_every. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 10 + required: false + - name: binary_path + description: Path to the `iw` binary. If an absolute path is provided, the collector will use it directly; otherwise, it will search for the binary in directories specified in the PATH environment variable. + default_value: /usr/sbin/iw + required: true + - name: timeout + description: Timeout for executing the binary, specified in seconds. + default_value: 2 + required: false + examples: + folding: + title: "" + enabled: false + list: + - name: Custom binary path + description: The executable is not in the directories specified in the PATH environment variable. + config: | + jobs: + - name: custom_iw + binary_path: /usr/local/sbin/iw + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: wireless device + description: "These metrics refer to the entire monitored application." + labels: + - name: device + description: Wireless interface name + - name: ssid + description: SSID + metrics: + - name: ap.clients + description: Connected clients + unit: "clients" + chart_type: line + dimensions: + - name: clients + - name: ap.net + description: Bandwidth + unit: "kilobits/s" + chart_type: area + dimensions: + - name: received + - name: sent + - name: ap.packets + description: Packets + unit: "packets/s" + chart_type: line + dimensions: + - name: received + - name: sent + - name: ap.issues + description: Transmit Issues + unit: "issues/s" + chart_type: line + dimensions: + - name: retries + - name: failures + - name: ap.signal + description: Average Signal + unit: "dBm" + chart_type: line + dimensions: + - name: average signal + - name: ap.bitrate + description: Bitrate + unit: "Mbps" + chart_type: line + dimensions: + - name: receive + - name: transmit diff --git a/src/go/collectors/go.d.plugin/modules/sensors/testdata/config.json b/src/go/plugin/go.d/modules/ap/testdata/config.json index 09571319..09571319 100644 --- a/src/go/collectors/go.d.plugin/modules/sensors/testdata/config.json +++ b/src/go/plugin/go.d/modules/ap/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/sensors/testdata/config.yaml b/src/go/plugin/go.d/modules/ap/testdata/config.yaml index baf3bcd0..baf3bcd0 100644 --- a/src/go/collectors/go.d.plugin/modules/sensors/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/ap/testdata/config.yaml diff --git a/src/go/plugin/go.d/modules/ap/testdata/iw_dev_ap.txt b/src/go/plugin/go.d/modules/ap/testdata/iw_dev_ap.txt new file mode 100644 index 00000000..0b1e4077 --- /dev/null +++ b/src/go/plugin/go.d/modules/ap/testdata/iw_dev_ap.txt @@ -0,0 +1,25 @@ +phy#0 + Interface wlp1s0 + ifindex 2 + wdev 0x1 + addr 28:cd:c4:b8:63:cb + ssid testing + type AP + channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz + txpower 20.00 dBm + multicast TXQ: + qsz-byt qsz-pkt flows drops marks overlmt hashcol tx-bytes tx-packets + 0 0 2 0 0 0 0 16447 226 + +phy#1 + Interface wlp1s1 + ifindex 3 + wdev 0x1 + addr 28:cd:c4:b8:63:cc + ssid testing + type AP + channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz + txpower 20.00 dBm + multicast TXQ: + qsz-byt qsz-pkt flows drops marks overlmt hashcol tx-bytes tx-packets + 0 0 2 0 0 0 0 16447 226 diff --git a/src/go/plugin/go.d/modules/ap/testdata/iw_dev_managed.txt b/src/go/plugin/go.d/modules/ap/testdata/iw_dev_managed.txt new file mode 100644 index 00000000..5bb09a85 --- /dev/null +++ b/src/go/plugin/go.d/modules/ap/testdata/iw_dev_managed.txt @@ -0,0 +1,11 @@ +phy#0 + Interface wlp1s0 + ifindex 2 + wdev 0x1 + addr 28:cd:c4:b8:63:cb + type managed + channel 4 (2427 MHz), width: 20 MHz, center1: 2427 MHz + txpower 20.00 dBm + multicast TXQ: + qsz-byt qsz-pkt flows drops marks overlmt hashcol tx-bytes tx-packets + 0 0 0 0 0 0 0 0 0 diff --git a/src/go/plugin/go.d/modules/ap/testdata/station_dump.txt b/src/go/plugin/go.d/modules/ap/testdata/station_dump.txt new file mode 100644 index 00000000..683a6818 --- /dev/null +++ b/src/go/plugin/go.d/modules/ap/testdata/station_dump.txt @@ -0,0 +1,58 @@ +Station 7e:0d:a5:a6:91:2b (on wlp1s0) + inactive time: 58264 ms + rx bytes: 89675 + rx packets: 2446 + tx bytes: 6918 + tx packets: 30 + tx retries: 1 + tx failed: 1 + rx drop misc: 0 + signal: -44 [-51, -44] dBm + signal avg: -38 [-39, -39] dBm + tx bitrate: 65.0 MBit/s MCS 7 + tx duration: 0 us + rx bitrate: 130.0 MBit/s MCS 15 + rx duration: 0 us + authorized: yes + authenticated: yes + associated: yes + preamble: short + WMM/WME: yes + MFP: no + TDLS peer: no + DTIM period: 2 + beacon interval:100 + short slot time:yes + connected time: 796 seconds + associated at [boottime]: 12650.576s + associated at: 1720705279930 ms + current time: 1720706075344 ms +Station fa:50:db:c1:1c:18 (on wlp1s0) + inactive time: 93 ms + rx bytes: 5442 + rx packets: 85 + tx bytes: 1352 + tx packets: 8 + tx retries: 0 + tx failed: 0 + rx drop misc: 0 + signal: -31 [-31, -39] dBm + signal avg: -30 [-30, -38] dBm + tx bitrate: 65.0 MBit/s MCS 7 + tx duration: 0 us + rx bitrate: 1.0 MBit/s + rx duration: 0 us + authorized: yes + authenticated: yes + associated: yes + preamble: short + WMM/WME: yes + MFP: no + TDLS peer: no + DTIM period: 2 + beacon interval:100 + short slot time:yes + connected time: 6 seconds + associated at [boottime]: 13440.167s + associated at: 1720706069520 ms + current time: 1720706075344 ms diff --git a/src/go/collectors/go.d.plugin/modules/apache/README.md b/src/go/plugin/go.d/modules/apache/README.md index 066ee416..066ee416 120000 --- a/src/go/collectors/go.d.plugin/modules/apache/README.md +++ b/src/go/plugin/go.d/modules/apache/README.md diff --git a/src/go/collectors/go.d.plugin/modules/apache/apache.go b/src/go/plugin/go.d/modules/apache/apache.go index 2c958ecf..d0869353 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/apache.go +++ b/src/go/plugin/go.d/modules/apache/apache.go @@ -9,8 +9,8 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/apache/apache_test.go b/src/go/plugin/go.d/modules/apache/apache_test.go index 02e97ff1..64fa6ed9 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/apache_test.go +++ b/src/go/plugin/go.d/modules/apache/apache_test.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/apache/charts.go b/src/go/plugin/go.d/modules/apache/charts.go index 5470aeca..ad83112d 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/charts.go +++ b/src/go/plugin/go.d/modules/apache/charts.go @@ -2,7 +2,7 @@ package apache -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" const ( prioRequests = module.Priority + iota diff --git a/src/go/collectors/go.d.plugin/modules/apache/collect.go b/src/go/plugin/go.d/modules/apache/collect.go index 52bad9fd..79de7722 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/collect.go +++ b/src/go/plugin/go.d/modules/apache/collect.go @@ -10,8 +10,8 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (a *Apache) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/apache/config_schema.json b/src/go/plugin/go.d/modules/apache/config_schema.json index 94e30202..b92363e9 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/config_schema.json +++ b/src/go/plugin/go.d/modules/apache/config_schema.json @@ -123,6 +123,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/apache/init.go b/src/go/plugin/go.d/modules/apache/init.go index 00fc9d7e..e13186f0 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/init.go +++ b/src/go/plugin/go.d/modules/apache/init.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (a *Apache) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/apache/integrations/apache.md b/src/go/plugin/go.d/modules/apache/integrations/apache.md index 6b46ffbe..ec9f8888 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/integrations/apache.md +++ b/src/go/plugin/go.d/modules/apache/integrations/apache.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/apache/integrations/apache.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/apache/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/apache/integrations/apache.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/apache/metadata.yaml" sidebar_label: "Apache" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -213,6 +213,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `apache` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -235,4 +237,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m apache ``` +### Getting Logs + +If you're encountering problems with the `apache` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep apache +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep apache /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep apache +``` + diff --git a/src/go/collectors/go.d.plugin/modules/apache/integrations/httpd.md b/src/go/plugin/go.d/modules/apache/integrations/httpd.md index 000d9b60..25836518 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/integrations/httpd.md +++ b/src/go/plugin/go.d/modules/apache/integrations/httpd.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/apache/integrations/httpd.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/apache/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/apache/integrations/httpd.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/apache/metadata.yaml" sidebar_label: "HTTPD" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -213,6 +213,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `apache` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -235,4 +237,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m apache ``` +### Getting Logs + +If you're encountering problems with the `apache` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep apache +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep apache /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep apache +``` + diff --git a/src/go/collectors/go.d.plugin/modules/apache/metadata.yaml b/src/go/plugin/go.d/modules/apache/metadata.yaml index bfab73fc..bfab73fc 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/metadata.yaml +++ b/src/go/plugin/go.d/modules/apache/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/apache/metrics.go b/src/go/plugin/go.d/modules/apache/metrics.go index 953bd42c..953bd42c 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/metrics.go +++ b/src/go/plugin/go.d/modules/apache/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/apache/testdata/config.json b/src/go/plugin/go.d/modules/apache/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/testdata/config.json +++ b/src/go/plugin/go.d/modules/apache/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/apache/testdata/config.yaml b/src/go/plugin/go.d/modules/apache/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/apache/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/apache/testdata/extended-status-mpm-event.txt b/src/go/plugin/go.d/modules/apache/testdata/extended-status-mpm-event.txt index 136b6936..136b6936 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/testdata/extended-status-mpm-event.txt +++ b/src/go/plugin/go.d/modules/apache/testdata/extended-status-mpm-event.txt diff --git a/src/go/collectors/go.d.plugin/modules/apache/testdata/extended-status-mpm-prefork.txt b/src/go/plugin/go.d/modules/apache/testdata/extended-status-mpm-prefork.txt index eeafb498..eeafb498 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/testdata/extended-status-mpm-prefork.txt +++ b/src/go/plugin/go.d/modules/apache/testdata/extended-status-mpm-prefork.txt diff --git a/src/go/collectors/go.d.plugin/modules/apache/testdata/lighttpd-status.txt b/src/go/plugin/go.d/modules/apache/testdata/lighttpd-status.txt index 07d8e06e..07d8e06e 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/testdata/lighttpd-status.txt +++ b/src/go/plugin/go.d/modules/apache/testdata/lighttpd-status.txt diff --git a/src/go/collectors/go.d.plugin/modules/apache/testdata/simple-status-mpm-event.txt b/src/go/plugin/go.d/modules/apache/testdata/simple-status-mpm-event.txt index 8093eacf..8093eacf 100644 --- a/src/go/collectors/go.d.plugin/modules/apache/testdata/simple-status-mpm-event.txt +++ b/src/go/plugin/go.d/modules/apache/testdata/simple-status-mpm-event.txt diff --git a/src/go/plugin/go.d/modules/beanstalk/README.md b/src/go/plugin/go.d/modules/beanstalk/README.md new file mode 120000 index 00000000..4efe1388 --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/README.md @@ -0,0 +1 @@ +integrations/beanstalk.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/beanstalk/beanstalk.go b/src/go/plugin/go.d/modules/beanstalk/beanstalk.go new file mode 100644 index 00000000..f37cbeda --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/beanstalk.go @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package beanstalk + +import ( + _ "embed" + "errors" + "fmt" + "time" + + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("beanstalk", module.Creator{ + JobConfigSchema: configSchema, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Beanstalk { + return &Beanstalk{ + Config: Config{ + Address: "127.0.0.1:11300", + Timeout: web.Duration(time.Second * 1), + TubeSelector: "*", + }, + + charts: statsCharts.Copy(), + newConn: newBeanstalkConn, + discoverTubesEvery: time.Minute * 1, + tubeSr: matcher.TRUE(), + seenTubes: make(map[string]bool), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Address string `yaml:"address" json:"address"` + Timeout web.Duration `yaml:"timeout,omitempty" json:"timeout"` + TubeSelector string `yaml:"tube_selector,omitempty" json:"tube_selector"` +} + +type Beanstalk struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + newConn func(Config, *logger.Logger) beanstalkConn + conn beanstalkConn + + discoverTubesEvery time.Duration + lastDiscoverTubesTime time.Time + discoveredTubes []string + tubeSr matcher.Matcher + seenTubes map[string]bool +} + +func (b *Beanstalk) Configuration() any { + return b.Config +} + +func (b *Beanstalk) Init() error { + if err := b.validateConfig(); err != nil { + return fmt.Errorf("config validation: %v", err) + } + + sr, err := b.initTubeSelector() + if err != nil { + return fmt.Errorf("failed to init tube selector: %v", err) + } + b.tubeSr = sr + + return nil +} + +func (b *Beanstalk) Check() error { + mx, err := b.collect() + if err != nil { + b.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (b *Beanstalk) Charts() *module.Charts { + return b.charts +} + +func (b *Beanstalk) Collect() map[string]int64 { + mx, err := b.collect() + if err != nil { + b.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (b *Beanstalk) Cleanup() { + if b.conn != nil { + if err := b.conn.disconnect(); err != nil { + b.Warningf("error on disconnect: %s", err) + } + b.conn = nil + } +} diff --git a/src/go/plugin/go.d/modules/beanstalk/beanstalk_test.go b/src/go/plugin/go.d/modules/beanstalk/beanstalk_test.go new file mode 100644 index 00000000..da1fcaf0 --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/beanstalk_test.go @@ -0,0 +1,384 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package beanstalk + +import ( + "bufio" + "errors" + "fmt" + "net" + "os" + "strings" + "testing" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataStats, _ = os.ReadFile("testdata/stats.txt") + dataListTubes, _ = os.ReadFile("testdata/list-tubes.txt") + dataStatsTubeDefault, _ = os.ReadFile("testdata/stats-tube-default.txt") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + "dataStats": dataStats, + "dataListTubes": dataListTubes, + "dataStatsTubeDefault": dataStatsTubeDefault, + } { + require.NotNil(t, data, name) + } +} + +func TestBeanstalk_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &Beanstalk{}, dataConfigJSON, dataConfigYAML) +} + +func TestBeanstalk_Init(t *testing.T) { + tests := map[string]struct { + config Config + wantFail bool + }{ + "success with default config": { + wantFail: false, + config: New().Config, + }, + "fails if address not set": { + wantFail: true, + config: func() Config { + conf := New().Config + conf.Address = "" + return conf + }(), + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + beans := New() + beans.Config = test.config + + if test.wantFail { + assert.Error(t, beans.Init()) + } else { + assert.NoError(t, beans.Init()) + } + }) + } +} + +func TestBeanstalk_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestBeanstalk_Check(t *testing.T) { + tests := map[string]struct { + prepare func() (*Beanstalk, *mockBeanstalkDaemon) + wantFail bool + }{ + "success on valid response": { + wantFail: false, + prepare: prepareCaseOk, + }, + "fails on unexpected response": { + wantFail: true, + prepare: prepareCaseUnexpectedResponse, + }, + "fails on connection refused": { + wantFail: true, + prepare: prepareCaseConnectionRefused, + }, + } + for name, test := range tests { + t.Run(name, func(t *testing.T) { + beanstalk, daemon := test.prepare() + + defer func() { + assert.NoError(t, daemon.Close(), "daemon.Close()") + }() + go func() { + assert.NoError(t, daemon.Run(), "daemon.Run()") + }() + + select { + case <-daemon.started: + case <-time.After(time.Second * 3): + t.Errorf("mock beanstalk daemon start timed out") + } + + require.NoError(t, beanstalk.Init()) + + if test.wantFail { + assert.Error(t, beanstalk.Check()) + } else { + assert.NoError(t, beanstalk.Check()) + } + + beanstalk.Cleanup() + + select { + case <-daemon.stopped: + case <-time.After(time.Second * 3): + t.Errorf("mock beanstalk daemon stop timed out") + } + }) + } +} + +func TestBeanstalk_Collect(t *testing.T) { + tests := map[string]struct { + prepare func() (*Beanstalk, *mockBeanstalkDaemon) + wantMetrics map[string]int64 + wantCharts int + }{ + "success on valid response": { + prepare: prepareCaseOk, + wantMetrics: map[string]int64{ + "binlog-records-migrated": 0, + "binlog-records-written": 0, + "cmd-bury": 0, + "cmd-delete": 0, + "cmd-ignore": 0, + "cmd-kick": 0, + "cmd-list-tube-used": 0, + "cmd-list-tubes": 317, + "cmd-list-tubes-watched": 0, + "cmd-pause-tube": 0, + "cmd-peek": 0, + "cmd-peek-buried": 0, + "cmd-peek-delayed": 0, + "cmd-peek-ready": 0, + "cmd-put": 0, + "cmd-release": 0, + "cmd-reserve": 0, + "cmd-reserve-with-timeout": 0, + "cmd-stats": 23619, + "cmd-stats-job": 0, + "cmd-stats-tube": 18964, + "cmd-touch": 0, + "cmd-use": 0, + "cmd-watch": 0, + "current-connections": 2, + "current-jobs-buried": 0, + "current-jobs-delayed": 0, + "current-jobs-ready": 0, + "current-jobs-reserved": 0, + "current-jobs-urgent": 0, + "current-producers": 0, + "current-tubes": 1, + "current-waiting": 0, + "current-workers": 0, + "job-timeouts": 0, + "rusage-stime": 3922, + "rusage-utime": 1602, + "total-connections": 72, + "total-jobs": 0, + "tube_default_cmd-delete": 0, + "tube_default_cmd-pause-tube": 0, + "tube_default_current-jobs-buried": 0, + "tube_default_current-jobs-delayed": 0, + "tube_default_current-jobs-ready": 0, + "tube_default_current-jobs-reserved": 0, + "tube_default_current-jobs-urgent": 0, + "tube_default_current-using": 2, + "tube_default_current-waiting": 0, + "tube_default_current-watching": 2, + "tube_default_pause": 0, + "tube_default_pause-time-left": 0, + "tube_default_total-jobs": 0, + "uptime": 105881, + }, + wantCharts: len(statsCharts) + len(tubeChartsTmpl)*1, + }, + "fails on unexpected response": { + prepare: prepareCaseUnexpectedResponse, + wantCharts: len(statsCharts), + }, + "fails on connection refused": { + prepare: prepareCaseConnectionRefused, + wantCharts: len(statsCharts), + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + beanstalk, daemon := test.prepare() + + defer func() { + assert.NoError(t, daemon.Close(), "daemon.Close()") + }() + go func() { + assert.NoError(t, daemon.Run(), "daemon.Run()") + }() + + select { + case <-daemon.started: + case <-time.After(time.Second * 3): + t.Errorf("mock beanstalk daemon start timed out") + } + + require.NoError(t, beanstalk.Init()) + + mx := beanstalk.Collect() + + require.Equal(t, test.wantMetrics, mx) + + assert.Equal(t, test.wantCharts, len(*beanstalk.Charts()), "want charts") + + if len(test.wantMetrics) > 0 { + module.TestMetricsHasAllChartsDims(t, beanstalk.Charts(), mx) + } + + beanstalk.Cleanup() + + select { + case <-daemon.stopped: + case <-time.After(time.Second * 3): + t.Errorf("mock beanstalk daemon stop timed out") + } + }) + } +} + +func prepareCaseOk() (*Beanstalk, *mockBeanstalkDaemon) { + daemon := &mockBeanstalkDaemon{ + addr: "127.0.0.1:65001", + started: make(chan struct{}), + stopped: make(chan struct{}), + dataStats: dataStats, + dataListTubes: dataListTubes, + dataStatsTube: dataStatsTubeDefault, + } + + beanstalk := New() + beanstalk.Address = daemon.addr + + return beanstalk, daemon +} + +func prepareCaseUnexpectedResponse() (*Beanstalk, *mockBeanstalkDaemon) { + daemon := &mockBeanstalkDaemon{ + addr: "127.0.0.1:65001", + started: make(chan struct{}), + stopped: make(chan struct{}), + dataStats: []byte("INTERNAL_ERROR\n"), + dataListTubes: []byte("INTERNAL_ERROR\n"), + dataStatsTube: []byte("INTERNAL_ERROR\n"), + } + + beanstalk := New() + beanstalk.Address = daemon.addr + + return beanstalk, daemon +} + +func prepareCaseConnectionRefused() (*Beanstalk, *mockBeanstalkDaemon) { + ch := make(chan struct{}) + close(ch) + daemon := &mockBeanstalkDaemon{ + addr: "127.0.0.1:65001", + dontStart: true, + started: ch, + stopped: ch, + } + + beanstalk := New() + beanstalk.Address = daemon.addr + + return beanstalk, daemon +} + +type mockBeanstalkDaemon struct { + addr string + srv net.Listener + started chan struct{} + stopped chan struct{} + dontStart bool + + dataStats []byte + dataListTubes []byte + dataStatsTube []byte +} + +func (m *mockBeanstalkDaemon) Run() error { + if m.dontStart { + return nil + } + + srv, err := net.Listen("tcp", m.addr) + if err != nil { + return err + } + + m.srv = srv + + close(m.started) + defer close(m.stopped) + + return m.handleConnections() +} + +func (m *mockBeanstalkDaemon) Close() error { + if m.srv != nil { + err := m.srv.Close() + m.srv = nil + return err + } + return nil +} + +func (m *mockBeanstalkDaemon) handleConnections() error { + conn, err := m.srv.Accept() + if err != nil || conn == nil { + return errors.New("could not accept connection") + } + return m.handleConnection(conn) +} + +func (m *mockBeanstalkDaemon) handleConnection(conn net.Conn) error { + defer func() { _ = conn.Close() }() + + rw := bufio.NewReadWriter(bufio.NewReader(conn), bufio.NewWriter(conn)) + var line string + var err error + + for { + if line, err = rw.ReadString('\n'); err != nil { + return fmt.Errorf("error reading from connection: %v", err) + } + + line = strings.TrimSpace(line) + + cmd, param, _ := strings.Cut(line, " ") + + switch cmd { + case cmdQuit: + return nil + case cmdStats: + _, err = rw.Write(m.dataStats) + case cmdListTubes: + _, err = rw.Write(m.dataListTubes) + case cmdStatsTube: + if param == "default" { + _, err = rw.Write(m.dataStatsTube) + } else { + _, err = rw.WriteString("NOT_FOUND\n") + } + default: + return fmt.Errorf("unexpected command: %s", line) + } + _ = rw.Flush() + if err != nil { + return err + } + } +} diff --git a/src/go/plugin/go.d/modules/beanstalk/charts.go b/src/go/plugin/go.d/modules/beanstalk/charts.go new file mode 100644 index 00000000..fb2f2262 --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/charts.go @@ -0,0 +1,333 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package beanstalk + +import ( + "fmt" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioCurrentJobs = module.Priority + iota + prioJobsRate + prioJobsTimeouts + + prioCurrentTubes + + prioCommandsRate + + prioCurrentConnections + prioConnectionsRate + + prioBinlogRecords + + prioCpuUsage + + prioUptime + + prioTubeCurrentJobs + prioTubeJobsRate + + prioTubeCommands + + prioTubeCurrentConnections + + prioTubePauseTime +) + +var ( + statsCharts = module.Charts{ + currentJobs.Copy(), + jobsRateChart.Copy(), + jobsTimeoutsChart.Copy(), + + currentTubesChart.Copy(), + + commandsRateChart.Copy(), + + currentConnectionsChart.Copy(), + connectionsRateChart.Copy(), + + binlogRecordsChart.Copy(), + + cpuUsageChart.Copy(), + + uptimeChart.Copy(), + } + + currentJobs = module.Chart{ + ID: "current_jobs", + Title: "Current Jobs", + Units: "jobs", + Fam: "jobs", + Ctx: "beanstalk.current_jobs", + Type: module.Stacked, + Priority: prioCurrentJobs, + Dims: module.Dims{ + {ID: "current-jobs-ready", Name: "ready"}, + {ID: "current-jobs-buried", Name: "buried"}, + {ID: "current-jobs-urgent", Name: "urgent"}, + {ID: "current-jobs-delayed", Name: "delayed"}, + {ID: "current-jobs-reserved", Name: "reserved"}, + }, + } + jobsRateChart = module.Chart{ + ID: "jobs_rate", + Title: "Jobs Rate", + Units: "jobs/s", + Fam: "jobs", + Ctx: "beanstalk.jobs_rate", + Type: module.Line, + Priority: prioJobsRate, + Dims: module.Dims{ + {ID: "total-jobs", Name: "created", Algo: module.Incremental}, + }, + } + jobsTimeoutsChart = module.Chart{ + ID: "jobs_timeouts", + Title: "Timed Out Jobs", + Units: "jobs/s", + Fam: "jobs", + Ctx: "beanstalk.jobs_timeouts", + Type: module.Line, + Priority: prioJobsTimeouts, + Dims: module.Dims{ + {ID: "job-timeouts", Name: "timeouts", Algo: module.Incremental}, + }, + } + + currentTubesChart = module.Chart{ + ID: "current_tubes", + Title: "Current Tubes", + Units: "tubes", + Fam: "tubes", + Ctx: "beanstalk.current_tubes", + Type: module.Line, + Priority: prioCurrentTubes, + Dims: module.Dims{ + {ID: "current-tubes", Name: "tubes"}, + }, + } + + commandsRateChart = module.Chart{ + ID: "commands_rate", + Title: "Commands Rate", + Units: "commands/s", + Fam: "commands", + Ctx: "beanstalk.commands_rate", + Type: module.Stacked, + Priority: prioCommandsRate, + Dims: module.Dims{ + {ID: "cmd-put", Name: "put", Algo: module.Incremental}, + {ID: "cmd-peek", Name: "peek", Algo: module.Incremental}, + {ID: "cmd-peek-ready", Name: "peek-ready", Algo: module.Incremental}, + {ID: "cmd-peek-delayed", Name: "peek-delayed", Algo: module.Incremental}, + {ID: "cmd-peek-buried", Name: "peek-buried", Algo: module.Incremental}, + {ID: "cmd-reserve", Name: "reserve", Algo: module.Incremental}, + {ID: "cmd-reserve-with-timeout", Name: "reserve-with-timeout", Algo: module.Incremental}, + {ID: "cmd-touch", Name: "touch", Algo: module.Incremental}, + {ID: "cmd-use", Name: "use", Algo: module.Incremental}, + {ID: "cmd-watch", Name: "watch", Algo: module.Incremental}, + {ID: "cmd-ignore", Name: "ignore", Algo: module.Incremental}, + {ID: "cmd-delete", Name: "delete", Algo: module.Incremental}, + {ID: "cmd-release", Name: "release", Algo: module.Incremental}, + {ID: "cmd-bury", Name: "bury", Algo: module.Incremental}, + {ID: "cmd-kick", Name: "kick", Algo: module.Incremental}, + {ID: "cmd-stats", Name: "stats", Algo: module.Incremental}, + {ID: "cmd-stats-job", Name: "stats-job", Algo: module.Incremental}, + {ID: "cmd-stats-tube", Name: "stats-tube", Algo: module.Incremental}, + {ID: "cmd-list-tubes", Name: "list-tubes", Algo: module.Incremental}, + {ID: "cmd-list-tube-used", Name: "list-tube-used", Algo: module.Incremental}, + {ID: "cmd-list-tubes-watched", Name: "list-tubes-watched", Algo: module.Incremental}, + {ID: "cmd-pause-tube", Name: "pause-tube", Algo: module.Incremental}, + }, + } + + currentConnectionsChart = module.Chart{ + ID: "current_connections", + Title: "Current Connections", + Units: "connections", + Fam: "connections", + Ctx: "beanstalk.current_connections", + Type: module.Line, + Priority: prioCurrentConnections, + Dims: module.Dims{ + {ID: "current-connections", Name: "open"}, + {ID: "current-producers", Name: "producers"}, + {ID: "current-workers", Name: "workers"}, + {ID: "current-waiting", Name: "waiting"}, + }, + } + connectionsRateChart = module.Chart{ + ID: "connections_rate", + Title: "Connections Rate", + Units: "connections/s", + Fam: "connections", + Ctx: "beanstalk.connections_rate", + Type: module.Line, + Priority: prioConnectionsRate, + Dims: module.Dims{ + {ID: "total-connections", Name: "created", Algo: module.Incremental}, + }, + } + + binlogRecordsChart = module.Chart{ + ID: "binlog_records", + Title: "Binlog Records", + Units: "records/s", + Fam: "binlog", + Ctx: "beanstalk.binlog_records", + Type: module.Line, + Priority: prioBinlogRecords, + Dims: module.Dims{ + {ID: "binlog-records-written", Name: "written", Algo: module.Incremental}, + {ID: "binlog-records-migrated", Name: "migrated", Algo: module.Incremental}, + }, + } + + cpuUsageChart = module.Chart{ + ID: "cpu_usage", + Title: "CPU Usage", + Units: "percent", + Fam: "cpu usage", + Ctx: "beanstalk.cpu_usage", + Type: module.Stacked, + Priority: prioCpuUsage, + Dims: module.Dims{ + {ID: "rusage-utime", Name: "user", Algo: module.Incremental, Mul: 100, Div: 1000}, + {ID: "rusage-stime", Name: "system", Algo: module.Incremental, Mul: 100, Div: 1000}, + }, + } + + uptimeChart = module.Chart{ + ID: "uptime", + Title: "Uptime", + Units: "seconds", + Fam: "uptime", + Ctx: "beanstalk.uptime", + Type: module.Line, + Priority: prioUptime, + Dims: module.Dims{ + {ID: "uptime"}, + }, + } +) + +var ( + tubeChartsTmpl = module.Charts{ + tubeCurrentJobsChartTmpl.Copy(), + tubeJobsRateChartTmpl.Copy(), + + tubeCommandsRateChartTmpl.Copy(), + + tubeCurrentConnectionsChartTmpl.Copy(), + + tubePauseTimeChartTmpl.Copy(), + } + + tubeCurrentJobsChartTmpl = module.Chart{ + ID: "tube_%s_current_jobs", + Title: "Tube Current Jobs", + Units: "jobs", + Fam: "tube jobs", + Ctx: "beanstalk.tube_current_jobs", + Type: module.Stacked, + Priority: prioTubeCurrentJobs, + Dims: module.Dims{ + {ID: "tube_%s_current-jobs-ready", Name: "ready"}, + {ID: "tube_%s_current-jobs-buried", Name: "buried"}, + {ID: "tube_%s_current-jobs-urgent", Name: "urgent"}, + {ID: "tube_%s_current-jobs-delayed", Name: "delayed"}, + {ID: "tube_%s_current-jobs-reserved", Name: "reserved"}, + }, + } + tubeJobsRateChartTmpl = module.Chart{ + ID: "tube_%s_jobs_rate", + Title: "Tube Jobs Rate", + Units: "jobs/s", + Fam: "tube jobs", + Ctx: "beanstalk.tube_jobs_rate", + Type: module.Line, + Priority: prioTubeJobsRate, + Dims: module.Dims{ + {ID: "tube_%s_total-jobs", Name: "created", Algo: module.Incremental}, + }, + } + tubeCommandsRateChartTmpl = module.Chart{ + ID: "tube_%s_commands_rate", + Title: "Tube Commands", + Units: "commands/s", + Fam: "tube commands", + Ctx: "beanstalk.tube_commands_rate", + Type: module.Stacked, + Priority: prioTubeCommands, + Dims: module.Dims{ + {ID: "tube_%s_cmd-delete", Name: "delete", Algo: module.Incremental}, + {ID: "tube_%s_cmd-pause-tube", Name: "pause-tube", Algo: module.Incremental}, + }, + } + tubeCurrentConnectionsChartTmpl = module.Chart{ + ID: "tube_%s_current_connections", + Title: "Tube Current Connections", + Units: "connections", + Fam: "tube connections", + Ctx: "beanstalk.tube_current_connections", + Type: module.Stacked, + Priority: prioTubeCurrentConnections, + Dims: module.Dims{ + {ID: "tube_%s_current-using", Name: "using"}, + {ID: "tube_%s_current-waiting", Name: "waiting"}, + {ID: "tube_%s_current-watching", Name: "watching"}, + }, + } + tubePauseTimeChartTmpl = module.Chart{ + ID: "tube_%s_pause_time", + Title: "Tube Pause Time", + Units: "seconds", + Fam: "tube pause", + Ctx: "beanstalk.tube_pause", + Type: module.Line, + Priority: prioTubePauseTime, + Dims: module.Dims{ + {ID: "tube_%s_pause", Name: "since"}, + {ID: "tube_%s_pause-time-left", Name: "left"}, + }, + } +) + +func (b *Beanstalk) addTubeCharts(name string) { + charts := tubeChartsTmpl.Copy() + + for _, chart := range *charts { + chart.ID = fmt.Sprintf(chart.ID, cleanTubeName(name)) + chart.Labels = []module.Label{ + {Key: "tube_name", Value: name}, + } + + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf(dim.ID, name) + } + } + + if err := b.Charts().Add(*charts...); err != nil { + b.Warning(err) + } +} + +func (b *Beanstalk) removeTubeCharts(name string) { + px := fmt.Sprintf("tube_%s_", cleanTubeName(name)) + + for _, chart := range *b.Charts() { + if strings.HasPrefix(chart.ID, px) { + chart.MarkRemove() + chart.MarkNotCreated() + } + } +} + +func cleanTubeName(name string) string { + r := strings.NewReplacer(" ", "_", ".", "_", ",", "_") + return r.Replace(name) +} diff --git a/src/go/plugin/go.d/modules/beanstalk/client.go b/src/go/plugin/go.d/modules/beanstalk/client.go new file mode 100644 index 00000000..66a8b1ce --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/client.go @@ -0,0 +1,249 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package beanstalk + +import ( + "errors" + "fmt" + "strconv" + "strings" + + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" + + "gopkg.in/yaml.v2" +) + +type beanstalkConn interface { + connect() error + disconnect() error + queryStats() (*beanstalkdStats, error) + queryListTubes() ([]string, error) + queryStatsTube(string) (*tubeStats, error) +} + +// https://github.com/beanstalkd/beanstalkd/blob/91c54fc05dc759ef27459ce4383934e1a4f2fb4b/doc/protocol.txt#L553 +type beanstalkdStats struct { + CurrentJobsUrgent int64 `yaml:"current-jobs-urgent" stm:"current-jobs-urgent"` + CurrentJobsReady int64 `yaml:"current-jobs-ready" stm:"current-jobs-ready"` + CurrentJobsReserved int64 `yaml:"current-jobs-reserved" stm:"current-jobs-reserved"` + CurrentJobsDelayed int64 `yaml:"current-jobs-delayed" stm:"current-jobs-delayed"` + CurrentJobsBuried int64 `yaml:"current-jobs-buried" stm:"current-jobs-buried"` + CmdPut int64 `yaml:"cmd-put" stm:"cmd-put"` + CmdPeek int64 `yaml:"cmd-peek" stm:"cmd-peek"` + CmdPeekReady int64 `yaml:"cmd-peek-ready" stm:"cmd-peek-ready"` + CmdPeekDelayed int64 `yaml:"cmd-peek-delayed" stm:"cmd-peek-delayed"` + CmdPeekBuried int64 `yaml:"cmd-peek-buried" stm:"cmd-peek-buried"` + CmdReserve int64 `yaml:"cmd-reserve" stm:"cmd-reserve"` + CmdReserveWithTimeout int64 `yaml:"cmd-reserve-with-timeout" stm:"cmd-reserve-with-timeout"` + CmdTouch int64 `yaml:"cmd-touch" stm:"cmd-touch"` + CmdUse int64 `yaml:"cmd-use" stm:"cmd-use"` + CmdWatch int64 `yaml:"cmd-watch" stm:"cmd-watch"` + CmdIgnore int64 `yaml:"cmd-ignore" stm:"cmd-ignore"` + CmdDelete int64 `yaml:"cmd-delete" stm:"cmd-delete"` + CmdRelease int64 `yaml:"cmd-release" stm:"cmd-release"` + CmdBury int64 `yaml:"cmd-bury" stm:"cmd-bury"` + CmdKick int64 `yaml:"cmd-kick" stm:"cmd-kick"` + CmdStats int64 `yaml:"cmd-stats" stm:"cmd-stats"` + CmdStatsJob int64 `yaml:"cmd-stats-job" stm:"cmd-stats-job"` + CmdStatsTube int64 `yaml:"cmd-stats-tube" stm:"cmd-stats-tube"` + CmdListTubes int64 `yaml:"cmd-list-tubes" stm:"cmd-list-tubes"` + CmdListTubeUsed int64 `yaml:"cmd-list-tube-used" stm:"cmd-list-tube-used"` + CmdListTubesWatched int64 `yaml:"cmd-list-tubes-watched" stm:"cmd-list-tubes-watched"` + CmdPauseTube int64 `yaml:"cmd-pause-tube" stm:"cmd-pause-tube"` + JobTimeouts int64 `yaml:"job-timeouts" stm:"job-timeouts"` + TotalJobs int64 `yaml:"total-jobs" stm:"total-jobs"` + CurrentTubes int64 `yaml:"current-tubes" stm:"current-tubes"` + CurrentConnections int64 `yaml:"current-connections" stm:"current-connections"` + CurrentProducers int64 `yaml:"current-producers" stm:"current-producers"` + CurrentWorkers int64 `yaml:"current-workers" stm:"current-workers"` + CurrentWaiting int64 `yaml:"current-waiting" stm:"current-waiting"` + TotalConnections int64 `yaml:"total-connections" stm:"total-connections"` + RusageUtime float64 `yaml:"rusage-utime" stm:"rusage-utime,1000,1"` + RusageStime float64 `yaml:"rusage-stime" stm:"rusage-stime,1000,1"` + Uptime int64 `yaml:"uptime" stm:"uptime"` + BinlogRecordsWritten int64 `yaml:"binlog-records-written" stm:"binlog-records-written"` + BinlogRecordsMigrated int64 `yaml:"binlog-records-migrated" stm:"binlog-records-migrated"` +} + +// https://github.com/beanstalkd/beanstalkd/blob/91c54fc05dc759ef27459ce4383934e1a4f2fb4b/doc/protocol.txt#L497 +type tubeStats struct { + Name string `yaml:"name"` + CurrentJobsUrgent int64 `yaml:"current-jobs-urgent" stm:"current-jobs-urgent"` + CurrentJobsReady int64 `yaml:"current-jobs-ready" stm:"current-jobs-ready"` + CurrentJobsReserved int64 `yaml:"current-jobs-reserved" stm:"current-jobs-reserved"` + CurrentJobsDelayed int64 `yaml:"current-jobs-delayed" stm:"current-jobs-delayed"` + CurrentJobsBuried int64 `yaml:"current-jobs-buried" stm:"current-jobs-buried"` + TotalJobs int64 `yaml:"total-jobs" stm:"total-jobs"` + CurrentUsing int64 `yaml:"current-using" stm:"current-using"` + CurrentWaiting int64 `yaml:"current-waiting" stm:"current-waiting"` + CurrentWatching int64 `yaml:"current-watching" stm:"current-watching"` + Pause float64 `yaml:"pause" stm:"pause"` + CmdDelete int64 `yaml:"cmd-delete" stm:"cmd-delete"` + CmdPauseTube int64 `yaml:"cmd-pause-tube" stm:"cmd-pause-tube"` + PauseTimeLeft float64 `yaml:"pause-time-left" stm:"pause-time-left"` +} + +func newBeanstalkConn(conf Config, log *logger.Logger) beanstalkConn { + return &beanstalkClient{ + Logger: log, + client: socket.New(socket.Config{ + Address: conf.Address, + ConnectTimeout: conf.Timeout.Duration(), + ReadTimeout: conf.Timeout.Duration(), + WriteTimeout: conf.Timeout.Duration(), + TLSConf: nil, + }), + } +} + +const ( + cmdQuit = "quit" + cmdStats = "stats" + cmdListTubes = "list-tubes" + cmdStatsTube = "stats-tube" +) + +type beanstalkClient struct { + *logger.Logger + + client socket.Client +} + +func (c *beanstalkClient) connect() error { + return c.client.Connect() +} + +func (c *beanstalkClient) disconnect() error { + _, _, _ = c.query(cmdQuit) + return c.client.Disconnect() +} + +func (c *beanstalkClient) queryStats() (*beanstalkdStats, error) { + cmd := cmdStats + + resp, data, err := c.query(cmd) + if err != nil { + return nil, err + } + if resp != "OK" { + return nil, fmt.Errorf("command '%s' bad response: %s", cmd, resp) + } + + var stats beanstalkdStats + + if err := yaml.Unmarshal(data, &stats); err != nil { + return nil, err + } + + return &stats, nil +} + +func (c *beanstalkClient) queryListTubes() ([]string, error) { + cmd := cmdListTubes + + resp, data, err := c.query(cmd) + if err != nil { + return nil, err + } + if resp != "OK" { + return nil, fmt.Errorf("command '%s' bad response: %s", cmd, resp) + } + + var tubes []string + + if err := yaml.Unmarshal(data, &tubes); err != nil { + return nil, err + } + + return tubes, nil +} + +func (c *beanstalkClient) queryStatsTube(tubeName string) (*tubeStats, error) { + cmd := fmt.Sprintf("%s %s", cmdStatsTube, tubeName) + + resp, data, err := c.query(cmd) + if err != nil { + return nil, err + } + if resp == "NOT_FOUND" { + return nil, nil + } + if resp != "OK" { + return nil, fmt.Errorf("command '%s' bad response: %s", cmd, resp) + } + + var stats tubeStats + if err := yaml.Unmarshal(data, &stats); err != nil { + return nil, err + } + + return &stats, nil +} + +func (c *beanstalkClient) query(command string) (string, []byte, error) { + var resp string + var length int + var body []byte + var err error + + c.Debugf("executing command: %s", command) + + const limitReadLines = 1000 + var num int + + clientErr := c.client.Command(command+"\r\n", func(line []byte) bool { + if resp == "" { + s := string(line) + c.Debugf("command '%s' response: '%s'", command, s) + + resp, length, err = parseResponseLine(s) + if err != nil { + err = fmt.Errorf("command '%s' line '%s': %v", command, s, err) + } + return err == nil && resp == "OK" + } + + if num++; num >= limitReadLines { + err = fmt.Errorf("command '%s': read line limit exceeded (%d)", command, limitReadLines) + return false + } + + body = append(body, line...) + body = append(body, '\n') + + return len(body) < length + }) + if clientErr != nil { + return "", nil, fmt.Errorf("command '%s' client error: %v", command, clientErr) + } + if err != nil { + return "", nil, err + } + + return resp, body, nil +} + +func parseResponseLine(line string) (string, int, error) { + parts := strings.Fields(line) + if len(parts) == 0 { + return "", 0, errors.New("empty response") + } + + resp := parts[0] + + if resp != "OK" { + return resp, 0, nil + } + + if len(parts) < 2 { + return "", 0, errors.New("missing bytes count") + } + + length, err := strconv.Atoi(parts[1]) + if err != nil { + return "", 0, errors.New("invalid bytes count") + } + + return resp, length, nil +} diff --git a/src/go/plugin/go.d/modules/beanstalk/collect.go b/src/go/plugin/go.d/modules/beanstalk/collect.go new file mode 100644 index 00000000..f85b2402 --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/collect.go @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package beanstalk + +import ( + "fmt" + "slices" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" +) + +func (b *Beanstalk) collect() (map[string]int64, error) { + if b.conn == nil { + conn, err := b.establishConn() + if err != nil { + return nil, err + } + b.conn = conn + } + + mx := make(map[string]int64) + + if err := b.collectStats(mx); err != nil { + b.Cleanup() + return nil, err + } + if err := b.collectTubesStats(mx); err != nil { + return mx, err + } + + return mx, nil +} + +func (b *Beanstalk) collectStats(mx map[string]int64) error { + stats, err := b.conn.queryStats() + if err != nil { + return err + } + for k, v := range stm.ToMap(stats) { + mx[k] = v + } + return nil +} + +func (b *Beanstalk) collectTubesStats(mx map[string]int64) error { + now := time.Now() + + if now.Sub(b.lastDiscoverTubesTime) > b.discoverTubesEvery { + tubes, err := b.conn.queryListTubes() + if err != nil { + return err + } + + b.Debugf("discovered tubes (%d): %v", len(tubes), tubes) + v := slices.DeleteFunc(tubes, func(s string) bool { return !b.tubeSr.MatchString(s) }) + if len(tubes) != len(v) { + b.Debugf("discovered tubes after filtering (%d): %v", len(v), v) + } + + b.discoveredTubes = v + b.lastDiscoverTubesTime = now + } + + seen := make(map[string]bool) + + for i, tube := range b.discoveredTubes { + if tube == "" { + continue + } + + stats, err := b.conn.queryStatsTube(tube) + if err != nil { + return err + } + + if stats == nil { + b.Infof("tube '%s' stats object not found (tube does not exist)", tube) + b.discoveredTubes[i] = "" + continue + } + if stats.Name == "" { + b.Debugf("tube '%s' stats object has an empty name, ignoring it", tube) + b.discoveredTubes[i] = "" + continue + } + + seen[stats.Name] = true + if !b.seenTubes[stats.Name] { + b.seenTubes[stats.Name] = true + b.addTubeCharts(stats.Name) + } + + px := fmt.Sprintf("tube_%s_", stats.Name) + for k, v := range stm.ToMap(stats) { + mx[px+k] = v + } + } + + for tube := range b.seenTubes { + if !seen[tube] { + delete(b.seenTubes, tube) + b.removeTubeCharts(tube) + } + } + + return nil +} + +func (b *Beanstalk) establishConn() (beanstalkConn, error) { + conn := b.newConn(b.Config, b.Logger) + + if err := conn.connect(); err != nil { + return nil, err + } + + return conn, nil +} diff --git a/src/go/plugin/go.d/modules/beanstalk/config_schema.json b/src/go/plugin/go.d/modules/beanstalk/config_schema.json new file mode 100644 index 00000000..aa600ac0 --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/config_schema.json @@ -0,0 +1,54 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Beanstalk collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "address": { + "title": "Address", + "description": "The IP address and port where the Beanstalk service listens for connections.", + "type": "string", + "default": "127.0.0.1:11300" + }, + "timeout": { + "title": "Timeout", + "description": "Timeout for establishing a connection and communication (reading and writing) in seconds.", + "type": "number", + "minimum": 0.5, + "default": 1 + }, + "tube_selector": { + "title": "Tube selector", + "description": "Specifies a [pattern](https://github.com/netdata/netdata/tree/master/src/libnetdata/simple_pattern#readme) for which Beanstalk tubes Netdata will collect statistics. Only tubes whose names match the provided pattern will be included.", + "type": "string", + "minimum": 1, + "default": "*" + } + }, + "required": [ + "address" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + }, + "tube_selector": { + "ui:help": "Leave blank or use `*` to collect data for all tubes." + } + } +} diff --git a/src/go/plugin/go.d/modules/beanstalk/init.go b/src/go/plugin/go.d/modules/beanstalk/init.go new file mode 100644 index 00000000..50916b3a --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/init.go @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package beanstalk + +import ( + "errors" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" +) + +func (b *Beanstalk) validateConfig() error { + if b.Address == "" { + return errors.New("beanstalk address is required") + } + return nil +} + +func (b *Beanstalk) initTubeSelector() (matcher.Matcher, error) { + if b.TubeSelector == "" { + return matcher.TRUE(), nil + } + + m, err := matcher.NewSimplePatternsMatcher(b.TubeSelector) + if err != nil { + return nil, err + } + + return m, nil +} diff --git a/src/go/plugin/go.d/modules/beanstalk/integrations/beanstalk.md b/src/go/plugin/go.d/modules/beanstalk/integrations/beanstalk.md new file mode 100644 index 00000000..c8efd988 --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/integrations/beanstalk.md @@ -0,0 +1,253 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/beanstalk/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/beanstalk/metadata.yaml" +sidebar_label: "Beanstalk" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Message Brokers" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Beanstalk + + +<img src="https://netdata.cloud/img/beanstalk.svg" width="150"/> + + +Plugin: go.d.plugin +Module: beanstalk + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +This collector monitors Beanstalk server performance and provides detailed statistics for each tube. + + +Using the [beanstalkd protocol](https://github.com/beanstalkd/beanstalkd/blob/master/doc/protocol.txt), it communicates with the Beanstalk daemon to gather essential metrics that help understand the server's performance and activity. +Executed commands: + +- [stats](https://github.com/beanstalkd/beanstalkd/blob/91c54fc05dc759ef27459ce4383934e1a4f2fb4b/doc/protocol.txt#L553). +- [list-tubes](https://github.com/beanstalkd/beanstalkd/blob/91c54fc05dc759ef27459ce4383934e1a4f2fb4b/doc/protocol.txt#L688). +- [stats-tube](https://github.com/beanstalkd/beanstalkd/blob/91c54fc05dc759ef27459ce4383934e1a4f2fb4b/doc/protocol.txt#L497). + + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +By default, it detects Beanstalk instances running on localhost that are listening on port 11300. + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per Beanstalk instance + +These metrics refer to the entire monitored application. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| beanstalk.current_jobs | ready, buried, urgent, delayed, reserved | jobs | +| beanstalk.jobs_rate | created | jobs/s | +| beanstalk.jobs_timeouts | timeouts | jobs/s | +| beanstalk.current_tubes | tubes | tubes | +| beanstalk.commands_rate | put, peek, peek-ready, peek-delayed, peek-buried, reserve, reserve-with-timeout, touch, use, watch, ignore, delete, bury, kick, stats, stats-job, stats-tube, list-tubes, list-tube-used, list-tubes-watched, pause-tube | commands/s | +| beanstalk.current_connections | open, producers, workers, waiting | connections | +| beanstalk.connections_rate | created | connections/s | +| beanstalk.binlog_records | written, migrated | records/s | +| beanstalk.cpu_usage | user, system | percent | +| beanstalk.uptime | uptime | seconds | + +### Per tube + +Metrics related to Beanstalk tubes. This set of metrics is provided for each tube. + +Labels: + +| Label | Description | +|:-----------|:----------------| +| tube_name | Tube name. | + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| beanstalk.tube_current_jobs | ready, buried, urgent, delayed, reserved | jobs | +| beanstalk.tube_jobs_rate | created | jobs/s | +| beanstalk.tube_commands_rate | delete, pause-tube | commands/s | +| beanstalk.tube_current_connections | using, waiting, watching | connections | +| beanstalk.tube_pause_time | since, left | seconds | + + + +## Alerts + + +The following alerts are available: + +| Alert name | On metric | Description | +|:------------|:----------|:------------| +| [ beanstalk_server_buried_jobs ](https://github.com/netdata/netdata/blob/master/src/health/health.d/beanstalkd.conf) | beanstalk.current_jobs | number of buried jobs across all tubes. You need to manually kick them so they can be processed. Presence of buried jobs in a tube does not affect new jobs. | + + +## Setup + +### Prerequisites + +No action required. + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/beanstalk.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/beanstalk.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| address | The IP address and port where the Beanstalk service listens for connections. | 127.0.0.1:11300 | yes | +| timeout | Connection, read, and write timeout duration in seconds. The timeout includes name resolution. | 1 | no | +| tube_selector | Specifies a [pattern](https://github.com/netdata/netdata/tree/master/src/libnetdata/simple_pattern#readme) for which Beanstalk tubes Netdata will collect statistics. | * | no | + +</details> + +#### Examples + +##### Basic + +A basic example configuration. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:11300 + +``` +</details> + +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:11300 + + - name: remote + address: 203.0.113.0:11300 + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `beanstalk` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m beanstalk + ``` + +### Getting Logs + +If you're encountering problems with the `beanstalk` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep beanstalk +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep beanstalk /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep beanstalk +``` + + diff --git a/src/go/plugin/go.d/modules/beanstalk/metadata.yaml b/src/go/plugin/go.d/modules/beanstalk/metadata.yaml new file mode 100644 index 00000000..60aaf77e --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/metadata.yaml @@ -0,0 +1,255 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-beanstalk + plugin_name: go.d.plugin + module_name: beanstalk + monitored_instance: + name: Beanstalk + link: https://beanstalkd.github.io/ + categories: + - data-collection.message-brokers + icon_filename: "beanstalk.svg" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - beanstalk + - beanstalkd + - message + most_popular: false + overview: + data_collection: + metrics_description: | + This collector monitors Beanstalk server performance and provides detailed statistics for each tube. + method_description: | + Using the [beanstalkd protocol](https://github.com/beanstalkd/beanstalkd/blob/master/doc/protocol.txt), it communicates with the Beanstalk daemon to gather essential metrics that help understand the server's performance and activity. + Executed commands: + + - [stats](https://github.com/beanstalkd/beanstalkd/blob/91c54fc05dc759ef27459ce4383934e1a4f2fb4b/doc/protocol.txt#L553). + - [list-tubes](https://github.com/beanstalkd/beanstalkd/blob/91c54fc05dc759ef27459ce4383934e1a4f2fb4b/doc/protocol.txt#L688). + - [stats-tube](https://github.com/beanstalkd/beanstalkd/blob/91c54fc05dc759ef27459ce4383934e1a4f2fb4b/doc/protocol.txt#L497). + supported_platforms: + include: [] + exclude: [] + multi_instance: true + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: | + By default, it detects Beanstalk instances running on localhost that are listening on port 11300. + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: [] + configuration: + file: + name: go.d/beanstalk.conf + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: address + description: The IP address and port where the Beanstalk service listens for connections. + default_value: 127.0.0.1:11300 + required: true + - name: timeout + description: Connection, read, and write timeout duration in seconds. The timeout includes name resolution. + default_value: 1 + required: false + - name: tube_selector + description: "Specifies a [pattern](https://github.com/netdata/netdata/tree/master/src/libnetdata/simple_pattern#readme) for which Beanstalk tubes Netdata will collect statistics." + default_value: "*" + required: false + examples: + folding: + enabled: true + title: Config + list: + - name: Basic + description: A basic example configuration. + config: | + jobs: + - name: local + address: 127.0.0.1:11300 + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + address: 127.0.0.1:11300 + + - name: remote + address: 203.0.113.0:11300 + troubleshooting: + problems: + list: [] + alerts: + - name: beanstalk_server_buried_jobs + link: https://github.com/netdata/netdata/blob/master/src/health/health.d/beanstalkd.conf + metric: beanstalk.current_jobs + info: number of buried jobs across all tubes. You need to manually kick them so they can be processed. Presence of buried jobs in a tube does not affect new jobs. + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: "These metrics refer to the entire monitored application." + labels: [] + metrics: + - name: beanstalk.current_jobs + description: Current Jobs + unit: "jobs" + chart_type: stacked + dimensions: + - name: ready + - name: buried + - name: urgent + - name: delayed + - name: reserved + - name: beanstalk.jobs_rate + description: Jobs Rate + unit: "jobs/s" + chart_type: line + dimensions: + - name: created + - name: beanstalk.jobs_timeouts + description: Timed Out Jobs + unit: "jobs/s" + chart_type: line + dimensions: + - name: timeouts + - name: beanstalk.current_tubes + description: Current Tubes + unit: "tubes" + chart_type: line + dimensions: + - name: tubes + - name: beanstalk.commands_rate + description: Commands Rate + unit: "commands/s" + chart_type: stacked + dimensions: + - name: put + - name: peek + - name: peek-ready + - name: peek-delayed + - name: peek-buried + - name: reserve + - name: reserve-with-timeout + - name: touch + - name: use + - name: watch + - name: ignore + - name: delete + - name: bury + - name: kick + - name: stats + - name: stats-job + - name: stats-tube + - name: list-tubes + - name: list-tube-used + - name: list-tubes-watched + - name: pause-tube + - name: beanstalk.current_connections + description: Current Connections + unit: "connections" + chart_type: line + dimensions: + - name: open + - name: producers + - name: workers + - name: waiting + - name: beanstalk.connections_rate + description: Connections Rate + unit: "connections/s" + chart_type: area + dimensions: + - name: created + - name: beanstalk.binlog_records + description: Binlog Records + unit: "records/s" + chart_type: line + dimensions: + - name: written + - name: migrated + - name: beanstalk.cpu_usage + description: Cpu Usage + unit: "percent" + chart_type: stacked + dimensions: + - name: user + - name: system + - name: beanstalk.uptime + description: seconds + unit: "seconds" + chart_type: line + dimensions: + - name: uptime + - name: tube + description: "Metrics related to Beanstalk tubes. This set of metrics is provided for each tube." + labels: + - name: tube_name + description: Tube name. + metrics: + - name: beanstalk.tube_current_jobs + description: Tube Current Jobs + unit: "jobs" + chart_type: stacked + dimensions: + - name: ready + - name: buried + - name: urgent + - name: delayed + - name: reserved + - name: beanstalk.tube_jobs_rate + description: Tube Jobs Rate + unit: "jobs/s" + chart_type: line + dimensions: + - name: created + - name: beanstalk.tube_commands_rate + description: Tube Commands + unit: "commands/s" + chart_type: stacked + dimensions: + - name: delete + - name: pause-tube + - name: beanstalk.tube_current_connections + description: Tube Current Connections + unit: "connections" + chart_type: stacked + dimensions: + - name: using + - name: waiting + - name: watching + - name: beanstalk.tube_pause_time + description: Tube Pause Time + unit: "seconds" + chart_type: line + dimensions: + - name: since + - name: left diff --git a/src/go/plugin/go.d/modules/beanstalk/testdata/config.json b/src/go/plugin/go.d/modules/beanstalk/testdata/config.json new file mode 100644 index 00000000..c8da279a --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/testdata/config.json @@ -0,0 +1,6 @@ +{ + "update_every": 123, + "address": "ok", + "timeout": 123.123, + "tube_selector": "ok" +} diff --git a/src/go/plugin/go.d/modules/beanstalk/testdata/config.yaml b/src/go/plugin/go.d/modules/beanstalk/testdata/config.yaml new file mode 100644 index 00000000..7fe212a9 --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/testdata/config.yaml @@ -0,0 +1,4 @@ +update_every: 123 +address: "ok" +timeout: 123.123 +tube_selector: "ok" diff --git a/src/go/plugin/go.d/modules/beanstalk/testdata/list-tubes.txt b/src/go/plugin/go.d/modules/beanstalk/testdata/list-tubes.txt new file mode 100644 index 00000000..4fec61ef --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/testdata/list-tubes.txt @@ -0,0 +1,3 @@ +OK 14 +--- +- default diff --git a/src/go/plugin/go.d/modules/beanstalk/testdata/stats-tube-default.txt b/src/go/plugin/go.d/modules/beanstalk/testdata/stats-tube-default.txt new file mode 100644 index 00000000..888ff3da --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/testdata/stats-tube-default.txt @@ -0,0 +1,16 @@ +OK 265 +--- +name: default +current-jobs-urgent: 0 +current-jobs-ready: 0 +current-jobs-reserved: 0 +current-jobs-delayed: 0 +current-jobs-buried: 0 +total-jobs: 0 +current-using: 2 +current-watching: 2 +current-waiting: 0 +cmd-delete: 0 +cmd-pause-tube: 0 +pause: 0 +pause-time-left: 0 diff --git a/src/go/plugin/go.d/modules/beanstalk/testdata/stats.txt b/src/go/plugin/go.d/modules/beanstalk/testdata/stats.txt new file mode 100644 index 00000000..69b06e4c --- /dev/null +++ b/src/go/plugin/go.d/modules/beanstalk/testdata/stats.txt @@ -0,0 +1,50 @@ +OK 913 +--- +current-jobs-urgent: 0 +current-jobs-ready: 0 +current-jobs-reserved: 0 +current-jobs-delayed: 0 +current-jobs-buried: 0 +cmd-put: 0 +cmd-peek: 0 +cmd-peek-ready: 0 +cmd-peek-delayed: 0 +cmd-peek-buried: 0 +cmd-reserve: 0 +cmd-reserve-with-timeout: 0 +cmd-delete: 0 +cmd-release: 0 +cmd-use: 0 +cmd-watch: 0 +cmd-ignore: 0 +cmd-bury: 0 +cmd-kick: 0 +cmd-touch: 0 +cmd-stats: 23619 +cmd-stats-job: 0 +cmd-stats-tube: 18964 +cmd-list-tubes: 317 +cmd-list-tube-used: 0 +cmd-list-tubes-watched: 0 +cmd-pause-tube: 0 +job-timeouts: 0 +total-jobs: 0 +max-job-size: 65535 +current-tubes: 1 +current-connections: 2 +current-producers: 0 +current-workers: 0 +current-waiting: 0 +total-connections: 72 +pid: 1 +version: 1.10 +rusage-utime: 1.602079 +rusage-stime: 3.922748 +uptime: 105881 +binlog-oldest-index: 0 +binlog-current-index: 0 +binlog-records-migrated: 0 +binlog-records-written: 0 +binlog-max-size: 10485760 +id: 5a0667a881cd05e0 +hostname: c6796814b94b diff --git a/src/go/collectors/go.d.plugin/modules/bind/README.md b/src/go/plugin/go.d/modules/bind/README.md index 6de0078e..90906ac2 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/README.md +++ b/src/go/plugin/go.d/modules/bind/README.md @@ -88,7 +88,7 @@ jobs: View filter syntax: [simple patterns](https://docs.netdata.cloud/libnetdata/simple_pattern/). For all available options please see -module [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/bind.conf). +module [configuration file](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/config/go.d/bind.conf). ## Troubleshooting diff --git a/src/go/collectors/go.d.plugin/modules/bind/bind.go b/src/go/plugin/go.d/modules/bind/bind.go index 1bdf986c..6087f6f7 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/bind.go +++ b/src/go/plugin/go.d/modules/bind/bind.go @@ -8,10 +8,10 @@ import ( "net/http" "time" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/bind/bind_test.go b/src/go/plugin/go.d/modules/bind/bind_test.go index f5f49218..d1ce5c2b 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/bind_test.go +++ b/src/go/plugin/go.d/modules/bind/bind_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/bind/charts.go b/src/go/plugin/go.d/modules/bind/charts.go index db1833ab..2fa868da 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/charts.go +++ b/src/go/plugin/go.d/modules/bind/charts.go @@ -3,7 +3,7 @@ package bind import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) type ( diff --git a/src/go/collectors/go.d.plugin/modules/bind/collect.go b/src/go/plugin/go.d/modules/bind/collect.go index faf5c07c..4f38f390 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/collect.go +++ b/src/go/plugin/go.d/modules/bind/collect.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func (b *Bind) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/bind/config_schema.json b/src/go/plugin/go.d/modules/bind/config_schema.json index 55aa502a..29bb739e 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/config_schema.json +++ b/src/go/plugin/go.d/modules/bind/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/bind/init.go b/src/go/plugin/go.d/modules/bind/init.go index a4b40d0a..fe533b97 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/init.go +++ b/src/go/plugin/go.d/modules/bind/init.go @@ -8,7 +8,7 @@ import ( "net/http" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" ) func (b *Bind) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/bind/json_client.go b/src/go/plugin/go.d/modules/bind/json_client.go index 46a98de3..04eecdb0 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/json_client.go +++ b/src/go/plugin/go.d/modules/bind/json_client.go @@ -10,7 +10,7 @@ import ( "net/url" "path" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) type serverStats = jsonServerStats diff --git a/src/go/collectors/go.d.plugin/modules/bind/testdata/config.json b/src/go/plugin/go.d/modules/bind/testdata/config.json index 145df9ff..145df9ff 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/testdata/config.json +++ b/src/go/plugin/go.d/modules/bind/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/bind/testdata/config.yaml b/src/go/plugin/go.d/modules/bind/testdata/config.yaml index cc0a33b7..cc0a33b7 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/bind/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/bind/testdata/query-server.json b/src/go/plugin/go.d/modules/bind/testdata/query-server.json index 885a4e28..885a4e28 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/testdata/query-server.json +++ b/src/go/plugin/go.d/modules/bind/testdata/query-server.json diff --git a/src/go/collectors/go.d.plugin/modules/bind/testdata/query-server.xml b/src/go/plugin/go.d/modules/bind/testdata/query-server.xml index 515cdeab..515cdeab 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/testdata/query-server.xml +++ b/src/go/plugin/go.d/modules/bind/testdata/query-server.xml diff --git a/src/go/collectors/go.d.plugin/modules/bind/xml3_client.go b/src/go/plugin/go.d/modules/bind/xml3_client.go index 8ba804ec..c48d1af3 100644 --- a/src/go/collectors/go.d.plugin/modules/bind/xml3_client.go +++ b/src/go/plugin/go.d/modules/bind/xml3_client.go @@ -9,7 +9,7 @@ import ( "net/url" "path" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) type xml3Stats struct { diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/README.md b/src/go/plugin/go.d/modules/cassandra/README.md index 99b5b9da..99b5b9da 120000 --- a/src/go/collectors/go.d.plugin/modules/cassandra/README.md +++ b/src/go/plugin/go.d/modules/cassandra/README.md diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/cassandra.go b/src/go/plugin/go.d/modules/cassandra/cassandra.go index ee39246d..5352703d 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/cassandra.go +++ b/src/go/plugin/go.d/modules/cassandra/cassandra.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/cassandra_test.go b/src/go/plugin/go.d/modules/cassandra/cassandra_test.go index 650f79cd..0b6af936 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/cassandra_test.go +++ b/src/go/plugin/go.d/modules/cassandra/cassandra_test.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/charts.go b/src/go/plugin/go.d/modules/cassandra/charts.go index 8c3fc239..a909c7ba 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/charts.go +++ b/src/go/plugin/go.d/modules/cassandra/charts.go @@ -5,7 +5,7 @@ package cassandra import ( "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/collect.go b/src/go/plugin/go.d/modules/cassandra/collect.go index 511aac64..08cdfbe9 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/collect.go +++ b/src/go/plugin/go.d/modules/cassandra/collect.go @@ -4,7 +4,7 @@ package cassandra import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" "strings" ) diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/config_schema.json b/src/go/plugin/go.d/modules/cassandra/config_schema.json index d6309d73..c4ca5f4f 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/config_schema.json +++ b/src/go/plugin/go.d/modules/cassandra/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/init.go b/src/go/plugin/go.d/modules/cassandra/init.go index 7248681d..1a74fdf9 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/init.go +++ b/src/go/plugin/go.d/modules/cassandra/init.go @@ -5,8 +5,8 @@ package cassandra import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (c *Cassandra) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/integrations/cassandra.md b/src/go/plugin/go.d/modules/cassandra/integrations/cassandra.md index 76b62301..61c4d143 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/integrations/cassandra.md +++ b/src/go/plugin/go.d/modules/cassandra/integrations/cassandra.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/cassandra/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/cassandra/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/cassandra/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/cassandra/metadata.yaml" sidebar_label: "Cassandra" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -253,6 +253,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `cassandra` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -275,4 +277,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m cassandra ``` +### Getting Logs + +If you're encountering problems with the `cassandra` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep cassandra +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep cassandra /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep cassandra +``` + diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/jmx_exporter.yaml b/src/go/plugin/go.d/modules/cassandra/jmx_exporter.yaml index 983f6f9b..983f6f9b 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/jmx_exporter.yaml +++ b/src/go/plugin/go.d/modules/cassandra/jmx_exporter.yaml diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/metadata.yaml b/src/go/plugin/go.d/modules/cassandra/metadata.yaml index ef9458c0..ef9458c0 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/metadata.yaml +++ b/src/go/plugin/go.d/modules/cassandra/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/metrics.go b/src/go/plugin/go.d/modules/cassandra/metrics.go index 6533c694..6533c694 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/metrics.go +++ b/src/go/plugin/go.d/modules/cassandra/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/testdata/config.json b/src/go/plugin/go.d/modules/cassandra/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/testdata/config.json +++ b/src/go/plugin/go.d/modules/cassandra/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/testdata/config.yaml b/src/go/plugin/go.d/modules/cassandra/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/cassandra/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/cassandra/testdata/metrics.txt b/src/go/plugin/go.d/modules/cassandra/testdata/metrics.txt index 663a6808..663a6808 100644 --- a/src/go/collectors/go.d.plugin/modules/cassandra/testdata/metrics.txt +++ b/src/go/plugin/go.d/modules/cassandra/testdata/metrics.txt diff --git a/src/go/collectors/go.d.plugin/modules/chrony/README.md b/src/go/plugin/go.d/modules/chrony/README.md index 4a58f373..4a58f373 120000 --- a/src/go/collectors/go.d.plugin/modules/chrony/README.md +++ b/src/go/plugin/go.d/modules/chrony/README.md diff --git a/src/go/plugin/go.d/modules/chrony/charts.go b/src/go/plugin/go.d/modules/chrony/charts.go new file mode 100644 index 00000000..37a6fa3e --- /dev/null +++ b/src/go/plugin/go.d/modules/chrony/charts.go @@ -0,0 +1,320 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package chrony + +import ( + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioStratum = module.Priority + iota + prioCurrentCorrection + prioRootDelay + prioRootDispersion + prioLastOffset + prioRmsOffset + prioFrequency + prioResidualFrequency + prioSkew + prioUpdateInterval + prioRefMeasurementTime + prioLeapStatus + prioActivity + //prioNTPPackets + //prioCommandPackets + //prioNKEConnections + //prioClientLogRecords +) + +var charts = module.Charts{ + stratumChart.Copy(), + + currentCorrectionChart.Copy(), + + rootDelayChart.Copy(), + rootDispersionChart.Copy(), + + lastOffsetChart.Copy(), + rmsOffsetChart.Copy(), + + frequencyChart.Copy(), + residualFrequencyChart.Copy(), + + skewChart.Copy(), + + updateIntervalChart.Copy(), + refMeasurementTimeChart.Copy(), + + leapStatusChart.Copy(), + + activityChart.Copy(), +} + +// Tracking charts +var ( + stratumChart = module.Chart{ + ID: "stratum", + Title: "Distance to the reference clock", + Units: "level", + Fam: "stratum", + Ctx: "chrony.stratum", + Priority: prioStratum, + Dims: module.Dims{ + {ID: "stratum", Name: "stratum"}, + }, + } + + currentCorrectionChart = module.Chart{ + ID: "current_correction", + Title: "Current correction", + Units: "seconds", + Fam: "correction", + Ctx: "chrony.current_correction", + Priority: prioCurrentCorrection, + Dims: module.Dims{ + {ID: "current_correction", Div: scaleFactor}, + }, + } + + rootDelayChart = module.Chart{ + ID: "root_delay", + Title: "Network path delay to stratum-1", + Units: "seconds", + Fam: "root", + Ctx: "chrony.root_delay", + Priority: prioRootDelay, + Dims: module.Dims{ + {ID: "root_delay", Div: scaleFactor}, + }, + } + rootDispersionChart = module.Chart{ + ID: "root_dispersion", + Title: "Dispersion accumulated back to stratum-1", + Units: "seconds", + Fam: "root", + Ctx: "chrony.root_dispersion", + Priority: prioRootDispersion, + Dims: module.Dims{ + {ID: "root_dispersion", Div: scaleFactor}, + }, + } + + lastOffsetChart = module.Chart{ + ID: "last_offset", + Title: "Offset on the last clock update", + Units: "seconds", + Fam: "offset", + Ctx: "chrony.last_offset", + Priority: prioLastOffset, + Dims: module.Dims{ + {ID: "last_offset", Name: "offset", Div: scaleFactor}, + }, + } + rmsOffsetChart = module.Chart{ + ID: "rms_offset", + Title: "Long-term average of the offset value", + Units: "seconds", + Fam: "offset", + Ctx: "chrony.rms_offset", + Priority: prioRmsOffset, + Dims: module.Dims{ + {ID: "rms_offset", Name: "offset", Div: scaleFactor}, + }, + } + + frequencyChart = module.Chart{ + ID: "frequency", + Title: "Frequency", + Units: "ppm", + Fam: "frequency", + Ctx: "chrony.frequency", + Priority: prioFrequency, + Dims: module.Dims{ + {ID: "frequency", Div: scaleFactor}, + }, + } + residualFrequencyChart = module.Chart{ + ID: "residual_frequency", + Title: "Residual frequency", + Units: "ppm", + Fam: "frequency", + Ctx: "chrony.residual_frequency", + Priority: prioResidualFrequency, + Dims: module.Dims{ + {ID: "residual_frequency", Div: scaleFactor}, + }, + } + + skewChart = module.Chart{ + ID: "skew", + Title: "Skew", + Units: "ppm", + Fam: "frequency", + Ctx: "chrony.skew", + Priority: prioSkew, + Dims: module.Dims{ + {ID: "skew", Div: scaleFactor}, + }, + } + + updateIntervalChart = module.Chart{ + ID: "update_interval", + Title: "Interval between the last two clock updates", + Units: "seconds", + Fam: "updates", + Ctx: "chrony.update_interval", + Priority: prioUpdateInterval, + Dims: module.Dims{ + {ID: "update_interval", Div: scaleFactor}, + }, + } + refMeasurementTimeChart = module.Chart{ + ID: "ref_measurement_time", + Title: "Time since the last measurement", + Units: "seconds", + Fam: "updates", + Ctx: "chrony.ref_measurement_time", + Priority: prioRefMeasurementTime, + Dims: module.Dims{ + {ID: "ref_measurement_time"}, + }, + } + + leapStatusChart = module.Chart{ + ID: "leap_status", + Title: "Leap status", + Units: "status", + Fam: "leap status", + Ctx: "chrony.leap_status", + Priority: prioLeapStatus, + Dims: module.Dims{ + {ID: "leap_status_normal", Name: "normal"}, + {ID: "leap_status_insert_second", Name: "insert_second"}, + {ID: "leap_status_delete_second", Name: "delete_second"}, + {ID: "leap_status_unsynchronised", Name: "unsynchronised"}, + }, + } +) + +// Activity charts +var ( + activityChart = module.Chart{ + ID: "activity", + Title: "Peers activity", + Units: "sources", + Fam: "activity", + Ctx: "chrony.activity", + Type: module.Stacked, + Priority: prioActivity, + Dims: module.Dims{ + {ID: "online_sources", Name: "online"}, + {ID: "offline_sources", Name: "offline"}, + {ID: "burst_online_sources", Name: "burst_online"}, + {ID: "burst_offline_sources", Name: "burst_offline"}, + {ID: "unresolved_sources", Name: "unresolved"}, + }, + } +) + +//var serverStatsVer1Charts = module.Charts{ +// ntpPacketsChart.Copy(), +// commandPacketsChart.Copy(), +// clientLogRecordsChart.Copy(), +//} +// +//var serverStatsVer2Charts = module.Charts{ +// ntpPacketsChart.Copy(), +// commandPacketsChart.Copy(), +// clientLogRecordsChart.Copy(), +// nkeConnectionChart.Copy(), +//} +// +//var serverStatsVer3Charts = module.Charts{ +// ntpPacketsChart.Copy(), +// commandPacketsChart.Copy(), +// clientLogRecordsChart.Copy(), +// nkeConnectionChart.Copy(), +//} +// +//var serverStatsVer4Charts = module.Charts{ +// ntpPacketsChart.Copy(), +// commandPacketsChart.Copy(), +// clientLogRecordsChart.Copy(), +// nkeConnectionChart.Copy(), +//} + +// ServerStats charts +//var ( +// ntpPacketsChart = module.Chart{ +// ID: "ntp_packets", +// Title: "NTP packets", +// Units: "packets/s", +// Fam: "client requests", +// Ctx: "chrony.ntp_packets", +// Type: module.Stacked, +// Priority: prioNTPPackets, +// Dims: module.Dims{ +// {ID: "ntp_packets_received", Name: "received", Algo: module.Incremental}, +// {ID: "ntp_packets_dropped", Name: "dropped", Algo: module.Incremental}, +// }, +// } +// commandPacketsChart = module.Chart{ +// ID: "command_packets", +// Title: "Command packets", +// Units: "packets/s", +// Fam: "client requests", +// Ctx: "chrony.command_packets", +// Type: module.Stacked, +// Priority: prioCommandPackets, +// Dims: module.Dims{ +// {ID: "command_packets_received", Name: "received", Algo: module.Incremental}, +// {ID: "command_packets_dropped", Name: "dropped", Algo: module.Incremental}, +// }, +// } +// nkeConnectionChart = module.Chart{ +// ID: "nke_connections", +// Title: "NTS-KE connections", +// Units: "connections/s", +// Fam: "client requests", +// Ctx: "chrony.nke_connections", +// Type: module.Stacked, +// Priority: prioNKEConnections, +// Dims: module.Dims{ +// {ID: "nke_connections_accepted", Name: "accepted", Algo: module.Incremental}, +// {ID: "nke_connections_dropped", Name: "dropped", Algo: module.Incremental}, +// }, +// } +// clientLogRecordsChart = module.Chart{ +// ID: "client_log_records", +// Title: "Client log records", +// Units: "records/s", +// Fam: "client requests", +// Ctx: "chrony.client_log_records", +// Type: module.Stacked, +// Priority: prioClientLogRecords, +// Dims: module.Dims{ +// {ID: "client_log_records_dropped", Name: "dropped", Algo: module.Incremental}, +// }, +// } +//) + +//func (c *Chrony) addServerStatsCharts(stats *serverStats) { +// var err error +// +// switch { +// case stats.v1 != nil: +// err = c.Charts().Add(*serverStatsVer1Charts.Copy()...) +// case stats.v2 != nil: +// err = c.Charts().Add(*serverStatsVer2Charts.Copy()...) +// case stats.v3 != nil: +// err = c.Charts().Add(*serverStatsVer3Charts.Copy()...) +// case stats.v4 != nil: +// err = c.Charts().Add(*serverStatsVer4Charts.Copy()...) +// default: +// err = errors.New("unknown stats chart") +// } +// +// if err != nil { +// c.Warning(err) +// } +//} diff --git a/src/go/collectors/go.d.plugin/modules/chrony/chrony.go b/src/go/plugin/go.d/modules/chrony/chrony.go index eb51c410..0bdd3183 100644 --- a/src/go/collectors/go.d.plugin/modules/chrony/chrony.go +++ b/src/go/plugin/go.d/modules/chrony/chrony.go @@ -5,11 +5,13 @@ package chrony import ( _ "embed" "errors" + "sync" "time" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" + "github.com/facebook/time/ntp/chrony" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" ) //go:embed "config_schema.json" @@ -29,8 +31,9 @@ func New() *Chrony { Address: "127.0.0.1:323", Timeout: web.Duration(time.Second), }, - charts: charts.Copy(), - newClient: newChronyClient, + charts: charts.Copy(), + addStatsChartsOnce: &sync.Once{}, + newClient: newChronyClient, } } @@ -45,7 +48,8 @@ type ( module.Base Config `yaml:",inline" json:""` - charts *module.Charts + charts *module.Charts + addStatsChartsOnce *sync.Once client chronyClient newClient func(c Config) (chronyClient, error) @@ -53,6 +57,7 @@ type ( chronyClient interface { Tracking() (*chrony.ReplyTracking, error) Activity() (*chrony.ReplyActivity, error) + ServerStats() (*serverStats, error) Close() } ) diff --git a/src/go/collectors/go.d.plugin/modules/chrony/chrony_test.go b/src/go/plugin/go.d/modules/chrony/chrony_test.go index 03e7dd52..407724e7 100644 --- a/src/go/collectors/go.d.plugin/modules/chrony/chrony_test.go +++ b/src/go/plugin/go.d/modules/chrony/chrony_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/facebook/time/ntp/chrony" "github.com/stretchr/testify/assert" @@ -240,9 +240,10 @@ func prepareChronyWithMock(m *mockClient) *Chrony { } type mockClient struct { - errOnTracking bool - errOnActivity bool - closeCalled bool + errOnTracking bool + errOnActivity bool + errOnServerStats bool + closeCalled bool } func (m *mockClient) Tracking() (*chrony.ReplyTracking, error) { @@ -286,6 +287,30 @@ func (m *mockClient) Activity() (*chrony.ReplyActivity, error) { return &reply, nil } +func (m *mockClient) ServerStats() (*serverStats, error) { + if m.errOnServerStats { + return nil, errors.New("mockClient.ServerStats call error") + } + + reply := serverStats{ + v3: &chrony.ServerStats3{ + NTPHits: 10, + NKEHits: 10, + CMDHits: 10, + NTPDrops: 1, + NKEDrops: 1, + CMDDrops: 1, + LogDrops: 1, + NTPAuthHits: 10, + NTPInterleavedHits: 10, + NTPTimestamps: 0, + NTPSpanSeconds: 0, + }, + } + + return &reply, nil +} + func (m *mockClient) Close() { m.closeCalled = true } diff --git a/src/go/plugin/go.d/modules/chrony/client.go b/src/go/plugin/go.d/modules/chrony/client.go new file mode 100644 index 00000000..233e78f1 --- /dev/null +++ b/src/go/plugin/go.d/modules/chrony/client.go @@ -0,0 +1,171 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package chrony + +import ( + "fmt" + "net" + "time" + + "github.com/facebook/time/ntp/chrony" +) + +func newChronyClient(c Config) (chronyClient, error) { + conn, err := net.DialTimeout("udp", c.Address, c.Timeout.Duration()) + if err != nil { + return nil, err + } + + client := &simpleClient{ + conn: conn, + client: &chrony.Client{Connection: &connWithTimeout{ + Conn: conn, + timeout: c.Timeout.Duration(), + }}, + } + + return client, nil +} + +type connWithTimeout struct { + net.Conn + timeout time.Duration +} + +func (c *connWithTimeout) Read(p []byte) (n int, err error) { + if err := c.Conn.SetReadDeadline(c.deadline()); err != nil { + return 0, err + } + return c.Conn.Read(p) +} + +func (c *connWithTimeout) Write(p []byte) (n int, err error) { + if err := c.Conn.SetWriteDeadline(c.deadline()); err != nil { + return 0, err + } + return c.Conn.Write(p) +} + +func (c *connWithTimeout) deadline() time.Time { + return time.Now().Add(c.timeout) +} + +type simpleClient struct { + conn net.Conn + client *chrony.Client +} + +func (sc *simpleClient) Tracking() (*chrony.ReplyTracking, error) { + req := chrony.NewTrackingPacket() + + reply, err := sc.client.Communicate(req) + if err != nil { + return nil, err + } + + tracking, ok := reply.(*chrony.ReplyTracking) + if !ok { + return nil, fmt.Errorf("unexpected reply type, want=%T, got=%T", &chrony.ReplyTracking{}, reply) + } + return tracking, nil +} + +func (sc *simpleClient) Activity() (*chrony.ReplyActivity, error) { + req := chrony.NewActivityPacket() + + reply, err := sc.client.Communicate(req) + if err != nil { + return nil, err + } + + activity, ok := reply.(*chrony.ReplyActivity) + if !ok { + return nil, fmt.Errorf("unexpected reply type, want=%T, got=%T", &chrony.ReplyActivity{}, reply) + } + return activity, nil +} + +type serverStats struct { + v1 *chrony.ServerStats + v2 *chrony.ServerStats2 + v3 *chrony.ServerStats3 + v4 *chrony.ServerStats4 +} + +func (sc *simpleClient) ServerStats() (*serverStats, error) { + req := chrony.NewServerStatsPacket() + + reply, err := sc.client.Communicate(req) + if err != nil { + return nil, err + } + + var stats serverStats + + switch v := reply.(type) { + case *chrony.ReplyServerStats: + stats.v1 = &chrony.ServerStats{ + NTPHits: v.NTPHits, + CMDHits: v.CMDHits, + NTPDrops: v.NTPDrops, + CMDDrops: v.CMDDrops, + LogDrops: v.LogDrops, + } + case *chrony.ReplyServerStats2: + stats.v2 = &chrony.ServerStats2{ + NTPHits: v.NTPHits, + NKEHits: v.NKEHits, + CMDHits: v.CMDHits, + NTPDrops: v.NTPDrops, + NKEDrops: v.NKEDrops, + CMDDrops: v.CMDDrops, + LogDrops: v.LogDrops, + NTPAuthHits: v.NTPAuthHits, + } + case *chrony.ReplyServerStats3: + stats.v3 = &chrony.ServerStats3{ + NTPHits: v.NTPHits, + NKEHits: v.NKEHits, + CMDHits: v.CMDHits, + NTPDrops: v.NTPDrops, + NKEDrops: v.NKEDrops, + CMDDrops: v.CMDDrops, + LogDrops: v.LogDrops, + NTPAuthHits: v.NTPAuthHits, + NTPInterleavedHits: v.NTPInterleavedHits, + NTPTimestamps: v.NTPTimestamps, + NTPSpanSeconds: v.NTPSpanSeconds, + } + case *chrony.ReplyServerStats4: + stats.v4 = &chrony.ServerStats4{ + NTPHits: v.NTPHits, + NKEHits: v.NKEHits, + CMDHits: v.CMDHits, + NTPDrops: v.NTPDrops, + NKEDrops: v.NKEDrops, + CMDDrops: v.CMDDrops, + LogDrops: v.LogDrops, + NTPAuthHits: v.NTPAuthHits, + NTPInterleavedHits: v.NTPInterleavedHits, + NTPTimestamps: v.NTPTimestamps, + NTPSpanSeconds: v.NTPSpanSeconds, + NTPDaemonRxtimestamps: v.NTPDaemonRxtimestamps, + NTPDaemonTxtimestamps: v.NTPDaemonTxtimestamps, + NTPKernelRxtimestamps: v.NTPKernelRxtimestamps, + NTPKernelTxtimestamps: v.NTPKernelTxtimestamps, + NTPHwRxTimestamps: v.NTPHwRxTimestamps, + NTPHwTxTimestamps: v.NTPHwTxTimestamps, + } + default: + return nil, fmt.Errorf("unexpected reply type, want=ReplyServerStats, got=%T", reply) + } + + return &stats, nil +} + +func (sc *simpleClient) Close() { + if sc.conn != nil { + _ = sc.conn.Close() + sc.conn = nil + } +} diff --git a/src/go/plugin/go.d/modules/chrony/collect.go b/src/go/plugin/go.d/modules/chrony/collect.go new file mode 100644 index 00000000..1a3a286f --- /dev/null +++ b/src/go/plugin/go.d/modules/chrony/collect.go @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package chrony + +import ( + "fmt" + "time" +) + +const scaleFactor = 1000000000 + +func (c *Chrony) collect() (map[string]int64, error) { + if c.client == nil { + client, err := c.newClient(c.Config) + if err != nil { + return nil, err + } + c.client = client + } + + mx := make(map[string]int64) + + if err := c.collectTracking(mx); err != nil { + return nil, err + } + if err := c.collectActivity(mx); err != nil { + return mx, err + } + //if strings.HasPrefix(c.Address, "/") { + // TODO: Allowed only through the Unix domain socket (requires "_chrony" group membership). + // See https://github.com/facebook/time/blob/18207c5d8ddc7242e8d4192985898b6dbe66932c/cmd/ntpcheck/checker/chrony.go#L38 + // ^^ For some reason doesn't work, Chrony doesn't respond. Additional configuration needed? + //if err := c.collectServerStats(mx); err != nil { + // return mx, err + //} + //} + + return mx, nil +} + +const ( + // https://github.com/mlichvar/chrony/blob/7daf34675a5a2487895c74d1578241ca91a4eb70/ntp.h#L70-L75 + leapStatusNormal = 0 + leapStatusInsertSecond = 1 + leapStatusDeleteSecond = 2 + leapStatusUnsynchronised = 3 +) + +func (c *Chrony) collectTracking(mx map[string]int64) error { + reply, err := c.client.Tracking() + if err != nil { + return fmt.Errorf("error on collecting tracking: %v", err) + } + + mx["stratum"] = int64(reply.Stratum) + mx["leap_status_normal"] = boolToInt(reply.LeapStatus == leapStatusNormal) + mx["leap_status_insert_second"] = boolToInt(reply.LeapStatus == leapStatusInsertSecond) + mx["leap_status_delete_second"] = boolToInt(reply.LeapStatus == leapStatusDeleteSecond) + mx["leap_status_unsynchronised"] = boolToInt(reply.LeapStatus == leapStatusUnsynchronised) + mx["root_delay"] = int64(reply.RootDelay * scaleFactor) + mx["root_dispersion"] = int64(reply.RootDispersion * scaleFactor) + mx["skew"] = int64(reply.SkewPPM * scaleFactor) + mx["last_offset"] = int64(reply.LastOffset * scaleFactor) + mx["rms_offset"] = int64(reply.RMSOffset * scaleFactor) + mx["update_interval"] = int64(reply.LastUpdateInterval * scaleFactor) + // handle chrony restarts + if reply.RefTime.Year() != 1970 { + mx["ref_measurement_time"] = time.Now().Unix() - reply.RefTime.Unix() + } + mx["residual_frequency"] = int64(reply.ResidFreqPPM * scaleFactor) + // https://github.com/mlichvar/chrony/blob/5b04f3ca902e5d10aa5948fb7587d30b43941049/client.c#L1706 + mx["current_correction"] = abs(int64(reply.CurrentCorrection * scaleFactor)) + mx["frequency"] = abs(int64(reply.FreqPPM * scaleFactor)) + + return nil +} + +func (c *Chrony) collectActivity(mx map[string]int64) error { + reply, err := c.client.Activity() + if err != nil { + return fmt.Errorf("error on collecting activity: %v", err) + } + + mx["online_sources"] = int64(reply.Online) + mx["offline_sources"] = int64(reply.Offline) + mx["burst_online_sources"] = int64(reply.BurstOnline) + mx["burst_offline_sources"] = int64(reply.BurstOffline) + mx["unresolved_sources"] = int64(reply.Unresolved) + + return nil +} + +//func (c *Chrony) collectServerStats(mx map[string]int64) error { +// stats, err := c.client.ServerStats() +// if err != nil { +// return fmt.Errorf("error on collecting server stats: %v", err) +// } +// +// switch { +// case stats.v4 != nil: +// mx["ntp_packets_received"] = int64(stats.v4.NTPHits) +// mx["ntp_packets_dropped"] = int64(stats.v4.NTPDrops) +// mx["command_packets_received"] = int64(stats.v4.CMDHits) +// mx["command_packets_dropped"] = int64(stats.v4.CMDDrops) +// mx["client_log_records_dropped"] = int64(stats.v4.LogDrops) +// mx["nke_connections_accepted"] = int64(stats.v4.NKEHits) +// mx["nke_connections_dropped"] = int64(stats.v4.NKEDrops) +// mx["authenticated_ntp_packets"] = int64(stats.v4.NTPAuthHits) +// mx["interleaved_ntp_packets"] = int64(stats.v4.NTPInterleavedHits) +// case stats.v3 != nil: +// mx["ntp_packets_received"] = int64(stats.v3.NTPHits) +// mx["ntp_packets_dropped"] = int64(stats.v3.NTPDrops) +// mx["command_packets_received"] = int64(stats.v3.CMDHits) +// mx["command_packets_dropped"] = int64(stats.v3.CMDDrops) +// mx["client_log_records_dropped"] = int64(stats.v3.LogDrops) +// mx["nke_connections_accepted"] = int64(stats.v3.NKEHits) +// mx["nke_connections_dropped"] = int64(stats.v3.NKEDrops) +// mx["authenticated_ntp_packets"] = int64(stats.v3.NTPAuthHits) +// mx["interleaved_ntp_packets"] = int64(stats.v3.NTPInterleavedHits) +// case stats.v2 != nil: +// mx["ntp_packets_received"] = int64(stats.v2.NTPHits) +// mx["ntp_packets_dropped"] = int64(stats.v2.NTPDrops) +// mx["command_packets_received"] = int64(stats.v2.CMDHits) +// mx["command_packets_dropped"] = int64(stats.v2.CMDDrops) +// mx["client_log_records_dropped"] = int64(stats.v2.LogDrops) +// mx["nke_connections_accepted"] = int64(stats.v2.NKEHits) +// mx["nke_connections_dropped"] = int64(stats.v2.NKEDrops) +// mx["authenticated_ntp_packets"] = int64(stats.v2.NTPAuthHits) +// case stats.v1 != nil: +// mx["ntp_packets_received"] = int64(stats.v1.NTPHits) +// mx["ntp_packets_dropped"] = int64(stats.v1.NTPDrops) +// mx["command_packets_received"] = int64(stats.v1.CMDHits) +// mx["command_packets_dropped"] = int64(stats.v1.CMDDrops) +// mx["client_log_records_dropped"] = int64(stats.v1.LogDrops) +// default: +// return errors.New("invalid server stats reply") +// } +// +// //c.addStatsChartsOnce.Do(func() { c.addServerStatsCharts(stats) }) +// +// return nil +//} + +func boolToInt(v bool) int64 { + if v { + return 1 + } + return 0 +} + +func abs(v int64) int64 { + if v < 0 { + return -v + } + return v +} diff --git a/src/go/collectors/go.d.plugin/modules/chrony/config_schema.json b/src/go/plugin/go.d/modules/chrony/config_schema.json index 5de10a82..5de10a82 100644 --- a/src/go/collectors/go.d.plugin/modules/chrony/config_schema.json +++ b/src/go/plugin/go.d/modules/chrony/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/chrony/init.go b/src/go/plugin/go.d/modules/chrony/init.go index 828112c9..828112c9 100644 --- a/src/go/collectors/go.d.plugin/modules/chrony/init.go +++ b/src/go/plugin/go.d/modules/chrony/init.go diff --git a/src/go/collectors/go.d.plugin/modules/chrony/integrations/chrony.md b/src/go/plugin/go.d/modules/chrony/integrations/chrony.md index f6c80549..e9b9454d 100644 --- a/src/go/collectors/go.d.plugin/modules/chrony/integrations/chrony.md +++ b/src/go/plugin/go.d/modules/chrony/integrations/chrony.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/chrony/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/chrony/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/chrony/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/chrony/metadata.yaml" sidebar_label: "Chrony" learn_status: "Published" learn_rel_path: "Collecting Metrics/System Clock and NTP" @@ -162,6 +162,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `chrony` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -184,4 +186,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m chrony ``` +### Getting Logs + +If you're encountering problems with the `chrony` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep chrony +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep chrony /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep chrony +``` + diff --git a/src/go/collectors/go.d.plugin/modules/chrony/metadata.yaml b/src/go/plugin/go.d/modules/chrony/metadata.yaml index 18f9152e..18f9152e 100644 --- a/src/go/collectors/go.d.plugin/modules/chrony/metadata.yaml +++ b/src/go/plugin/go.d/modules/chrony/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/chrony/testdata/config.json b/src/go/plugin/go.d/modules/chrony/testdata/config.json index e8683472..e8683472 100644 --- a/src/go/collectors/go.d.plugin/modules/chrony/testdata/config.json +++ b/src/go/plugin/go.d/modules/chrony/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/chrony/testdata/config.yaml b/src/go/plugin/go.d/modules/chrony/testdata/config.yaml index 1b81d09e..1b81d09e 100644 --- a/src/go/collectors/go.d.plugin/modules/chrony/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/chrony/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/README.md b/src/go/plugin/go.d/modules/clickhouse/README.md index 078a1eee..078a1eee 120000 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/README.md +++ b/src/go/plugin/go.d/modules/clickhouse/README.md diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/charts.go b/src/go/plugin/go.d/modules/clickhouse/charts.go index cefcca1e..dcae1600 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/charts.go +++ b/src/go/plugin/go.d/modules/clickhouse/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/clickhouse.go b/src/go/plugin/go.d/modules/clickhouse/clickhouse.go index 21b7f1d3..3e34f726 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/clickhouse.go +++ b/src/go/plugin/go.d/modules/clickhouse/clickhouse.go @@ -8,8 +8,8 @@ import ( "net/http" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/clickhouse_test.go b/src/go/plugin/go.d/modules/clickhouse/clickhouse_test.go index de78bed4..c3defbda 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/clickhouse_test.go +++ b/src/go/plugin/go.d/modules/clickhouse/clickhouse_test.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/collect.go b/src/go/plugin/go.d/modules/clickhouse/collect.go index 8bb75652..8bb75652 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/collect.go +++ b/src/go/plugin/go.d/modules/clickhouse/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_async_metrics.go b/src/go/plugin/go.d/modules/clickhouse/collect_system_async_metrics.go index 46b8fed4..79b7e0ff 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_async_metrics.go +++ b/src/go/plugin/go.d/modules/clickhouse/collect_system_async_metrics.go @@ -6,7 +6,7 @@ import ( "errors" "strconv" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const querySystemAsyncMetrics = ` diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_disks.go b/src/go/plugin/go.d/modules/clickhouse/collect_system_disks.go index 7e1dbb8d..4b9829bf 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_disks.go +++ b/src/go/plugin/go.d/modules/clickhouse/collect_system_disks.go @@ -5,7 +5,7 @@ package clickhouse import ( "strconv" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const querySystemDisks = ` diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_events.go b/src/go/plugin/go.d/modules/clickhouse/collect_system_events.go index 94d99616..de3c33a1 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_events.go +++ b/src/go/plugin/go.d/modules/clickhouse/collect_system_events.go @@ -6,7 +6,7 @@ import ( "errors" "strconv" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const querySystemEvents = ` diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_metrics.go b/src/go/plugin/go.d/modules/clickhouse/collect_system_metrics.go index f7c3981c..26891f80 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_metrics.go +++ b/src/go/plugin/go.d/modules/clickhouse/collect_system_metrics.go @@ -6,7 +6,7 @@ import ( "errors" "strconv" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const querySystemMetrics = ` diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_parts.go b/src/go/plugin/go.d/modules/clickhouse/collect_system_parts.go index 08ffd602..3e9dc6ac 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_parts.go +++ b/src/go/plugin/go.d/modules/clickhouse/collect_system_parts.go @@ -6,7 +6,7 @@ import ( "fmt" "strconv" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const querySystemParts = ` diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_processes.go b/src/go/plugin/go.d/modules/clickhouse/collect_system_processes.go index d31103a8..53698ea6 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/collect_system_processes.go +++ b/src/go/plugin/go.d/modules/clickhouse/collect_system_processes.go @@ -5,7 +5,7 @@ package clickhouse import ( "strconv" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const queryLongestQueryTime = ` diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/config_schema.json b/src/go/plugin/go.d/modules/clickhouse/config_schema.json index e8b0ed2b..8b0129ec 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/config_schema.json +++ b/src/go/plugin/go.d/modules/clickhouse/config_schema.json @@ -123,6 +123,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/init.go b/src/go/plugin/go.d/modules/clickhouse/init.go index c8db54e4..4b8ce3e4 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/init.go +++ b/src/go/plugin/go.d/modules/clickhouse/init.go @@ -6,7 +6,7 @@ import ( "errors" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (c *ClickHouse) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/integrations/clickhouse.md b/src/go/plugin/go.d/modules/clickhouse/integrations/clickhouse.md index 27c0396d..c4f1384c 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/integrations/clickhouse.md +++ b/src/go/plugin/go.d/modules/clickhouse/integrations/clickhouse.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/clickhouse/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/clickhouse/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/clickhouse/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/clickhouse/metadata.yaml" sidebar_label: "ClickHouse" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -308,6 +308,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `clickhouse` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -330,4 +332,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m clickhouse ``` +### Getting Logs + +If you're encountering problems with the `clickhouse` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep clickhouse +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep clickhouse /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep clickhouse +``` + diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/metadata.yaml b/src/go/plugin/go.d/modules/clickhouse/metadata.yaml index e9a6b915..e9a6b915 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/metadata.yaml +++ b/src/go/plugin/go.d/modules/clickhouse/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/config.json b/src/go/plugin/go.d/modules/clickhouse/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/config.json +++ b/src/go/plugin/go.d/modules/clickhouse/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/config.yaml b/src/go/plugin/go.d/modules/clickhouse/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/clickhouse/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_longest_query_time.csv b/src/go/plugin/go.d/modules/clickhouse/testdata/resp_longest_query_time.csv index 85119aa6..85119aa6 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_longest_query_time.csv +++ b/src/go/plugin/go.d/modules/clickhouse/testdata/resp_longest_query_time.csv diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_async_metrics.csv b/src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_async_metrics.csv index 7c9da4f4..7c9da4f4 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_async_metrics.csv +++ b/src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_async_metrics.csv diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_disks.csv b/src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_disks.csv index 42751e54..42751e54 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_disks.csv +++ b/src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_disks.csv diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_events.csv b/src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_events.csv index 546e7e7e..546e7e7e 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_events.csv +++ b/src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_events.csv diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_metrics.csv b/src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_metrics.csv index d5ecc29a..d5ecc29a 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_metrics.csv +++ b/src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_metrics.csv diff --git a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_parts.csv b/src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_parts.csv index 6ade3324..6ade3324 100644 --- a/src/go/collectors/go.d.plugin/modules/clickhouse/testdata/resp_system_parts.csv +++ b/src/go/plugin/go.d/modules/clickhouse/testdata/resp_system_parts.csv diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/README.md b/src/go/plugin/go.d/modules/cockroachdb/README.md index a8130f26..a8130f26 120000 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/README.md +++ b/src/go/plugin/go.d/modules/cockroachdb/README.md diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go b/src/go/plugin/go.d/modules/cockroachdb/charts.go index d615ef23..2adfc5f9 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go +++ b/src/go/plugin/go.d/modules/cockroachdb/charts.go @@ -2,7 +2,7 @@ package cockroachdb -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( Charts = module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/cockroachdb.go b/src/go/plugin/go.d/modules/cockroachdb/cockroachdb.go index c07f22ef..32d13fa7 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/cockroachdb.go +++ b/src/go/plugin/go.d/modules/cockroachdb/cockroachdb.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/cockroachdb_test.go b/src/go/plugin/go.d/modules/cockroachdb/cockroachdb_test.go index b8abc1a4..886b65fa 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/cockroachdb_test.go +++ b/src/go/plugin/go.d/modules/cockroachdb/cockroachdb_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/collect.go b/src/go/plugin/go.d/modules/cockroachdb/collect.go index 1636a14d..9ba25513 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/collect.go +++ b/src/go/plugin/go.d/modules/cockroachdb/collect.go @@ -5,8 +5,8 @@ package cockroachdb import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) func validCockroachDBMetrics(scraped prometheus.Series) bool { diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/config_schema.json b/src/go/plugin/go.d/modules/cockroachdb/config_schema.json index e045b591..51b94f6a 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/config_schema.json +++ b/src/go/plugin/go.d/modules/cockroachdb/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/init.go b/src/go/plugin/go.d/modules/cockroachdb/init.go index fbe635a8..7558e995 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/init.go +++ b/src/go/plugin/go.d/modules/cockroachdb/init.go @@ -4,9 +4,9 @@ package cockroachdb import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) func (c *CockroachDB) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/integrations/cockroachdb.md b/src/go/plugin/go.d/modules/cockroachdb/integrations/cockroachdb.md index e9dc1a28..52e27a87 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/integrations/cockroachdb.md +++ b/src/go/plugin/go.d/modules/cockroachdb/integrations/cockroachdb.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/cockroachdb/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/cockroachdb/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/cockroachdb/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/cockroachdb/metadata.yaml" sidebar_label: "CockroachDB" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -263,6 +263,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `cockroachdb` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -285,4 +287,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m cockroachdb ``` +### Getting Logs + +If you're encountering problems with the `cockroachdb` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep cockroachdb +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep cockroachdb /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep cockroachdb +``` + diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/metadata.yaml b/src/go/plugin/go.d/modules/cockroachdb/metadata.yaml index 522f200a..522f200a 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/metadata.yaml +++ b/src/go/plugin/go.d/modules/cockroachdb/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/metrics.go b/src/go/plugin/go.d/modules/cockroachdb/metrics.go index fabd2549..fabd2549 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/metrics.go +++ b/src/go/plugin/go.d/modules/cockroachdb/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/testdata/config.json b/src/go/plugin/go.d/modules/cockroachdb/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/testdata/config.json +++ b/src/go/plugin/go.d/modules/cockroachdb/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/testdata/config.yaml b/src/go/plugin/go.d/modules/cockroachdb/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/cockroachdb/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/testdata/metrics.txt b/src/go/plugin/go.d/modules/cockroachdb/testdata/metrics.txt index ca537e10..ca537e10 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/testdata/metrics.txt +++ b/src/go/plugin/go.d/modules/cockroachdb/testdata/metrics.txt diff --git a/src/go/collectors/go.d.plugin/modules/cockroachdb/testdata/non_cockroachdb.txt b/src/go/plugin/go.d/modules/cockroachdb/testdata/non_cockroachdb.txt index f5f0ae08..f5f0ae08 100644 --- a/src/go/collectors/go.d.plugin/modules/cockroachdb/testdata/non_cockroachdb.txt +++ b/src/go/plugin/go.d/modules/cockroachdb/testdata/non_cockroachdb.txt diff --git a/src/go/collectors/go.d.plugin/modules/consul/README.md b/src/go/plugin/go.d/modules/consul/README.md index 5e57e46d..5e57e46d 120000 --- a/src/go/collectors/go.d.plugin/modules/consul/README.md +++ b/src/go/plugin/go.d/modules/consul/README.md diff --git a/src/go/collectors/go.d.plugin/modules/consul/charts.go b/src/go/plugin/go.d/modules/consul/charts.go index 3e6c50cf..697a0c36 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/charts.go +++ b/src/go/plugin/go.d/modules/consul/charts.go @@ -7,7 +7,7 @@ import ( "github.com/blang/semver/v4" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/consul/collect.go b/src/go/plugin/go.d/modules/consul/collect.go index 3b5ebfd3..3033e046 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/collect.go +++ b/src/go/plugin/go.d/modules/consul/collect.go @@ -8,7 +8,7 @@ import ( "io" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const ( @@ -69,12 +69,11 @@ func (c *Consul) isServer() bool { } func (c *Consul) doOKDecode(urlPath string, in interface{}, statusCodes ...int) error { - req, err := web.NewHTTPRequest(c.Request.Copy()) + req, err := web.NewHTTPRequestWithPath(c.Request, urlPath) if err != nil { return fmt.Errorf("error on creating request: %v", err) } - req.URL.Path = urlPath if c.ACLToken != "" { req.Header.Set("X-Consul-Token", c.ACLToken) } diff --git a/src/go/collectors/go.d.plugin/modules/consul/collect_autopilot.go b/src/go/plugin/go.d/modules/consul/collect_autopilot.go index e73ce9b2..e73ce9b2 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/collect_autopilot.go +++ b/src/go/plugin/go.d/modules/consul/collect_autopilot.go diff --git a/src/go/collectors/go.d.plugin/modules/consul/collect_checks.go b/src/go/plugin/go.d/modules/consul/collect_checks.go index 88ea4612..88ea4612 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/collect_checks.go +++ b/src/go/plugin/go.d/modules/consul/collect_checks.go diff --git a/src/go/collectors/go.d.plugin/modules/consul/collect_config.go b/src/go/plugin/go.d/modules/consul/collect_config.go index 14c77067..14c77067 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/collect_config.go +++ b/src/go/plugin/go.d/modules/consul/collect_config.go diff --git a/src/go/collectors/go.d.plugin/modules/consul/collect_metrics.go b/src/go/plugin/go.d/modules/consul/collect_metrics.go index 8dcfe183..557ecf64 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/collect_metrics.go +++ b/src/go/plugin/go.d/modules/consul/collect_metrics.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) func (c *Consul) collectMetricsPrometheus(mx map[string]int64) error { diff --git a/src/go/collectors/go.d.plugin/modules/consul/collect_net_rtt.go b/src/go/plugin/go.d/modules/consul/collect_net_rtt.go index 1b185371..80330d23 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/collect_net_rtt.go +++ b/src/go/plugin/go.d/modules/consul/collect_net_rtt.go @@ -4,7 +4,7 @@ import ( "math" "time" - "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/consul/config_schema.json b/src/go/plugin/go.d/modules/consul/config_schema.json index 18679ad0..a716e15e 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/config_schema.json +++ b/src/go/plugin/go.d/modules/consul/config_schema.json @@ -174,6 +174,15 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "acl_token": { + "ui:widget": "password" + }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/consul/consul.go b/src/go/plugin/go.d/modules/consul/consul.go index 2e2793fa..6389d065 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/consul.go +++ b/src/go/plugin/go.d/modules/consul/consul.go @@ -9,9 +9,9 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/blang/semver/v4" ) diff --git a/src/go/collectors/go.d.plugin/modules/consul/consul_test.go b/src/go/plugin/go.d/modules/consul/consul_test.go index 9d53b6cb..ccc9f99b 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/consul_test.go +++ b/src/go/plugin/go.d/modules/consul/consul_test.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/consul/init.go b/src/go/plugin/go.d/modules/consul/init.go index 944609a1..4ba5b86e 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/init.go +++ b/src/go/plugin/go.d/modules/consul/init.go @@ -7,8 +7,8 @@ import ( "net/http" "net/url" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (c *Consul) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/consul/integrations/consul.md b/src/go/plugin/go.d/modules/consul/integrations/consul.md index c8d014d0..3a364bfd 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/integrations/consul.md +++ b/src/go/plugin/go.d/modules/consul/integrations/consul.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/consul/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/consul/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/consul/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/consul/metadata.yaml" sidebar_label: "Consul" learn_status: "Published" learn_rel_path: "Collecting Metrics/Service Discovery / Registry" @@ -299,6 +299,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `consul` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -321,4 +323,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m consul ``` +### Getting Logs + +If you're encountering problems with the `consul` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep consul +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep consul /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep consul +``` + diff --git a/src/go/collectors/go.d.plugin/modules/consul/metadata.yaml b/src/go/plugin/go.d/modules/consul/metadata.yaml index 34445cd7..34445cd7 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/metadata.yaml +++ b/src/go/plugin/go.d/modules/consul/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/config.json b/src/go/plugin/go.d/modules/consul/testdata/config.json index bcd07a41..bcd07a41 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/config.json +++ b/src/go/plugin/go.d/modules/consul/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/config.yaml b/src/go/plugin/go.d/modules/consul/testdata/config.yaml index def554c7..def554c7 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/consul/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/client_v1-agent-metrics.txt b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/client_v1-agent-metrics.txt index e93e677d..e93e677d 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/client_v1-agent-metrics.txt +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/client_v1-agent-metrics.txt diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/client_v1-agent-self.json b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/client_v1-agent-self.json index e5f75dc2..e5f75dc2 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/client_v1-agent-self.json +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/client_v1-agent-self.json diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-metrics.txt b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-metrics.txt index 63dbaddf..63dbaddf 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-metrics.txt +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-metrics.txt diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-metrics_with_hostname.txt b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-metrics_with_hostname.txt index a5df1d58..a5df1d58 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-metrics_with_hostname.txt +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-metrics_with_hostname.txt diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-self.json b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-self.json index 0b11cda5..0b11cda5 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-self.json +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-self.json diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-self_cloud-managed.json b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-self_cloud-managed.json index 0b11cda5..0b11cda5 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-self_cloud-managed.json +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-self_cloud-managed.json diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-self_disabled_prom.json b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-self_disabled_prom.json index c964d10f..c964d10f 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-self_disabled_prom.json +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-self_disabled_prom.json diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-self_with_hostname.json b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-self_with_hostname.json index dfe37bcc..dfe37bcc 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-agent-self_with_hostname.json +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-agent-self_with_hostname.json diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-coordinate-nodes.json b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-coordinate-nodes.json index 8f3f6383..8f3f6383 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-coordinate-nodes.json +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-coordinate-nodes.json diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-operator-autopilot-health.json b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-operator-autopilot-health.json index 4acee01e..4acee01e 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/server_v1-operator-autopilot-health.json +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/server_v1-operator-autopilot-health.json diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/v1-agent-checks.json b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/v1-agent-checks.json index b8967cb7..b8967cb7 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.13.2/v1-agent-checks.json +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.13.2/v1-agent-checks.json diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.14.3-cloud/server_v1-agent-metrics.txt b/src/go/plugin/go.d/modules/consul/testdata/v1.14.3-cloud/server_v1-agent-metrics.txt index 094f0350..094f0350 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.14.3-cloud/server_v1-agent-metrics.txt +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.14.3-cloud/server_v1-agent-metrics.txt diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.14.3-cloud/server_v1-agent-self.json b/src/go/plugin/go.d/modules/consul/testdata/v1.14.3-cloud/server_v1-agent-self.json index 8a11b7d0..8a11b7d0 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.14.3-cloud/server_v1-agent-self.json +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.14.3-cloud/server_v1-agent-self.json diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.14.3-cloud/server_v1-coordinate-nodes.json b/src/go/plugin/go.d/modules/consul/testdata/v1.14.3-cloud/server_v1-coordinate-nodes.json index bfe44c7f..bfe44c7f 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.14.3-cloud/server_v1-coordinate-nodes.json +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.14.3-cloud/server_v1-coordinate-nodes.json diff --git a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.14.3-cloud/v1-agent-checks.json b/src/go/plugin/go.d/modules/consul/testdata/v1.14.3-cloud/v1-agent-checks.json index 0daa492c..0daa492c 100644 --- a/src/go/collectors/go.d.plugin/modules/consul/testdata/v1.14.3-cloud/v1-agent-checks.json +++ b/src/go/plugin/go.d/modules/consul/testdata/v1.14.3-cloud/v1-agent-checks.json diff --git a/src/go/collectors/go.d.plugin/modules/coredns/README.md b/src/go/plugin/go.d/modules/coredns/README.md index fcd7e554..fcd7e554 120000 --- a/src/go/collectors/go.d.plugin/modules/coredns/README.md +++ b/src/go/plugin/go.d/modules/coredns/README.md diff --git a/src/go/collectors/go.d.plugin/modules/coredns/charts.go b/src/go/plugin/go.d/modules/coredns/charts.go index fecc1736..fd93efad 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/charts.go +++ b/src/go/plugin/go.d/modules/coredns/charts.go @@ -2,7 +2,7 @@ package coredns -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( // Charts is an alias for module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/coredns/collect.go b/src/go/plugin/go.d/modules/coredns/collect.go index b77f9a29..d6137b18 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/collect.go +++ b/src/go/plugin/go.d/modules/coredns/collect.go @@ -8,8 +8,8 @@ import ( "strings" "github.com/blang/semver/v4" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/coredns/config_schema.json b/src/go/plugin/go.d/modules/coredns/config_schema.json index 77134298..d5f87912 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/config_schema.json +++ b/src/go/plugin/go.d/modules/coredns/config_schema.json @@ -40,7 +40,7 @@ "properties": { "includes": { "title": "Include", - "description": "Include servers whose names match any of the specified inclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "description": "Include servers whose names match any of the specified inclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme).", "type": [ "array", "null" @@ -53,7 +53,7 @@ }, "excludes": { "title": "Exclude", - "description": "Exclude servers whose names match any of the specified exclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "description": "Exclude servers whose names match any of the specified exclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme).", "type": [ "array", "null" @@ -76,7 +76,7 @@ "properties": { "includes": { "title": "Include", - "description": "Include zones whose names match any of the specified inclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "description": "Include zones whose names match any of the specified inclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme).", "type": [ "array", "null" @@ -89,7 +89,7 @@ }, "excludes": { "title": "Exclude", - "description": "Exclude zones whose names match any of the specified exclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "description": "Exclude zones whose names match any of the specified exclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme).", "type": [ "array", "null" @@ -254,6 +254,12 @@ "ui:help": "The logic for inclusion and exclusion is as follows: `(include1 OR include2) AND !(exclude1 OR exclude2)`.", "ui:collapsible": true }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/coredns/coredns.go b/src/go/plugin/go.d/modules/coredns/coredns.go index 66937397..c91af7d1 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/coredns.go +++ b/src/go/plugin/go.d/modules/coredns/coredns.go @@ -7,10 +7,10 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/blang/semver/v4" ) diff --git a/src/go/collectors/go.d.plugin/modules/coredns/coredns_test.go b/src/go/plugin/go.d/modules/coredns/coredns_test.go index df5dc150..5d67b417 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/coredns_test.go +++ b/src/go/plugin/go.d/modules/coredns/coredns_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/coredns/init.go b/src/go/plugin/go.d/modules/coredns/init.go index 1e3a7be5..e2b888bb 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/init.go +++ b/src/go/plugin/go.d/modules/coredns/init.go @@ -5,9 +5,9 @@ package coredns import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (cd *CoreDNS) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/coredns/integrations/coredns.md b/src/go/plugin/go.d/modules/coredns/integrations/coredns.md index ef942222..549e2d8d 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/integrations/coredns.md +++ b/src/go/plugin/go.d/modules/coredns/integrations/coredns.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/coredns/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/coredns/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/coredns/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/coredns/metadata.yaml" sidebar_label: "CoreDNS" learn_status: "Published" learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" @@ -177,7 +177,7 @@ The following options can be defined globally: update_every, autodetection_retry Metrics of servers matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#supported-format). +- Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#supported-format). - Syntax: ```yaml @@ -195,7 +195,7 @@ per_server_stats: Metrics of zones matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#supported-format). +- Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#supported-format). - Syntax: ```yaml @@ -269,6 +269,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `coredns` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -291,4 +293,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m coredns ``` +### Getting Logs + +If you're encountering problems with the `coredns` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep coredns +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep coredns /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep coredns +``` + diff --git a/src/go/collectors/go.d.plugin/modules/coredns/metadata.yaml b/src/go/plugin/go.d/modules/coredns/metadata.yaml index 27f70fdc..e128ab54 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/metadata.yaml +++ b/src/go/plugin/go.d/modules/coredns/metadata.yaml @@ -70,7 +70,7 @@ modules: detailed_description: | Metrics of servers matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) - - Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#supported-format). + - Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#supported-format). - Syntax: ```yaml @@ -89,7 +89,7 @@ modules: detailed_description: | Metrics of zones matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) - - Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#supported-format). + - Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#supported-format). - Syntax: ```yaml diff --git a/src/go/collectors/go.d.plugin/modules/coredns/metrics.go b/src/go/plugin/go.d/modules/coredns/metrics.go index 1c72041b..5929fdbf 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/metrics.go +++ b/src/go/plugin/go.d/modules/coredns/metrics.go @@ -3,7 +3,7 @@ package coredns import ( - mtx "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" + mtx "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" ) func newMetrics() *metrics { diff --git a/src/go/collectors/go.d.plugin/modules/coredns/testdata/config.json b/src/go/plugin/go.d/modules/coredns/testdata/config.json index 2dc54a1a..2dc54a1a 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/testdata/config.json +++ b/src/go/plugin/go.d/modules/coredns/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/coredns/testdata/config.yaml b/src/go/plugin/go.d/modules/coredns/testdata/config.yaml index be474167..be474167 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/coredns/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/coredns/testdata/no_version/no_load.txt b/src/go/plugin/go.d/modules/coredns/testdata/no_version/no_load.txt index f0de841f..f0de841f 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/testdata/no_version/no_load.txt +++ b/src/go/plugin/go.d/modules/coredns/testdata/no_version/no_load.txt diff --git a/src/go/collectors/go.d.plugin/modules/coredns/testdata/version169/no_load.txt b/src/go/plugin/go.d/modules/coredns/testdata/version169/no_load.txt index 8fee1a73..8fee1a73 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/testdata/version169/no_load.txt +++ b/src/go/plugin/go.d/modules/coredns/testdata/version169/no_load.txt diff --git a/src/go/collectors/go.d.plugin/modules/coredns/testdata/version169/some_load.txt b/src/go/plugin/go.d/modules/coredns/testdata/version169/some_load.txt index 15c4a57e..15c4a57e 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/testdata/version169/some_load.txt +++ b/src/go/plugin/go.d/modules/coredns/testdata/version169/some_load.txt diff --git a/src/go/collectors/go.d.plugin/modules/coredns/testdata/version170/no_load.txt b/src/go/plugin/go.d/modules/coredns/testdata/version170/no_load.txt index ba343ab5..ba343ab5 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/testdata/version170/no_load.txt +++ b/src/go/plugin/go.d/modules/coredns/testdata/version170/no_load.txt diff --git a/src/go/collectors/go.d.plugin/modules/coredns/testdata/version170/some_load.txt b/src/go/plugin/go.d/modules/coredns/testdata/version170/some_load.txt index 34f0a9a2..34f0a9a2 100644 --- a/src/go/collectors/go.d.plugin/modules/coredns/testdata/version170/some_load.txt +++ b/src/go/plugin/go.d/modules/coredns/testdata/version170/some_load.txt diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/README.md b/src/go/plugin/go.d/modules/couchbase/README.md index fa8d05e1..fa8d05e1 120000 --- a/src/go/collectors/go.d.plugin/modules/couchbase/README.md +++ b/src/go/plugin/go.d/modules/couchbase/README.md diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/charts.go b/src/go/plugin/go.d/modules/couchbase/charts.go index 79271809..277b814a 100644 --- a/src/go/collectors/go.d.plugin/modules/couchbase/charts.go +++ b/src/go/plugin/go.d/modules/couchbase/charts.go @@ -3,7 +3,7 @@ package couchbase import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) type ( diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/collect.go b/src/go/plugin/go.d/modules/couchbase/collect.go index 2d4d3626..6027ac91 100644 --- a/src/go/collectors/go.d.plugin/modules/couchbase/collect.go +++ b/src/go/plugin/go.d/modules/couchbase/collect.go @@ -9,8 +9,8 @@ import ( "net/http" "net/url" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const ( @@ -112,11 +112,13 @@ func (cb *Couchbase) addDimToChart(chartID string, dim *module.Dim) { } func (cb *Couchbase) scrapeCouchbase() (*cbMetrics, error) { - ms := &cbMetrics{} - req, _ := web.NewHTTPRequest(cb.Request) - req.URL.Path = urlPathBucketsStats + req, err := web.NewHTTPRequestWithPath(cb.Request, urlPathBucketsStats) + if err != nil { + return nil, err + } req.URL.RawQuery = url.Values{"skipMap": []string{"true"}}.Encode() + ms := &cbMetrics{} if err := cb.doOKDecode(req, &ms.BucketsBasicStats); err != nil { return nil, err } diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/config_schema.json b/src/go/plugin/go.d/modules/couchbase/config_schema.json index 7a69e994..6ef455a9 100644 --- a/src/go/collectors/go.d.plugin/modules/couchbase/config_schema.json +++ b/src/go/plugin/go.d/modules/couchbase/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/couchbase.go b/src/go/plugin/go.d/modules/couchbase/couchbase.go index 92a82f2f..8ef880c2 100644 --- a/src/go/collectors/go.d.plugin/modules/couchbase/couchbase.go +++ b/src/go/plugin/go.d/modules/couchbase/couchbase.go @@ -8,8 +8,8 @@ import ( "net/http" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/couchbase_test.go b/src/go/plugin/go.d/modules/couchbase/couchbase_test.go index 9c792b7d..b28c8e8f 100644 --- a/src/go/collectors/go.d.plugin/modules/couchbase/couchbase_test.go +++ b/src/go/plugin/go.d/modules/couchbase/couchbase_test.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/init.go b/src/go/plugin/go.d/modules/couchbase/init.go index 255e0354..196e6998 100644 --- a/src/go/collectors/go.d.plugin/modules/couchbase/init.go +++ b/src/go/plugin/go.d/modules/couchbase/init.go @@ -6,8 +6,8 @@ import ( "errors" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (cb *Couchbase) initCharts() (*Charts, error) { diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/integrations/couchbase.md b/src/go/plugin/go.d/modules/couchbase/integrations/couchbase.md index 209d851f..b53dc940 100644 --- a/src/go/collectors/go.d.plugin/modules/couchbase/integrations/couchbase.md +++ b/src/go/plugin/go.d/modules/couchbase/integrations/couchbase.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/couchbase/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/couchbase/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/couchbase/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/couchbase/metadata.yaml" sidebar_label: "Couchbase" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -187,6 +187,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `couchbase` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -209,4 +211,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m couchbase ``` +### Getting Logs + +If you're encountering problems with the `couchbase` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep couchbase +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep couchbase /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep couchbase +``` + diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/metadata.yaml b/src/go/plugin/go.d/modules/couchbase/metadata.yaml index de21e924..de21e924 100644 --- a/src/go/collectors/go.d.plugin/modules/couchbase/metadata.yaml +++ b/src/go/plugin/go.d/modules/couchbase/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/metrics.go b/src/go/plugin/go.d/modules/couchbase/metrics.go index c4f23304..c4f23304 100644 --- a/src/go/collectors/go.d.plugin/modules/couchbase/metrics.go +++ b/src/go/plugin/go.d/modules/couchbase/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/testdata/6.6.0/buckets_basic_stats.json b/src/go/plugin/go.d/modules/couchbase/testdata/6.6.0/buckets_basic_stats.json index 3749add7..3749add7 100644 --- a/src/go/collectors/go.d.plugin/modules/couchbase/testdata/6.6.0/buckets_basic_stats.json +++ b/src/go/plugin/go.d/modules/couchbase/testdata/6.6.0/buckets_basic_stats.json diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/testdata/config.json b/src/go/plugin/go.d/modules/couchbase/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/couchbase/testdata/config.json +++ b/src/go/plugin/go.d/modules/couchbase/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/couchbase/testdata/config.yaml b/src/go/plugin/go.d/modules/couchbase/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/couchbase/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/couchbase/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/README.md b/src/go/plugin/go.d/modules/couchdb/README.md index 14cff4d3..14cff4d3 120000 --- a/src/go/collectors/go.d.plugin/modules/couchdb/README.md +++ b/src/go/plugin/go.d/modules/couchdb/README.md diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/charts.go b/src/go/plugin/go.d/modules/couchdb/charts.go index 3dedec7d..3d84471d 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/charts.go +++ b/src/go/plugin/go.d/modules/couchdb/charts.go @@ -3,7 +3,7 @@ package couchdb import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) type ( diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/collect.go b/src/go/plugin/go.d/modules/couchdb/collect.go index 5c722fd0..21b38fb3 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/collect.go +++ b/src/go/plugin/go.d/modules/couchdb/collect.go @@ -13,8 +13,8 @@ import ( "strings" "sync" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const ( @@ -120,8 +120,7 @@ func (cdb *CouchDB) scrapeCouchDB() *cdbMetrics { } func (cdb *CouchDB) scrapeNodeStats(ms *cdbMetrics) { - req, _ := web.NewHTTPRequest(cdb.Request) - req.URL.Path = fmt.Sprintf(urlPathOverviewStats, cdb.Config.Node) + req, _ := web.NewHTTPRequestWithPath(cdb.Request, fmt.Sprintf(urlPathOverviewStats, cdb.Config.Node)) var stats cdbNodeStats if err := cdb.doOKDecode(req, &stats); err != nil { @@ -132,8 +131,7 @@ func (cdb *CouchDB) scrapeNodeStats(ms *cdbMetrics) { } func (cdb *CouchDB) scrapeSystemStats(ms *cdbMetrics) { - req, _ := web.NewHTTPRequest(cdb.Request) - req.URL.Path = fmt.Sprintf(urlPathSystemStats, cdb.Config.Node) + req, _ := web.NewHTTPRequestWithPath(cdb.Request, fmt.Sprintf(urlPathSystemStats, cdb.Config.Node)) var stats cdbNodeSystem if err := cdb.doOKDecode(req, &stats); err != nil { @@ -144,8 +142,7 @@ func (cdb *CouchDB) scrapeSystemStats(ms *cdbMetrics) { } func (cdb *CouchDB) scrapeActiveTasks(ms *cdbMetrics) { - req, _ := web.NewHTTPRequest(cdb.Request) - req.URL.Path = urlPathActiveTasks + req, _ := web.NewHTTPRequestWithPath(cdb.Request, urlPathActiveTasks) var stats []cdbActiveTask if err := cdb.doOKDecode(req, &stats); err != nil { @@ -156,8 +153,7 @@ func (cdb *CouchDB) scrapeActiveTasks(ms *cdbMetrics) { } func (cdb *CouchDB) scrapeDBStats(ms *cdbMetrics) { - req, _ := web.NewHTTPRequest(cdb.Request) - req.URL.Path = urlPathDatabases + req, _ := web.NewHTTPRequestWithPath(cdb.Request, urlPathDatabases) req.Method = http.MethodPost req.Header.Add("Accept", "application/json") req.Header.Add("Content-Type", "application/json") @@ -182,18 +178,18 @@ func (cdb *CouchDB) scrapeDBStats(ms *cdbMetrics) { } func findMaxMQSize(MessageQueues map[string]interface{}) int64 { - var max float64 + var maxSize float64 for _, mq := range MessageQueues { switch mqSize := mq.(type) { case float64: - max = math.Max(max, mqSize) + maxSize = math.Max(maxSize, mqSize) case map[string]interface{}: if v, ok := mqSize["count"].(float64); ok { - max = math.Max(max, v) + maxSize = math.Max(maxSize, v) } } } - return int64(max) + return int64(maxSize) } func (cdb *CouchDB) pingCouchDB() error { diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/config_schema.json b/src/go/plugin/go.d/modules/couchdb/config_schema.json index 2f9df722..0df439b0 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/config_schema.json +++ b/src/go/plugin/go.d/modules/couchdb/config_schema.json @@ -181,6 +181,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/couchdb.go b/src/go/plugin/go.d/modules/couchdb/couchdb.go index 459251e9..56563ec7 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/couchdb.go +++ b/src/go/plugin/go.d/modules/couchdb/couchdb.go @@ -9,8 +9,8 @@ import ( "strings" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/couchdb_test.go b/src/go/plugin/go.d/modules/couchdb/couchdb_test.go index 15e7aa0a..99b7825f 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/couchdb_test.go +++ b/src/go/plugin/go.d/modules/couchdb/couchdb_test.go @@ -8,9 +8,9 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/init.go b/src/go/plugin/go.d/modules/couchdb/init.go index 02884815..65e55574 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/init.go +++ b/src/go/plugin/go.d/modules/couchdb/init.go @@ -6,8 +6,8 @@ import ( "errors" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (cdb *CouchDB) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/integrations/couchdb.md b/src/go/plugin/go.d/modules/couchdb/integrations/couchdb.md index 8a59d181..5e7f578c 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/integrations/couchdb.md +++ b/src/go/plugin/go.d/modules/couchdb/integrations/couchdb.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/couchdb/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/couchdb/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/couchdb/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/couchdb/metadata.yaml" sidebar_label: "CouchDB" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -200,6 +200,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `couchdb` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -222,4 +224,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m couchdb ``` +### Getting Logs + +If you're encountering problems with the `couchdb` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep couchdb +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep couchdb /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep couchdb +``` + diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/metadata.yaml b/src/go/plugin/go.d/modules/couchdb/metadata.yaml index 2f0036db..2f0036db 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/metadata.yaml +++ b/src/go/plugin/go.d/modules/couchdb/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/metrics.go b/src/go/plugin/go.d/modules/couchdb/metrics.go index 4d2f0267..4d2f0267 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/metrics.go +++ b/src/go/plugin/go.d/modules/couchdb/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/config.json b/src/go/plugin/go.d/modules/couchdb/testdata/config.json index 0fa716e5..0fa716e5 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/config.json +++ b/src/go/plugin/go.d/modules/couchdb/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/config.yaml b/src/go/plugin/go.d/modules/couchdb/testdata/config.yaml index 4968ed26..4968ed26 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/couchdb/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/active_tasks.json b/src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/active_tasks.json index 788fe564..788fe564 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/active_tasks.json +++ b/src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/active_tasks.json diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/dbs_info.json b/src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/dbs_info.json index 9ca43a53..9ca43a53 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/dbs_info.json +++ b/src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/dbs_info.json diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/node_stats.json b/src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/node_stats.json index ae31366a..ae31366a 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/node_stats.json +++ b/src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/node_stats.json diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/node_system.json b/src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/node_system.json index 7084645a..7084645a 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/node_system.json +++ b/src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/node_system.json diff --git a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/root.json b/src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/root.json index e7feb41c..e7feb41c 100644 --- a/src/go/collectors/go.d.plugin/modules/couchdb/testdata/v3.1.1/root.json +++ b/src/go/plugin/go.d/modules/couchdb/testdata/v3.1.1/root.json diff --git a/src/go/collectors/go.d.plugin/modules/dmcache/README.md b/src/go/plugin/go.d/modules/dmcache/README.md index 9609ec86..9609ec86 120000 --- a/src/go/collectors/go.d.plugin/modules/dmcache/README.md +++ b/src/go/plugin/go.d/modules/dmcache/README.md diff --git a/src/go/collectors/go.d.plugin/modules/dmcache/charts.go b/src/go/plugin/go.d/modules/dmcache/charts.go index 0f57d40a..c77f3d87 100644 --- a/src/go/collectors/go.d.plugin/modules/dmcache/charts.go +++ b/src/go/plugin/go.d/modules/dmcache/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/dmcache/collect.go b/src/go/plugin/go.d/modules/dmcache/collect.go index eae961b7..eae961b7 100644 --- a/src/go/collectors/go.d.plugin/modules/dmcache/collect.go +++ b/src/go/plugin/go.d/modules/dmcache/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/dmcache/config_schema.json b/src/go/plugin/go.d/modules/dmcache/config_schema.json index 4428b4d1..4428b4d1 100644 --- a/src/go/collectors/go.d.plugin/modules/dmcache/config_schema.json +++ b/src/go/plugin/go.d/modules/dmcache/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/dmcache/dmcache.go b/src/go/plugin/go.d/modules/dmcache/dmcache.go index c7eb5ea1..9f3844b1 100644 --- a/src/go/collectors/go.d.plugin/modules/dmcache/dmcache.go +++ b/src/go/plugin/go.d/modules/dmcache/dmcache.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/dmcache/dmcache_test.go b/src/go/plugin/go.d/modules/dmcache/dmcache_test.go index ef2de991..218ae044 100644 --- a/src/go/collectors/go.d.plugin/modules/dmcache/dmcache_test.go +++ b/src/go/plugin/go.d/modules/dmcache/dmcache_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/dmcache/exec.go b/src/go/plugin/go.d/modules/dmcache/exec.go index 9d860ffb..1cd11be3 100644 --- a/src/go/collectors/go.d.plugin/modules/dmcache/exec.go +++ b/src/go/plugin/go.d/modules/dmcache/exec.go @@ -8,7 +8,7 @@ import ( "os/exec" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" ) func newDmsetupExec(ndsudoPath string, timeout time.Duration, log *logger.Logger) *dmsetupExec { diff --git a/src/go/collectors/go.d.plugin/modules/dmcache/init.go b/src/go/plugin/go.d/modules/dmcache/init.go index 888e278a..229972da 100644 --- a/src/go/collectors/go.d.plugin/modules/dmcache/init.go +++ b/src/go/plugin/go.d/modules/dmcache/init.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" + "github.com/netdata/netdata/go/plugins/pkg/executable" ) func (c *DmCache) initDmsetupCLI() (dmsetupCLI, error) { diff --git a/src/go/collectors/go.d.plugin/modules/dmcache/integrations/dmcache_devices.md b/src/go/plugin/go.d/modules/dmcache/integrations/dmcache_devices.md index 7dfa898f..ac61311b 100644 --- a/src/go/collectors/go.d.plugin/modules/dmcache/integrations/dmcache_devices.md +++ b/src/go/plugin/go.d/modules/dmcache/integrations/dmcache_devices.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/dmcache/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/dmcache/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dmcache/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dmcache/metadata.yaml" sidebar_label: "DMCache devices" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -138,6 +138,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `dmcache` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -160,4 +162,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m dmcache ``` +### Getting Logs + +If you're encountering problems with the `dmcache` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep dmcache +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep dmcache /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep dmcache +``` + diff --git a/src/go/collectors/go.d.plugin/modules/dmcache/metadata.yaml b/src/go/plugin/go.d/modules/dmcache/metadata.yaml index 58d9e462..58d9e462 100644 --- a/src/go/collectors/go.d.plugin/modules/dmcache/metadata.yaml +++ b/src/go/plugin/go.d/modules/dmcache/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/dmcache/testdata/config.json b/src/go/plugin/go.d/modules/dmcache/testdata/config.json index 291ecee3..291ecee3 100644 --- a/src/go/collectors/go.d.plugin/modules/dmcache/testdata/config.json +++ b/src/go/plugin/go.d/modules/dmcache/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/dmcache/testdata/config.yaml b/src/go/plugin/go.d/modules/dmcache/testdata/config.yaml index 25b0b4c7..25b0b4c7 100644 --- a/src/go/collectors/go.d.plugin/modules/dmcache/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/dmcache/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/README.md b/src/go/plugin/go.d/modules/dnsdist/README.md index c5fd71aa..c5fd71aa 120000 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/README.md +++ b/src/go/plugin/go.d/modules/dnsdist/README.md diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/charts.go b/src/go/plugin/go.d/modules/dnsdist/charts.go index 8a9914ca..24e1a8c8 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/charts.go +++ b/src/go/plugin/go.d/modules/dnsdist/charts.go @@ -2,7 +2,7 @@ package dnsdist -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" var charts = module.Charts{ { diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/collect.go b/src/go/plugin/go.d/modules/dnsdist/collect.go index 65075747..9b860abf 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/collect.go +++ b/src/go/plugin/go.d/modules/dnsdist/collect.go @@ -9,8 +9,8 @@ import ( "net/http" "net/url" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const ( @@ -36,8 +36,10 @@ func (d *DNSdist) collectStatistic(collected map[string]int64, statistics *stati } func (d *DNSdist) scrapeStatistics() (*statisticMetrics, error) { - req, _ := web.NewHTTPRequest(d.Request) - req.URL.Path = urlPathJSONStat + req, err := web.NewHTTPRequestWithPath(d.Request, urlPathJSONStat) + if err != nil { + return nil, err + } req.URL.RawQuery = url.Values{"command": []string{"stats"}}.Encode() var statistics statisticMetrics diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/config_schema.json b/src/go/plugin/go.d/modules/dnsdist/config_schema.json index d635ab1a..a71faaa0 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/config_schema.json +++ b/src/go/plugin/go.d/modules/dnsdist/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/dnsdist.go b/src/go/plugin/go.d/modules/dnsdist/dnsdist.go index 97f3eb2a..fd0d8a38 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/dnsdist.go +++ b/src/go/plugin/go.d/modules/dnsdist/dnsdist.go @@ -8,8 +8,8 @@ import ( "net/http" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/dnsdist_test.go b/src/go/plugin/go.d/modules/dnsdist/dnsdist_test.go index 06d88103..18212c79 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/dnsdist_test.go +++ b/src/go/plugin/go.d/modules/dnsdist/dnsdist_test.go @@ -3,14 +3,14 @@ package dnsdist import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "net/http" "net/http/httptest" "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/init.go b/src/go/plugin/go.d/modules/dnsdist/init.go index d8831088..d331da92 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/init.go +++ b/src/go/plugin/go.d/modules/dnsdist/init.go @@ -6,8 +6,8 @@ import ( "errors" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (d *DNSdist) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/integrations/dnsdist.md b/src/go/plugin/go.d/modules/dnsdist/integrations/dnsdist.md index c1acaf53..934245a5 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/integrations/dnsdist.md +++ b/src/go/plugin/go.d/modules/dnsdist/integrations/dnsdist.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/dnsdist/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/dnsdist/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dnsdist/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dnsdist/metadata.yaml" sidebar_label: "DNSdist" learn_status: "Published" learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" @@ -185,6 +185,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `dnsdist` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -207,4 +209,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m dnsdist ``` +### Getting Logs + +If you're encountering problems with the `dnsdist` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep dnsdist +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep dnsdist /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep dnsdist +``` + diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/metadata.yaml b/src/go/plugin/go.d/modules/dnsdist/metadata.yaml index 4e7a45d3..4e7a45d3 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/metadata.yaml +++ b/src/go/plugin/go.d/modules/dnsdist/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/metrics.go b/src/go/plugin/go.d/modules/dnsdist/metrics.go index 1de04319..1de04319 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/metrics.go +++ b/src/go/plugin/go.d/modules/dnsdist/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/testdata/config.json b/src/go/plugin/go.d/modules/dnsdist/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/testdata/config.json +++ b/src/go/plugin/go.d/modules/dnsdist/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/testdata/config.yaml b/src/go/plugin/go.d/modules/dnsdist/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/dnsdist/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/dnsdist/testdata/v1.5.1/jsonstat.json b/src/go/plugin/go.d/modules/dnsdist/testdata/v1.5.1/jsonstat.json index 37b791e4..37b791e4 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsdist/testdata/v1.5.1/jsonstat.json +++ b/src/go/plugin/go.d/modules/dnsdist/testdata/v1.5.1/jsonstat.json diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq/README.md b/src/go/plugin/go.d/modules/dnsmasq/README.md index a424dd9c..a424dd9c 120000 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq/README.md +++ b/src/go/plugin/go.d/modules/dnsmasq/README.md diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq/charts.go b/src/go/plugin/go.d/modules/dnsmasq/charts.go index 70a3e699..403e7862 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq/charts.go +++ b/src/go/plugin/go.d/modules/dnsmasq/charts.go @@ -2,7 +2,7 @@ package dnsmasq -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" var cacheCharts = module.Charts{ { diff --git a/src/go/plugin/go.d/modules/dnsmasq/collect.go b/src/go/plugin/go.d/modules/dnsmasq/collect.go new file mode 100644 index 00000000..9f3f963f --- /dev/null +++ b/src/go/plugin/go.d/modules/dnsmasq/collect.go @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package dnsmasq + +import ( + "fmt" + "strconv" + "strings" + + "github.com/miekg/dns" +) + +func (d *Dnsmasq) collect() (map[string]int64, error) { + mx := make(map[string]int64) + + if err := d.collectCacheStatistics(mx); err != nil { + return nil, err + } + + return mx, nil +} + +func (d *Dnsmasq) collectCacheStatistics(mx map[string]int64) error { + /* + ;; flags: qr aa rd ra; QUERY: 7, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 0 + + ;; QUESTION SECTION: + ;cachesize.bind. CH TXT + ;insertions.bind. CH TXT + ;evictions.bind. CH TXT + ;hits.bind. CH TXT + ;misses.bind. CH TXT + ;auth.bind. CH TXT + ;servers.bind. CH TXT + + ;; ANSWER SECTION: + cachesize.bind. 0 CH TXT "150" + insertions.bind. 0 CH TXT "1" + evictions.bind. 0 CH TXT "0" + hits.bind. 0 CH TXT "176" + misses.bind. 0 CH TXT "4" + auth.bind. 0 CH TXT "0" + servers.bind. 0 CH TXT "10.0.0.1#53 0 0" "1.1.1.1#53 4 3" "1.0.0.1#53 3 0" + */ + + questions := []string{ + "servers.bind.", + "cachesize.bind.", + "insertions.bind.", + "evictions.bind.", + "hits.bind.", + "misses.bind.", + // auth.bind query is only supported if dnsmasq has been built to support running as an authoritative name server + // See https://github.com/netdata/netdata/issues/13766 + //"auth.bind.", + } + + for _, q := range questions { + resp, err := d.query(q) + if err != nil { + return err + } + + for _, a := range resp.Answer { + txt, ok := a.(*dns.TXT) + if !ok { + continue + } + + idx := strings.IndexByte(txt.Hdr.Name, '.') + if idx == -1 { + continue + } + + name := txt.Hdr.Name[:idx] + + switch name { + case "servers": + for _, entry := range txt.Txt { + parts := strings.Fields(entry) + if len(parts) != 3 { + return fmt.Errorf("parse %s (%s): unexpected format", txt.Hdr.Name, entry) + } + queries, err := strconv.ParseFloat(parts[1], 64) + if err != nil { + return fmt.Errorf("parse '%s' (%s): %v", txt.Hdr.Name, entry, err) + } + failedQueries, err := strconv.ParseFloat(parts[2], 64) + if err != nil { + return fmt.Errorf("parse '%s' (%s): %v", txt.Hdr.Name, entry, err) + } + + mx["queries"] += int64(queries) + mx["failed_queries"] += int64(failedQueries) + } + case "cachesize", "insertions", "evictions", "hits", "misses", "auth": + if len(txt.Txt) != 1 { + return fmt.Errorf("parse '%s' (%v): unexpected format", txt.Hdr.Name, txt.Txt) + } + v, err := strconv.ParseFloat(txt.Txt[0], 64) + if err != nil { + return fmt.Errorf("parse '%s' (%s): %v", txt.Hdr.Name, txt.Txt[0], err) + } + + mx[name] = int64(v) + } + } + } + + return nil +} + +func (d *Dnsmasq) query(question string) (*dns.Msg, error) { + msg := &dns.Msg{ + MsgHdr: dns.MsgHdr{ + Id: dns.Id(), + RecursionDesired: true, + }, + Question: []dns.Question{ + {Name: question, Qtype: dns.TypeTXT, Qclass: dns.ClassCHAOS}, + }, + } + + r, _, err := d.dnsClient.Exchange(msg, d.Address) + if err != nil { + return nil, err + } + + if r == nil { + return nil, fmt.Errorf("'%s' question '%s', returned an empty response", d.Address, question) + } + + if r.Rcode != dns.RcodeSuccess { + s := dns.RcodeToString[r.Rcode] + return nil, fmt.Errorf("'%s' question '%s' returned '%s' (%d) response code", d.Address, question, s, r.Rcode) + } + + return r, nil +} diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq/config_schema.json b/src/go/plugin/go.d/modules/dnsmasq/config_schema.json index 79396b36..79396b36 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq/config_schema.json +++ b/src/go/plugin/go.d/modules/dnsmasq/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq/dnsmasq.go b/src/go/plugin/go.d/modules/dnsmasq/dnsmasq.go index 095047e8..2d2112c0 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq/dnsmasq.go +++ b/src/go/plugin/go.d/modules/dnsmasq/dnsmasq.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/miekg/dns" ) diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq/dnsmasq_test.go b/src/go/plugin/go.d/modules/dnsmasq/dnsmasq_test.go index 7b6185cd..b3d54ac9 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq/dnsmasq_test.go +++ b/src/go/plugin/go.d/modules/dnsmasq/dnsmasq_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/miekg/dns" "github.com/stretchr/testify/assert" diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq/init.go b/src/go/plugin/go.d/modules/dnsmasq/init.go index be21758a..a660ac77 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq/init.go +++ b/src/go/plugin/go.d/modules/dnsmasq/init.go @@ -6,7 +6,7 @@ import ( "errors" "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func (d *Dnsmasq) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq/integrations/dnsmasq.md b/src/go/plugin/go.d/modules/dnsmasq/integrations/dnsmasq.md index f75912e7..d5c358a2 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq/integrations/dnsmasq.md +++ b/src/go/plugin/go.d/modules/dnsmasq/integrations/dnsmasq.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/dnsmasq/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/dnsmasq/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dnsmasq/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dnsmasq/metadata.yaml" sidebar_label: "Dnsmasq" learn_status: "Published" learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" @@ -170,6 +170,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `dnsmasq` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -192,4 +194,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m dnsmasq ``` +### Getting Logs + +If you're encountering problems with the `dnsmasq` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep dnsmasq +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep dnsmasq /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep dnsmasq +``` + diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq/metadata.yaml b/src/go/plugin/go.d/modules/dnsmasq/metadata.yaml index 6911a323..6911a323 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq/metadata.yaml +++ b/src/go/plugin/go.d/modules/dnsmasq/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq/testdata/config.json b/src/go/plugin/go.d/modules/dnsmasq/testdata/config.json index 4fff563b..4fff563b 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq/testdata/config.json +++ b/src/go/plugin/go.d/modules/dnsmasq/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq/testdata/config.yaml b/src/go/plugin/go.d/modules/dnsmasq/testdata/config.yaml index 1a79b877..1a79b877 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/dnsmasq/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/README.md b/src/go/plugin/go.d/modules/dnsmasq_dhcp/README.md index ad22eb4e..ad22eb4e 120000 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/README.md +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/README.md diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/charts.go b/src/go/plugin/go.d/modules/dnsmasq_dhcp/charts.go index 39ac0024..bcef8aa3 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/charts.go +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/collect.go b/src/go/plugin/go.d/modules/dnsmasq_dhcp/collect.go index 4d3e3ac5..6de2fa21 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/collect.go +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/collect.go @@ -12,7 +12,7 @@ import ( "strings" "time" - "github.com/netdata/netdata/go/go.d.plugin/pkg/iprange" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/iprange" ) func (d *DnsmasqDHCP) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/config_schema.json b/src/go/plugin/go.d/modules/dnsmasq_dhcp/config_schema.json index f51a3b2a..f51a3b2a 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/config_schema.json +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/dhcp.go b/src/go/plugin/go.d/modules/dnsmasq_dhcp/dhcp.go index 45ddacf4..de56723f 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/dhcp.go +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/dhcp.go @@ -8,8 +8,8 @@ import ( "net" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/iprange" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/iprange" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/dhcp_test.go b/src/go/plugin/go.d/modules/dnsmasq_dhcp/dhcp_test.go index b83b6a3f..16e0f17d 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/dhcp_test.go +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/dhcp_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -147,3 +147,63 @@ func TestDnsmasqDHCP_CollectFailedToOpenLeasesPath(t *testing.T) { job.LeasesPath = "" assert.Nil(t, job.Collect()) } + +func TestDnsmasqDHCP_parseDHCPRangeValue(t *testing.T) { + tests := map[string]struct { + input string + wantFail bool + }{ + "ipv4": { + input: "192.168.0.50,192.168.0.150,12h", + }, + "ipv4 with netmask": { + input: "192.168.0.50,192.168.0.150,255.255.255.0,12h", + }, + "ipv4 with netmask and tag": { + input: "set:red,1.1.1.50,1.1.2.150, 255.255.252.0", + }, + "ipv4 with iface": { + input: "enp3s0, 172.16.1.2, 172.16.1.254, 1h", + }, + "ipv4 with iface 2": { + input: "enp2s0.100, 192.168.100.2, 192.168.100.254, 1h", + }, + "ipv4 static": { + wantFail: true, + input: "192.168.0.0,static", + }, + "ipv6": { + input: "1234::2,1234::500", + }, + "ipv6 slacc": { + input: "1234::2,1234::500, slaac", + }, + "ipv6 with with prefix length and lease time": { + input: "1234::2,1234::500, 64, 12h", + }, + "ipv6 ra-only": { + wantFail: true, + input: "1234::,ra-only", + }, + "ipv6 ra-names": { + wantFail: true, + input: "1234::,ra-names", + }, + "ipv6 ra-stateless": { + wantFail: true, + input: "1234::,ra-stateless", + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + v := parseDHCPRangeValue(test.input) + + if test.wantFail { + assert.Emptyf(t, v, "parsing '%s' must fail", test.input) + } else { + assert.NotEmptyf(t, v, "parsing '%s' must not fail", test.input) + } + }) + } +} diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/init.go b/src/go/plugin/go.d/modules/dnsmasq_dhcp/init.go index 6c74674a..6c74674a 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/init.go +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/init.go diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/integrations/dnsmasq_dhcp.md b/src/go/plugin/go.d/modules/dnsmasq_dhcp/integrations/dnsmasq_dhcp.md index 23eb0738..751ebf08 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/integrations/dnsmasq_dhcp.md +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/integrations/dnsmasq_dhcp.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dnsmasq_dhcp/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dnsmasq_dhcp/metadata.yaml" sidebar_label: "Dnsmasq DHCP" learn_status: "Published" learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" @@ -180,6 +180,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `dnsmasq_dhcp` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -202,4 +204,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m dnsmasq_dhcp ``` +### Getting Logs + +If you're encountering problems with the `dnsmasq_dhcp` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep dnsmasq_dhcp +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep dnsmasq_dhcp /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep dnsmasq_dhcp +``` + diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/metadata.yaml b/src/go/plugin/go.d/modules/dnsmasq_dhcp/metadata.yaml index 13b73336..13b73336 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/metadata.yaml +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/parse_configuration.go b/src/go/plugin/go.d/modules/dnsmasq_dhcp/parse_configuration.go index 24a20bb5..558ce7c6 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/parse_configuration.go +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/parse_configuration.go @@ -12,7 +12,7 @@ import ( "sort" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/iprange" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/iprange" ) func (d *DnsmasqDHCP) parseDnsmasqDHCPConfiguration() ([]iprange.Range, []net.IP) { @@ -97,24 +97,31 @@ Examples: - 1234::,ra-names - 1234::,ra-stateless */ -var reDHCPRange = regexp.MustCompile(`([0-9a-f.:]+),([0-9a-f.:]+)`) func parseDHCPRangeValue(s string) (r string) { if strings.Contains(s, "ra-stateless") { - return + return "" } - match := reDHCPRange.FindStringSubmatch(s) - if match == nil { - return - } + s = strings.ReplaceAll(s, " ", "") + + var start, end net.IP + parts := strings.Split(s, ",") - start, end := net.ParseIP(match[1]), net.ParseIP(match[2]) - if start == nil || end == nil { - return + for i, v := range parts { + if start = net.ParseIP(strings.TrimSpace(v)); start == nil { + continue + } + if len(parts) < i+1 { + return "" + } + if end = net.ParseIP(parts[i+1]); end == nil || iprange.New(start, end) == nil { + return "" + } + return fmt.Sprintf("%s-%s", start, end) } - return fmt.Sprintf("%s-%s", start, end) + return "" } /* @@ -134,6 +141,8 @@ var ( ) func parseDHCPHostValue(s string) (r string) { + s = strings.ReplaceAll(s, " ", "") + if strings.Contains(s, "[") { return strings.Trim(reDHCPHostV6.FindString(s), "[]") } diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/config.json b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/config.json index 6df6faec..6df6faec 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/config.json +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/config.yaml b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/config.yaml index 4a03e6db..4a03e6db 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.conf b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.conf index 4cf77478..4cf77478 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.conf +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.conf diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d/.dnsmasq.conf b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d/.dnsmasq.conf index b9ca7821..b9ca7821 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d/.dnsmasq.conf +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d/.dnsmasq.conf diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d/dnsmasqv4.any b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d/dnsmasqv4.any index 300faa28..300faa28 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d/dnsmasqv4.any +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d/dnsmasqv4.any diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d/dnsmasqv6.any b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d/dnsmasqv6.any index 414d6819..414d6819 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d/dnsmasqv6.any +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d/dnsmasqv6.any diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/dnsmasqv4.any b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/dnsmasqv4.any index 24a74279..24a74279 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/dnsmasqv4.any +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/dnsmasqv4.any diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/dnsmasqv6.any b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/dnsmasqv6.any index 4ae70f0b..4ae70f0b 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/dnsmasqv6.any +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/dnsmasqv6.any diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/~dnsmasq.conf b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/~dnsmasq.conf index dc58bf9d..dc58bf9d 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/~dnsmasq.conf +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d2/~dnsmasq.conf diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasq.bak b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasq.bak index c3897671..c3897671 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasq.bak +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasq.bak diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasqv4.any b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasqv4.any index a55ac969..a55ac969 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasqv4.any +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasqv4.any diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasqv6.any b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasqv6.any index 4bc6cf10..4bc6cf10 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasqv6.any +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d3/dnsmasqv6.any diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasq.other b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasq.other index 18fe1ac5..18fe1ac5 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasq.other +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasq.other diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasqv4.conf b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasqv4.conf index 1493b800..1493b800 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasqv4.conf +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasqv4.conf diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasqv6.conf b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasqv6.conf index 389c2c95..389c2c95 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasqv6.conf +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.d4/dnsmasqv6.conf diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.leases b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.leases index 606e74fb..606e74fb 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq.leases +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq.leases diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq2.conf b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq2.conf index bd1766ad..bd1766ad 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq2.conf +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq2.conf diff --git a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq3.conf b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq3.conf index 3475544b..3475544b 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/testdata/dnsmasq3.conf +++ b/src/go/plugin/go.d/modules/dnsmasq_dhcp/testdata/dnsmasq3.conf diff --git a/src/go/collectors/go.d.plugin/modules/dnsquery/README.md b/src/go/plugin/go.d/modules/dnsquery/README.md index c5baa825..c5baa825 120000 --- a/src/go/collectors/go.d.plugin/modules/dnsquery/README.md +++ b/src/go/plugin/go.d/modules/dnsquery/README.md diff --git a/src/go/collectors/go.d.plugin/modules/dnsquery/charts.go b/src/go/plugin/go.d/modules/dnsquery/charts.go index b229d89e..66c2ea6c 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsquery/charts.go +++ b/src/go/plugin/go.d/modules/dnsquery/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/dnsquery/collect.go b/src/go/plugin/go.d/modules/dnsquery/collect.go index a98e37ca..a98e37ca 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsquery/collect.go +++ b/src/go/plugin/go.d/modules/dnsquery/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/dnsquery/config_schema.json b/src/go/plugin/go.d/modules/dnsquery/config_schema.json index cfa6f3a1..cfa6f3a1 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsquery/config_schema.json +++ b/src/go/plugin/go.d/modules/dnsquery/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/dnsquery/dnsquery.go b/src/go/plugin/go.d/modules/dnsquery/dnsquery.go index 5a0df7ad..408b08ee 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsquery/dnsquery.go +++ b/src/go/plugin/go.d/modules/dnsquery/dnsquery.go @@ -6,8 +6,8 @@ import ( _ "embed" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/miekg/dns" ) diff --git a/src/go/collectors/go.d.plugin/modules/dnsquery/dnsquery_test.go b/src/go/plugin/go.d/modules/dnsquery/dnsquery_test.go index 9842e54f..a9f55d6e 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsquery/dnsquery_test.go +++ b/src/go/plugin/go.d/modules/dnsquery/dnsquery_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/miekg/dns" "github.com/stretchr/testify/assert" diff --git a/src/go/collectors/go.d.plugin/modules/dnsquery/init.go b/src/go/plugin/go.d/modules/dnsquery/init.go index 65af0ea2..5899a27b 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsquery/init.go +++ b/src/go/plugin/go.d/modules/dnsquery/init.go @@ -5,7 +5,7 @@ package dnsquery import ( "errors" "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/miekg/dns" ) diff --git a/src/go/collectors/go.d.plugin/modules/dnsquery/integrations/dns_query.md b/src/go/plugin/go.d/modules/dnsquery/integrations/dns_query.md index fccac8b5..b081a7bb 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsquery/integrations/dns_query.md +++ b/src/go/plugin/go.d/modules/dnsquery/integrations/dns_query.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/dnsquery/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/dnsquery/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dnsquery/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dnsquery/metadata.yaml" sidebar_label: "DNS query" learn_status: "Published" learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" @@ -156,6 +156,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `dns_query` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -178,4 +180,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m dns_query ``` +### Getting Logs + +If you're encountering problems with the `dns_query` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep dns_query +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep dns_query /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep dns_query +``` + diff --git a/src/go/collectors/go.d.plugin/modules/dnsquery/metadata.yaml b/src/go/plugin/go.d/modules/dnsquery/metadata.yaml index 8c199550..8c199550 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsquery/metadata.yaml +++ b/src/go/plugin/go.d/modules/dnsquery/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/dnsquery/testdata/config.json b/src/go/plugin/go.d/modules/dnsquery/testdata/config.json index b16ed18c..b16ed18c 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsquery/testdata/config.json +++ b/src/go/plugin/go.d/modules/dnsquery/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/dnsquery/testdata/config.yaml b/src/go/plugin/go.d/modules/dnsquery/testdata/config.yaml index 6c6b014b..6c6b014b 100644 --- a/src/go/collectors/go.d.plugin/modules/dnsquery/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/dnsquery/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/docker/README.md b/src/go/plugin/go.d/modules/docker/README.md index b4804ee0..b4804ee0 120000 --- a/src/go/collectors/go.d.plugin/modules/docker/README.md +++ b/src/go/plugin/go.d/modules/docker/README.md diff --git a/src/go/collectors/go.d.plugin/modules/docker/charts.go b/src/go/plugin/go.d/modules/docker/charts.go index 2dd26c0e..6660dc1e 100644 --- a/src/go/collectors/go.d.plugin/modules/docker/charts.go +++ b/src/go/plugin/go.d/modules/docker/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/docker/collect.go b/src/go/plugin/go.d/modules/docker/collect.go index f23c58f2..f23c58f2 100644 --- a/src/go/collectors/go.d.plugin/modules/docker/collect.go +++ b/src/go/plugin/go.d/modules/docker/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/docker/config_schema.json b/src/go/plugin/go.d/modules/docker/config_schema.json index bd48c912..bd48c912 100644 --- a/src/go/collectors/go.d.plugin/modules/docker/config_schema.json +++ b/src/go/plugin/go.d/modules/docker/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/docker/docker.go b/src/go/plugin/go.d/modules/docker/docker.go index 68662fd4..88890b9f 100644 --- a/src/go/collectors/go.d.plugin/modules/docker/docker.go +++ b/src/go/plugin/go.d/modules/docker/docker.go @@ -8,9 +8,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/dockerhost" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/dockerhost" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/docker/docker/api/types" typesContainer "github.com/docker/docker/api/types/container" diff --git a/src/go/collectors/go.d.plugin/modules/docker/docker_test.go b/src/go/plugin/go.d/modules/docker/docker_test.go index 8125cd3c..0ab89442 100644 --- a/src/go/collectors/go.d.plugin/modules/docker/docker_test.go +++ b/src/go/plugin/go.d/modules/docker/docker_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/docker/docker/api/types" typesContainer "github.com/docker/docker/api/types/container" diff --git a/src/go/collectors/go.d.plugin/modules/docker/integrations/docker.md b/src/go/plugin/go.d/modules/docker/integrations/docker.md index 10f00c2d..cb545253 100644 --- a/src/go/collectors/go.d.plugin/modules/docker/integrations/docker.md +++ b/src/go/plugin/go.d/modules/docker/integrations/docker.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/docker/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/docker/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/docker/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/docker/metadata.yaml" sidebar_label: "Docker" learn_status: "Published" learn_rel_path: "Collecting Metrics/Containers and VMs" @@ -183,6 +183,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `docker` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -205,4 +207,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m docker ``` +### Getting Logs + +If you're encountering problems with the `docker` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep docker +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep docker /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep docker +``` + diff --git a/src/go/collectors/go.d.plugin/modules/docker/metadata.yaml b/src/go/plugin/go.d/modules/docker/metadata.yaml index 8fc6853a..8fc6853a 100644 --- a/src/go/collectors/go.d.plugin/modules/docker/metadata.yaml +++ b/src/go/plugin/go.d/modules/docker/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/docker/testdata/config.json b/src/go/plugin/go.d/modules/docker/testdata/config.json index 5e687448..5e687448 100644 --- a/src/go/collectors/go.d.plugin/modules/docker/testdata/config.json +++ b/src/go/plugin/go.d/modules/docker/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/docker/testdata/config.yaml b/src/go/plugin/go.d/modules/docker/testdata/config.yaml index 2b0f3222..2b0f3222 100644 --- a/src/go/collectors/go.d.plugin/modules/docker/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/docker/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/README.md b/src/go/plugin/go.d/modules/docker_engine/README.md index f00a4cd9..f00a4cd9 120000 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/README.md +++ b/src/go/plugin/go.d/modules/docker_engine/README.md diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/charts.go b/src/go/plugin/go.d/modules/docker_engine/charts.go index d23f6e78..8a37545c 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/charts.go +++ b/src/go/plugin/go.d/modules/docker_engine/charts.go @@ -2,7 +2,7 @@ package docker_engine -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( Charts = module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/collect.go b/src/go/plugin/go.d/modules/docker_engine/collect.go index 171d58b5..90cd4998 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/collect.go +++ b/src/go/plugin/go.d/modules/docker_engine/collect.go @@ -5,8 +5,8 @@ package docker_engine import ( "fmt" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) func isDockerEngineMetrics(pms prometheus.Series) bool { diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/config_schema.json b/src/go/plugin/go.d/modules/docker_engine/config_schema.json index a18a8fe8..1e40bb58 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/config_schema.json +++ b/src/go/plugin/go.d/modules/docker_engine/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/docker_engine.go b/src/go/plugin/go.d/modules/docker_engine/docker_engine.go index ea855123..4f50ecb4 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/docker_engine.go +++ b/src/go/plugin/go.d/modules/docker_engine/docker_engine.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/docker_engine_test.go b/src/go/plugin/go.d/modules/docker_engine/docker_engine_test.go index 19321427..1734f182 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/docker_engine_test.go +++ b/src/go/plugin/go.d/modules/docker_engine/docker_engine_test.go @@ -8,9 +8,9 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/init.go b/src/go/plugin/go.d/modules/docker_engine/init.go index 5e06f545..5610af9a 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/init.go +++ b/src/go/plugin/go.d/modules/docker_engine/init.go @@ -4,9 +4,9 @@ package docker_engine import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) func (de *DockerEngine) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/integrations/docker_engine.md b/src/go/plugin/go.d/modules/docker_engine/integrations/docker_engine.md index bf1d9112..eaba917e 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/integrations/docker_engine.md +++ b/src/go/plugin/go.d/modules/docker_engine/integrations/docker_engine.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/docker_engine/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/docker_engine/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/docker_engine/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/docker_engine/metadata.yaml" sidebar_label: "Docker Engine" learn_status: "Published" learn_rel_path: "Collecting Metrics/Containers and VMs" @@ -204,6 +204,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `docker_engine` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -226,4 +228,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m docker_engine ``` +### Getting Logs + +If you're encountering problems with the `docker_engine` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep docker_engine +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep docker_engine /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep docker_engine +``` + diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/metadata.yaml b/src/go/plugin/go.d/modules/docker_engine/metadata.yaml index 8f81d4e3..8f81d4e3 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/metadata.yaml +++ b/src/go/plugin/go.d/modules/docker_engine/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/metrics.go b/src/go/plugin/go.d/modules/docker_engine/metrics.go index 4c84e839..4c84e839 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/metrics.go +++ b/src/go/plugin/go.d/modules/docker_engine/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/testdata/config.json b/src/go/plugin/go.d/modules/docker_engine/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/testdata/config.json +++ b/src/go/plugin/go.d/modules/docker_engine/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/testdata/config.yaml b/src/go/plugin/go.d/modules/docker_engine/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/docker_engine/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/testdata/non-docker-engine.txt b/src/go/plugin/go.d/modules/docker_engine/testdata/non-docker-engine.txt index e69de29b..e69de29b 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/testdata/non-docker-engine.txt +++ b/src/go/plugin/go.d/modules/docker_engine/testdata/non-docker-engine.txt diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/testdata/v17.05.0-ce.txt b/src/go/plugin/go.d/modules/docker_engine/testdata/v17.05.0-ce.txt index 8d175a8e..8d175a8e 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/testdata/v17.05.0-ce.txt +++ b/src/go/plugin/go.d/modules/docker_engine/testdata/v17.05.0-ce.txt diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/testdata/v18.09.3-ce-swarm.txt b/src/go/plugin/go.d/modules/docker_engine/testdata/v18.09.3-ce-swarm.txt index edd69abe..edd69abe 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/testdata/v18.09.3-ce-swarm.txt +++ b/src/go/plugin/go.d/modules/docker_engine/testdata/v18.09.3-ce-swarm.txt diff --git a/src/go/collectors/go.d.plugin/modules/docker_engine/testdata/v18.09.3-ce.txt b/src/go/plugin/go.d/modules/docker_engine/testdata/v18.09.3-ce.txt index b5458921..b5458921 100644 --- a/src/go/collectors/go.d.plugin/modules/docker_engine/testdata/v18.09.3-ce.txt +++ b/src/go/plugin/go.d/modules/docker_engine/testdata/v18.09.3-ce.txt diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/README.md b/src/go/plugin/go.d/modules/dockerhub/README.md index 703add4e..703add4e 120000 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/README.md +++ b/src/go/plugin/go.d/modules/dockerhub/README.md diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/apiclient.go b/src/go/plugin/go.d/modules/dockerhub/apiclient.go index fa6e1c80..f0da897f 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/apiclient.go +++ b/src/go/plugin/go.d/modules/dockerhub/apiclient.go @@ -10,7 +10,7 @@ import ( "net/url" "path" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) type repository struct { diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/charts.go b/src/go/plugin/go.d/modules/dockerhub/charts.go index 07ba8e18..78b51eac 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/charts.go +++ b/src/go/plugin/go.d/modules/dockerhub/charts.go @@ -5,7 +5,7 @@ package dockerhub import ( "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) type ( diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/collect.go b/src/go/plugin/go.d/modules/dockerhub/collect.go index 211c1ea7..211c1ea7 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/collect.go +++ b/src/go/plugin/go.d/modules/dockerhub/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/config_schema.json b/src/go/plugin/go.d/modules/dockerhub/config_schema.json index 47842fd9..7998516f 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/config_schema.json +++ b/src/go/plugin/go.d/modules/dockerhub/config_schema.json @@ -187,6 +187,12 @@ "repositories": { "ui:listFlavour": "list" }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/dockerhub.go b/src/go/plugin/go.d/modules/dockerhub/dockerhub.go index 54fcf7dc..37cf6496 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/dockerhub.go +++ b/src/go/plugin/go.d/modules/dockerhub/dockerhub.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/dockerhub_test.go b/src/go/plugin/go.d/modules/dockerhub/dockerhub_test.go index 7036ff7a..5d8df4cf 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/dockerhub_test.go +++ b/src/go/plugin/go.d/modules/dockerhub/dockerhub_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/init.go b/src/go/plugin/go.d/modules/dockerhub/init.go index 245bee1c..7e502a5a 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/init.go +++ b/src/go/plugin/go.d/modules/dockerhub/init.go @@ -4,7 +4,7 @@ package dockerhub import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (dh *DockerHub) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/integrations/docker_hub_repository.md b/src/go/plugin/go.d/modules/dockerhub/integrations/docker_hub_repository.md index 2d833d3c..72c171d6 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/integrations/docker_hub_repository.md +++ b/src/go/plugin/go.d/modules/dockerhub/integrations/docker_hub_repository.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/dockerhub/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/dockerhub/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dockerhub/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dockerhub/metadata.yaml" sidebar_label: "Docker Hub repository" learn_status: "Published" learn_rel_path: "Collecting Metrics/Containers and VMs" @@ -149,6 +149,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `dockerhub` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -171,4 +173,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m dockerhub ``` +### Getting Logs + +If you're encountering problems with the `dockerhub` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep dockerhub +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep dockerhub /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep dockerhub +``` + diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/metadata.yaml b/src/go/plugin/go.d/modules/dockerhub/metadata.yaml index 605d6c1c..605d6c1c 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/metadata.yaml +++ b/src/go/plugin/go.d/modules/dockerhub/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/testdata/config.json b/src/go/plugin/go.d/modules/dockerhub/testdata/config.json index 3496e747..3496e747 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/testdata/config.json +++ b/src/go/plugin/go.d/modules/dockerhub/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/testdata/config.yaml b/src/go/plugin/go.d/modules/dockerhub/testdata/config.yaml index 20c4ba61..20c4ba61 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/dockerhub/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/testdata/repo1.txt b/src/go/plugin/go.d/modules/dockerhub/testdata/repo1.txt index b67e2f38..b67e2f38 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/testdata/repo1.txt +++ b/src/go/plugin/go.d/modules/dockerhub/testdata/repo1.txt diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/testdata/repo2.txt b/src/go/plugin/go.d/modules/dockerhub/testdata/repo2.txt index e84ba989..e84ba989 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/testdata/repo2.txt +++ b/src/go/plugin/go.d/modules/dockerhub/testdata/repo2.txt diff --git a/src/go/collectors/go.d.plugin/modules/dockerhub/testdata/repo3.txt b/src/go/plugin/go.d/modules/dockerhub/testdata/repo3.txt index 1fc64a9c..1fc64a9c 100644 --- a/src/go/collectors/go.d.plugin/modules/dockerhub/testdata/repo3.txt +++ b/src/go/plugin/go.d/modules/dockerhub/testdata/repo3.txt diff --git a/src/go/plugin/go.d/modules/dovecot/README.md b/src/go/plugin/go.d/modules/dovecot/README.md new file mode 120000 index 00000000..c4749ced --- /dev/null +++ b/src/go/plugin/go.d/modules/dovecot/README.md @@ -0,0 +1 @@ +integrations/dovecot.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/dovecot/charts.go b/src/go/plugin/go.d/modules/dovecot/charts.go new file mode 100644 index 00000000..3a8bb1a8 --- /dev/null +++ b/src/go/plugin/go.d/modules/dovecot/charts.go @@ -0,0 +1,185 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package dovecot + +import ( + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioSessions = module.Priority + iota + prioLogins + prioAuthenticationAttempts + prioCommands + prioPageFaults + prioContextSwitches + prioDiskIO + prioNetTraffic + prioSysCalls + prioLookups + prioCachePerformance + prioAuthCachePerformance +) + +var charts = module.Charts{ + sessionsChart.Copy(), + loginsChart.Copy(), + authAttemptsChart.Copy(), + commandsChart.Copy(), + pageFaultsChart.Copy(), + contextSwitchesChart.Copy(), + diskIOChart.Copy(), + netTrafficChart.Copy(), + sysCallsChart.Copy(), + lookupsChart.Copy(), + cacheChart.Copy(), + authCacheChart.Copy(), +} + +var ( + sessionsChart = module.Chart{ + ID: "sessions", + Title: "Dovecot Active Sessions", + Units: "sessions", + Fam: "sessions", + Ctx: "dovecot.sessions", + Priority: prioSessions, + Dims: module.Dims{ + {ID: "num_connected_sessions", Name: "active"}, + }, + } + loginsChart = module.Chart{ + ID: "logins", + Title: "Dovecot Logins", + Units: "logins", + Fam: "logins", + Ctx: "dovecot.logins", + Priority: prioLogins, + Dims: module.Dims{ + {ID: "num_logins", Name: "logins"}, + }, + } + authAttemptsChart = module.Chart{ + ID: "auth", + Title: "Dovecot Authentications", + Units: "attempts/s", + Fam: "logins", + Ctx: "dovecot.auth", + Priority: prioAuthenticationAttempts, + Type: module.Stacked, + Dims: module.Dims{ + {ID: "auth_successes", Name: "ok", Algo: module.Incremental}, + {ID: "auth_failures", Name: "failed", Algo: module.Incremental}, + }, + } + commandsChart = module.Chart{ + ID: "commands", + Title: "Dovecot Commands", + Units: "commands", + Fam: "commands", + Ctx: "dovecot.commands", + Priority: prioCommands, + Dims: module.Dims{ + {ID: "num_cmds", Name: "commands"}, + }, + } + pageFaultsChart = module.Chart{ + ID: "faults", + Title: "Dovecot Page Faults", + Units: "faults/s", + Fam: "page faults", + Ctx: "dovecot.faults", + Priority: prioPageFaults, + Dims: module.Dims{ + {ID: "min_faults", Name: "minor", Algo: module.Incremental}, + {ID: "maj_faults", Name: "major", Algo: module.Incremental}, + }, + } + contextSwitchesChart = module.Chart{ + ID: "context_switches", + Title: "Dovecot Context Switches", + Units: "switches/s", + Fam: "context switches", + Ctx: "dovecot.context_switches", + Priority: prioContextSwitches, + Dims: module.Dims{ + {ID: "vol_cs", Name: "voluntary", Algo: module.Incremental}, + {ID: "invol_cs", Name: "involuntary", Algo: module.Incremental}, + }, + } + diskIOChart = module.Chart{ + ID: "io", + Title: "Dovecot Disk I/O", + Units: "KiB/s", + Fam: "disk", + Ctx: "dovecot.io", + Priority: prioDiskIO, + Type: module.Area, + Dims: module.Dims{ + {ID: "disk_input", Name: "read", Div: 1024, Algo: module.Incremental}, + {ID: "disk_output", Name: "write", Mul: -1, Div: 1024, Algo: module.Incremental}, + }, + } + netTrafficChart = module.Chart{ + ID: "net", + Title: "Dovecot Network Bandwidth", + Units: "kilobits/s", + Fam: "network", + Ctx: "dovecot.net", + Priority: prioNetTraffic, + Type: module.Area, + Dims: module.Dims{ + {ID: "read_bytes", Name: "read", Mul: 8, Div: 1000, Algo: module.Incremental}, + {ID: "write_bytes", Name: "write", Mul: -8, Div: 1000, Algo: module.Incremental}, + }, + } + sysCallsChart = module.Chart{ + ID: "syscalls", + Title: "Dovecot Number of SysCalls", + Units: "syscalls/s", + Fam: "system", + Ctx: "dovecot.syscalls", + Priority: prioSysCalls, + Dims: module.Dims{ + {ID: "read_count", Name: "read", Algo: module.Incremental}, + {ID: "write_count", Name: "write", Algo: module.Incremental}, + }, + } + lookupsChart = module.Chart{ + ID: "lookup", + Title: "Dovecot Lookups", + Units: "lookups/s", + Fam: "lookups", + Ctx: "dovecot.lookup", + Priority: prioLookups, + Type: module.Stacked, + Dims: module.Dims{ + {ID: "mail_lookup_path", Name: "path", Algo: module.Incremental}, + {ID: "mail_lookup_attr", Name: "attr", Algo: module.Incremental}, + }, + } + cacheChart = module.Chart{ + ID: "cache", + Title: "Dovecot Cache Hits", + Units: "hits/s", + Fam: "cache", + Ctx: "dovecot.cache", + Priority: prioCachePerformance, + Dims: module.Dims{ + {ID: "mail_cache_hits", Name: "hits", Algo: module.Incremental}, + }, + } + authCacheChart = module.Chart{ + ID: "auth_cache", + Title: "Dovecot Authentication Cache", + Units: "requests/s", + Fam: "cache", + Ctx: "dovecot.auth_cache", + Priority: prioAuthCachePerformance, + Type: module.Stacked, + Dims: module.Dims{ + {ID: "auth_cache_hits", Name: "hits", Algo: module.Incremental}, + {ID: "auth_cache_misses", Name: "misses", Algo: module.Incremental}, + }, + } +) diff --git a/src/go/plugin/go.d/modules/dovecot/client.go b/src/go/plugin/go.d/modules/dovecot/client.go new file mode 100644 index 00000000..245d1743 --- /dev/null +++ b/src/go/plugin/go.d/modules/dovecot/client.go @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package dovecot + +import ( + "bytes" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" +) + +type dovecotConn interface { + connect() error + disconnect() + queryExportGlobal() ([]byte, error) +} + +func newDovecotConn(conf Config) dovecotConn { + return &dovecotClient{conn: socket.New(socket.Config{ + Address: conf.Address, + ConnectTimeout: conf.Timeout.Duration(), + ReadTimeout: conf.Timeout.Duration(), + WriteTimeout: conf.Timeout.Duration(), + })} +} + +type dovecotClient struct { + conn socket.Client +} + +func (c *dovecotClient) connect() error { + return c.conn.Connect() +} + +func (c *dovecotClient) disconnect() { + _ = c.conn.Disconnect() +} + +func (c *dovecotClient) queryExportGlobal() ([]byte, error) { + var b bytes.Buffer + var n int + + err := c.conn.Command("EXPORT\tglobal\n", func(bs []byte) bool { + b.Write(bs) + b.WriteByte('\n') + + n++ + return n < 2 + }) + if err != nil { + return nil, err + } + + return b.Bytes(), nil +} diff --git a/src/go/plugin/go.d/modules/dovecot/collect.go b/src/go/plugin/go.d/modules/dovecot/collect.go new file mode 100644 index 00000000..a93bfc81 --- /dev/null +++ b/src/go/plugin/go.d/modules/dovecot/collect.go @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package dovecot + +import ( + "bufio" + "bytes" + "errors" + "fmt" + "strconv" + "strings" +) + +// FIXME: drop using "old_stats" in favour of "stats" (https://doc.dovecot.org/configuration_manual/stats/openmetrics/). + +func (d *Dovecot) collect() (map[string]int64, error) { + if d.conn == nil { + conn, err := d.establishConn() + if err != nil { + return nil, err + } + d.conn = conn + } + + stats, err := d.conn.queryExportGlobal() + if err != nil { + d.conn.disconnect() + d.conn = nil + return nil, err + } + + mx := make(map[string]int64) + + // https://doc.dovecot.org/configuration_manual/stats/old_statistics/#statistics-gathered + if err := d.collectExportGlobal(mx, stats); err != nil { + return nil, err + } + + return mx, nil +} + +func (d *Dovecot) collectExportGlobal(mx map[string]int64, resp []byte) error { + sc := bufio.NewScanner(bytes.NewReader(resp)) + + if !sc.Scan() { + return errors.New("failed to read fields line from export global response") + } + fieldsLine := strings.TrimSpace(sc.Text()) + + if !sc.Scan() { + return errors.New("failed to read values line from export global response") + } + valuesLine := strings.TrimSpace(sc.Text()) + + if fieldsLine == "" || valuesLine == "" { + return errors.New("empty fields line or values line from export global response") + } + + fields := strings.Fields(fieldsLine) + values := strings.Fields(valuesLine) + + if len(fields) != len(values) { + return fmt.Errorf("mismatched fields and values count: fields=%d, values=%d", len(fields), len(values)) + } + + for i, name := range fields { + val := values[i] + + v, err := strconv.ParseInt(val, 10, 64) + if err != nil { + d.Debugf("failed to parse export value %s %s: %v", name, val, err) + continue + } + + mx[name] = v + } + + return nil +} + +func (d *Dovecot) establishConn() (dovecotConn, error) { + conn := d.newConn(d.Config) + + if err := conn.connect(); err != nil { + return nil, err + } + + return conn, nil +} diff --git a/src/go/plugin/go.d/modules/dovecot/config_schema.json b/src/go/plugin/go.d/modules/dovecot/config_schema.json new file mode 100644 index 00000000..cf99b693 --- /dev/null +++ b/src/go/plugin/go.d/modules/dovecot/config_schema.json @@ -0,0 +1,47 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Dovecot collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "address": { + "title": "Address", + "description": "The Unix or TCP socket address where the Dovecot [old_stats](https://doc.dovecot.org/configuration_manual/stats/old_statistics/#old-statistics) plugin listens for connections.", + "type": "string", + "default": "127.0.0.1:24242" + }, + "timeout": { + "title": "Timeout", + "description": "Timeout for establishing a connection and communication (reading and writing) in seconds.", + "type": "number", + "minimum": 0.5, + "default": 1 + } + }, + "required": [ + "address" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "address": { + "ui:help": "Use `unix://{path_to_socket}` for Unix socket or `{ip}:{port}` for TCP socket." + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + } + } +} diff --git a/src/go/plugin/go.d/modules/dovecot/dovecot.go b/src/go/plugin/go.d/modules/dovecot/dovecot.go new file mode 100644 index 00000000..ee3d6239 --- /dev/null +++ b/src/go/plugin/go.d/modules/dovecot/dovecot.go @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package dovecot + +import ( + _ "embed" + "errors" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("dovecot", module.Creator{ + JobConfigSchema: configSchema, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Dovecot { + return &Dovecot{ + Config: Config{ + Address: "127.0.0.1:24242", + Timeout: web.Duration(time.Second * 1), + }, + newConn: newDovecotConn, + charts: charts.Copy(), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Address string `yaml:"address" json:"address"` + Timeout web.Duration `yaml:"timeout" json:"timeout"` +} + +type Dovecot struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + newConn func(Config) dovecotConn + conn dovecotConn +} + +func (d *Dovecot) Configuration() any { + return d.Config +} + +func (d *Dovecot) Init() error { + if d.Address == "" { + d.Error("config: 'address' not set") + return errors.New("address not set") + } + + return nil +} + +func (d *Dovecot) Check() error { + mx, err := d.collect() + if err != nil { + d.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (d *Dovecot) Charts() *module.Charts { + return d.charts +} + +func (d *Dovecot) Collect() map[string]int64 { + mx, err := d.collect() + if err != nil { + d.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (d *Dovecot) Cleanup() { + if d.conn != nil { + d.conn.disconnect() + d.conn = nil + } +} diff --git a/src/go/plugin/go.d/modules/dovecot/dovecot_test.go b/src/go/plugin/go.d/modules/dovecot/dovecot_test.go new file mode 100644 index 00000000..ba60adeb --- /dev/null +++ b/src/go/plugin/go.d/modules/dovecot/dovecot_test.go @@ -0,0 +1,281 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package dovecot + +import ( + "errors" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataExportGlobal, _ = os.ReadFile("testdata/export_global.txt") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + "dataExportGlobal": dataExportGlobal, + } { + require.NotNil(t, data, name) + } +} + +func TestDovecot_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &Dovecot{}, dataConfigJSON, dataConfigYAML) +} + +func TestDovecot_Init(t *testing.T) { + tests := map[string]struct { + config Config + wantFail bool + }{ + "success with default config": { + wantFail: false, + config: New().Config, + }, + "fails if address not set": { + wantFail: true, + config: func() Config { + conf := New().Config + conf.Address = "" + return conf + }(), + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + dovecot := New() + dovecot.Config = test.config + + if test.wantFail { + assert.Error(t, dovecot.Init()) + } else { + assert.NoError(t, dovecot.Init()) + } + }) + } +} + +func TestDovecot_Cleanup(t *testing.T) { + tests := map[string]struct { + prepare func() *Dovecot + }{ + "not initialized": { + prepare: func() *Dovecot { + return New() + }, + }, + "after check": { + prepare: func() *Dovecot { + dovecot := New() + dovecot.newConn = func(config Config) dovecotConn { return prepareMockOk() } + _ = dovecot.Check() + return dovecot + }, + }, + "after collect": { + prepare: func() *Dovecot { + dovecot := New() + dovecot.newConn = func(config Config) dovecotConn { return prepareMockOk() } + _ = dovecot.Collect() + return dovecot + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + dovecot := test.prepare() + + assert.NotPanics(t, dovecot.Cleanup) + }) + } +} + +func TestDovecot_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestDovecot_Check(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockDovecotConn + wantFail bool + }{ + "success case": { + wantFail: false, + prepareMock: prepareMockOk, + }, + "err on connect": { + wantFail: true, + prepareMock: prepareMockErrOnConnect, + }, + "unexpected response": { + wantFail: true, + prepareMock: prepareMockUnexpectedResponse, + }, + "empty response": { + wantFail: true, + prepareMock: prepareMockEmptyResponse, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + dovecot := New() + mock := test.prepareMock() + dovecot.newConn = func(config Config) dovecotConn { return mock } + + if test.wantFail { + assert.Error(t, dovecot.Check()) + } else { + assert.NoError(t, dovecot.Check()) + } + }) + } +} + +func TestDovecot_Collect(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockDovecotConn + wantMetrics map[string]int64 + disconnectBeforeCleanup bool + disconnectAfterCleanup bool + }{ + "success case": { + prepareMock: prepareMockOk, + disconnectBeforeCleanup: false, + disconnectAfterCleanup: true, + wantMetrics: map[string]int64{ + "auth_cache_hits": 1, + "auth_cache_misses": 1, + "auth_db_tempfails": 1, + "auth_failures": 1, + "auth_master_successes": 1, + "auth_successes": 1, + "disk_input": 1, + "disk_output": 1, + "invol_cs": 1, + "mail_cache_hits": 1, + "mail_lookup_attr": 1, + "mail_lookup_path": 1, + "mail_read_bytes": 1, + "mail_read_count": 1, + "maj_faults": 1, + "min_faults": 1, + "num_cmds": 1, + "num_connected_sessions": 1, + "num_logins": 1, + "read_bytes": 1, + "read_count": 1, + "reset_timestamp": 1723481629, + "vol_cs": 1, + "write_bytes": 1, + "write_count": 1, + }, + }, + "unexpected response": { + prepareMock: prepareMockUnexpectedResponse, + disconnectBeforeCleanup: false, + disconnectAfterCleanup: true, + }, + "empty response": { + prepareMock: prepareMockEmptyResponse, + disconnectBeforeCleanup: false, + disconnectAfterCleanup: true, + }, + "err on connect": { + prepareMock: prepareMockErrOnConnect, + disconnectBeforeCleanup: false, + disconnectAfterCleanup: false, + }, + "err on query stats": { + prepareMock: prepareMockErrOnQueryExportGlobal, + disconnectBeforeCleanup: true, + disconnectAfterCleanup: true, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + dovecot := New() + mock := test.prepareMock() + dovecot.newConn = func(config Config) dovecotConn { return mock } + + mx := dovecot.Collect() + + require.Equal(t, test.wantMetrics, mx) + + if len(test.wantMetrics) > 0 { + module.TestMetricsHasAllChartsDims(t, dovecot.Charts(), mx) + } + + assert.Equal(t, test.disconnectBeforeCleanup, mock.disconnectCalled, "disconnect before cleanup") + dovecot.Cleanup() + assert.Equal(t, test.disconnectAfterCleanup, mock.disconnectCalled, "disconnect after cleanup") + }) + } +} + +func prepareMockOk() *mockDovecotConn { + return &mockDovecotConn{ + exportGlobalResponse: dataExportGlobal, + } +} + +func prepareMockErrOnConnect() *mockDovecotConn { + return &mockDovecotConn{ + errOnConnect: true, + } +} + +func prepareMockErrOnQueryExportGlobal() *mockDovecotConn { + return &mockDovecotConn{ + errOnQueryExportGlobal: true, + } +} + +func prepareMockUnexpectedResponse() *mockDovecotConn { + return &mockDovecotConn{ + exportGlobalResponse: []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit."), + } +} + +func prepareMockEmptyResponse() *mockDovecotConn { + return &mockDovecotConn{} +} + +type mockDovecotConn struct { + errOnConnect bool + errOnQueryExportGlobal bool + exportGlobalResponse []byte + disconnectCalled bool +} + +func (m *mockDovecotConn) connect() error { + if m.errOnConnect { + return errors.New("mock.connect() error") + } + return nil +} + +func (m *mockDovecotConn) disconnect() { + m.disconnectCalled = true +} + +func (m *mockDovecotConn) queryExportGlobal() ([]byte, error) { + if m.errOnQueryExportGlobal { + return nil, errors.New("mock.queryExportGlobal() error") + } + return m.exportGlobalResponse, nil +} diff --git a/src/go/plugin/go.d/modules/dovecot/integrations/dovecot.md b/src/go/plugin/go.d/modules/dovecot/integrations/dovecot.md new file mode 100644 index 00000000..8b45e2de --- /dev/null +++ b/src/go/plugin/go.d/modules/dovecot/integrations/dovecot.md @@ -0,0 +1,244 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dovecot/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/dovecot/metadata.yaml" +sidebar_label: "Dovecot" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Mail Servers" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Dovecot + + +<img src="https://netdata.cloud/img/dovecot.svg" width="150"/> + + +Plugin: go.d.plugin +Module: dovecot + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +This collector monitors Dovecot metrics about sessions, logins, commands, page faults and more. + + +It reads the server's response to the `EXPORT\tglobal\n` command. + + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +Automatically discovers and collects Dovecot statistics from the following default locations: + +- localhost:24242 +- unix:///var/run/dovecot/old-stats + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per Dovecot instance + +These metrics refer to the entire monitored application. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| dovecot.session | active | sessions | +| dovecot.logins | logins | logins | +| dovecot.auth | ok, failed | attempts/s | +| dovecot.commands | commands | commands | +| dovecot.context_switches | voluntary, voluntary | switches/s | +| dovecot.io | read, write | KiB/s | +| dovecot.net | read, write | kilobits/s | +| dovecot.syscalls | read, write | syscalls/s | +| dovecot.lookup | path, attr | lookups/s | +| dovecot.cache | hits | hits/s | +| dovecot.auth_cache | hits, misses | requests/s | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +#### Enable old_stats plugin + +To enable `old_stats` plugin, see [Old Statistics](https://doc.dovecot.org/configuration_manual/stats/old_statistics/#old-statistics). + + + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/dovecot.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/dovecot.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| address | The Unix or TCP socket address where the Dovecot [old_stats](https://doc.dovecot.org/configuration_manual/stats/old_statistics/#old-statistics) plugin listens for connections. | 127.0.0.1:24242 | yes | +| timeout | Connection, read, and write timeout duration in seconds. The timeout includes name resolution. | 1 | no | + +</details> + +#### Examples + +##### Basic (TCP) + +A basic example configuration. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:24242 + +``` +</details> + +##### Basic (UNIX) + +A basic example configuration using a UNIX socket. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: unix:///var/run/dovecot/old-stats + +``` +</details> + +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:24242 + + - name: remote + address: 203.0.113.0:24242 + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `dovecot` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m dovecot + ``` + +### Getting Logs + +If you're encountering problems with the `dovecot` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep dovecot +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep dovecot /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep dovecot +``` + + diff --git a/src/go/plugin/go.d/modules/dovecot/metadata.yaml b/src/go/plugin/go.d/modules/dovecot/metadata.yaml new file mode 100644 index 00000000..948990bc --- /dev/null +++ b/src/go/plugin/go.d/modules/dovecot/metadata.yaml @@ -0,0 +1,194 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-dovecot + plugin_name: go.d.plugin + module_name: dovecot + monitored_instance: + name: Dovecot + link: 'https://www.dovecot.org/' + categories: + - data-collection.mail-servers + icon_filename: "dovecot.svg" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - dovecot + - imap + - mail + most_popular: false + overview: + data_collection: + metrics_description: | + This collector monitors Dovecot metrics about sessions, logins, commands, page faults and more. + method_description: | + It reads the server's response to the `EXPORT\tglobal\n` command. + supported_platforms: + include: [] + exclude: [] + multi_instance: true + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: | + Automatically discovers and collects Dovecot statistics from the following default locations: + + - localhost:24242 + - unix:///var/run/dovecot/old-stats + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: + - title: Enable old_stats plugin + description: | + To enable `old_stats` plugin, see [Old Statistics](https://doc.dovecot.org/configuration_manual/stats/old_statistics/#old-statistics). + configuration: + file: + name: go.d/dovecot.conf + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: address + description: "The Unix or TCP socket address where the Dovecot [old_stats](https://doc.dovecot.org/configuration_manual/stats/old_statistics/#old-statistics) plugin listens for connections." + default_value: 127.0.0.1:24242 + required: true + - name: timeout + description: Connection, read, and write timeout duration in seconds. The timeout includes name resolution. + default_value: 1 + required: false + examples: + folding: + title: Config + enabled: true + list: + - name: Basic (TCP) + description: A basic example configuration. + config: | + jobs: + - name: local + address: 127.0.0.1:24242 + - name: Basic (UNIX) + description: A basic example configuration using a UNIX socket. + config: | + jobs: + - name: local + address: unix:///var/run/dovecot/old-stats + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + address: 127.0.0.1:24242 + + - name: remote + address: 203.0.113.0:24242 + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: "These metrics refer to the entire monitored application." + labels: [] + metrics: + - name: dovecot.session + description: Dovecot Active Sessions + unit: "sessions" + chart_type: line + dimensions: + - name: active + - name: dovecot.logins + description: Dovecot Logins + unit: "logins" + chart_type: line + dimensions: + - name: logins + - name: dovecot.auth + description: Dovecot Authentications + unit: "attempts/s" + chart_type: stacked + dimensions: + - name: ok + - name: failed + - name: dovecot.commands + description: Dovecot Commands + unit: "commands" + chart_type: line + dimensions: + - name: commands + - name: dovecot.context_switches + description: Dovecot Context Switches + unit: "switches/s" + chart_type: line + dimensions: + - name: voluntary + - name: voluntary + - name: dovecot.io + description: Dovecot Disk I/O + unit: "KiB/s" + chart_type: area + dimensions: + - name: read + - name: write + - name: dovecot.net + description: Dovecot Network Bandwidth + unit: "kilobits/s" + chart_type: area + dimensions: + - name: read + - name: write + - name: dovecot.syscalls + description: Dovecot Number of SysCalls + unit: "syscalls/s" + chart_type: line + dimensions: + - name: read + - name: write + - name: dovecot.lookup + description: Dovecot Lookups + unit: "lookups/s" + chart_type: stacked + dimensions: + - name: path + - name: attr + - name: dovecot.cache + description: Dovecot Cache Hits + unit: "hits/s" + chart_type: line + dimensions: + - name: hits + - name: dovecot.auth_cache + description: Dovecot Authentication Cache + unit: "requests/s" + chart_type: stacked + dimensions: + - name: hits + - name: misses diff --git a/src/go/collectors/go.d.plugin/modules/hddtemp/testdata/config.json b/src/go/plugin/go.d/modules/dovecot/testdata/config.json index e8683472..e8683472 100644 --- a/src/go/collectors/go.d.plugin/modules/hddtemp/testdata/config.json +++ b/src/go/plugin/go.d/modules/dovecot/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/hddtemp/testdata/config.yaml b/src/go/plugin/go.d/modules/dovecot/testdata/config.yaml index 1b81d09e..1b81d09e 100644 --- a/src/go/collectors/go.d.plugin/modules/hddtemp/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/dovecot/testdata/config.yaml diff --git a/src/go/plugin/go.d/modules/dovecot/testdata/export_global.txt b/src/go/plugin/go.d/modules/dovecot/testdata/export_global.txt new file mode 100644 index 00000000..00d28914 --- /dev/null +++ b/src/go/plugin/go.d/modules/dovecot/testdata/export_global.txt @@ -0,0 +1,2 @@ +reset_timestamp last_update num_logins num_cmds num_connected_sessions user_cpu sys_cpu clock_time min_faults maj_faults vol_cs invol_cs disk_input disk_output read_count read_bytes write_count write_bytes mail_lookup_path mail_lookup_attr mail_read_count mail_read_bytes mail_cache_hits auth_successes auth_master_successes auth_failures auth_db_tempfails auth_cache_hits auth_cache_misses +1723481629 1.111111 1 1 1 1.1 1.1 1.1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/README.md b/src/go/plugin/go.d/modules/elasticsearch/README.md index 8951ff7b..8951ff7b 120000 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/README.md +++ b/src/go/plugin/go.d/modules/elasticsearch/README.md diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/charts.go b/src/go/plugin/go.d/modules/elasticsearch/charts.go index 1087ef65..04906123 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/charts.go +++ b/src/go/plugin/go.d/modules/elasticsearch/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/collect.go b/src/go/plugin/go.d/modules/elasticsearch/collect.go index eb3ffb35..4f46f108 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/collect.go +++ b/src/go/plugin/go.d/modules/elasticsearch/collect.go @@ -13,8 +13,8 @@ import ( "strings" "sync" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const ( @@ -158,13 +158,15 @@ func (es *Elasticsearch) scrapeElasticsearch() *esMetrics { } func (es *Elasticsearch) scrapeNodesStats(ms *esMetrics) { - req, _ := web.NewHTTPRequest(es.Request) + var p string if es.ClusterMode { - req.URL.Path = urlPathNodesStats + p = urlPathNodesStats } else { - req.URL.Path = urlPathLocalNodeStats + p = urlPathLocalNodeStats } + req, _ := web.NewHTTPRequestWithPath(es.Request, p) + var stats esNodesStats if err := es.doOKDecode(req, &stats); err != nil { es.Warning(err) @@ -175,8 +177,7 @@ func (es *Elasticsearch) scrapeNodesStats(ms *esMetrics) { } func (es *Elasticsearch) scrapeClusterHealth(ms *esMetrics) { - req, _ := web.NewHTTPRequest(es.Request) - req.URL.Path = urlPathClusterHealth + req, _ := web.NewHTTPRequestWithPath(es.Request, urlPathClusterHealth) var health esClusterHealth if err := es.doOKDecode(req, &health); err != nil { @@ -188,8 +189,7 @@ func (es *Elasticsearch) scrapeClusterHealth(ms *esMetrics) { } func (es *Elasticsearch) scrapeClusterStats(ms *esMetrics) { - req, _ := web.NewHTTPRequest(es.Request) - req.URL.Path = urlPathClusterStats + req, _ := web.NewHTTPRequestWithPath(es.Request, urlPathClusterStats) var stats esClusterStats if err := es.doOKDecode(req, &stats); err != nil { @@ -201,8 +201,7 @@ func (es *Elasticsearch) scrapeClusterStats(ms *esMetrics) { } func (es *Elasticsearch) scrapeLocalIndicesStats(ms *esMetrics) { - req, _ := web.NewHTTPRequest(es.Request) - req.URL.Path = urlPathIndicesStats + req, _ := web.NewHTTPRequestWithPath(es.Request, urlPathIndicesStats) req.URL.RawQuery = "local=true&format=json" var stats []esIndexStats diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/config_schema.json b/src/go/plugin/go.d/modules/elasticsearch/config_schema.json index f1c39b02..230993b0 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/config_schema.json +++ b/src/go/plugin/go.d/modules/elasticsearch/config_schema.json @@ -202,6 +202,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/elasticsearch.go b/src/go/plugin/go.d/modules/elasticsearch/elasticsearch.go index 5a1c1b98..22280f2d 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/elasticsearch.go +++ b/src/go/plugin/go.d/modules/elasticsearch/elasticsearch.go @@ -9,8 +9,8 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/elasticsearch_test.go b/src/go/plugin/go.d/modules/elasticsearch/elasticsearch_test.go index dc481733..ca3aa526 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/elasticsearch_test.go +++ b/src/go/plugin/go.d/modules/elasticsearch/elasticsearch_test.go @@ -3,14 +3,14 @@ package elasticsearch import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "net/http" "net/http/httptest" "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/init.go b/src/go/plugin/go.d/modules/elasticsearch/init.go index 955d9c3a..f87b594f 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/init.go +++ b/src/go/plugin/go.d/modules/elasticsearch/init.go @@ -6,7 +6,7 @@ import ( "errors" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (es *Elasticsearch) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/integrations/elasticsearch.md b/src/go/plugin/go.d/modules/elasticsearch/integrations/elasticsearch.md index 2ae4e670..ab6f7d00 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/integrations/elasticsearch.md +++ b/src/go/plugin/go.d/modules/elasticsearch/integrations/elasticsearch.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/elasticsearch/integrations/elasticsearch.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/elasticsearch/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/elasticsearch/integrations/elasticsearch.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/elasticsearch/metadata.yaml" sidebar_label: "Elasticsearch" learn_status: "Published" learn_rel_path: "Collecting Metrics/Search Engines" @@ -318,6 +318,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `elasticsearch` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -340,4 +342,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m elasticsearch ``` +### Getting Logs + +If you're encountering problems with the `elasticsearch` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep elasticsearch +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep elasticsearch /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep elasticsearch +``` + diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/integrations/opensearch.md b/src/go/plugin/go.d/modules/elasticsearch/integrations/opensearch.md index 58c0e7c5..9426ada7 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/integrations/opensearch.md +++ b/src/go/plugin/go.d/modules/elasticsearch/integrations/opensearch.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/elasticsearch/integrations/opensearch.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/elasticsearch/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/elasticsearch/integrations/opensearch.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/elasticsearch/metadata.yaml" sidebar_label: "OpenSearch" learn_status: "Published" learn_rel_path: "Collecting Metrics/Search Engines" @@ -318,6 +318,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `elasticsearch` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -340,4 +342,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m elasticsearch ``` +### Getting Logs + +If you're encountering problems with the `elasticsearch` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep elasticsearch +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep elasticsearch /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep elasticsearch +``` + diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/metadata.yaml b/src/go/plugin/go.d/modules/elasticsearch/metadata.yaml index 9ee89294..9ee89294 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/metadata.yaml +++ b/src/go/plugin/go.d/modules/elasticsearch/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/metrics.go b/src/go/plugin/go.d/modules/elasticsearch/metrics.go index e838dc64..e838dc64 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/metrics.go +++ b/src/go/plugin/go.d/modules/elasticsearch/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/config.json b/src/go/plugin/go.d/modules/elasticsearch/testdata/config.json index a456d1d5..a456d1d5 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/config.json +++ b/src/go/plugin/go.d/modules/elasticsearch/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/config.yaml b/src/go/plugin/go.d/modules/elasticsearch/testdata/config.yaml index af1b4a13..af1b4a13 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/elasticsearch/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/cat_indices_stats.json b/src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/cat_indices_stats.json index f46794cc..f46794cc 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/cat_indices_stats.json +++ b/src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/cat_indices_stats.json diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/cluster_health.json b/src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/cluster_health.json index 0fdc0de4..0fdc0de4 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/cluster_health.json +++ b/src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/cluster_health.json diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/cluster_stats.json b/src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/cluster_stats.json index 53bea1b3..53bea1b3 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/cluster_stats.json +++ b/src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/cluster_stats.json diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/info.json b/src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/info.json index 23e3f159..23e3f159 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/info.json +++ b/src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/info.json diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/nodes_local_stats.json b/src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/nodes_local_stats.json index 77e0ad0b..77e0ad0b 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/nodes_local_stats.json +++ b/src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/nodes_local_stats.json diff --git a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/nodes_stats.json b/src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/nodes_stats.json index 6e6b21b9..6e6b21b9 100644 --- a/src/go/collectors/go.d.plugin/modules/elasticsearch/testdata/v8.4.2/nodes_stats.json +++ b/src/go/plugin/go.d/modules/elasticsearch/testdata/v8.4.2/nodes_stats.json diff --git a/src/go/collectors/go.d.plugin/modules/envoy/README.md b/src/go/plugin/go.d/modules/envoy/README.md index a0d3a2a2..a0d3a2a2 120000 --- a/src/go/collectors/go.d.plugin/modules/envoy/README.md +++ b/src/go/plugin/go.d/modules/envoy/README.md diff --git a/src/go/collectors/go.d.plugin/modules/envoy/charts.go b/src/go/plugin/go.d/modules/envoy/charts.go index 0f6d7165..3abe10e4 100644 --- a/src/go/collectors/go.d.plugin/modules/envoy/charts.go +++ b/src/go/plugin/go.d/modules/envoy/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/prometheus/prometheus/model/labels" ) diff --git a/src/go/collectors/go.d.plugin/modules/envoy/collect.go b/src/go/plugin/go.d/modules/envoy/collect.go index a7c74379..922e466d 100644 --- a/src/go/collectors/go.d.plugin/modules/envoy/collect.go +++ b/src/go/plugin/go.d/modules/envoy/collect.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" "github.com/prometheus/prometheus/model/labels" ) diff --git a/src/go/collectors/go.d.plugin/modules/envoy/config_schema.json b/src/go/plugin/go.d/modules/envoy/config_schema.json index edcb6799..7073337d 100644 --- a/src/go/collectors/go.d.plugin/modules/envoy/config_schema.json +++ b/src/go/plugin/go.d/modules/envoy/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/envoy/envoy.go b/src/go/plugin/go.d/modules/envoy/envoy.go index 5bdfa3b0..194acf17 100644 --- a/src/go/collectors/go.d.plugin/modules/envoy/envoy.go +++ b/src/go/plugin/go.d/modules/envoy/envoy.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/envoy/envoy_test.go b/src/go/plugin/go.d/modules/envoy/envoy_test.go index 9a705009..cbda31f9 100644 --- a/src/go/collectors/go.d.plugin/modules/envoy/envoy_test.go +++ b/src/go/plugin/go.d/modules/envoy/envoy_test.go @@ -3,13 +3,13 @@ package envoy import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "net/http" "net/http/httptest" "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/envoy/init.go b/src/go/plugin/go.d/modules/envoy/init.go index 0ce89c8b..8eba65d9 100644 --- a/src/go/collectors/go.d.plugin/modules/envoy/init.go +++ b/src/go/plugin/go.d/modules/envoy/init.go @@ -5,8 +5,8 @@ package envoy import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (e *Envoy) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/envoy/integrations/envoy.md b/src/go/plugin/go.d/modules/envoy/integrations/envoy.md index 943c1afb..3865ca52 100644 --- a/src/go/collectors/go.d.plugin/modules/envoy/integrations/envoy.md +++ b/src/go/plugin/go.d/modules/envoy/integrations/envoy.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/envoy/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/envoy/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/envoy/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/envoy/metadata.yaml" sidebar_label: "Envoy" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -246,6 +246,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `envoy` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -268,4 +270,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m envoy ``` +### Getting Logs + +If you're encountering problems with the `envoy` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep envoy +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep envoy /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep envoy +``` + diff --git a/src/go/collectors/go.d.plugin/modules/envoy/metadata.yaml b/src/go/plugin/go.d/modules/envoy/metadata.yaml index def9e726..def9e726 100644 --- a/src/go/collectors/go.d.plugin/modules/envoy/metadata.yaml +++ b/src/go/plugin/go.d/modules/envoy/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/envoy/testdata/config.json b/src/go/plugin/go.d/modules/envoy/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/envoy/testdata/config.json +++ b/src/go/plugin/go.d/modules/envoy/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/envoy/testdata/config.yaml b/src/go/plugin/go.d/modules/envoy/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/envoy/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/envoy/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/envoy/testdata/consul-dataplane.txt b/src/go/plugin/go.d/modules/envoy/testdata/consul-dataplane.txt index 2dbb9185..2dbb9185 100644 --- a/src/go/collectors/go.d.plugin/modules/envoy/testdata/consul-dataplane.txt +++ b/src/go/plugin/go.d/modules/envoy/testdata/consul-dataplane.txt diff --git a/src/go/collectors/go.d.plugin/modules/envoy/testdata/envoy.txt b/src/go/plugin/go.d/modules/envoy/testdata/envoy.txt index 1102c4c0..1102c4c0 100644 --- a/src/go/collectors/go.d.plugin/modules/envoy/testdata/envoy.txt +++ b/src/go/plugin/go.d/modules/envoy/testdata/envoy.txt diff --git a/src/go/collectors/go.d.plugin/modules/example/README.md b/src/go/plugin/go.d/modules/example/README.md index 01eb34eb..934dfd10 100644 --- a/src/go/collectors/go.d.plugin/modules/example/README.md +++ b/src/go/plugin/go.d/modules/example/README.md @@ -27,7 +27,7 @@ sudo ./edit-config go.d/example.conf ``` Disabled by default. Should be explicitly enabled -in [go.d.conf](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d.conf). +in [go.d.conf](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/config/go.d.conf). ```yaml # go.d.conf @@ -53,7 +53,7 @@ jobs: --- For all available options, see the Example -collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/example.conf). +collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/config/go.d/example.conf). ## Troubleshooting diff --git a/src/go/collectors/go.d.plugin/modules/example/charts.go b/src/go/plugin/go.d/modules/example/charts.go index d3973a99..71ecafdb 100644 --- a/src/go/collectors/go.d.plugin/modules/example/charts.go +++ b/src/go/plugin/go.d/modules/example/charts.go @@ -4,7 +4,7 @@ package example import ( "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) var chartTemplate = module.Chart{ diff --git a/src/go/collectors/go.d.plugin/modules/example/collect.go b/src/go/plugin/go.d/modules/example/collect.go index 588d605d..b72d3c25 100644 --- a/src/go/collectors/go.d.plugin/modules/example/collect.go +++ b/src/go/plugin/go.d/modules/example/collect.go @@ -5,7 +5,7 @@ package example import ( "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func (e *Example) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/example/config_schema.json b/src/go/plugin/go.d/modules/example/config_schema.json index 328773f6..328773f6 100644 --- a/src/go/collectors/go.d.plugin/modules/example/config_schema.json +++ b/src/go/plugin/go.d/modules/example/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/example/example.go b/src/go/plugin/go.d/modules/example/example.go index 433bf1ff..2ca0ad97 100644 --- a/src/go/collectors/go.d.plugin/modules/example/example.go +++ b/src/go/plugin/go.d/modules/example/example.go @@ -6,7 +6,7 @@ import ( _ "embed" "math/rand" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/example/example_test.go b/src/go/plugin/go.d/modules/example/example_test.go index 6fde9b64..26b3ec9c 100644 --- a/src/go/collectors/go.d.plugin/modules/example/example_test.go +++ b/src/go/plugin/go.d/modules/example/example_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/example/init.go b/src/go/plugin/go.d/modules/example/init.go index 6ee39ef4..f159c4b5 100644 --- a/src/go/collectors/go.d.plugin/modules/example/init.go +++ b/src/go/plugin/go.d/modules/example/init.go @@ -4,7 +4,7 @@ package example import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func (e *Example) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/example/testdata/config.json b/src/go/plugin/go.d/modules/example/testdata/config.json index af06e85a..af06e85a 100644 --- a/src/go/collectors/go.d.plugin/modules/example/testdata/config.json +++ b/src/go/plugin/go.d/modules/example/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/example/testdata/config.yaml b/src/go/plugin/go.d/modules/example/testdata/config.yaml index a5f6556f..a5f6556f 100644 --- a/src/go/collectors/go.d.plugin/modules/example/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/example/testdata/config.yaml diff --git a/src/go/plugin/go.d/modules/exim/README.md b/src/go/plugin/go.d/modules/exim/README.md new file mode 120000 index 00000000..f1f2ef9f --- /dev/null +++ b/src/go/plugin/go.d/modules/exim/README.md @@ -0,0 +1 @@ +integrations/exim.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/exim/charts.go b/src/go/plugin/go.d/modules/exim/charts.go new file mode 100644 index 00000000..f09faf1d --- /dev/null +++ b/src/go/plugin/go.d/modules/exim/charts.go @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package exim + +import ( + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioQueueEmailsCount = module.Priority + iota +) + +var charts = module.Charts{ + queueEmailsCountChart.Copy(), +} + +var queueEmailsCountChart = module.Chart{ + ID: "qemails", + Title: "Exim Queue Emails", + Units: "emails", + Fam: "queue", + Ctx: "exim.qemails", + Priority: prioQueueEmailsCount, + Dims: module.Dims{ + {ID: "emails"}, + }, +} diff --git a/src/go/plugin/go.d/modules/exim/collect.go b/src/go/plugin/go.d/modules/exim/collect.go new file mode 100644 index 00000000..ce1a3472 --- /dev/null +++ b/src/go/plugin/go.d/modules/exim/collect.go @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package exim + +import ( + "bufio" + "bytes" + "fmt" + "strconv" + "strings" +) + +func (e *Exim) collect() (map[string]int64, error) { + resp, err := e.exec.countMessagesInQueue() + if err != nil { + return nil, err + } + + emails, err := parseResponse(resp) + if err != nil { + return nil, err + } + + mx := map[string]int64{ + "emails": emails, + } + + return mx, nil +} + +func parseResponse(resp []byte) (int64, error) { + sc := bufio.NewScanner(bytes.NewReader(resp)) + sc.Scan() + + line := strings.TrimSpace(sc.Text()) + + emails, err := strconv.ParseInt(line, 10, 64) + if err != nil { + return 0, fmt.Errorf("invalid response '%s': %v", line, err) + } + + return emails, nil +} diff --git a/src/go/plugin/go.d/modules/exim/config_schema.json b/src/go/plugin/go.d/modules/exim/config_schema.json new file mode 100644 index 00000000..6561ea34 --- /dev/null +++ b/src/go/plugin/go.d/modules/exim/config_schema.json @@ -0,0 +1,35 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Exim collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 10 + }, + "timeout": { + "title": "Timeout", + "description": "Timeout for executing the binary, specified in seconds.", + "type": "number", + "minimum": 0.5, + "default": 2 + } + }, + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + } + } +} diff --git a/src/go/plugin/go.d/modules/exim/exec.go b/src/go/plugin/go.d/modules/exim/exec.go new file mode 100644 index 00000000..241c72ac --- /dev/null +++ b/src/go/plugin/go.d/modules/exim/exec.go @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package exim + +import ( + "context" + "fmt" + "os/exec" + "time" + + "github.com/netdata/netdata/go/plugins/logger" +) + +type eximBinary interface { + countMessagesInQueue() ([]byte, error) +} + +func newEximExec(ndsudoPath string, timeout time.Duration, log *logger.Logger) *eximExec { + return &eximExec{ + Logger: log, + ndsudoPath: ndsudoPath, + timeout: timeout, + } +} + +type eximExec struct { + *logger.Logger + + ndsudoPath string + timeout time.Duration +} + +func (e *eximExec) countMessagesInQueue() ([]byte, error) { + ctx, cancel := context.WithTimeout(context.Background(), e.timeout) + defer cancel() + + cmd := exec.CommandContext(ctx, e.ndsudoPath, "exim-bpc") + + e.Debugf("executing '%s'", cmd) + + bs, err := cmd.Output() + if err != nil { + return nil, fmt.Errorf("error on '%s': %v", cmd, err) + } + + return bs, nil +} diff --git a/src/go/plugin/go.d/modules/exim/exim.go b/src/go/plugin/go.d/modules/exim/exim.go new file mode 100644 index 00000000..f3c3e6e7 --- /dev/null +++ b/src/go/plugin/go.d/modules/exim/exim.go @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package exim + +import ( + _ "embed" + "errors" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("exim", module.Creator{ + JobConfigSchema: configSchema, + Defaults: module.Defaults{ + UpdateEvery: 10, + }, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Exim { + return &Exim{ + Config: Config{ + Timeout: web.Duration(time.Second * 2), + }, + charts: charts.Copy(), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Timeout web.Duration `yaml:"timeout,omitempty" json:"timeout"` +} + +type Exim struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + exec eximBinary +} + +func (e *Exim) Configuration() any { + return e.Config +} + +func (e *Exim) Init() error { + exim, err := e.initEximExec() + if err != nil { + e.Errorf("exim exec initialization: %v", err) + return err + } + e.exec = exim + + return nil +} + +func (e *Exim) Check() error { + mx, err := e.collect() + if err != nil { + e.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (e *Exim) Charts() *module.Charts { + return e.charts +} + +func (e *Exim) Collect() map[string]int64 { + mx, err := e.collect() + if err != nil { + e.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (e *Exim) Cleanup() {} diff --git a/src/go/plugin/go.d/modules/exim/exim_test.go b/src/go/plugin/go.d/modules/exim/exim_test.go new file mode 100644 index 00000000..16eb025e --- /dev/null +++ b/src/go/plugin/go.d/modules/exim/exim_test.go @@ -0,0 +1,217 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package exim + +import ( + "errors" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + } { + require.NotNil(t, data, name) + + } +} + +func TestExim_Configuration(t *testing.T) { + module.TestConfigurationSerialize(t, &Exim{}, dataConfigJSON, dataConfigYAML) +} + +func TestExim_Init(t *testing.T) { + tests := map[string]struct { + config Config + wantFail bool + }{ + "fails if failed to locate ndsudo": { + wantFail: true, + config: New().Config, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + exim := New() + exim.Config = test.config + + if test.wantFail { + assert.Error(t, exim.Init()) + } else { + assert.NoError(t, exim.Init()) + } + }) + } +} + +func TestExim_Cleanup(t *testing.T) { + tests := map[string]struct { + prepare func() *Exim + }{ + "not initialized exec": { + prepare: func() *Exim { + return New() + }, + }, + "after check": { + prepare: func() *Exim { + exim := New() + exim.exec = prepareMockOK() + _ = exim.Check() + return exim + }, + }, + "after collect": { + prepare: func() *Exim { + exim := New() + exim.exec = prepareMockOK() + _ = exim.Collect() + return exim + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + exim := test.prepare() + + assert.NotPanics(t, exim.Cleanup) + }) + } +} + +func TestEximCharts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestExim_Check(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockEximExec + wantFail bool + }{ + "success case": { + prepareMock: prepareMockOK, + wantFail: false, + }, + "error on exec": { + prepareMock: prepareMockErr, + wantFail: true, + }, + "empty response": { + prepareMock: prepareMockEmptyResponse, + wantFail: true, + }, + "unexpected response": { + prepareMock: prepareMockUnexpectedResponse, + wantFail: true, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + exim := New() + mock := test.prepareMock() + exim.exec = mock + + if test.wantFail { + assert.Error(t, exim.Check()) + } else { + assert.NoError(t, exim.Check()) + } + }) + } +} + +func TestExim_Collect(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockEximExec + wantMetrics map[string]int64 + }{ + "success case": { + prepareMock: prepareMockOK, + wantMetrics: map[string]int64{ + "emails": 99, + }, + }, + "error on exec": { + prepareMock: prepareMockErr, + wantMetrics: nil, + }, + "empty response": { + prepareMock: prepareMockEmptyResponse, + wantMetrics: nil, + }, + "unexpected response": { + prepareMock: prepareMockUnexpectedResponse, + wantMetrics: nil, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + exim := New() + mock := test.prepareMock() + exim.exec = mock + + mx := exim.Collect() + + assert.Equal(t, test.wantMetrics, mx) + + if len(test.wantMetrics) > 0 { + assert.Len(t, *exim.Charts(), len(charts)) + module.TestMetricsHasAllChartsDims(t, exim.Charts(), mx) + } + }) + } +} + +func prepareMockOK() *mockEximExec { + return &mockEximExec{ + data: []byte("99"), + } +} + +func prepareMockErr() *mockEximExec { + return &mockEximExec{ + err: true, + } +} + +func prepareMockEmptyResponse() *mockEximExec { + return &mockEximExec{} +} + +func prepareMockUnexpectedResponse() *mockEximExec { + return &mockEximExec{ + data: []byte(` +Lorem ipsum dolor sit amet, consectetur adipiscing elit. +Nulla malesuada erat id magna mattis, eu viverra tellus rhoncus. +Fusce et felis pulvinar, posuere sem non, porttitor eros. +`), + } +} + +type mockEximExec struct { + err bool + data []byte +} + +func (m *mockEximExec) countMessagesInQueue() ([]byte, error) { + if m.err { + return nil, errors.New("mock.countMessagesInQueue() error") + } + return m.data, nil +} diff --git a/src/go/plugin/go.d/modules/exim/init.go b/src/go/plugin/go.d/modules/exim/init.go new file mode 100644 index 00000000..d1d5c079 --- /dev/null +++ b/src/go/plugin/go.d/modules/exim/init.go @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package exim + +import ( + "fmt" + "os" + "path/filepath" + + "github.com/netdata/netdata/go/plugins/pkg/executable" +) + +func (e *Exim) initEximExec() (eximBinary, error) { + ndsudoPath := filepath.Join(executable.Directory, "ndsudo") + if _, err := os.Stat(ndsudoPath); err != nil { + return nil, fmt.Errorf("ndsudo executable not found: %v", err) + + } + + exim := newEximExec(ndsudoPath, e.Timeout.Duration(), e.Logger) + + return exim, nil +} diff --git a/src/go/plugin/go.d/modules/exim/integrations/exim.md b/src/go/plugin/go.d/modules/exim/integrations/exim.md new file mode 100644 index 00000000..78f45683 --- /dev/null +++ b/src/go/plugin/go.d/modules/exim/integrations/exim.md @@ -0,0 +1,191 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/exim/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/exim/metadata.yaml" +sidebar_label: "Exim" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Mail Servers" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Exim + + +<img src="https://netdata.cloud/img/exim.jpg" width="150"/> + + +Plugin: go.d.plugin +Module: exim + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +This collector monitors Exim mail queue. It relies on the [`exim`](https://www.exim.org/exim-html-3.20/doc/html/spec_5.html) CLI tool but avoids directly executing the binary. Instead, it utilizes `ndsudo`, a Netdata helper specifically designed to run privileged commands securely within the Netdata environment. This approach eliminates the need to use `sudo`, improving security and potentially simplifying permission management. +Executed commands: +- `exim -bpc` + + + + +This collector is supported on all platforms. + +This collector only supports collecting metrics from a single instance of this integration. + + +### Default Behavior + +#### Auto-Detection + +This integration doesn't support auto-detection. + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per Exim instance + +These metrics refer to the the entire monitored application. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| exim.qemails | emails | emails | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +No action required. + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/exim.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/exim.conf +``` +#### Options + +The following options can be defined globally: update_every. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 10 | no | +| timeout | exim binary execution timeout. | 2 | no | + +</details> + +#### Examples + +##### Custom update_every + +Allows you to override the default data collection interval. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: exim + update_every: 5 # Collect logical volume statistics every 5 seconds + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `exim` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m exim + ``` + +### Getting Logs + +If you're encountering problems with the `exim` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep exim +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep exim /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep exim +``` + + diff --git a/src/go/plugin/go.d/modules/exim/metadata.yaml b/src/go/plugin/go.d/modules/exim/metadata.yaml new file mode 100644 index 00000000..c7f4a7a9 --- /dev/null +++ b/src/go/plugin/go.d/modules/exim/metadata.yaml @@ -0,0 +1,100 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-exim + plugin_name: go.d.plugin + module_name: exim + monitored_instance: + name: Exim + link: "https://www.exim.org/" + icon_filename: 'exim.jpg' + categories: + - data-collection.mail-servers + keywords: + - exim + - mail + - email + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + most_popular: false + overview: + data_collection: + metrics_description: > + This collector monitors Exim mail queue. + It relies on the [`exim`](https://www.exim.org/exim-html-3.20/doc/html/spec_5.html) CLI tool but avoids directly executing the binary. + Instead, it utilizes `ndsudo`, a Netdata helper specifically designed to run privileged commands securely within the Netdata environment. + This approach eliminates the need to use `sudo`, improving security and potentially simplifying permission management. + + Executed commands: + + - `exim -bpc` + method_description: "" + supported_platforms: + include: [] + exclude: [] + multi_instance: false + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: "" + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: [] + configuration: + file: + name: go.d/exim.conf + options: + description: | + The following options can be defined globally: update_every. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 10 + required: false + - name: timeout + description: exim binary execution timeout. + default_value: 2 + required: false + examples: + folding: + title: Config + enabled: true + list: + - name: Custom update_every + description: Allows you to override the default data collection interval. + config: | + jobs: + - name: exim + update_every: 5 # Collect logical volume statistics every 5 seconds + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: These metrics refer to the the entire monitored application. + labels: [] + metrics: + - name: exim.qemails + description: Exim Queue Emails + unit: 'emails' + chart_type: line + dimensions: + - name: emails diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/testdata/config.json b/src/go/plugin/go.d/modules/exim/testdata/config.json index 291ecee3..291ecee3 100644 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/testdata/config.json +++ b/src/go/plugin/go.d/modules/exim/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/testdata/config.yaml b/src/go/plugin/go.d/modules/exim/testdata/config.yaml index 25b0b4c7..25b0b4c7 100644 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/exim/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/README.md b/src/go/plugin/go.d/modules/fail2ban/README.md index 642a8bcf..642a8bcf 120000 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/README.md +++ b/src/go/plugin/go.d/modules/fail2ban/README.md diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/charts.go b/src/go/plugin/go.d/modules/fail2ban/charts.go index d203e786..3015c738 100644 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/charts.go +++ b/src/go/plugin/go.d/modules/fail2ban/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/collect.go b/src/go/plugin/go.d/modules/fail2ban/collect.go index 8ca413c3..8ca413c3 100644 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/collect.go +++ b/src/go/plugin/go.d/modules/fail2ban/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/config_schema.json b/src/go/plugin/go.d/modules/fail2ban/config_schema.json index 7fd0d91a..7fd0d91a 100644 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/config_schema.json +++ b/src/go/plugin/go.d/modules/fail2ban/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/exec.go b/src/go/plugin/go.d/modules/fail2ban/exec.go index 06b5841e..b3037a6c 100644 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/exec.go +++ b/src/go/plugin/go.d/modules/fail2ban/exec.go @@ -6,36 +6,56 @@ import ( "context" "errors" "fmt" + "os" "os/exec" "strings" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" ) var errJailNotExist = errors.New("jail not exist") +const socketPathInDocker = "/host/var/run/fail2ban/fail2ban.sock" + func newFail2BanClientCliExec(ndsudoPath string, timeout time.Duration, log *logger.Logger) *fail2banClientCliExec { + _, err := os.Stat("/host/var/run") + return &fail2banClientCliExec{ - Logger: log, - ndsudoPath: ndsudoPath, - timeout: timeout, + Logger: log, + ndsudoPath: ndsudoPath, + timeout: timeout, + isInsideDocker: err == nil, } } type fail2banClientCliExec struct { *logger.Logger - ndsudoPath string - timeout time.Duration + ndsudoPath string + timeout time.Duration + isInsideDocker bool } func (e *fail2banClientCliExec) status() ([]byte, error) { + if e.isInsideDocker { + return e.execute("fail2ban-client-status-socket", + "--socket_path", socketPathInDocker, + ) + } return e.execute("fail2ban-client-status") } func (e *fail2banClientCliExec) jailStatus(jail string) ([]byte, error) { - return e.execute("fail2ban-client-status-jail", "--jail", jail) + if e.isInsideDocker { + return e.execute("fail2ban-client-status-jail-socket", + "--jail", jail, + "--socket_path", socketPathInDocker, + ) + } + return e.execute("fail2ban-client-status-jail", + "--jail", jail, + ) } func (e *fail2banClientCliExec) execute(args ...string) ([]byte, error) { diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/fail2ban.go b/src/go/plugin/go.d/modules/fail2ban/fail2ban.go index a9763633..45dcb6e2 100644 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/fail2ban.go +++ b/src/go/plugin/go.d/modules/fail2ban/fail2ban.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/fail2ban_test.go b/src/go/plugin/go.d/modules/fail2ban/fail2ban_test.go index 7d1988bd..ae84959b 100644 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/fail2ban_test.go +++ b/src/go/plugin/go.d/modules/fail2ban/fail2ban_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/init.go b/src/go/plugin/go.d/modules/fail2ban/init.go index 938c9697..ab963616 100644 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/init.go +++ b/src/go/plugin/go.d/modules/fail2ban/init.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" + "github.com/netdata/netdata/go/plugins/pkg/executable" ) func (f *Fail2Ban) initFail2banClientCliExec() (fail2banClientCli, error) { diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/integrations/fail2ban.md b/src/go/plugin/go.d/modules/fail2ban/integrations/fail2ban.md index 9162b3b4..0b967925 100644 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/integrations/fail2ban.md +++ b/src/go/plugin/go.d/modules/fail2ban/integrations/fail2ban.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/fail2ban/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/fail2ban/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/fail2ban/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/fail2ban/metadata.yaml" sidebar_label: "Fail2ban" learn_status: "Published" learn_rel_path: "Collecting Metrics/Authentication and Authorization" @@ -82,7 +82,17 @@ There are no alerts configured by default for this integration. ### Prerequisites -No action required. +#### For Netdata running in a Docker container + +1. **Install Fail2ban client**. + + Ensure `fail2ban-client` is available in the container by setting the environment variable `NETDATA_EXTRA_DEB_PACKAGES=fail2ban` when starting the container. + +2. **Mount host's `/var/run` directory**. + + Mount the host machine's `/var/run` directory to `/host/var/run` inside your Netdata container. This grants Netdata access to the Fail2ban socket file, typically located at `/var/run/fail2ban/fail2ban.sock`. + + ### Configuration @@ -134,6 +144,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `fail2ban` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -156,4 +168,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m fail2ban ``` +### Getting Logs + +If you're encountering problems with the `fail2ban` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep fail2ban +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep fail2ban /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep fail2ban +``` + diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/metadata.yaml b/src/go/plugin/go.d/modules/fail2ban/metadata.yaml index 87a5732a..922b4e5a 100644 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/metadata.yaml +++ b/src/go/plugin/go.d/modules/fail2ban/metadata.yaml @@ -44,7 +44,16 @@ modules: description: "" setup: prerequisites: - list: [] + list: + - title: For Netdata running in a Docker container + description: | + 1. **Install Fail2ban client**. + + Ensure `fail2ban-client` is available in the container by setting the environment variable `NETDATA_EXTRA_DEB_PACKAGES=fail2ban` when starting the container. + + 2. **Mount host's `/var/run` directory**. + + Mount the host machine's `/var/run` directory to `/host/var/run` inside your Netdata container. This grants Netdata access to the Fail2ban socket file, typically located at `/var/run/fail2ban/fail2ban.sock`. configuration: file: name: go.d/fail2ban.conf diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/testdata/config.json b/src/go/plugin/go.d/modules/fail2ban/testdata/config.json index 291ecee3..291ecee3 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/testdata/config.json +++ b/src/go/plugin/go.d/modules/fail2ban/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/testdata/config.yaml b/src/go/plugin/go.d/modules/fail2ban/testdata/config.yaml index 25b0b4c7..25b0b4c7 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/fail2ban/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/testdata/fail2ban-jail-status.txt b/src/go/plugin/go.d/modules/fail2ban/testdata/fail2ban-jail-status.txt index 17a3f53c..17a3f53c 100644 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/testdata/fail2ban-jail-status.txt +++ b/src/go/plugin/go.d/modules/fail2ban/testdata/fail2ban-jail-status.txt diff --git a/src/go/collectors/go.d.plugin/modules/fail2ban/testdata/fail2ban-status.txt b/src/go/plugin/go.d/modules/fail2ban/testdata/fail2ban-status.txt index 1e65a78c..1e65a78c 100644 --- a/src/go/collectors/go.d.plugin/modules/fail2ban/testdata/fail2ban-status.txt +++ b/src/go/plugin/go.d/modules/fail2ban/testdata/fail2ban-status.txt diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/README.md b/src/go/plugin/go.d/modules/filecheck/README.md index 24dc78d8..24dc78d8 120000 --- a/src/go/collectors/go.d.plugin/modules/filecheck/README.md +++ b/src/go/plugin/go.d/modules/filecheck/README.md diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/cache.go b/src/go/plugin/go.d/modules/filecheck/cache.go index 1acd6f82..1acd6f82 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/cache.go +++ b/src/go/plugin/go.d/modules/filecheck/cache.go diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/charts.go b/src/go/plugin/go.d/modules/filecheck/charts.go index 2be3c946..6d00463a 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/charts.go +++ b/src/go/plugin/go.d/modules/filecheck/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/collect.go b/src/go/plugin/go.d/modules/filecheck/collect.go index 077ad86c..077ad86c 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/collect.go +++ b/src/go/plugin/go.d/modules/filecheck/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/collect_dirs.go b/src/go/plugin/go.d/modules/filecheck/collect_dirs.go index 143915d4..143915d4 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/collect_dirs.go +++ b/src/go/plugin/go.d/modules/filecheck/collect_dirs.go diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/collect_files.go b/src/go/plugin/go.d/modules/filecheck/collect_files.go index 4c465c11..4c465c11 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/collect_files.go +++ b/src/go/plugin/go.d/modules/filecheck/collect_files.go diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/config_schema.json b/src/go/plugin/go.d/modules/filecheck/config_schema.json index c64bb941..c64bb941 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/config_schema.json +++ b/src/go/plugin/go.d/modules/filecheck/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/discover.go b/src/go/plugin/go.d/modules/filecheck/discover.go index 29ae552c..29ae552c 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/discover.go +++ b/src/go/plugin/go.d/modules/filecheck/discover.go diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/filecheck.go b/src/go/plugin/go.d/modules/filecheck/filecheck.go index 90541ee7..8d19c7c6 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/filecheck.go +++ b/src/go/plugin/go.d/modules/filecheck/filecheck.go @@ -6,9 +6,9 @@ import ( _ "embed" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/filecheck_test.go b/src/go/plugin/go.d/modules/filecheck/filecheck_test.go index 7cbbcd89..43024b0b 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/filecheck_test.go +++ b/src/go/plugin/go.d/modules/filecheck/filecheck_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/init.go b/src/go/plugin/go.d/modules/filecheck/init.go index 464f8173..20b30964 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/init.go +++ b/src/go/plugin/go.d/modules/filecheck/init.go @@ -5,7 +5,7 @@ package filecheck import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" ) func (f *Filecheck) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/integrations/files_and_directories.md b/src/go/plugin/go.d/modules/filecheck/integrations/files_and_directories.md index f7f0b033..ed131a12 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/integrations/files_and_directories.md +++ b/src/go/plugin/go.d/modules/filecheck/integrations/files_and_directories.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/filecheck/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/filecheck/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/filecheck/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/filecheck/metadata.yaml" sidebar_label: "Files and directories" learn_status: "Published" learn_rel_path: "Collecting Metrics/Other" @@ -220,6 +220,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `filecheck` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -242,4 +244,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m filecheck ``` +### Getting Logs + +If you're encountering problems with the `filecheck` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep filecheck +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep filecheck /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep filecheck +``` + diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/metadata.yaml b/src/go/plugin/go.d/modules/filecheck/metadata.yaml index 446226f2..446226f2 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/metadata.yaml +++ b/src/go/plugin/go.d/modules/filecheck/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/config.json b/src/go/plugin/go.d/modules/filecheck/testdata/config.json index 93d286f8..93d286f8 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/config.json +++ b/src/go/plugin/go.d/modules/filecheck/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/config.yaml b/src/go/plugin/go.d/modules/filecheck/testdata/config.yaml index 494a2185..494a2185 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/filecheck/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/dir/empty_file.log b/src/go/plugin/go.d/modules/filecheck/testdata/dir/empty_file.log index e69de29b..e69de29b 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/dir/empty_file.log +++ b/src/go/plugin/go.d/modules/filecheck/testdata/dir/empty_file.log diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/dir/file.log b/src/go/plugin/go.d/modules/filecheck/testdata/dir/file.log index c1c152a8..c1c152a8 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/dir/file.log +++ b/src/go/plugin/go.d/modules/filecheck/testdata/dir/file.log diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/dir/subdir/empty_file.log b/src/go/plugin/go.d/modules/filecheck/testdata/dir/subdir/empty_file.log index e69de29b..e69de29b 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/dir/subdir/empty_file.log +++ b/src/go/plugin/go.d/modules/filecheck/testdata/dir/subdir/empty_file.log diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/empty_file.log b/src/go/plugin/go.d/modules/filecheck/testdata/empty_file.log index e69de29b..e69de29b 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/empty_file.log +++ b/src/go/plugin/go.d/modules/filecheck/testdata/empty_file.log diff --git a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/file.log b/src/go/plugin/go.d/modules/filecheck/testdata/file.log index e0db6851..e0db6851 100644 --- a/src/go/collectors/go.d.plugin/modules/filecheck/testdata/file.log +++ b/src/go/plugin/go.d/modules/filecheck/testdata/file.log diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/README.md b/src/go/plugin/go.d/modules/fluentd/README.md index 96241702..96241702 120000 --- a/src/go/collectors/go.d.plugin/modules/fluentd/README.md +++ b/src/go/plugin/go.d/modules/fluentd/README.md diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/apiclient.go b/src/go/plugin/go.d/modules/fluentd/apiclient.go index 1bee8148..1c6bf85a 100644 --- a/src/go/collectors/go.d.plugin/modules/fluentd/apiclient.go +++ b/src/go/plugin/go.d/modules/fluentd/apiclient.go @@ -10,7 +10,7 @@ import ( "net/url" "path" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const pluginsPath = "/api/plugins.json" diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/charts.go b/src/go/plugin/go.d/modules/fluentd/charts.go index 3b7d0d59..b0034c02 100644 --- a/src/go/collectors/go.d.plugin/modules/fluentd/charts.go +++ b/src/go/plugin/go.d/modules/fluentd/charts.go @@ -2,7 +2,7 @@ package fluentd -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( // Charts is an alias for module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/collect.go b/src/go/plugin/go.d/modules/fluentd/collect.go index 14ee6df6..14ee6df6 100644 --- a/src/go/collectors/go.d.plugin/modules/fluentd/collect.go +++ b/src/go/plugin/go.d/modules/fluentd/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/config_schema.json b/src/go/plugin/go.d/modules/fluentd/config_schema.json index ff2adc73..037420f7 100644 --- a/src/go/collectors/go.d.plugin/modules/fluentd/config_schema.json +++ b/src/go/plugin/go.d/modules/fluentd/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/fluentd.go b/src/go/plugin/go.d/modules/fluentd/fluentd.go index 5b9753d9..467edaac 100644 --- a/src/go/collectors/go.d.plugin/modules/fluentd/fluentd.go +++ b/src/go/plugin/go.d/modules/fluentd/fluentd.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/fluentd_test.go b/src/go/plugin/go.d/modules/fluentd/fluentd_test.go index 01c4f963..e21b58fc 100644 --- a/src/go/collectors/go.d.plugin/modules/fluentd/fluentd_test.go +++ b/src/go/plugin/go.d/modules/fluentd/fluentd_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/init.go b/src/go/plugin/go.d/modules/fluentd/init.go index d8df8b3a..6ee71c0a 100644 --- a/src/go/collectors/go.d.plugin/modules/fluentd/init.go +++ b/src/go/plugin/go.d/modules/fluentd/init.go @@ -5,8 +5,8 @@ package fluentd import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (f *Fluentd) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/integrations/fluentd.md b/src/go/plugin/go.d/modules/fluentd/integrations/fluentd.md index b00facd3..b4740a77 100644 --- a/src/go/collectors/go.d.plugin/modules/fluentd/integrations/fluentd.md +++ b/src/go/plugin/go.d/modules/fluentd/integrations/fluentd.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/fluentd/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/fluentd/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/fluentd/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/fluentd/metadata.yaml" sidebar_label: "Fluentd" learn_status: "Published" learn_rel_path: "Collecting Metrics/Logs Servers" @@ -196,6 +196,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `fluentd` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -218,4 +220,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m fluentd ``` +### Getting Logs + +If you're encountering problems with the `fluentd` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep fluentd +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep fluentd /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep fluentd +``` + diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/metadata.yaml b/src/go/plugin/go.d/modules/fluentd/metadata.yaml index 0a6a6605..0a6a6605 100644 --- a/src/go/collectors/go.d.plugin/modules/fluentd/metadata.yaml +++ b/src/go/plugin/go.d/modules/fluentd/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/testdata/config.json b/src/go/plugin/go.d/modules/fluentd/testdata/config.json index 6477bd57..6477bd57 100644 --- a/src/go/collectors/go.d.plugin/modules/fluentd/testdata/config.json +++ b/src/go/plugin/go.d/modules/fluentd/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/testdata/config.yaml b/src/go/plugin/go.d/modules/fluentd/testdata/config.yaml index 0afd42e6..0afd42e6 100644 --- a/src/go/collectors/go.d.plugin/modules/fluentd/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/fluentd/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/fluentd/testdata/plugins.json b/src/go/plugin/go.d/modules/fluentd/testdata/plugins.json index 1fd921f7..1fd921f7 100644 --- a/src/go/collectors/go.d.plugin/modules/fluentd/testdata/plugins.json +++ b/src/go/plugin/go.d/modules/fluentd/testdata/plugins.json diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/README.md b/src/go/plugin/go.d/modules/freeradius/README.md index 66deefdb..66deefdb 120000 --- a/src/go/collectors/go.d.plugin/modules/freeradius/README.md +++ b/src/go/plugin/go.d/modules/freeradius/README.md diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/api/client.go b/src/go/plugin/go.d/modules/freeradius/api/client.go index 01f784c1..01f784c1 100644 --- a/src/go/collectors/go.d.plugin/modules/freeradius/api/client.go +++ b/src/go/plugin/go.d/modules/freeradius/api/client.go diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/api/client_test.go b/src/go/plugin/go.d/modules/freeradius/api/client_test.go index 9323aa99..9323aa99 100644 --- a/src/go/collectors/go.d.plugin/modules/freeradius/api/client_test.go +++ b/src/go/plugin/go.d/modules/freeradius/api/client_test.go diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/api/dictionary.go b/src/go/plugin/go.d/modules/freeradius/api/dictionary.go index 0ed348ae..0ed348ae 100644 --- a/src/go/collectors/go.d.plugin/modules/freeradius/api/dictionary.go +++ b/src/go/plugin/go.d/modules/freeradius/api/dictionary.go diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/charts.go b/src/go/plugin/go.d/modules/freeradius/charts.go index 18732c94..a9df720f 100644 --- a/src/go/collectors/go.d.plugin/modules/freeradius/charts.go +++ b/src/go/plugin/go.d/modules/freeradius/charts.go @@ -2,7 +2,7 @@ package freeradius -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( // Charts is an alias for module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/collect.go b/src/go/plugin/go.d/modules/freeradius/collect.go index 8ec4bf46..05fd8232 100644 --- a/src/go/collectors/go.d.plugin/modules/freeradius/collect.go +++ b/src/go/plugin/go.d/modules/freeradius/collect.go @@ -3,7 +3,7 @@ package freeradius import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) func (f *FreeRADIUS) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/config_schema.json b/src/go/plugin/go.d/modules/freeradius/config_schema.json index 7e1a3a4e..7e1a3a4e 100644 --- a/src/go/collectors/go.d.plugin/modules/freeradius/config_schema.json +++ b/src/go/plugin/go.d/modules/freeradius/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/freeradius.go b/src/go/plugin/go.d/modules/freeradius/freeradius.go index c9ce3514..e3c995b5 100644 --- a/src/go/collectors/go.d.plugin/modules/freeradius/freeradius.go +++ b/src/go/plugin/go.d/modules/freeradius/freeradius.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/modules/freeradius/api" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/freeradius/api" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/freeradius_test.go b/src/go/plugin/go.d/modules/freeradius/freeradius_test.go index bf061e01..58e2dce5 100644 --- a/src/go/collectors/go.d.plugin/modules/freeradius/freeradius_test.go +++ b/src/go/plugin/go.d/modules/freeradius/freeradius_test.go @@ -7,8 +7,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/modules/freeradius/api" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/freeradius/api" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/init.go b/src/go/plugin/go.d/modules/freeradius/init.go index 9c14da0e..9c14da0e 100644 --- a/src/go/collectors/go.d.plugin/modules/freeradius/init.go +++ b/src/go/plugin/go.d/modules/freeradius/init.go diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/integrations/freeradius.md b/src/go/plugin/go.d/modules/freeradius/integrations/freeradius.md index 9f23792f..59b124f7 100644 --- a/src/go/collectors/go.d.plugin/modules/freeradius/integrations/freeradius.md +++ b/src/go/plugin/go.d/modules/freeradius/integrations/freeradius.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/freeradius/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/freeradius/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/freeradius/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/freeradius/metadata.yaml" sidebar_label: "FreeRADIUS" learn_status: "Published" learn_rel_path: "Collecting Metrics/Authentication and Authorization" @@ -174,6 +174,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `freeradius` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -196,4 +198,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m freeradius ``` +### Getting Logs + +If you're encountering problems with the `freeradius` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep freeradius +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep freeradius /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep freeradius +``` + diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/metadata.yaml b/src/go/plugin/go.d/modules/freeradius/metadata.yaml index 5ecdcf41..5ecdcf41 100644 --- a/src/go/collectors/go.d.plugin/modules/freeradius/metadata.yaml +++ b/src/go/plugin/go.d/modules/freeradius/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/testdata/config.json b/src/go/plugin/go.d/modules/freeradius/testdata/config.json index 5a1939b6..5a1939b6 100644 --- a/src/go/collectors/go.d.plugin/modules/freeradius/testdata/config.json +++ b/src/go/plugin/go.d/modules/freeradius/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/freeradius/testdata/config.yaml b/src/go/plugin/go.d/modules/freeradius/testdata/config.yaml index 4a3d1f8c..4a3d1f8c 100644 --- a/src/go/collectors/go.d.plugin/modules/freeradius/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/freeradius/testdata/config.yaml diff --git a/src/go/plugin/go.d/modules/gearman/README.md b/src/go/plugin/go.d/modules/gearman/README.md new file mode 120000 index 00000000..70189d69 --- /dev/null +++ b/src/go/plugin/go.d/modules/gearman/README.md @@ -0,0 +1 @@ +integrations/gearman.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/gearman/charts.go b/src/go/plugin/go.d/modules/gearman/charts.go new file mode 100644 index 00000000..425c00fd --- /dev/null +++ b/src/go/plugin/go.d/modules/gearman/charts.go @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package gearman + +import ( + "fmt" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioQueuedJobsByActivity = module.Priority + iota + prioQueuedJobsByPriority + + prioFunctionQueuedJobsByActivity + prioFunctionQueuedJobsByPriority + prioFunctionAvailableWorkers +) + +var summaryCharts = module.Charts{ + chartQueuedJobsActivity.Copy(), + chartQueuedJobsPriority.Copy(), +} + +var ( + chartQueuedJobsActivity = module.Chart{ + ID: "queued_jobs_by_activity", + Title: "Jobs Activity", + Units: "jobs", + Fam: "jobs", + Ctx: "gearman.queued_jobs_activity", + Priority: prioQueuedJobsByActivity, + Type: module.Stacked, + Dims: module.Dims{ + {ID: "total_jobs_running", Name: "running"}, + {ID: "total_jobs_waiting", Name: "waiting"}, + }, + } + chartQueuedJobsPriority = module.Chart{ + ID: "queued_jobs_by_priority", + Title: "Jobs Priority", + Units: "jobs", + Fam: "jobs", + Ctx: "gearman.queued_jobs_priority", + Priority: prioQueuedJobsByPriority, + Type: module.Stacked, + Dims: module.Dims{ + {ID: "total_high_priority_jobs", Name: "high"}, + {ID: "total_normal_priority_jobs", Name: "normal"}, + {ID: "total_low_priority_jobs", Name: "low"}, + }, + } +) + +var functionStatusChartsTmpl = module.Charts{ + functionQueuedJobsActivityChartTmpl.Copy(), + functionWorkersChartTmpl.Copy(), +} + +var ( + functionQueuedJobsActivityChartTmpl = module.Chart{ + ID: "function_%s_queued_jobs_by_activity", + Title: "Function Jobs Activity", + Units: "jobs", + Fam: "fn jobs", + Ctx: "gearman.function_queued_jobs_activity", + Priority: prioFunctionQueuedJobsByActivity, + Type: module.Stacked, + Dims: module.Dims{ + {ID: "function_%s_jobs_running", Name: "running"}, + {ID: "function_%s_jobs_waiting", Name: "waiting"}, + }, + } + functionWorkersChartTmpl = module.Chart{ + ID: "function_%s_workers", + Title: "Function Workers", + Units: "workers", + Fam: "fn workers", + Ctx: "gearman.function_workers", + Priority: prioFunctionAvailableWorkers, + Type: module.Line, + Dims: module.Dims{ + {ID: "function_%s_workers_available", Name: "available"}, + }, + } +) + +var functionPriorityStatusChartsTmpl = module.Charts{ + functionQueuedJobsByPriorityChartTmpl.Copy(), +} + +var ( + functionQueuedJobsByPriorityChartTmpl = module.Chart{ + ID: "prio_function_%s_queued_jobs_by_priority", + Title: "Function Jobs Priority", + Units: "jobs", + Fam: "fn jobs", + Ctx: "gearman.function_queued_jobs_priority", + Priority: prioFunctionQueuedJobsByPriority, + Type: module.Stacked, + Dims: module.Dims{ + {ID: "function_%s_high_priority_jobs", Name: "high"}, + {ID: "function_%s_normal_priority_jobs", Name: "normal"}, + {ID: "function_%s_low_priority_jobs", Name: "low"}, + }, + } +) + +func (g *Gearman) addFunctionStatusCharts(name string) { + g.addFunctionCharts(name, functionStatusChartsTmpl.Copy()) +} + +func (g *Gearman) removeFunctionStatusCharts(name string) { + px := fmt.Sprintf("function_%s_", cleanFunctionName(name)) + g.removeCharts(px) +} + +func (g *Gearman) addFunctionPriorityStatusCharts(name string) { + g.addFunctionCharts(name, functionPriorityStatusChartsTmpl.Copy()) +} + +func (g *Gearman) removeFunctionPriorityStatusCharts(name string) { + px := fmt.Sprintf("prio_function_%s_", cleanFunctionName(name)) + g.removeCharts(px) +} + +func (g *Gearman) addFunctionCharts(name string, charts *module.Charts) { + charts = charts.Copy() + + for _, chart := range *charts { + chart.ID = fmt.Sprintf(chart.ID, cleanFunctionName(name)) + chart.Labels = []module.Label{ + {Key: "function_name", Value: name}, + } + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf(dim.ID, name) + } + } + + if err := g.Charts().Add(*charts...); err != nil { + g.Warning(err) + } +} + +func (g *Gearman) removeCharts(px string) { + for _, chart := range *g.Charts() { + if strings.HasPrefix(chart.ID, px) { + chart.MarkRemove() + chart.MarkNotCreated() + } + } +} + +func cleanFunctionName(name string) string { + r := strings.NewReplacer(".", "_", ",", "_", " ", "_") + return r.Replace(name) +} diff --git a/src/go/plugin/go.d/modules/gearman/client.go b/src/go/plugin/go.d/modules/gearman/client.go new file mode 100644 index 00000000..dff9a1be --- /dev/null +++ b/src/go/plugin/go.d/modules/gearman/client.go @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package gearman + +import ( + "bytes" + "fmt" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" +) + +type gearmanConn interface { + connect() error + disconnect() + queryStatus() ([]byte, error) + queryPriorityStatus() ([]byte, error) +} + +func newGearmanConn(conf Config) gearmanConn { + return &gearmanClient{conn: socket.New(socket.Config{ + Address: conf.Address, + ConnectTimeout: conf.Timeout.Duration(), + ReadTimeout: conf.Timeout.Duration(), + WriteTimeout: conf.Timeout.Duration(), + })} +} + +type gearmanClient struct { + conn socket.Client +} + +func (c *gearmanClient) connect() error { + return c.conn.Connect() +} + +func (c *gearmanClient) disconnect() { + _ = c.conn.Disconnect() +} + +func (c *gearmanClient) queryStatus() ([]byte, error) { + return c.query("status") +} + +func (c *gearmanClient) queryPriorityStatus() ([]byte, error) { + return c.query("prioritystatus") +} + +func (c *gearmanClient) query(cmd string) ([]byte, error) { + const limitReadLines = 10000 + var num int + var err error + var b bytes.Buffer + + clientErr := c.conn.Command(cmd+"\n", func(bs []byte) bool { + s := string(bs) + + if strings.HasPrefix(s, "ERR") { + err = fmt.Errorf("command '%s': %s", cmd, s) + return false + } + + b.WriteString(s) + b.WriteByte('\n') + + if num++; num >= limitReadLines { + err = fmt.Errorf("command '%s': read line limit exceeded (%d)", cmd, limitReadLines) + return false + } + return !strings.HasPrefix(s, ".") + }) + if clientErr != nil { + return nil, fmt.Errorf("command '%s' client error: %v", cmd, clientErr) + } + if err != nil { + return nil, err + } + + return b.Bytes(), nil +} diff --git a/src/go/plugin/go.d/modules/gearman/collect.go b/src/go/plugin/go.d/modules/gearman/collect.go new file mode 100644 index 00000000..ddfd8c96 --- /dev/null +++ b/src/go/plugin/go.d/modules/gearman/collect.go @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package gearman + +import ( + "bufio" + "bytes" + "errors" + "fmt" + "strconv" + "strings" +) + +func (g *Gearman) collect() (map[string]int64, error) { + if g.conn == nil { + conn, err := g.establishConn() + if err != nil { + return nil, err + } + g.conn = conn + } + + status, err := g.conn.queryStatus() + if err != nil { + g.Cleanup() + return nil, fmt.Errorf("couldn't query status: %v", err) + } + + prioStatus, err := g.conn.queryPriorityStatus() + if err != nil { + g.Cleanup() + return nil, fmt.Errorf("couldn't query priority status: %v", err) + } + + mx := make(map[string]int64) + + if err := g.collectStatus(mx, status); err != nil { + return nil, fmt.Errorf("couldn't collect status: %v", err) + } + if err := g.collectPriorityStatus(mx, prioStatus); err != nil { + return nil, fmt.Errorf("couldn't collect priority status: %v", err) + } + + return mx, nil + +} + +func (g *Gearman) collectStatus(mx map[string]int64, statusData []byte) error { + /* + Same output as the "gearadmin --status" command: + + FUNCTION\tTOTAL\tRUNNING\tAVAILABLE_WORKERS + + E.g.: + + prefix generic_worker4 78 78 500 + generic_worker2 78 78 500 + generic_worker3 0 0 760 + generic_worker1 0 0 500 + */ + + seen := make(map[string]bool) + var foundEnd bool + sc := bufio.NewScanner(bytes.NewReader(statusData)) + + mx["total_jobs_queued"] = 0 + mx["total_jobs_running"] = 0 + mx["total_jobs_waiting"] = 0 + mx["total_workers_avail"] = 0 + + for sc.Scan() { + line := strings.TrimSpace(sc.Text()) + + if foundEnd = line == "."; foundEnd { + break + } + + parts := strings.Fields(line) + + // Gearman does not remove old tasks. We are only interested in tasks that have stats. + if len(parts) < 4 { + continue + } + + name := strings.Join(parts[:len(parts)-3], "_") + metrics := parts[len(parts)-3:] + + var queued, running, availWorkers int64 + var err error + + if queued, err = strconv.ParseInt(metrics[0], 10, 64); err != nil { + return fmt.Errorf("couldn't parse queued count: %v", err) + } + if running, err = strconv.ParseInt(metrics[1], 10, 64); err != nil { + return fmt.Errorf("couldn't parse running count: %v", err) + } + if availWorkers, err = strconv.ParseInt(metrics[2], 10, 64); err != nil { + return fmt.Errorf("couldn't parse available count: %v", err) + } + + px := fmt.Sprintf("function_%s_", name) + + waiting := queued - running + + mx[px+"jobs_queued"] = queued + mx[px+"jobs_running"] = running + mx[px+"jobs_waiting"] = waiting + mx[px+"workers_available"] = availWorkers + + mx["total_jobs_queued"] += queued + mx["total_jobs_running"] += running + mx["total_jobs_waiting"] += waiting + mx["total_workers_available"] += availWorkers + + seen[name] = true + } + + if !foundEnd { + return errors.New("unexpected status response") + } + + for name := range seen { + if !g.seenTasks[name] { + g.seenTasks[name] = true + g.addFunctionStatusCharts(name) + } + } + for name := range g.seenTasks { + if !seen[name] { + delete(g.seenTasks, name) + g.removeFunctionStatusCharts(name) + } + } + + return nil +} + +func (g *Gearman) collectPriorityStatus(mx map[string]int64, prioStatusData []byte) error { + /* + Same output as the "gearadmin --priority-status" command: + + FUNCTION\tHIGH\tNORMAL\tLOW\tAVAILABLE_WORKERS + */ + + seen := make(map[string]bool) + var foundEnd bool + sc := bufio.NewScanner(bytes.NewReader(prioStatusData)) + + mx["total_high_priority_jobs"] = 0 + mx["total_normal_priority_jobs"] = 0 + mx["total_low_priority_jobs"] = 0 + + for sc.Scan() { + line := strings.TrimSpace(sc.Text()) + + if foundEnd = line == "."; foundEnd { + break + } + + parts := strings.Fields(line) + if len(parts) < 5 { + continue + } + + name := strings.Join(parts[:len(parts)-4], "_") + metrics := parts[len(parts)-4:] + + var high, normal, low int64 + var err error + + if high, err = strconv.ParseInt(metrics[0], 10, 64); err != nil { + return fmt.Errorf("couldn't parse high count: %v", err) + } + if normal, err = strconv.ParseInt(metrics[1], 10, 64); err != nil { + return fmt.Errorf("couldn't parse normal count: %v", err) + } + if low, err = strconv.ParseInt(metrics[2], 10, 64); err != nil { + return fmt.Errorf("couldn't parse low count: %v", err) + } + + px := fmt.Sprintf("function_%s_", name) + + mx[px+"high_priority_jobs"] = high + mx[px+"normal_priority_jobs"] = normal + mx[px+"low_priority_jobs"] = low + mx["total_high_priority_jobs"] += high + mx["total_normal_priority_jobs"] += normal + mx["total_low_priority_jobs"] += low + + seen[name] = true + } + + if !foundEnd { + return errors.New("unexpected priority status response") + } + + for name := range seen { + if !g.seenPriorityTasks[name] { + g.seenPriorityTasks[name] = true + g.addFunctionPriorityStatusCharts(name) + } + } + for name := range g.seenPriorityTasks { + if !seen[name] { + delete(g.seenPriorityTasks, name) + g.removeFunctionPriorityStatusCharts(name) + } + } + + return nil +} + +func (g *Gearman) establishConn() (gearmanConn, error) { + conn := g.newConn(g.Config) + + if err := conn.connect(); err != nil { + return nil, err + } + + return conn, nil +} diff --git a/src/go/plugin/go.d/modules/gearman/config_schema.json b/src/go/plugin/go.d/modules/gearman/config_schema.json new file mode 100644 index 00000000..dd5d3a0b --- /dev/null +++ b/src/go/plugin/go.d/modules/gearman/config_schema.json @@ -0,0 +1,44 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Gearman collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "address": { + "title": "Address", + "description": "The IP address and port where the Gearman service listens for connections.", + "type": "string", + "default": "127.0.0.1:4730" + }, + "timeout": { + "title": "Timeout", + "description": "Timeout for establishing a connection and communication (reading and writing) in seconds.", + "type": "number", + "minimum": 0.5, + "default": 1 + } + }, + "required": [ + "address" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + } + } +} diff --git a/src/go/plugin/go.d/modules/gearman/gearman.go b/src/go/plugin/go.d/modules/gearman/gearman.go new file mode 100644 index 00000000..e1780a95 --- /dev/null +++ b/src/go/plugin/go.d/modules/gearman/gearman.go @@ -0,0 +1,106 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package gearman + +import ( + _ "embed" + "errors" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("gearman", module.Creator{ + JobConfigSchema: configSchema, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Gearman { + return &Gearman{ + Config: Config{ + Address: "127.0.0.1:4730", + Timeout: web.Duration(time.Second * 1), + }, + newConn: newGearmanConn, + charts: summaryCharts.Copy(), + seenTasks: make(map[string]bool), + seenPriorityTasks: make(map[string]bool), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Address string `yaml:"address" json:"address"` + Timeout web.Duration `yaml:"timeout" json:"timeout"` +} + +type Gearman struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + newConn func(Config) gearmanConn + conn gearmanConn + + seenTasks map[string]bool + seenPriorityTasks map[string]bool +} + +func (g *Gearman) Configuration() any { + return g.Config +} + +func (g *Gearman) Init() error { + if g.Address == "" { + g.Error("config: 'address' not set") + return errors.New("address not set") + } + + return nil +} + +func (g *Gearman) Check() error { + mx, err := g.collect() + if err != nil { + g.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (g *Gearman) Charts() *module.Charts { + return g.charts +} + +func (g *Gearman) Collect() map[string]int64 { + mx, err := g.collect() + if err != nil { + g.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (g *Gearman) Cleanup() { + if g.conn != nil { + g.conn.disconnect() + g.conn = nil + } +} diff --git a/src/go/plugin/go.d/modules/gearman/gearman_test.go b/src/go/plugin/go.d/modules/gearman/gearman_test.go new file mode 100644 index 00000000..43069abc --- /dev/null +++ b/src/go/plugin/go.d/modules/gearman/gearman_test.go @@ -0,0 +1,326 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package gearman + +import ( + "errors" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataStatus, _ = os.ReadFile("testdata/status.txt") + dataPriorityStatus, _ = os.ReadFile("testdata/priority-status.txt") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + + "dataStatus": dataStatus, + "dataPriorityStatus": dataPriorityStatus, + } { + require.NotNil(t, data, name) + } +} + +func TestGearman_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &Gearman{}, dataConfigJSON, dataConfigYAML) +} + +func TestGearman_Init(t *testing.T) { + tests := map[string]struct { + config Config + wantFail bool + }{ + "success with default config": { + wantFail: false, + config: New().Config, + }, + "fails if address not set": { + wantFail: true, + config: func() Config { + conf := New().Config + conf.Address = "" + return conf + }(), + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + gear := New() + gear.Config = test.config + + if test.wantFail { + assert.Error(t, gear.Init()) + } else { + assert.NoError(t, gear.Init()) + } + }) + } +} + +func TestGearman_Cleanup(t *testing.T) { + tests := map[string]struct { + prepare func() *Gearman + }{ + "not initialized": { + prepare: func() *Gearman { + return New() + }, + }, + "after check": { + prepare: func() *Gearman { + gear := New() + gear.newConn = func(config Config) gearmanConn { return prepareMockOk() } + _ = gear.Check() + return gear + }, + }, + "after collect": { + prepare: func() *Gearman { + gear := New() + gear.newConn = func(config Config) gearmanConn { return prepareMockOk() } + _ = gear.Collect() + return gear + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + gear := test.prepare() + + assert.NotPanics(t, gear.Cleanup) + }) + } +} + +func TestGearman_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestGearman_Check(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockGearmanConn + wantFail bool + }{ + "success case": { + wantFail: false, + prepareMock: prepareMockOk, + }, + "err on connect": { + wantFail: true, + prepareMock: prepareMockErrOnConnect, + }, + "unexpected response": { + wantFail: true, + prepareMock: prepareMockUnexpectedResponse, + }, + "empty response": { + wantFail: false, + prepareMock: prepareMockEmptyResponse, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + gear := New() + mock := test.prepareMock() + gear.newConn = func(config Config) gearmanConn { return mock } + + if test.wantFail { + assert.Error(t, gear.Check()) + } else { + assert.NoError(t, gear.Check()) + } + }) + } +} + +func TestGearman_Collect(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockGearmanConn + wantMetrics map[string]int64 + wantCharts int + disconnectBeforeCleanup bool + disconnectAfterCleanup bool + }{ + "success case": { + prepareMock: prepareMockOk, + disconnectBeforeCleanup: false, + disconnectAfterCleanup: true, + wantCharts: len(summaryCharts) + len(functionStatusChartsTmpl)*4 + len(functionPriorityStatusChartsTmpl)*4, + wantMetrics: map[string]int64{ + "function_generic_worker1_high_priority_jobs": 10, + "function_generic_worker1_jobs_queued": 4, + "function_generic_worker1_jobs_running": 3, + "function_generic_worker1_jobs_waiting": 1, + "function_generic_worker1_low_priority_jobs": 12, + "function_generic_worker1_normal_priority_jobs": 11, + "function_generic_worker1_workers_available": 500, + "function_generic_worker2_high_priority_jobs": 4, + "function_generic_worker2_jobs_queued": 78, + "function_generic_worker2_jobs_running": 78, + "function_generic_worker2_jobs_waiting": 0, + "function_generic_worker2_low_priority_jobs": 6, + "function_generic_worker2_normal_priority_jobs": 5, + "function_generic_worker2_workers_available": 500, + "function_generic_worker3_high_priority_jobs": 7, + "function_generic_worker3_jobs_queued": 2, + "function_generic_worker3_jobs_running": 1, + "function_generic_worker3_jobs_waiting": 1, + "function_generic_worker3_low_priority_jobs": 9, + "function_generic_worker3_normal_priority_jobs": 8, + "function_generic_worker3_workers_available": 760, + "function_prefix_generic_worker4_high_priority_jobs": 1, + "function_prefix_generic_worker4_jobs_queued": 78, + "function_prefix_generic_worker4_jobs_running": 78, + "function_prefix_generic_worker4_jobs_waiting": 0, + "function_prefix_generic_worker4_low_priority_jobs": 3, + "function_prefix_generic_worker4_normal_priority_jobs": 2, + "function_prefix_generic_worker4_workers_available": 500, + "total_high_priority_jobs": 22, + "total_jobs_queued": 162, + "total_jobs_running": 160, + "total_jobs_waiting": 2, + "total_low_priority_jobs": 30, + "total_normal_priority_jobs": 26, + "total_workers_avail": 0, + "total_workers_available": 2260, + }, + }, + "unexpected response": { + prepareMock: prepareMockUnexpectedResponse, + disconnectBeforeCleanup: false, + disconnectAfterCleanup: true, + }, + "empty response": { + prepareMock: prepareMockEmptyResponse, + disconnectBeforeCleanup: false, + disconnectAfterCleanup: true, + wantCharts: len(summaryCharts), + wantMetrics: map[string]int64{ + "total_high_priority_jobs": 0, + "total_jobs_queued": 0, + "total_jobs_running": 0, + "total_jobs_waiting": 0, + "total_low_priority_jobs": 0, + "total_normal_priority_jobs": 0, + "total_workers_avail": 0, + }, + }, + "err on connect": { + prepareMock: prepareMockErrOnConnect, + disconnectBeforeCleanup: false, + disconnectAfterCleanup: false, + }, + "err on query status": { + prepareMock: prepareMockErrOnQueryStatus, + disconnectBeforeCleanup: true, + disconnectAfterCleanup: true, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + gear := New() + mock := test.prepareMock() + gear.newConn = func(config Config) gearmanConn { return mock } + + mx := gear.Collect() + + require.Equal(t, test.wantMetrics, mx, "want metrics") + + if len(test.wantMetrics) > 0 { + module.TestMetricsHasAllChartsDims(t, gear.Charts(), mx) + assert.Equal(t, test.wantCharts, len(*gear.Charts()), "want charts") + } + + assert.Equal(t, test.disconnectBeforeCleanup, mock.disconnectCalled, "disconnect before cleanup") + gear.Cleanup() + assert.Equal(t, test.disconnectAfterCleanup, mock.disconnectCalled, "disconnect after cleanup") + }) + } +} + +func prepareMockOk() *mockGearmanConn { + return &mockGearmanConn{ + responseStatus: dataStatus, + responsePriorityStatus: dataPriorityStatus, + } +} + +func prepareMockErrOnConnect() *mockGearmanConn { + return &mockGearmanConn{ + errOnConnect: true, + } +} + +func prepareMockErrOnQueryStatus() *mockGearmanConn { + return &mockGearmanConn{ + errOnQueryStatus: true, + } +} + +func prepareMockUnexpectedResponse() *mockGearmanConn { + resp := []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit.") + return &mockGearmanConn{ + responseStatus: resp, + responsePriorityStatus: resp, + } +} + +func prepareMockEmptyResponse() *mockGearmanConn { + return &mockGearmanConn{ + responseStatus: []byte("."), + responsePriorityStatus: []byte("."), + } +} + +type mockGearmanConn struct { + errOnConnect bool + + responseStatus []byte + errOnQueryStatus bool + + responsePriorityStatus []byte + errOnQueryPriorityStatus bool + + disconnectCalled bool +} + +func (m *mockGearmanConn) connect() error { + if m.errOnConnect { + return errors.New("mock.connect() error") + } + return nil +} + +func (m *mockGearmanConn) disconnect() { + m.disconnectCalled = true +} + +func (m *mockGearmanConn) queryStatus() ([]byte, error) { + if m.errOnQueryStatus { + return nil, errors.New("mock.queryStatus() error") + } + return m.responseStatus, nil +} + +func (m *mockGearmanConn) queryPriorityStatus() ([]byte, error) { + if m.errOnQueryPriorityStatus { + return nil, errors.New("mock.queryPriorityStatus() error") + } + return m.responsePriorityStatus, nil +} diff --git a/src/go/plugin/go.d/modules/gearman/integrations/gearman.md b/src/go/plugin/go.d/modules/gearman/integrations/gearman.md new file mode 100644 index 00000000..0a97a4cd --- /dev/null +++ b/src/go/plugin/go.d/modules/gearman/integrations/gearman.md @@ -0,0 +1,235 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/gearman/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/gearman/metadata.yaml" +sidebar_label: "Gearman" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Distributed Computing Systems" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Gearman + + +<img src="https://netdata.cloud/img/gearman.png" width="150"/> + + +Plugin: go.d.plugin +Module: gearman + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +Monitors jobs activity, priority and available workers. It collects summary and function-specific statistics. + + +This collector connects to a Gearman instance via TCP socket and executes the following commands: + +- status +- priority-status + + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +By default, it detects Gearman instances running on localhost that are listening on port 4730. + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per Gearman instance + +These metrics refer to the entire monitored application. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| gearman.queued_jobs_activity | running, waiting | jobs | +| gearman.queued_jobs_priority | high, normal, low | jobs | + +### Per Gearman instance + +These metrics refer to the Function (task). + +Labels: + +| Label | Description | +|:-----------|:----------------| +| function_name | Function name. | + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| gearman.function_queued_jobs_activity | running, waiting | jobs | +| gearman.function_queued_jobs_priority | high, normal, low | jobs | +| gearman.function_workers | available | workers | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +No action required. + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/gearman.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/gearman.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| address | The IP address and port where the Gearman service listens for connections. | 127.0.0.1:11211 | yes | +| timeout | Connection, read, and write timeout duration in seconds. The timeout includes name resolution. | 1 | no | + +</details> + +#### Examples + +##### Basic + +A basic example configuration. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:4730 + +``` +</details> + +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:4730 + + - name: remote + address: 203.0.113.0:4730 + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `gearman` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m gearman + ``` + +### Getting Logs + +If you're encountering problems with the `gearman` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep gearman +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep gearman /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep gearman +``` + + diff --git a/src/go/plugin/go.d/modules/gearman/metadata.yaml b/src/go/plugin/go.d/modules/gearman/metadata.yaml new file mode 100644 index 00000000..2312c9a5 --- /dev/null +++ b/src/go/plugin/go.d/modules/gearman/metadata.yaml @@ -0,0 +1,152 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-gearman + plugin_name: go.d.plugin + module_name: gearman + monitored_instance: + name: Gearman + link: https://gearman.org/ + categories: + - data-collection.distributed-computing-systems + icon_filename: "gearman.png" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - gearman + most_popular: false + overview: + data_collection: + metrics_description: | + Monitors jobs activity, priority and available workers. It collects summary and function-specific statistics. + method_description: | + This collector connects to a Gearman instance via TCP socket and executes the following commands: + + - status + - priority-status + supported_platforms: + include: [] + exclude: [] + multi_instance: true + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: | + By default, it detects Gearman instances running on localhost that are listening on port 4730. + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: [] + configuration: + file: + name: go.d/gearman.conf + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: address + description: The IP address and port where the Gearman service listens for connections. + default_value: 127.0.0.1:11211 + required: true + - name: timeout + description: Connection, read, and write timeout duration in seconds. The timeout includes name resolution. + default_value: 1 + required: false + examples: + folding: + title: Config + enabled: true + list: + - name: Basic + description: A basic example configuration. + config: | + jobs: + - name: local + address: 127.0.0.1:4730 + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + address: 127.0.0.1:4730 + + - name: remote + address: 203.0.113.0:4730 + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: "These metrics refer to the entire monitored application." + labels: [] + metrics: + - name: gearman.queued_jobs_activity + description: Jobs Activity + unit: "jobs" + chart_type: stacked + dimensions: + - name: running + - name: waiting + - name: gearman.queued_jobs_priority + description: Jobs Priority + unit: "jobs" + chart_type: stacked + dimensions: + - name: high + - name: normal + - name: low + - name: global + description: "These metrics refer to the Function (task)." + labels: + - name: function_name + description: Function name. + metrics: + - name: gearman.function_queued_jobs_activity + description: Function Jobs Activity + unit: "jobs" + chart_type: stacked + dimensions: + - name: running + - name: waiting + - name: gearman.function_queued_jobs_priority + description: Function Jobs Priority + unit: "jobs" + chart_type: stacked + dimensions: + - name: high + - name: normal + - name: low + - name: gearman.function_workers + description: Function Workers + unit: "workers" + chart_type: line + dimensions: + - name: available diff --git a/src/go/plugin/go.d/modules/gearman/testdata/config.json b/src/go/plugin/go.d/modules/gearman/testdata/config.json new file mode 100644 index 00000000..e8683472 --- /dev/null +++ b/src/go/plugin/go.d/modules/gearman/testdata/config.json @@ -0,0 +1,5 @@ +{ + "update_every": 123, + "address": "ok", + "timeout": 123.123 +} diff --git a/src/go/plugin/go.d/modules/gearman/testdata/config.yaml b/src/go/plugin/go.d/modules/gearman/testdata/config.yaml new file mode 100644 index 00000000..1b81d09e --- /dev/null +++ b/src/go/plugin/go.d/modules/gearman/testdata/config.yaml @@ -0,0 +1,3 @@ +update_every: 123 +address: "ok" +timeout: 123.123 diff --git a/src/go/plugin/go.d/modules/gearman/testdata/priority-status.txt b/src/go/plugin/go.d/modules/gearman/testdata/priority-status.txt new file mode 100644 index 00000000..3cb669d1 --- /dev/null +++ b/src/go/plugin/go.d/modules/gearman/testdata/priority-status.txt @@ -0,0 +1,5 @@ +prefix generic_worker4 1 2 3 500 +generic_worker2 4 5 6 500 +generic_worker3 7 8 9 760 +generic_worker1 10 11 12 500 +. diff --git a/src/go/plugin/go.d/modules/gearman/testdata/status.txt b/src/go/plugin/go.d/modules/gearman/testdata/status.txt new file mode 100644 index 00000000..33d77ab8 --- /dev/null +++ b/src/go/plugin/go.d/modules/gearman/testdata/status.txt @@ -0,0 +1,5 @@ +prefix generic_worker4 78 78 500 +generic_worker2 78 78 500 +generic_worker3 2 1 760 +generic_worker1 4 3 500 +. diff --git a/src/go/collectors/go.d.plugin/modules/geth/README.md b/src/go/plugin/go.d/modules/geth/README.md index 3a8eb0b6..3a8eb0b6 120000 --- a/src/go/collectors/go.d.plugin/modules/geth/README.md +++ b/src/go/plugin/go.d/modules/geth/README.md diff --git a/src/go/collectors/go.d.plugin/modules/geth/charts.go b/src/go/plugin/go.d/modules/geth/charts.go index 31663173..5b87168a 100644 --- a/src/go/collectors/go.d.plugin/modules/geth/charts.go +++ b/src/go/plugin/go.d/modules/geth/charts.go @@ -2,7 +2,7 @@ package geth -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( Charts = module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/geth/collect.go b/src/go/plugin/go.d/modules/geth/collect.go index dfdf5494..bd7b1d5b 100644 --- a/src/go/collectors/go.d.plugin/modules/geth/collect.go +++ b/src/go/plugin/go.d/modules/geth/collect.go @@ -3,8 +3,8 @@ package geth import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) func (g *Geth) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/geth/config_schema.json b/src/go/plugin/go.d/modules/geth/config_schema.json index 3fd239e4..00b3071d 100644 --- a/src/go/collectors/go.d.plugin/modules/geth/config_schema.json +++ b/src/go/plugin/go.d/modules/geth/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/geth/geth.go b/src/go/plugin/go.d/modules/geth/geth.go index 070ad058..6448965f 100644 --- a/src/go/collectors/go.d.plugin/modules/geth/geth.go +++ b/src/go/plugin/go.d/modules/geth/geth.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/geth/geth_test.go b/src/go/plugin/go.d/modules/geth/geth_test.go index 68c38385..c68701c1 100644 --- a/src/go/collectors/go.d.plugin/modules/geth/geth_test.go +++ b/src/go/plugin/go.d/modules/geth/geth_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/require" ) diff --git a/src/go/collectors/go.d.plugin/modules/geth/init.go b/src/go/plugin/go.d/modules/geth/init.go index 9b649f85..da908560 100644 --- a/src/go/collectors/go.d.plugin/modules/geth/init.go +++ b/src/go/plugin/go.d/modules/geth/init.go @@ -3,8 +3,8 @@ package geth import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (g *Geth) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/geth/integrations/go-ethereum.md b/src/go/plugin/go.d/modules/geth/integrations/go-ethereum.md index c14b0a7b..86f83052 100644 --- a/src/go/collectors/go.d.plugin/modules/geth/integrations/go-ethereum.md +++ b/src/go/plugin/go.d/modules/geth/integrations/go-ethereum.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/geth/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/geth/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/geth/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/geth/metadata.yaml" sidebar_label: "Go-ethereum" learn_status: "Published" learn_rel_path: "Collecting Metrics/Blockchain Servers" @@ -192,6 +192,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `geth` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -214,4 +216,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m geth ``` +### Getting Logs + +If you're encountering problems with the `geth` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep geth +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep geth /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep geth +``` + diff --git a/src/go/collectors/go.d.plugin/modules/geth/metadata.yaml b/src/go/plugin/go.d/modules/geth/metadata.yaml index ef131776..ef131776 100644 --- a/src/go/collectors/go.d.plugin/modules/geth/metadata.yaml +++ b/src/go/plugin/go.d/modules/geth/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/geth/metrics.go b/src/go/plugin/go.d/modules/geth/metrics.go index 642973d6..642973d6 100644 --- a/src/go/collectors/go.d.plugin/modules/geth/metrics.go +++ b/src/go/plugin/go.d/modules/geth/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/geth/testdata/config.json b/src/go/plugin/go.d/modules/geth/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/geth/testdata/config.json +++ b/src/go/plugin/go.d/modules/geth/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/geth/testdata/config.yaml b/src/go/plugin/go.d/modules/geth/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/geth/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/geth/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/geth/testdata/metrics_geth.txt b/src/go/plugin/go.d/modules/geth/testdata/metrics_geth.txt index 055fea89..055fea89 100644 --- a/src/go/collectors/go.d.plugin/modules/geth/testdata/metrics_geth.txt +++ b/src/go/plugin/go.d/modules/geth/testdata/metrics_geth.txt diff --git a/src/go/collectors/go.d.plugin/modules/haproxy/README.md b/src/go/plugin/go.d/modules/haproxy/README.md index 2f52cf84..2f52cf84 120000 --- a/src/go/collectors/go.d.plugin/modules/haproxy/README.md +++ b/src/go/plugin/go.d/modules/haproxy/README.md diff --git a/src/go/collectors/go.d.plugin/modules/haproxy/charts.go b/src/go/plugin/go.d/modules/haproxy/charts.go index 503094c5..e7118a07 100644 --- a/src/go/collectors/go.d.plugin/modules/haproxy/charts.go +++ b/src/go/plugin/go.d/modules/haproxy/charts.go @@ -5,7 +5,7 @@ package haproxy import ( "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) var charts = module.Charts{ diff --git a/src/go/collectors/go.d.plugin/modules/haproxy/collect.go b/src/go/plugin/go.d/modules/haproxy/collect.go index 203ff1ec..e3ade66a 100644 --- a/src/go/collectors/go.d.plugin/modules/haproxy/collect.go +++ b/src/go/plugin/go.d/modules/haproxy/collect.go @@ -6,8 +6,8 @@ import ( "errors" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/haproxy/config_schema.json b/src/go/plugin/go.d/modules/haproxy/config_schema.json index a5d43236..6a794145 100644 --- a/src/go/collectors/go.d.plugin/modules/haproxy/config_schema.json +++ b/src/go/plugin/go.d/modules/haproxy/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/haproxy/haproxy.go b/src/go/plugin/go.d/modules/haproxy/haproxy.go index 217eb3c2..0e3f9f3d 100644 --- a/src/go/collectors/go.d.plugin/modules/haproxy/haproxy.go +++ b/src/go/plugin/go.d/modules/haproxy/haproxy.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/haproxy/haproxy_test.go b/src/go/plugin/go.d/modules/haproxy/haproxy_test.go index 3566d17e..80a733ff 100644 --- a/src/go/collectors/go.d.plugin/modules/haproxy/haproxy_test.go +++ b/src/go/plugin/go.d/modules/haproxy/haproxy_test.go @@ -8,9 +8,9 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/haproxy/init.go b/src/go/plugin/go.d/modules/haproxy/init.go index 55c66900..0922a9b2 100644 --- a/src/go/collectors/go.d.plugin/modules/haproxy/init.go +++ b/src/go/plugin/go.d/modules/haproxy/init.go @@ -5,9 +5,9 @@ package haproxy import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus/selector" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus/selector" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (h *Haproxy) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/haproxy/integrations/haproxy.md b/src/go/plugin/go.d/modules/haproxy/integrations/haproxy.md index af6d3c9b..1619b9d7 100644 --- a/src/go/collectors/go.d.plugin/modules/haproxy/integrations/haproxy.md +++ b/src/go/plugin/go.d/modules/haproxy/integrations/haproxy.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/haproxy/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/haproxy/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/haproxy/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/haproxy/metadata.yaml" sidebar_label: "HAProxy" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -216,6 +216,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `haproxy` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -238,4 +240,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m haproxy ``` +### Getting Logs + +If you're encountering problems with the `haproxy` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep haproxy +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep haproxy /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep haproxy +``` + diff --git a/src/go/collectors/go.d.plugin/modules/haproxy/metadata.yaml b/src/go/plugin/go.d/modules/haproxy/metadata.yaml index adc87960..adc87960 100644 --- a/src/go/collectors/go.d.plugin/modules/haproxy/metadata.yaml +++ b/src/go/plugin/go.d/modules/haproxy/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/haproxy/testdata/config.json b/src/go/plugin/go.d/modules/haproxy/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/haproxy/testdata/config.json +++ b/src/go/plugin/go.d/modules/haproxy/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/haproxy/testdata/config.yaml b/src/go/plugin/go.d/modules/haproxy/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/haproxy/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/haproxy/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/haproxy/testdata/v2.3.10/metrics.txt b/src/go/plugin/go.d/modules/haproxy/testdata/v2.3.10/metrics.txt index a156485d..a156485d 100644 --- a/src/go/collectors/go.d.plugin/modules/haproxy/testdata/v2.3.10/metrics.txt +++ b/src/go/plugin/go.d/modules/haproxy/testdata/v2.3.10/metrics.txt diff --git a/src/go/collectors/go.d.plugin/modules/hddtemp/README.md b/src/go/plugin/go.d/modules/hddtemp/README.md index 95c7593f..95c7593f 120000 --- a/src/go/collectors/go.d.plugin/modules/hddtemp/README.md +++ b/src/go/plugin/go.d/modules/hddtemp/README.md diff --git a/src/go/collectors/go.d.plugin/modules/hddtemp/charts.go b/src/go/plugin/go.d/modules/hddtemp/charts.go index 7a5e9ed9..7e0766c4 100644 --- a/src/go/collectors/go.d.plugin/modules/hddtemp/charts.go +++ b/src/go/plugin/go.d/modules/hddtemp/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/hddtemp/client.go b/src/go/plugin/go.d/modules/hddtemp/client.go index 626381ee..b89be10a 100644 --- a/src/go/collectors/go.d.plugin/modules/hddtemp/client.go +++ b/src/go/plugin/go.d/modules/hddtemp/client.go @@ -3,7 +3,7 @@ package hddtemp import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/socket" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" ) func newHddTempConn(conf Config) hddtempConn { diff --git a/src/go/collectors/go.d.plugin/modules/hddtemp/collect.go b/src/go/plugin/go.d/modules/hddtemp/collect.go index f5c75db0..f5c75db0 100644 --- a/src/go/collectors/go.d.plugin/modules/hddtemp/collect.go +++ b/src/go/plugin/go.d/modules/hddtemp/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/hddtemp/config_schema.json b/src/go/plugin/go.d/modules/hddtemp/config_schema.json index 2858fbe0..2858fbe0 100644 --- a/src/go/collectors/go.d.plugin/modules/hddtemp/config_schema.json +++ b/src/go/plugin/go.d/modules/hddtemp/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/hddtemp/hddtemp.go b/src/go/plugin/go.d/modules/hddtemp/hddtemp.go index 119974c4..ac283d6e 100644 --- a/src/go/collectors/go.d.plugin/modules/hddtemp/hddtemp.go +++ b/src/go/plugin/go.d/modules/hddtemp/hddtemp.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/hddtemp/hddtemp_test.go b/src/go/plugin/go.d/modules/hddtemp/hddtemp_test.go index cab4ceb9..d20d79ed 100644 --- a/src/go/collectors/go.d.plugin/modules/hddtemp/hddtemp_test.go +++ b/src/go/plugin/go.d/modules/hddtemp/hddtemp_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/hddtemp/integrations/hdd_temperature.md b/src/go/plugin/go.d/modules/hddtemp/integrations/hdd_temperature.md index be91e67f..3d5f3e71 100644 --- a/src/go/collectors/go.d.plugin/modules/hddtemp/integrations/hdd_temperature.md +++ b/src/go/plugin/go.d/modules/hddtemp/integrations/hdd_temperature.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/hddtemp/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/hddtemp/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/hddtemp/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/hddtemp/metadata.yaml" sidebar_label: "HDD temperature" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -164,6 +164,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `hddtemp` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -186,4 +188,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m hddtemp ``` +### Getting Logs + +If you're encountering problems with the `hddtemp` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep hddtemp +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep hddtemp /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep hddtemp +``` + diff --git a/src/go/collectors/go.d.plugin/modules/hddtemp/metadata.yaml b/src/go/plugin/go.d/modules/hddtemp/metadata.yaml index 74206ebc..74206ebc 100644 --- a/src/go/collectors/go.d.plugin/modules/hddtemp/metadata.yaml +++ b/src/go/plugin/go.d/modules/hddtemp/metadata.yaml diff --git a/src/go/plugin/go.d/modules/hddtemp/testdata/config.json b/src/go/plugin/go.d/modules/hddtemp/testdata/config.json new file mode 100644 index 00000000..e8683472 --- /dev/null +++ b/src/go/plugin/go.d/modules/hddtemp/testdata/config.json @@ -0,0 +1,5 @@ +{ + "update_every": 123, + "address": "ok", + "timeout": 123.123 +} diff --git a/src/go/plugin/go.d/modules/hddtemp/testdata/config.yaml b/src/go/plugin/go.d/modules/hddtemp/testdata/config.yaml new file mode 100644 index 00000000..1b81d09e --- /dev/null +++ b/src/go/plugin/go.d/modules/hddtemp/testdata/config.yaml @@ -0,0 +1,3 @@ +update_every: 123 +address: "ok" +timeout: 123.123 diff --git a/src/go/collectors/go.d.plugin/modules/hddtemp/testdata/hddtemp-all-ok.txt b/src/go/plugin/go.d/modules/hddtemp/testdata/hddtemp-all-ok.txt index 5f6606e8..5f6606e8 100644 --- a/src/go/collectors/go.d.plugin/modules/hddtemp/testdata/hddtemp-all-ok.txt +++ b/src/go/plugin/go.d/modules/hddtemp/testdata/hddtemp-all-ok.txt diff --git a/src/go/collectors/go.d.plugin/modules/hddtemp/testdata/hddtemp-all-sleep.txt b/src/go/plugin/go.d/modules/hddtemp/testdata/hddtemp-all-sleep.txt index 732b62c7..732b62c7 100644 --- a/src/go/collectors/go.d.plugin/modules/hddtemp/testdata/hddtemp-all-sleep.txt +++ b/src/go/plugin/go.d/modules/hddtemp/testdata/hddtemp-all-sleep.txt diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/README.md b/src/go/plugin/go.d/modules/hdfs/README.md index 38f428a0..38f428a0 120000 --- a/src/go/collectors/go.d.plugin/modules/hdfs/README.md +++ b/src/go/plugin/go.d/modules/hdfs/README.md diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/charts.go b/src/go/plugin/go.d/modules/hdfs/charts.go index 94af99d2..5b264c64 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/charts.go +++ b/src/go/plugin/go.d/modules/hdfs/charts.go @@ -2,7 +2,7 @@ package hdfs -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( Charts = module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/client.go b/src/go/plugin/go.d/modules/hdfs/client.go index bdeced14..3c43348b 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/client.go +++ b/src/go/plugin/go.d/modules/hdfs/client.go @@ -8,7 +8,7 @@ import ( "io" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func newClient(httpClient *http.Client, request web.Request) *client { diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/collect.go b/src/go/plugin/go.d/modules/hdfs/collect.go index d7081d36..6ac022b8 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/collect.go +++ b/src/go/plugin/go.d/modules/hdfs/collect.go @@ -8,7 +8,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) func (h *HDFS) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/config_schema.json b/src/go/plugin/go.d/modules/hdfs/config_schema.json index 416b6941..528cc4db 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/config_schema.json +++ b/src/go/plugin/go.d/modules/hdfs/config_schema.json @@ -170,6 +170,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/hdfs.go b/src/go/plugin/go.d/modules/hdfs/hdfs.go index 1b0f849a..44b5840b 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/hdfs.go +++ b/src/go/plugin/go.d/modules/hdfs/hdfs.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/hdfs_test.go b/src/go/plugin/go.d/modules/hdfs/hdfs_test.go index f9cbdc1b..d24e50bb 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/hdfs_test.go +++ b/src/go/plugin/go.d/modules/hdfs/hdfs_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/init.go b/src/go/plugin/go.d/modules/hdfs/init.go index 79cd2e6b..1159ab73 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/init.go +++ b/src/go/plugin/go.d/modules/hdfs/init.go @@ -5,7 +5,7 @@ package hdfs import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (h *HDFS) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/integrations/hadoop_distributed_file_system_hdfs.md b/src/go/plugin/go.d/modules/hdfs/integrations/hadoop_distributed_file_system_hdfs.md index a3b39b18..e37ccde0 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/integrations/hadoop_distributed_file_system_hdfs.md +++ b/src/go/plugin/go.d/modules/hdfs/integrations/hadoop_distributed_file_system_hdfs.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/hdfs/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/hdfs/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/hdfs/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/hdfs/metadata.yaml" sidebar_label: "Hadoop Distributed File System (HDFS)" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -226,6 +226,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `hfs` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -248,4 +250,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m hfs ``` +### Getting Logs + +If you're encountering problems with the `hfs` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep hfs +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep hfs /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep hfs +``` + diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/metadata.yaml b/src/go/plugin/go.d/modules/hdfs/metadata.yaml index 694868e0..694868e0 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/metadata.yaml +++ b/src/go/plugin/go.d/modules/hdfs/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/metrics.go b/src/go/plugin/go.d/modules/hdfs/metrics.go index 972436a5..972436a5 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/metrics.go +++ b/src/go/plugin/go.d/modules/hdfs/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/raw_data.go b/src/go/plugin/go.d/modules/hdfs/raw_data.go index ab434ae1..ab434ae1 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/raw_data.go +++ b/src/go/plugin/go.d/modules/hdfs/raw_data.go diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/testdata/config.json b/src/go/plugin/go.d/modules/hdfs/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/testdata/config.json +++ b/src/go/plugin/go.d/modules/hdfs/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/testdata/config.yaml b/src/go/plugin/go.d/modules/hdfs/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/hdfs/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/testdata/datanode.json b/src/go/plugin/go.d/modules/hdfs/testdata/datanode.json index 0f657d56..0f657d56 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/testdata/datanode.json +++ b/src/go/plugin/go.d/modules/hdfs/testdata/datanode.json diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/testdata/namenode.json b/src/go/plugin/go.d/modules/hdfs/testdata/namenode.json index 2d33d32f..2d33d32f 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/testdata/namenode.json +++ b/src/go/plugin/go.d/modules/hdfs/testdata/namenode.json diff --git a/src/go/collectors/go.d.plugin/modules/hdfs/testdata/unknownnode.json b/src/go/plugin/go.d/modules/hdfs/testdata/unknownnode.json index 7370a7a3..7370a7a3 100644 --- a/src/go/collectors/go.d.plugin/modules/hdfs/testdata/unknownnode.json +++ b/src/go/plugin/go.d/modules/hdfs/testdata/unknownnode.json diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/README.md b/src/go/plugin/go.d/modules/hpssa/README.md index dd12f5a9..dd12f5a9 120000 --- a/src/go/collectors/go.d.plugin/modules/hpssa/README.md +++ b/src/go/plugin/go.d/modules/hpssa/README.md diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/charts.go b/src/go/plugin/go.d/modules/hpssa/charts.go index 437870df..14b032bd 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/charts.go +++ b/src/go/plugin/go.d/modules/hpssa/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/collect.go b/src/go/plugin/go.d/modules/hpssa/collect.go index a0ce7d0b..a0ce7d0b 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/collect.go +++ b/src/go/plugin/go.d/modules/hpssa/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/config_schema.json b/src/go/plugin/go.d/modules/hpssa/config_schema.json index 788d7685..788d7685 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/config_schema.json +++ b/src/go/plugin/go.d/modules/hpssa/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/exec.go b/src/go/plugin/go.d/modules/hpssa/exec.go index e8bf511d..510b7d65 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/exec.go +++ b/src/go/plugin/go.d/modules/hpssa/exec.go @@ -8,7 +8,7 @@ import ( "os/exec" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" ) func newSsacliExec(ndsudoPath string, timeout time.Duration, log *logger.Logger) *ssacliExec { diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/hpssa.go b/src/go/plugin/go.d/modules/hpssa/hpssa.go index c3b31721..1245f477 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/hpssa.go +++ b/src/go/plugin/go.d/modules/hpssa/hpssa.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/hpssa_test.go b/src/go/plugin/go.d/modules/hpssa/hpssa_test.go index ed311650..a3e90d2a 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/hpssa_test.go +++ b/src/go/plugin/go.d/modules/hpssa/hpssa_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/init.go b/src/go/plugin/go.d/modules/hpssa/init.go index 06038f5c..3e08c443 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/init.go +++ b/src/go/plugin/go.d/modules/hpssa/init.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" + "github.com/netdata/netdata/go/plugins/pkg/executable" ) func (h *Hpssa) initSsacliExec() (ssacli, error) { diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/integrations/hpe_smart_arrays.md b/src/go/plugin/go.d/modules/hpssa/integrations/hpe_smart_arrays.md index 90029fb9..47fe7473 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/integrations/hpe_smart_arrays.md +++ b/src/go/plugin/go.d/modules/hpssa/integrations/hpe_smart_arrays.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/hpssa/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/hpssa/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/hpssa/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/hpssa/metadata.yaml" sidebar_label: "HPE Smart Arrays" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -211,6 +211,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `hpssa` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -233,4 +235,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m hpssa ``` +### Getting Logs + +If you're encountering problems with the `hpssa` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep hpssa +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep hpssa /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep hpssa +``` + diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/metadata.yaml b/src/go/plugin/go.d/modules/hpssa/metadata.yaml index 6cf7a637..6cf7a637 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/metadata.yaml +++ b/src/go/plugin/go.d/modules/hpssa/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/parse.go b/src/go/plugin/go.d/modules/hpssa/parse.go index 64d1c8ae..64d1c8ae 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/parse.go +++ b/src/go/plugin/go.d/modules/hpssa/parse.go diff --git a/src/go/collectors/go.d.plugin/modules/logind/testdata/config.json b/src/go/plugin/go.d/modules/hpssa/testdata/config.json index 291ecee3..291ecee3 100644 --- a/src/go/collectors/go.d.plugin/modules/logind/testdata/config.json +++ b/src/go/plugin/go.d/modules/hpssa/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/logind/testdata/config.yaml b/src/go/plugin/go.d/modules/hpssa/testdata/config.yaml index 25b0b4c7..25b0b4c7 100644 --- a/src/go/collectors/go.d.plugin/modules/logind/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/hpssa/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/testdata/ssacli-P212_P410i.txt b/src/go/plugin/go.d/modules/hpssa/testdata/ssacli-P212_P410i.txt index c54cc10c..c54cc10c 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/testdata/ssacli-P212_P410i.txt +++ b/src/go/plugin/go.d/modules/hpssa/testdata/ssacli-P212_P410i.txt diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/testdata/ssacli-P400ar.txt b/src/go/plugin/go.d/modules/hpssa/testdata/ssacli-P400ar.txt index 7abec717..7abec717 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/testdata/ssacli-P400ar.txt +++ b/src/go/plugin/go.d/modules/hpssa/testdata/ssacli-P400ar.txt diff --git a/src/go/collectors/go.d.plugin/modules/hpssa/testdata/ssacli-P400i-unassigned.txt b/src/go/plugin/go.d/modules/hpssa/testdata/ssacli-P400i-unassigned.txt index b674f26c..b674f26c 100644 --- a/src/go/collectors/go.d.plugin/modules/hpssa/testdata/ssacli-P400i-unassigned.txt +++ b/src/go/plugin/go.d/modules/hpssa/testdata/ssacli-P400i-unassigned.txt diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/README.md b/src/go/plugin/go.d/modules/httpcheck/README.md index 69f05613..69f05613 120000 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/README.md +++ b/src/go/plugin/go.d/modules/httpcheck/README.md diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/charts.go b/src/go/plugin/go.d/modules/httpcheck/charts.go index efb0f874..376ed99a 100644 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/charts.go +++ b/src/go/plugin/go.d/modules/httpcheck/charts.go @@ -3,7 +3,7 @@ package httpcheck import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/collect.go b/src/go/plugin/go.d/modules/httpcheck/collect.go index 8d88dc02..fa0c96bc 100644 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/collect.go +++ b/src/go/plugin/go.d/modules/httpcheck/collect.go @@ -12,8 +12,8 @@ import ( "strings" "time" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) type reqErrCode int diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/config_schema.json b/src/go/plugin/go.d/modules/httpcheck/config_schema.json index 80db7b05..82ffc7cb 100644 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/config_schema.json +++ b/src/go/plugin/go.d/modules/httpcheck/config_schema.json @@ -95,7 +95,7 @@ }, "value": { "title": "Header value pattern", - "description": "Specifies the [matcher pattern](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme) to match against the value of the specified header.", + "description": "Specifies the [matcher pattern](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme) to match against the value of the specified header.", "type": "string" } }, @@ -253,6 +253,18 @@ }, "body": { "ui:widget": "textarea" + }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, + "password": { + "ui:widget": "password" + }, + "proxy_password": { + "ui:widget": "password" } } } diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/cookiejar.go b/src/go/plugin/go.d/modules/httpcheck/cookiejar.go index 628867ca..628867ca 100644 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/cookiejar.go +++ b/src/go/plugin/go.d/modules/httpcheck/cookiejar.go diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/httpcheck.go b/src/go/plugin/go.d/modules/httpcheck/httpcheck.go index 6d597d48..1c7b6b1c 100644 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/httpcheck.go +++ b/src/go/plugin/go.d/modules/httpcheck/httpcheck.go @@ -9,8 +9,8 @@ import ( "regexp" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/httpcheck_test.go b/src/go/plugin/go.d/modules/httpcheck/httpcheck_test.go index dde5761e..9ae0cf4e 100644 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/httpcheck_test.go +++ b/src/go/plugin/go.d/modules/httpcheck/httpcheck_test.go @@ -3,14 +3,14 @@ package httpcheck import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "net/http" "net/http/httptest" "os" "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/init.go b/src/go/plugin/go.d/modules/httpcheck/init.go index a7f70819..a4a3ae27 100644 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/init.go +++ b/src/go/plugin/go.d/modules/httpcheck/init.go @@ -8,9 +8,9 @@ import ( "net/http" "regexp" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) type headerMatch struct { diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/integrations/http_endpoints.md b/src/go/plugin/go.d/modules/httpcheck/integrations/http_endpoints.md index feb3133c..b94735de 100644 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/integrations/http_endpoints.md +++ b/src/go/plugin/go.d/modules/httpcheck/integrations/http_endpoints.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/httpcheck/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/httpcheck/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/httpcheck/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/httpcheck/metadata.yaml" sidebar_label: "HTTP Endpoints" learn_status: "Published" learn_rel_path: "Collecting Metrics/Synthetic Checks" @@ -21,7 +21,19 @@ Module: httpcheck ## Overview -This collector monitors HTTP servers availability and response time. +This collector monitors HTTP servers availability status and response time. + +Possible statuses: + +| Status | Description | +|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| success | HTTP request completed successfully with a status code matching the configured `status_accepted` range (default: 200), and the response body and headers (if configured) match expectations. | +| timeout | HTTP request timed out before receiving a response (default: 1 second). | +| no_connection | Failed to establish a connection to the target. | +| redirect | Received a redirect response (3xx status code) while `not_follow_redirects` is configured. | +| bad_status | HTTP request completed with a status code outside the configured `status_accepted` range (default: non-200). | +| bad_content | HTTP request completed successfully but the response body does not match the expected content (when using `response_match`). | +| bad_header | HTTP request completed successfully but response headers do not match the expected values (when using `headers_match`). | @@ -117,7 +129,7 @@ The following options can be defined globally: update_every, autodetection_retry | headers_match | This option defines a set of rules that check for specific key-value pairs in the HTTP headers of the response. | [] | no | | headers_match.exclude | This option determines whether the rule should check for the presence of the specified key-value pair or the absence of it. | no | no | | headers_match.key | The exact name of the HTTP header to check for. | | yes | -| headers_match.value | The [pattern](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#supported-format) to match against the value of the specified header. | | no | +| headers_match.value | The [pattern](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#supported-format) to match against the value of the specified header. | | no | | cookie_file | Path to cookie file. See [cookie file format](https://everything.curl.dev/http/cookies/fileformat). | | no | | timeout | HTTP request timeout. | 1 | no | | username | Username for basic HTTP authentication. | | no | @@ -189,7 +201,7 @@ jobs: ##### With `header_match` -Example configurations with `header_match`. See the value [pattern](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#supported-format) syntax. +Example configurations with `header_match`. See the value [pattern](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#supported-format) syntax. <details open><summary>Config</summary> @@ -292,6 +304,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `httpcheck` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -314,4 +328,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m httpcheck ``` +### Getting Logs + +If you're encountering problems with the `httpcheck` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep httpcheck +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep httpcheck /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep httpcheck +``` + diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/metadata.yaml b/src/go/plugin/go.d/modules/httpcheck/metadata.yaml index 6b6b7d51..f34993b5 100644 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/metadata.yaml +++ b/src/go/plugin/go.d/modules/httpcheck/metadata.yaml @@ -21,7 +21,19 @@ modules: overview: data_collection: metrics_description: | - This collector monitors HTTP servers availability and response time. + This collector monitors HTTP servers availability status and response time. + + Possible statuses: + + | Status | Description | + |---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | success | HTTP request completed successfully with a status code matching the configured `status_accepted` range (default: 200), and the response body and headers (if configured) match expectations. | + | timeout | HTTP request timed out before receiving a response (default: 1 second). | + | no_connection | Failed to establish a connection to the target. | + | redirect | Received a redirect response (3xx status code) while `not_follow_redirects` is configured. | + | bad_status | HTTP request completed with a status code outside the configured `status_accepted` range (default: non-200). | + | bad_content | HTTP request completed successfully but the response body does not match the expected content (when using `response_match`). | + | bad_header | HTTP request completed successfully but response headers do not match the expected values (when using `headers_match`). | method_description: "" supported_platforms: include: [] @@ -82,7 +94,7 @@ modules: default_value: "" required: true - name: headers_match.value - description: "The [pattern](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#supported-format) to match against the value of the specified header." + description: "The [pattern](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#supported-format) to match against the value of the specified header." default_value: "" required: false - name: cookie_file @@ -176,7 +188,7 @@ modules: - 200 - 204 - name: With `header_match` - description: Example configurations with `header_match`. See the value [pattern](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#supported-format) syntax. + description: Example configurations with `header_match`. See the value [pattern](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#supported-format) syntax. config: | jobs: # The "X-Robots-Tag" header must be present in the HTTP response header, diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/metrics.go b/src/go/plugin/go.d/modules/httpcheck/metrics.go index 676346fa..676346fa 100644 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/metrics.go +++ b/src/go/plugin/go.d/modules/httpcheck/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/testdata/config.json b/src/go/plugin/go.d/modules/httpcheck/testdata/config.json index 649393cd..649393cd 100644 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/testdata/config.json +++ b/src/go/plugin/go.d/modules/httpcheck/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/testdata/config.yaml b/src/go/plugin/go.d/modules/httpcheck/testdata/config.yaml index 1a66590e..1a66590e 100644 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/httpcheck/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/httpcheck/testdata/cookie.txt b/src/go/plugin/go.d/modules/httpcheck/testdata/cookie.txt index 2504c6ff..2504c6ff 100644 --- a/src/go/collectors/go.d.plugin/modules/httpcheck/testdata/cookie.txt +++ b/src/go/plugin/go.d/modules/httpcheck/testdata/cookie.txt diff --git a/src/go/plugin/go.d/modules/icecast/README.md b/src/go/plugin/go.d/modules/icecast/README.md new file mode 120000 index 00000000..db3c1b57 --- /dev/null +++ b/src/go/plugin/go.d/modules/icecast/README.md @@ -0,0 +1 @@ +integrations/icecast.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/icecast/charts.go b/src/go/plugin/go.d/modules/icecast/charts.go new file mode 100644 index 00000000..26d3fe10 --- /dev/null +++ b/src/go/plugin/go.d/modules/icecast/charts.go @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package icecast + +import ( + "fmt" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioSourceListeners = module.Priority + iota +) + +var sourceChartsTmpl = module.Charts{ + sourceListenersChartTmpl.Copy(), +} + +var ( + sourceListenersChartTmpl = module.Chart{ + ID: "icecast_%s_listeners", + Title: "Icecast Listeners", + Units: "listeners", + Fam: "listeners", + Ctx: "icecast.listeners", + Type: module.Line, + Priority: prioSourceListeners, + Dims: module.Dims{ + {ID: "source_%s_listeners", Name: "listeners"}, + }, + } +) + +func (ic *Icecast) addSourceCharts(name string) { + chart := sourceListenersChartTmpl.Copy() + + chart.ID = fmt.Sprintf(chart.ID, cleanSource(name)) + chart.Labels = []module.Label{ + {Key: "source", Value: name}, + } + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf(dim.ID, name) + } + + if err := ic.Charts().Add(chart); err != nil { + ic.Warning(err) + } + +} + +func (ic *Icecast) removeSourceCharts(name string) { + px := fmt.Sprintf("icecast_%s_", cleanSource(name)) + for _, chart := range *ic.Charts() { + if strings.HasPrefix(chart.ID, px) { + chart.MarkRemove() + chart.MarkNotCreated() + } + } +} + +func cleanSource(name string) string { + r := strings.NewReplacer(" ", "_", ".", "_", ",", "_") + return r.Replace(name) +} diff --git a/src/go/plugin/go.d/modules/icecast/collect.go b/src/go/plugin/go.d/modules/icecast/collect.go new file mode 100644 index 00000000..102ad31e --- /dev/null +++ b/src/go/plugin/go.d/modules/icecast/collect.go @@ -0,0 +1,107 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package icecast + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +const ( + urlPathServerStats = "/status-json.xsl" // https://icecast.org/docs/icecast-trunk/server_stats/ +) + +func (ic *Icecast) collect() (map[string]int64, error) { + mx := make(map[string]int64) + + if err := ic.collectServerStats(mx); err != nil { + return nil, err + } + + return mx, nil +} + +func (ic *Icecast) collectServerStats(mx map[string]int64) error { + stats, err := ic.queryServerStats() + if err != nil { + return err + } + if stats.IceStats == nil { + return fmt.Errorf("unexpected response: no icestats found") + } + if len(stats.IceStats.Source) == 0 { + return fmt.Errorf("no icecast sources found") + } + + seen := make(map[string]bool) + + for _, src := range stats.IceStats.Source { + name := src.ServerName + if name == "" { + continue + } + + seen[name] = true + + if !ic.seenSources[name] { + ic.seenSources[name] = true + ic.addSourceCharts(name) + } + + px := fmt.Sprintf("source_%s_", name) + + mx[px+"listeners"] = src.Listeners + } + + for name := range ic.seenSources { + if !seen[name] { + delete(ic.seenSources, name) + ic.removeSourceCharts(name) + } + } + + return nil +} + +func (ic *Icecast) queryServerStats() (*serverStats, error) { + req, err := web.NewHTTPRequestWithPath(ic.Request, urlPathServerStats) + if err != nil { + return nil, err + } + + var stats serverStats + + if err := ic.doOKDecode(req, &stats); err != nil { + return nil, err + } + + return &stats, nil +} + +func (ic *Icecast) doOKDecode(req *http.Request, in interface{}) error { + resp, err := ic.httpClient.Do(req) + if err != nil { + return fmt.Errorf("error on HTTP request '%s': %v", req.URL, err) + } + defer closeBody(resp) + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("'%s' returned HTTP status code: %d", req.URL, resp.StatusCode) + } + + if err := json.NewDecoder(resp.Body).Decode(in); err != nil { + return fmt.Errorf("error on decoding response from '%s': %v", req.URL, err) + } + return nil +} + +func closeBody(resp *http.Response) { + if resp != nil && resp.Body != nil { + _, _ = io.Copy(io.Discard, resp.Body) + _ = resp.Body.Close() + } +} diff --git a/src/go/plugin/go.d/modules/icecast/config_schema.json b/src/go/plugin/go.d/modules/icecast/config_schema.json new file mode 100644 index 00000000..3abda6e7 --- /dev/null +++ b/src/go/plugin/go.d/modules/icecast/config_schema.json @@ -0,0 +1,177 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Icecast collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "url": { + "title": "URL", + "description": "The base URL where the Icecast API can be accessed.", + "type": "string", + "default": "http://127.0.0.1:8000", + "format": "uri" + }, + "timeout": { + "title": "Timeout", + "description": "The timeout in seconds for the HTTP request.", + "type": "number", + "minimum": 0.5, + "default": 1 + }, + "not_follow_redirects": { + "title": "Not follow redirects", + "description": "If set, the client will not follow HTTP redirects automatically.", + "type": "boolean" + }, + "username": { + "title": "Username", + "description": "The username for basic authentication.", + "type": "string", + "sensitive": true + }, + "password": { + "title": "Password", + "description": "The password for basic authentication.", + "type": "string", + "sensitive": true + }, + "proxy_url": { + "title": "Proxy URL", + "description": "The URL of the proxy server.", + "type": "string" + }, + "proxy_username": { + "title": "Proxy username", + "description": "The username for proxy authentication.", + "type": "string", + "sensitive": true + }, + "proxy_password": { + "title": "Proxy password", + "description": "The password for proxy authentication.", + "type": "string", + "sensitive": true + }, + "headers": { + "title": "Headers", + "description": "Additional HTTP headers to include in the request.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "tls_skip_verify": { + "title": "Skip TLS verification", + "description": "If set, TLS certificate verification will be skipped.", + "type": "boolean" + }, + "tls_ca": { + "title": "TLS CA", + "description": "The path to the CA certificate file for TLS verification.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_cert": { + "title": "TLS certificate", + "description": "The path to the client certificate file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_key": { + "title": "TLS key", + "description": "The path to the client key file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "body": { + "title": "Body", + "type": "string" + }, + "method": { + "title": "Method", + "type": "string" + } + }, + "required": [ + "url" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "body": { + "ui:widget": "hidden" + }, + "method": { + "ui:widget": "hidden" + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + }, + "password": { + "ui:widget": "password" + }, + "proxy_password": { + "ui:widget": "password" + }, + "ui:flavour": "tabs", + "ui:options": { + "tabs": [ + { + "title": "Base", + "fields": [ + "update_every", + "url", + "timeout", + "not_follow_redirects" + ] + }, + { + "title": "Auth", + "fields": [ + "username", + "password" + ] + }, + { + "title": "TLS", + "fields": [ + "tls_skip_verify", + "tls_ca", + "tls_cert", + "tls_key" + ] + }, + { + "title": "Proxy", + "fields": [ + "proxy_url", + "proxy_username", + "proxy_password" + ] + }, + { + "title": "Headers", + "fields": [ + "headers" + ] + } + ] + } + } +} diff --git a/src/go/plugin/go.d/modules/icecast/icecast.go b/src/go/plugin/go.d/modules/icecast/icecast.go new file mode 100644 index 00000000..e999421f --- /dev/null +++ b/src/go/plugin/go.d/modules/icecast/icecast.go @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package icecast + +import ( + _ "embed" + "errors" + "net/http" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("icecast", module.Creator{ + JobConfigSchema: configSchema, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Icecast { + return &Icecast{ + Config: Config{ + HTTP: web.HTTP{ + Request: web.Request{ + URL: "http://127.0.0.1:8000", + }, + Client: web.Client{ + Timeout: web.Duration(time.Second * 1), + }, + }, + }, + charts: &module.Charts{}, + + seenSources: make(map[string]bool), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + web.HTTP `yaml:",inline" json:""` +} + +type Icecast struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + seenSources map[string]bool + + httpClient *http.Client +} + +func (ic *Icecast) Configuration() any { + return ic.Config +} + +func (ic *Icecast) Init() error { + if ic.URL == "" { + ic.Error("URL not set") + return errors.New("url not set") + } + + client, err := web.NewHTTPClient(ic.Client) + if err != nil { + ic.Error(err) + return err + } + ic.httpClient = client + + ic.Debugf("using URL %s", ic.URL) + ic.Debugf("using timeout: %s", ic.Timeout) + + return nil +} + +func (ic *Icecast) Check() error { + mx, err := ic.collect() + if err != nil { + ic.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (ic *Icecast) Charts() *module.Charts { + return ic.charts +} + +func (ic *Icecast) Collect() map[string]int64 { + mx, err := ic.collect() + if err != nil { + ic.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (ic *Icecast) Cleanup() { + if ic.httpClient != nil { + ic.httpClient.CloseIdleConnections() + } +} diff --git a/src/go/plugin/go.d/modules/icecast/icecast_test.go b/src/go/plugin/go.d/modules/icecast/icecast_test.go new file mode 100644 index 00000000..40132986 --- /dev/null +++ b/src/go/plugin/go.d/modules/icecast/icecast_test.go @@ -0,0 +1,285 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package icecast + +import ( + "net/http" + "net/http/httptest" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataServerStatsMultiSource, _ = os.ReadFile("testdata/stats_multi_source.json") + dataServerStatsSingleSource, _ = os.ReadFile("testdata/stats_single_source.json") + dataServerStatsNoSources, _ = os.ReadFile("testdata/stats_no_sources.json") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + "dataServerStats": dataServerStatsMultiSource, + "dataServerStatsSingleSource": dataServerStatsSingleSource, + "dataServerStatsNoSources": dataServerStatsNoSources, + } { + require.NotNil(t, data, name) + } +} + +func TestIcecast_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &Icecast{}, dataConfigJSON, dataConfigYAML) +} + +func TestIcecast_Init(t *testing.T) { + tests := map[string]struct { + wantFail bool + config Config + }{ + "success with default": { + wantFail: false, + config: New().Config, + }, + "fail when URL not set": { + wantFail: true, + config: Config{ + HTTP: web.HTTP{ + Request: web.Request{URL: ""}, + }, + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + icecast := New() + icecast.Config = test.config + + if test.wantFail { + assert.Error(t, icecast.Init()) + } else { + assert.NoError(t, icecast.Init()) + } + }) + } +} + +func TestIcecast_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestIcecast_Check(t *testing.T) { + tests := map[string]struct { + wantFail bool + prepare func(t *testing.T) (*Icecast, func()) + }{ + "success multiple sources": { + wantFail: false, + prepare: prepareCaseMultipleSources, + }, + "success single source": { + wantFail: false, + prepare: prepareCaseMultipleSources, + }, + "fails on no sources": { + wantFail: true, + prepare: prepareCaseNoSources, + }, + "fails on unexpected json response": { + wantFail: true, + prepare: prepareCaseUnexpectedJsonResponse, + }, + "fails on invalid format response": { + wantFail: true, + prepare: prepareCaseInvalidFormatResponse, + }, + "fails on connection refused": { + wantFail: true, + prepare: prepareCaseConnectionRefused, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + icecast, cleanup := test.prepare(t) + defer cleanup() + + if test.wantFail { + assert.Error(t, icecast.Check()) + } else { + assert.NoError(t, icecast.Check()) + } + }) + } +} + +func TestIcecast_Collect(t *testing.T) { + tests := map[string]struct { + prepare func(t *testing.T) (*Icecast, func()) + wantMetrics map[string]int64 + wantCharts int + }{ + "success multiple sources": { + prepare: prepareCaseMultipleSources, + wantCharts: len(sourceChartsTmpl) * 2, + wantMetrics: map[string]int64{ + "source_abc_listeners": 1, + "source_efg_listeners": 10, + }, + }, + "success single source": { + prepare: prepareCaseSingleSource, + wantCharts: len(sourceChartsTmpl) * 1, + wantMetrics: map[string]int64{ + "source_abc_listeners": 1, + }, + }, + "fails on no sources": { + prepare: prepareCaseNoSources, + }, + "fails on unexpected json response": { + prepare: prepareCaseUnexpectedJsonResponse, + }, + "fails on invalid format response": { + prepare: prepareCaseInvalidFormatResponse, + }, + "fails on connection refused": { + prepare: prepareCaseConnectionRefused, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + icecast, cleanup := test.prepare(t) + defer cleanup() + + mx := icecast.Collect() + + require.Equal(t, test.wantMetrics, mx) + if len(test.wantMetrics) > 0 { + assert.Equal(t, test.wantCharts, len(*icecast.Charts())) + module.TestMetricsHasAllChartsDims(t, icecast.Charts(), mx) + } + }) + } +} + +func prepareCaseMultipleSources(t *testing.T) (*Icecast, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case urlPathServerStats: + _, _ = w.Write(dataServerStatsMultiSource) + default: + w.WriteHeader(http.StatusNotFound) + } + })) + + icecast := New() + icecast.URL = srv.URL + require.NoError(t, icecast.Init()) + + return icecast, srv.Close +} + +func prepareCaseSingleSource(t *testing.T) (*Icecast, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case urlPathServerStats: + _, _ = w.Write(dataServerStatsSingleSource) + default: + w.WriteHeader(http.StatusNotFound) + } + })) + + icecast := New() + icecast.URL = srv.URL + require.NoError(t, icecast.Init()) + + return icecast, srv.Close +} + +func prepareCaseNoSources(t *testing.T) (*Icecast, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case urlPathServerStats: + _, _ = w.Write(dataServerStatsNoSources) + default: + w.WriteHeader(http.StatusNotFound) + } + })) + + icecast := New() + icecast.URL = srv.URL + require.NoError(t, icecast.Init()) + + return icecast, srv.Close +} + +func prepareCaseUnexpectedJsonResponse(t *testing.T) (*Icecast, func()) { + t.Helper() + resp := ` +{ + "elephant": { + "burn": false, + "mountain": true, + "fog": false, + "skin": -1561907625, + "burst": "anyway", + "shadow": 1558616893 + }, + "start": "ever", + "base": 2093056027, + "mission": -2007590351, + "victory": 999053756, + "die": false +} +` + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte(resp)) + })) + + icecast := New() + icecast.URL = srv.URL + require.NoError(t, icecast.Init()) + + return icecast, srv.Close +} + +func prepareCaseInvalidFormatResponse(t *testing.T) (*Icecast, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte("hello and\n goodbye")) + })) + + icecast := New() + icecast.URL = srv.URL + require.NoError(t, icecast.Init()) + + return icecast, srv.Close +} + +func prepareCaseConnectionRefused(t *testing.T) (*Icecast, func()) { + t.Helper() + icecast := New() + icecast.URL = "http://127.0.0.1:65001" + require.NoError(t, icecast.Init()) + + return icecast, func() {} +} diff --git a/src/go/plugin/go.d/modules/icecast/integrations/icecast.md b/src/go/plugin/go.d/modules/icecast/integrations/icecast.md new file mode 100644 index 00000000..9ff06a4d --- /dev/null +++ b/src/go/plugin/go.d/modules/icecast/integrations/icecast.md @@ -0,0 +1,226 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/icecast/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/icecast/metadata.yaml" +sidebar_label: "Icecast" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Media Services" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Icecast + + +<img src="https://netdata.cloud/img/icecast.svg" width="150"/> + + +Plugin: go.d.plugin +Module: icecast + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +This collector monitors Icecast listener counts. + +It uses the Icecast server statistics `status-json.xsl` endpoint to retrieve the metrics. + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +By default, it detects Icecast instances running on localhost that are listening on port 8000. + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per Icecast source + +These metrics refer to an icecast source. + +Labels: + +| Label | Description | +|:-----------|:----------------| +| source | Source name. | + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| icecast.listeners | listeners | listeners | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +#### Icecast minimum version + +Needs at least Icecast version >= 2.4.0 + + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/icecast.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/icecast.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| url | Server URL. | http://127.0.0.1:8000 | yes | +| timeout | HTTP request timeout. | 1 | no | +| username | Username for basic HTTP authentication. | | no | +| password | Password for basic HTTP authentication. | | no | +| proxy_url | Proxy URL. | | no | +| proxy_username | Username for proxy basic HTTP authentication. | | no | +| proxy_password | Password for proxy basic HTTP authentication. | | no | +| method | HTTP request method. | POST | no | +| body | HTTP request body. | | no | +| headers | HTTP request headers. | | no | +| not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no | +| tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no | +| tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no | +| tls_cert | Client TLS certificate. | | no | +| tls_key | Client TLS key. | | no | + +</details> + +#### Examples + +##### Basic + +A basic example configuration. + +```yaml +jobs: + - name: local + url: http://127.0.0.1:8000 + +``` +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + url: http://127.0.0.1:8000 + + - name: remote + url: http://192.0.2.1:8000 + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `icecast` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m icecast + ``` + +### Getting Logs + +If you're encountering problems with the `icecast` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep icecast +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep icecast /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep icecast +``` + + diff --git a/src/go/plugin/go.d/modules/icecast/metadata.yaml b/src/go/plugin/go.d/modules/icecast/metadata.yaml new file mode 100644 index 00000000..bcaa4b07 --- /dev/null +++ b/src/go/plugin/go.d/modules/icecast/metadata.yaml @@ -0,0 +1,169 @@ +plugin_name: go.d.plugin +modules: + - meta: + plugin_name: go.d.plugin + module_name: icecast + monitored_instance: + name: Icecast + link: "https://icecast.org/" + categories: + - data-collection.media-streaming-servers + icon_filename: "icecast.svg" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - icecast + - streaming + - media + most_popular: false + overview: + data_collection: + metrics_description: "This collector monitors Icecast listener counts." + method_description: "It uses the Icecast server statistics `status-json.xsl` endpoint to retrieve the metrics." + supported_platforms: + include: [] + exclude: [] + multi_instance: true + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: By default, it detects Icecast instances running on localhost that are listening on port 8000. + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: + - title: "Icecast minimum version" + description: "Needs at least Icecast version >= 2.4.0" + configuration: + file: + name: go.d/icecast.conf + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: "Config options" + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: url + description: Server URL. + default_value: http://127.0.0.1:8000 + required: true + - name: timeout + description: HTTP request timeout. + default_value: 1 + required: false + - name: username + description: Username for basic HTTP authentication. + default_value: "" + required: false + - name: password + description: Password for basic HTTP authentication. + default_value: "" + required: false + - name: proxy_url + description: Proxy URL. + default_value: "" + required: false + - name: proxy_username + description: Username for proxy basic HTTP authentication. + default_value: "" + required: false + - name: proxy_password + description: Password for proxy basic HTTP authentication. + default_value: "" + required: false + - name: method + description: HTTP request method. + default_value: POST + required: false + - name: body + description: HTTP request body. + default_value: "" + required: false + - name: headers + description: HTTP request headers. + default_value: "" + required: false + - name: not_follow_redirects + description: Redirect handling policy. Controls whether the client follows redirects. + default_value: false + required: false + - name: tls_skip_verify + description: Server certificate chain and hostname validation policy. Controls whether the client performs this check. + default_value: false + required: false + - name: tls_ca + description: Certification authority that the client uses when verifying the server's certificates. + default_value: "" + required: false + - name: tls_cert + description: Client TLS certificate. + default_value: "" + required: false + - name: tls_key + description: Client TLS key. + default_value: "" + required: false + examples: + folding: + enabled: true + title: Config + list: + - name: Basic + description: A basic example configuration. + folding: + enabled: false + config: | + jobs: + - name: local + url: http://127.0.0.1:8000 + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + url: http://127.0.0.1:8000 + + - name: remote + url: http://192.0.2.1:8000 + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: Icecast source + description: "These metrics refer to an icecast source." + labels: + - name: source + description: Source name. + metrics: + - name: icecast.listeners + description: Icecast Listeners + unit: "listeners" + chart_type: line + dimensions: + - name: listeners diff --git a/src/go/plugin/go.d/modules/icecast/server_stats.go b/src/go/plugin/go.d/modules/icecast/server_stats.go new file mode 100644 index 00000000..404d1255 --- /dev/null +++ b/src/go/plugin/go.d/modules/icecast/server_stats.go @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package icecast + +import ( + "encoding/json" + "fmt" +) + +type ( + serverStats struct { + IceStats *struct { + Source iceSource `json:"source"` + } `json:"icestats"` + } + iceSource []sourceStats + sourceStats struct { + ServerName string `json:"server_name"` + StreamStart string `json:"stream_start"` + Listeners int64 `json:"listeners"` + } +) + +func (i *iceSource) UnmarshalJSON(data []byte) error { + var v any + if err := json.Unmarshal(data, &v); err != nil { + return err + } + + switch v.(type) { + case []any: + type plain iceSource + return json.Unmarshal(data, (*plain)(i)) + case map[string]any: + var s sourceStats + if err := json.Unmarshal(data, &s); err != nil { + return err + } + *i = []sourceStats{s} + default: + return fmt.Errorf("invalid source data type: expected array or object") + } + + return nil +} diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/testdata/config.json b/src/go/plugin/go.d/modules/icecast/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/testdata/config.json +++ b/src/go/plugin/go.d/modules/icecast/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/testdata/config.yaml b/src/go/plugin/go.d/modules/icecast/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/icecast/testdata/config.yaml diff --git a/src/go/plugin/go.d/modules/icecast/testdata/stats_multi_source.json b/src/go/plugin/go.d/modules/icecast/testdata/stats_multi_source.json new file mode 100644 index 00000000..0a9c4515 --- /dev/null +++ b/src/go/plugin/go.d/modules/icecast/testdata/stats_multi_source.json @@ -0,0 +1,46 @@ +{ + "icestats": { + "admin": "icemaster@localhost", + "host": "localhost", + "location": "Earth", + "server_id": "Icecast 2.4.4", + "server_start": "Wed, 17 Jul 2024 11:27:40 +0300", + "server_start_iso8601": "2024-07-17T11:27:40+0300", + "source": [ + { + "audio_info": "ice-bitrate=128;ice-channels=2;ice-samplerate=44100", + "genre": "(null)", + "ice-bitrate": 128, + "ice-channels": 2, + "ice-samplerate": 44100, + "listener_peak": 2, + "listeners": 1, + "listenurl": "http://localhost:8000/line.nsv", + "server_description": "(null)", + "server_name": "abc", + "server_type": "audio/mpeg", + "server_url": "(null)", + "stream_start": "Wed, 17 Jul 2024 12:10:20 +0300", + "stream_start_iso8601": "2024-07-17T12:10:20+0300", + "dummy": null + }, + { + "audio_info": "ice-bitrate=128;ice-channels=2;ice-samplerate=44100", + "genre": "(null)", + "ice-bitrate": 128, + "ice-channels": 2, + "ice-samplerate": 44100, + "listener_peak": 10, + "listeners": 10, + "listenurl": "http://localhost:8000/lineb.nsv", + "server_description": "(null)", + "server_name": "efg", + "server_type": "audio/mpeg", + "server_url": "(null)", + "stream_start": "Wed, 17 Jul 2024 12:10:20 +0300", + "stream_start_iso8601": "2024-07-17T12:10:20+0300", + "dummy": null + } + ] + } +} diff --git a/src/go/plugin/go.d/modules/icecast/testdata/stats_no_sources.json b/src/go/plugin/go.d/modules/icecast/testdata/stats_no_sources.json new file mode 100644 index 00000000..3af4fbe3 --- /dev/null +++ b/src/go/plugin/go.d/modules/icecast/testdata/stats_no_sources.json @@ -0,0 +1,11 @@ +{ + "icestats": { + "admin": "icemaster@localhost", + "host": "localhost", + "location": "Earth", + "server_id": "Icecast 2.4.4", + "server_start": "Wed, 17 Jul 2024 11:27:40 +0300", + "server_start_iso8601": "2024-07-17T11:27:40+0300", + "dummy": null + } +}
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/icecast/testdata/stats_single_source.json b/src/go/plugin/go.d/modules/icecast/testdata/stats_single_source.json new file mode 100644 index 00000000..9d14e7d6 --- /dev/null +++ b/src/go/plugin/go.d/modules/icecast/testdata/stats_single_source.json @@ -0,0 +1,27 @@ +{ + "icestats": { + "admin": "icemaster@localhost", + "host": "localhost", + "location": "Earth", + "server_id": "Icecast 2.4.4", + "server_start": "Wed, 17 Jul 2024 11:27:40 +0300", + "server_start_iso8601": "2024-07-17T11:27:40+0300", + "source": { + "audio_info": "ice-bitrate=128;ice-channels=2;ice-samplerate=44100", + "genre": "(null)", + "ice-bitrate": 128, + "ice-channels": 2, + "ice-samplerate": 44100, + "listener_peak": 2, + "listeners": 1, + "listenurl": "http://localhost:8000/line.nsv", + "server_description": "(null)", + "server_name": "abc", + "server_type": "audio/mpeg", + "server_url": "(null)", + "stream_start": "Wed, 17 Jul 2024 12:10:20 +0300", + "stream_start_iso8601": "2024-07-17T12:10:20+0300", + "dummy": null + } + } +} diff --git a/src/go/plugin/go.d/modules/init.go b/src/go/plugin/go.d/modules/init.go new file mode 100644 index 00000000..8271a70e --- /dev/null +++ b/src/go/plugin/go.d/modules/init.go @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package modules + +import ( + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/activemq" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/adaptecraid" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/ap" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/apache" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/beanstalk" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/bind" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/cassandra" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/chrony" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/clickhouse" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/cockroachdb" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/consul" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/coredns" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/couchbase" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/couchdb" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/dmcache" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/dnsdist" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/dnsmasq" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/dnsmasq_dhcp" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/dnsquery" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/docker" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/docker_engine" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/dockerhub" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/dovecot" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/elasticsearch" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/envoy" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/example" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/exim" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/fail2ban" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/filecheck" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/fluentd" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/freeradius" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/gearman" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/geth" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/haproxy" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/hddtemp" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/hdfs" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/hpssa" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/httpcheck" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/icecast" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/intelgpu" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/ipfs" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/isc_dhcpd" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/k8s_kubelet" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/k8s_kubeproxy" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/k8s_state" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/lighttpd" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/litespeed" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/logind" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/logstash" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/lvm" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/megacli" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/memcached" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/mongodb" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/monit" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/mysql" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/nginx" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/nginxplus" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/nginxvts" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/nsd" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/ntpd" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/nvidia_smi" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/nvme" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/openvpn" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/openvpn_status_log" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/pgbouncer" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/phpdaemon" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/phpfpm" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/pihole" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/pika" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/ping" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/portcheck" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/postfix" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/postgres" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/powerdns" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/powerdns_recursor" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/prometheus" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/proxysql" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/pulsar" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/puppet" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/rabbitmq" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/redis" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/rethinkdb" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/riakkv" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/rspamd" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/scaleio" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/sensors" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/smartctl" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/snmp" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/squid" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/squidlog" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/storcli" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/supervisord" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/systemdunits" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/tengine" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/tomcat" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/tor" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/traefik" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/unbound" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/upsd" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/uwsgi" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vcsa" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vernemq" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/weblog" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/whoisquery" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/windows" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/wireguard" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/x509check" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/zfspool" + _ "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/zookeeper" +) diff --git a/src/go/collectors/go.d.plugin/modules/intelgpu/README.md b/src/go/plugin/go.d/modules/intelgpu/README.md index 44282e03..44282e03 120000 --- a/src/go/collectors/go.d.plugin/modules/intelgpu/README.md +++ b/src/go/plugin/go.d/modules/intelgpu/README.md diff --git a/src/go/collectors/go.d.plugin/modules/intelgpu/charts.go b/src/go/plugin/go.d/modules/intelgpu/charts.go index 93670633..a73efc72 100644 --- a/src/go/collectors/go.d.plugin/modules/intelgpu/charts.go +++ b/src/go/plugin/go.d/modules/intelgpu/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/intelgpu/collect.go b/src/go/plugin/go.d/modules/intelgpu/collect.go index 38e8b305..38e8b305 100644 --- a/src/go/collectors/go.d.plugin/modules/intelgpu/collect.go +++ b/src/go/plugin/go.d/modules/intelgpu/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/intelgpu/config_schema.json b/src/go/plugin/go.d/modules/intelgpu/config_schema.json index ac818342..ac818342 100644 --- a/src/go/collectors/go.d.plugin/modules/intelgpu/config_schema.json +++ b/src/go/plugin/go.d/modules/intelgpu/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/intelgpu/exec.go b/src/go/plugin/go.d/modules/intelgpu/exec.go index 8a57c798..bdfb526e 100644 --- a/src/go/collectors/go.d.plugin/modules/intelgpu/exec.go +++ b/src/go/plugin/go.d/modules/intelgpu/exec.go @@ -11,7 +11,7 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" ) func newIntelGpuTopExec(log *logger.Logger, ndsudoPath string, updateEvery int, device string) (*intelGpuTopExec, error) { diff --git a/src/go/collectors/go.d.plugin/modules/intelgpu/init.go b/src/go/plugin/go.d/modules/intelgpu/init.go index 5b02d02b..df489686 100644 --- a/src/go/collectors/go.d.plugin/modules/intelgpu/init.go +++ b/src/go/plugin/go.d/modules/intelgpu/init.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" + "github.com/netdata/netdata/go/plugins/pkg/executable" ) func (ig *IntelGPU) initIntelGPUTopExec() (intelGpuTop, error) { diff --git a/src/go/collectors/go.d.plugin/modules/intelgpu/integrations/intel_gpu.md b/src/go/plugin/go.d/modules/intelgpu/integrations/intel_gpu.md index 1c17f565..69674660 100644 --- a/src/go/collectors/go.d.plugin/modules/intelgpu/integrations/intel_gpu.md +++ b/src/go/plugin/go.d/modules/intelgpu/integrations/intel_gpu.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/intelgpu/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/intelgpu/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/intelgpu/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/intelgpu/metadata.yaml" sidebar_label: "Intel GPU" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -153,6 +153,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `intelgpu` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -175,4 +177,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m intelgpu ``` +### Getting Logs + +If you're encountering problems with the `intelgpu` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep intelgpu +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep intelgpu /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep intelgpu +``` + diff --git a/src/go/collectors/go.d.plugin/modules/intelgpu/intelgpu.go b/src/go/plugin/go.d/modules/intelgpu/intelgpu.go index d36295c2..8e98c688 100644 --- a/src/go/collectors/go.d.plugin/modules/intelgpu/intelgpu.go +++ b/src/go/plugin/go.d/modules/intelgpu/intelgpu.go @@ -6,7 +6,7 @@ import ( _ "embed" "errors" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/intelgpu/intelgpu_test.go b/src/go/plugin/go.d/modules/intelgpu/intelgpu_test.go index ac38727c..e38adc28 100644 --- a/src/go/collectors/go.d.plugin/modules/intelgpu/intelgpu_test.go +++ b/src/go/plugin/go.d/modules/intelgpu/intelgpu_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/intelgpu/metadata.yaml b/src/go/plugin/go.d/modules/intelgpu/metadata.yaml index 3b5b39f2..3b5b39f2 100644 --- a/src/go/collectors/go.d.plugin/modules/intelgpu/metadata.yaml +++ b/src/go/plugin/go.d/modules/intelgpu/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/intelgpu/testdata/config.json b/src/go/plugin/go.d/modules/intelgpu/testdata/config.json index 167bd15f..167bd15f 100644 --- a/src/go/collectors/go.d.plugin/modules/intelgpu/testdata/config.json +++ b/src/go/plugin/go.d/modules/intelgpu/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/intelgpu/testdata/config.yaml b/src/go/plugin/go.d/modules/intelgpu/testdata/config.yaml index f27729e3..f27729e3 100644 --- a/src/go/collectors/go.d.plugin/modules/intelgpu/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/intelgpu/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/intelgpu/testdata/igt.json b/src/go/plugin/go.d/modules/intelgpu/testdata/igt.json index 4d43cbc5..4d43cbc5 100644 --- a/src/go/collectors/go.d.plugin/modules/intelgpu/testdata/igt.json +++ b/src/go/plugin/go.d/modules/intelgpu/testdata/igt.json diff --git a/src/go/plugin/go.d/modules/ipfs/README.md b/src/go/plugin/go.d/modules/ipfs/README.md new file mode 120000 index 00000000..eee6a07b --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/README.md @@ -0,0 +1 @@ +integrations/ipfs.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/ipfs/charts.go b/src/go/plugin/go.d/modules/ipfs/charts.go new file mode 100644 index 00000000..1f71c7b4 --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/charts.go @@ -0,0 +1,105 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package ipfs + +import ( + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioBandwidth = module.Priority + iota + prioSwarmPeers + prioDatastoreSpaceUtilization + prioRepoSize + prioRepoObj + prioRepoPinnedObj +) + +var charts = module.Charts{ + bandwidthChart.Copy(), + peersChart.Copy(), + datastoreUtilizationChart.Copy(), + repoSizeChart.Copy(), + repoObjChart.Copy(), + repoPinnedObjChart.Copy(), +} + +var ( + bandwidthChart = module.Chart{ + ID: "bandwidth", + Title: "IPFS Bandwidth", + Units: "bytes/s", + Fam: "bandwidth", + Ctx: "ipfs.bandwidth", + Type: module.Area, + Priority: prioBandwidth, + Dims: module.Dims{ + {ID: "in", Algo: module.Incremental}, + {ID: "out", Mul: -1, Algo: module.Incremental}, + }, + } + + peersChart = module.Chart{ + ID: "peers", + Title: "IPFS Peers", + Units: "peers", + Fam: "peers", + Ctx: "ipfs.peers", + Type: module.Line, + Priority: prioSwarmPeers, + Dims: module.Dims{ + {ID: "peers"}, + }, + } + + datastoreUtilizationChart = module.Chart{ + ID: "datastore_space_utilization", + Title: "IPFS Datastore Space Utilization", + Units: "percent", + Fam: "size", + Ctx: "ipfs.datastore_space_utilization", + Type: module.Area, + Priority: prioDatastoreSpaceUtilization, + Dims: module.Dims{ + {ID: "used_percent", Name: "used"}, + }, + } + repoSizeChart = module.Chart{ + ID: "repo_size", + Title: "IPFS Repo Size", + Units: "bytes", + Fam: "size", + Ctx: "ipfs.repo_size", + Type: module.Line, + Priority: prioRepoSize, + Dims: module.Dims{ + {ID: "size"}, + }, + } + + repoObjChart = module.Chart{ + ID: "repo_objects", + Title: "IPFS Repo Objects", + Units: "objects", + Fam: "objects", + Ctx: "ipfs.repo_objects", + Type: module.Line, + Priority: prioRepoObj, + Dims: module.Dims{ + {ID: "objects"}, + }, + } + repoPinnedObjChart = module.Chart{ + ID: "repo_pinned_objects", + Title: "IPFS Repo Pinned Objects", + Units: "objects", + Fam: "objects", + Ctx: "ipfs.repo_pinned_objects", + Type: module.Line, + Priority: prioRepoPinnedObj, + Dims: module.Dims{ + {ID: "pinned"}, + {ID: "recursive_pins"}, + }, + } +) diff --git a/src/go/plugin/go.d/modules/ipfs/collect.go b/src/go/plugin/go.d/modules/ipfs/collect.go new file mode 100644 index 00000000..6bd0b128 --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/collect.go @@ -0,0 +1,209 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package ipfs + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +type ( + ipfsStatsBw struct { + TotalIn int64 `json:"TotalIn"` + TotalOut int64 `json:"TotalOut"` + RateIn *float64 `json:"RateIn"` + RateOut *float64 `json:"RateOut"` + } + ipfsStatsRepo struct { + RepoSize int64 `json:"RepoSize"` + StorageMax int64 `json:"StorageMax"` + NumObjects int64 `json:"NumObjects"` + } + ipfsSwarmPeers struct { + Peers []any `json:"Peers"` + } + ipfsPinsLs struct { + Keys map[string]struct { + Type string `json:"type"` + } `json:"Keys"` + } +) + +const ( + urlPathStatsBandwidth = "/api/v0/stats/bw" // https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-stats-bw + urlPathStatsRepo = "/api/v0/stats/repo" // https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-stats-repo + urlPathSwarmPeers = "/api/v0/swarm/peers" // https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-swarm-peers + urlPathPinLs = "/api/v0/pin/ls" // https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-pin-ls +) + +func (ip *IPFS) collect() (map[string]int64, error) { + mx := make(map[string]int64) + + if err := ip.collectStatsBandwidth(mx); err != nil { + return nil, err + } + if err := ip.collectSwarmPeers(mx); err != nil { + return nil, err + } + if ip.QueryRepoApi { + // https://github.com/netdata/netdata/pull/9687 + // TODO: collect by default with "size-only" + // https://github.com/ipfs/kubo/issues/7528#issuecomment-657398332 + if err := ip.collectStatsRepo(mx); err != nil { + return nil, err + } + } + if ip.QueryPinApi { + if err := ip.collectPinLs(mx); err != nil { + return nil, err + } + } + + return mx, nil +} + +func (ip *IPFS) collectStatsBandwidth(mx map[string]int64) error { + stats, err := ip.queryStatsBandwidth() + if err != nil { + return err + } + + mx["in"] = stats.TotalIn + mx["out"] = stats.TotalOut + + return nil +} + +func (ip *IPFS) collectSwarmPeers(mx map[string]int64) error { + stats, err := ip.querySwarmPeers() + if err != nil { + return err + } + + mx["peers"] = int64(len(stats.Peers)) + + return nil +} + +func (ip *IPFS) collectStatsRepo(mx map[string]int64) error { + stats, err := ip.queryStatsRepo() + if err != nil { + return err + } + + mx["used_percent"] = 0 + if stats.StorageMax > 0 { + mx["used_percent"] = stats.RepoSize * 100 / stats.StorageMax + } + mx["size"] = stats.RepoSize + mx["objects"] = stats.NumObjects + + return nil +} + +func (ip *IPFS) collectPinLs(mx map[string]int64) error { + stats, err := ip.queryPinLs() + if err != nil { + return err + } + + var n int64 + for _, v := range stats.Keys { + if v.Type == "recursive" { + n++ + } + } + + mx["pinned"] = int64(len(stats.Keys)) + mx["recursive_pins"] = n + + return nil +} + +func (ip *IPFS) queryStatsBandwidth() (*ipfsStatsBw, error) { + req, err := web.NewHTTPRequestWithPath(ip.Request, urlPathStatsBandwidth) + if err != nil { + return nil, err + } + + var stats ipfsStatsBw + if err := ip.doOKDecode(req, &stats); err != nil { + return nil, err + } + + if stats.RateIn == nil || stats.RateOut == nil { + return nil, fmt.Errorf("unexpected response: not ipfs data") + } + + return &stats, nil +} + +func (ip *IPFS) querySwarmPeers() (*ipfsSwarmPeers, error) { + req, err := web.NewHTTPRequestWithPath(ip.Request, urlPathSwarmPeers) + if err != nil { + return nil, err + } + + var stats ipfsSwarmPeers + if err := ip.doOKDecode(req, &stats); err != nil { + return nil, err + } + + return &stats, nil +} + +func (ip *IPFS) queryStatsRepo() (*ipfsStatsRepo, error) { + req, err := web.NewHTTPRequestWithPath(ip.Request, urlPathStatsRepo) + if err != nil { + return nil, err + } + + var stats ipfsStatsRepo + if err := ip.doOKDecode(req, &stats); err != nil { + return nil, err + } + + return &stats, nil +} + +func (ip *IPFS) queryPinLs() (*ipfsPinsLs, error) { + req, err := web.NewHTTPRequestWithPath(ip.Request, urlPathPinLs) + if err != nil { + return nil, err + } + + var stats ipfsPinsLs + if err := ip.doOKDecode(req, &stats); err != nil { + return nil, err + } + + return &stats, nil +} + +func (ip *IPFS) doOKDecode(req *http.Request, in interface{}) error { + resp, err := ip.httpClient.Do(req) + if err != nil { + return fmt.Errorf("error on HTTP request '%s': %v", req.URL, err) + } + defer closeBody(resp) + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("'%s' returned HTTP status code: %d", req.URL, resp.StatusCode) + } + + if err := json.NewDecoder(resp.Body).Decode(in); err != nil { + return fmt.Errorf("error on decoding response from '%s': %v", req.URL, err) + } + return nil +} + +func closeBody(resp *http.Response) { + if resp != nil && resp.Body != nil { + _, _ = io.Copy(io.Discard, resp.Body) + _ = resp.Body.Close() + } +} diff --git a/src/go/plugin/go.d/modules/ipfs/config_schema.json b/src/go/plugin/go.d/modules/ipfs/config_schema.json new file mode 100644 index 00000000..ce4921c3 --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/config_schema.json @@ -0,0 +1,195 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "IPFS collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "url": { + "title": "URL", + "description": "The base URL where the IPFS API can be accessed.", + "type": "string", + "default": "http://127.0.0.1:5001", + "format": "uri" + }, + "timeout": { + "title": "Timeout", + "description": "The timeout in seconds for the HTTP request.", + "type": "number", + "minimum": 0.5, + "default": 1 + }, + "not_follow_redirects": { + "title": "Not follow redirects", + "description": "If set, the client will not follow HTTP redirects automatically.", + "type": "boolean" + }, + "repoapi": { + "title": "Query Repo API", + "description": "Enables querying the [/api/v0/stats/repo](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-repo-stat) endpoint for repository statistics. **Disabled by default** due to potential high CPU usage.", + "type": "boolean" + }, + "pinapi": { + "title": "Query Pin API", + "description": "Enables querying the [/api/v0/pin/ls](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-pin-ls) endpoint to retrieve a list of all pinned objects. **Consider enabling only if necessary**.", + "type": "boolean" + }, + "username": { + "title": "Username", + "description": "The username for basic authentication.", + "type": "string", + "sensitive": true + }, + "password": { + "title": "Password", + "description": "The password for basic authentication.", + "type": "string", + "sensitive": true + }, + "proxy_url": { + "title": "Proxy URL", + "description": "The URL of the proxy server.", + "type": "string" + }, + "proxy_username": { + "title": "Proxy username", + "description": "The username for proxy authentication.", + "type": "string", + "sensitive": true + }, + "proxy_password": { + "title": "Proxy password", + "description": "The password for proxy authentication.", + "type": "string", + "sensitive": true + }, + "headers": { + "title": "Headers", + "description": "Additional HTTP headers to include in the request.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "tls_skip_verify": { + "title": "Skip TLS verification", + "description": "If set, TLS certificate verification will be skipped.", + "type": "boolean" + }, + "tls_ca": { + "title": "TLS CA", + "description": "The path to the CA certificate file for TLS verification.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_cert": { + "title": "TLS certificate", + "description": "The path to the client certificate file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_key": { + "title": "TLS key", + "description": "The path to the client key file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "body": { + "title": "Body", + "type": "string" + }, + "method": { + "title": "Method", + "type": "string" + } + }, + "required": [ + "url" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "body": { + "ui:widget": "hidden" + }, + "method": { + "ui:widget": "hidden" + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + }, + "repoapi": { + "ui:help": "This endpoint retrieves the number of objects in the local repository, which is not cached and can be computationally expensive for IPFS to calculate, especially with frequent collection intervals. See [#7528](https://github.com/ipfs/go-ipfs/issues/7528)." + }, + "pinapi": { + "ui:help": "Performance may decrease as the number of pinned objects grows, as the entire list needs to be retrieved. See [#3874](https://github.com/ipfs/go-ipfs/issues/3874)." + }, + "password": { + "ui:widget": "password" + }, + "proxy_password": { + "ui:widget": "password" + }, + "ui:flavour": "tabs", + "ui:options": { + "tabs": [ + { + "title": "Base", + "fields": [ + "update_every", + "url", + "timeout", + "repoapi", + "pinapi", + "not_follow_redirects" + ] + }, + { + "title": "Auth", + "fields": [ + "username", + "password" + ] + }, + { + "title": "TLS", + "fields": [ + "tls_skip_verify", + "tls_ca", + "tls_cert", + "tls_key" + ] + }, + { + "title": "Proxy", + "fields": [ + "proxy_url", + "proxy_username", + "proxy_password" + ] + }, + { + "title": "Headers", + "fields": [ + "headers" + ] + } + ] + } + } +} diff --git a/src/go/plugin/go.d/modules/ipfs/integrations/ipfs.md b/src/go/plugin/go.d/modules/ipfs/integrations/ipfs.md new file mode 100644 index 00000000..4357b866 --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/integrations/ipfs.md @@ -0,0 +1,246 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/ipfs/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/ipfs/metadata.yaml" +sidebar_label: "IPFS" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# IPFS + + +<img src="https://netdata.cloud/img/ipfs.svg" width="150"/> + + +Plugin: go.d.plugin +Module: ipfs + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +This collector monitors IPFS daemon health and network activity. + +It uses [RPC API](https://docs.ipfs.tech/reference/kubo/rpc/) to collect metrics. + +Used endpoints: + +- [/api/v0/stats/bw](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-stats-bw) +- [/api/v0/swarm/peers](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-swarm-peers) +- [/api/v0/stats/repo](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-stats-repo) +- [/api/v0/pin/ls](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-pin-ls) + + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +By default, it detects IPFS instances running on localhost that are listening on port 5001. + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +Calls to the following endpoints are disabled by default due to IPFS bugs: + +- /api/v0/stats/repo ([#7528](https://github.com/ipfs/go-ipfs/issues/7528)). +- /api/v0/pin/ls ([#3874](https://github.com/ipfs/go-ipfs/issues/3874)). + +**Disabled by default** due to potential high CPU usage. Consider enabling only if necessary. + + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per IPFS instance + +These metrics refer to the entire monitored application. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| ipfs.bandwidth | in, out | bytes/s | +| ipfs.peers | peers | peers | +| ipfs.datastore_space_utilization | used | percent | +| ipfs.repo_size | size | bytes | +| ipfs.repo_objects | objects | objects | +| ipfs.repo_pinned_objects | pinned, recursive_pins | objects | + + + +## Alerts + + +The following alerts are available: + +| Alert name | On metric | Description | +|:------------|:----------|:------------| +| [ ipfs_datastore_usage ](https://github.com/netdata/netdata/blob/master/src/health/health.d/ipfs.conf) | ipfs.datastore_space_utilization | IPFS datastore utilization | + + +## Setup + +### Prerequisites + +No action required. + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/ipfs.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/ipfs.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| repoapi | Enables querying the [/api/v0/stats/repo](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-repo-stat) endpoint for repository statistics. | no | no | +| pinapi | Enables querying the [/api/v0/pin/ls](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-pin-ls) endpoint to retrieve a list of all pinned objects. | no | no | +| url | Server URL. | http://127.0.0.1:5001 | yes | +| timeout | HTTP request timeout. | 1 | no | +| username | Username for basic HTTP authentication. | | no | +| password | Password for basic HTTP authentication. | | no | +| proxy_url | Proxy URL. | | no | +| proxy_username | Username for proxy basic HTTP authentication. | | no | +| proxy_password | Password for proxy basic HTTP authentication. | | no | +| method | HTTP request method. | POST | no | +| body | HTTP request body. | | no | +| headers | HTTP request headers. | | no | +| not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no | +| tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no | +| tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no | +| tls_cert | Client TLS certificate. | | no | +| tls_key | Client TLS key. | | no | + +</details> + +#### Examples + +##### Basic + +A basic example configuration. + +```yaml +jobs: + - name: local + url: http://127.0.0.1:5001 + +``` +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + url: http://127.0.0.1:5001 + + - name: remote + url: http://192.0.2.1:5001 + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `ipfs` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m ipfs + ``` + +### Getting Logs + +If you're encountering problems with the `ipfs` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep ipfs +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep ipfs /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep ipfs +``` + + diff --git a/src/go/plugin/go.d/modules/ipfs/ipfs.go b/src/go/plugin/go.d/modules/ipfs/ipfs.go new file mode 100644 index 00000000..0caed8d9 --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/ipfs.go @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package ipfs + +import ( + _ "embed" + "errors" + "net/http" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("ipfs", module.Creator{ + JobConfigSchema: configSchema, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *IPFS { + return &IPFS{ + Config: Config{ + HTTP: web.HTTP{ + Request: web.Request{ + URL: "http://127.0.0.1:5001", + Method: http.MethodPost, + }, + Client: web.Client{ + Timeout: web.Duration(time.Second * 1), + }, + }, + QueryRepoApi: false, + QueryPinApi: false, + }, + charts: charts.Copy(), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + web.HTTP `yaml:",inline" json:""` + QueryPinApi bool `yaml:"pinapi" json:"pinapi"` + QueryRepoApi bool `yaml:"repoapi" json:"repoapi"` +} + +type IPFS struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + httpClient *http.Client +} + +func (ip *IPFS) Configuration() any { + return ip.Config +} + +func (ip *IPFS) Init() error { + if ip.URL == "" { + ip.Error("URL not set") + return errors.New("url not set") + } + + client, err := web.NewHTTPClient(ip.Client) + if err != nil { + ip.Error(err) + return err + } + ip.httpClient = client + + if !ip.QueryPinApi { + _ = ip.Charts().Remove(repoPinnedObjChart.ID) + } + if !ip.QueryRepoApi { + _ = ip.Charts().Remove(datastoreUtilizationChart.ID) + _ = ip.Charts().Remove(repoSizeChart.ID) + _ = ip.Charts().Remove(repoObjChart.ID) + } + + ip.Debugf("using URL %s", ip.URL) + ip.Debugf("using timeout: %s", ip.Timeout) + + return nil +} + +func (ip *IPFS) Check() error { + mx, err := ip.collect() + if err != nil { + ip.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (ip *IPFS) Charts() *module.Charts { + return ip.charts +} + +func (ip *IPFS) Collect() map[string]int64 { + mx, err := ip.collect() + if err != nil { + ip.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (ip *IPFS) Cleanup() { + if ip.httpClient != nil { + ip.httpClient.CloseIdleConnections() + } +} diff --git a/src/go/plugin/go.d/modules/ipfs/ipfs_test.go b/src/go/plugin/go.d/modules/ipfs/ipfs_test.go new file mode 100644 index 00000000..5e353a1b --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/ipfs_test.go @@ -0,0 +1,278 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package ipfs + +import ( + "net/http" + "net/http/httptest" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + apiv0PinLsData, _ = os.ReadFile("testdata/api_v0_pin_ls.json") + apiv0StatsBwData, _ = os.ReadFile("testdata/api_v0_stats_bw.json") + apiv0StatsRepoData, _ = os.ReadFile("testdata/api_v0_stats_repo.json") + apiv0SwarmPeersData, _ = os.ReadFile("testdata/api_v0_swarm_peers.json") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + "apiv0PinLsData": apiv0PinLsData, + "apiv0StatsBwData": apiv0StatsBwData, + "apiv0StatsRepoData": apiv0StatsRepoData, + "apiv0SwarmPeersData": apiv0SwarmPeersData, + } { + require.NotNil(t, data, name) + } +} + +func TestIPFS_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &IPFS{}, dataConfigJSON, dataConfigYAML) +} + +func TestIPFS_Init(t *testing.T) { + tests := map[string]struct { + wantFail bool + config Config + }{ + "success with default": { + wantFail: false, + config: New().Config, + }, + "fail when URL not set": { + wantFail: true, + config: Config{ + HTTP: web.HTTP{ + Request: web.Request{URL: ""}, + }, + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + ipfs := New() + ipfs.Config = test.config + + if test.wantFail { + assert.Error(t, ipfs.Init()) + } else { + assert.NoError(t, ipfs.Init()) + } + }) + } +} + +func TestIPFS_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestIPFS_Check(t *testing.T) { + tests := map[string]struct { + wantFail bool + prepare func(t *testing.T) (*IPFS, func()) + }{ + "success default config": { + wantFail: false, + prepare: prepareCaseOkDefault, + }, + "success all queries enabled": { + wantFail: false, + prepare: prepareCaseOkDefault, + }, + "fails on unexpected json response": { + wantFail: true, + prepare: prepareCaseUnexpectedJsonResponse, + }, + "fails on invalid format response": { + wantFail: true, + prepare: prepareCaseInvalidFormatResponse, + }, + "fails on connection refused": { + wantFail: true, + prepare: prepareCaseConnectionRefused, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + ipfs, cleanup := test.prepare(t) + defer cleanup() + + if test.wantFail { + assert.Error(t, ipfs.Check()) + } else { + assert.NoError(t, ipfs.Check()) + } + }) + } +} + +func TestIPFS_Collect(t *testing.T) { + tests := map[string]struct { + prepare func(t *testing.T) (*IPFS, func()) + wantMetrics map[string]int64 + }{ + "success default config": { + prepare: prepareCaseOkDefault, + wantMetrics: map[string]int64{ + "in": 20113594, + "out": 3113852, + "peers": 6, + }, + }, + "success all queries enabled": { + prepare: prepareCaseOkAllQueriesEnabled, + wantMetrics: map[string]int64{ + "in": 20113594, + "objects": 1, + "out": 3113852, + "peers": 6, + "pinned": 1, + "recursive_pins": 1, + "size": 25495, + "used_percent": 0, + }, + }, + "fails on unexpected json response": { + prepare: prepareCaseUnexpectedJsonResponse, + }, + "fails on invalid format response": { + prepare: prepareCaseInvalidFormatResponse, + }, + "fails on connection refused": { + prepare: prepareCaseConnectionRefused, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + ipfs, cleanup := test.prepare(t) + defer cleanup() + + mx := ipfs.Collect() + + require.Equal(t, test.wantMetrics, mx) + if len(test.wantMetrics) > 0 { + testMetricsHasAllChartsDims(t, ipfs, mx) + } + }) + } +} + +func testMetricsHasAllChartsDims(t *testing.T, ipfs *IPFS, mx map[string]int64) { + for _, chart := range *ipfs.Charts() { + if chart.Obsolete { + continue + } + for _, dim := range chart.Dims { + _, ok := mx[dim.ID] + assert.Truef(t, ok, "collected metrics has no data for dim '%s' chart '%s'", dim.ID, chart.ID) + } + for _, v := range chart.Vars { + _, ok := mx[v.ID] + assert.Truef(t, ok, "collected metrics has no data for var '%s' chart '%s'", v.ID, chart.ID) + } + } +} + +func prepareCaseOkDefault(t *testing.T) (*IPFS, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case urlPathStatsBandwidth: + _, _ = w.Write(apiv0StatsBwData) + case urlPathStatsRepo: + _, _ = w.Write(apiv0StatsRepoData) + case urlPathSwarmPeers: + _, _ = w.Write(apiv0SwarmPeersData) + case urlPathPinLs: + _, _ = w.Write(apiv0PinLsData) + default: + w.WriteHeader(http.StatusNotFound) + } + })) + + ipfs := New() + ipfs.URL = srv.URL + require.NoError(t, ipfs.Init()) + + return ipfs, srv.Close +} + +func prepareCaseOkAllQueriesEnabled(t *testing.T) (*IPFS, func()) { + t.Helper() + ipfs, cleanup := prepareCaseOkDefault(t) + + ipfs.QueryRepoApi = true + ipfs.QueryPinApi = true + + return ipfs, cleanup +} + +func prepareCaseUnexpectedJsonResponse(t *testing.T) (*IPFS, func()) { + t.Helper() + resp := ` +{ + "elephant": { + "burn": false, + "mountain": true, + "fog": false, + "skin": -1561907625, + "burst": "anyway", + "shadow": 1558616893 + }, + "start": "ever", + "base": 2093056027, + "mission": -2007590351, + "victory": 999053756, + "die": false +} +` + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte(resp)) + })) + + ipfs := New() + ipfs.URL = srv.URL + require.NoError(t, ipfs.Init()) + + return ipfs, srv.Close +} + +func prepareCaseInvalidFormatResponse(t *testing.T) (*IPFS, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte("hello and\n goodbye")) + })) + + ipfs := New() + ipfs.URL = srv.URL + require.NoError(t, ipfs.Init()) + + return ipfs, srv.Close +} + +func prepareCaseConnectionRefused(t *testing.T) (*IPFS, func()) { + t.Helper() + ipfs := New() + ipfs.URL = "http://127.0.0.1:65001" + require.NoError(t, ipfs.Init()) + + return ipfs, func() {} +} diff --git a/src/go/plugin/go.d/modules/ipfs/metadata.yaml b/src/go/plugin/go.d/modules/ipfs/metadata.yaml new file mode 100644 index 00000000..a3793578 --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/metadata.yaml @@ -0,0 +1,224 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-ipfs + plugin_name: go.d.plugin + module_name: ipfs + monitored_instance: + name: IPFS + link: "https://ipfs.tech/" + categories: + - data-collection.storage-mount-points-and-filesystems + icon_filename: "ipfs.svg" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - ipfs + - filesystem + most_popular: false + overview: + data_collection: + metrics_description: "This collector monitors IPFS daemon health and network activity." + method_description: | + It uses [RPC API](https://docs.ipfs.tech/reference/kubo/rpc/) to collect metrics. + + Used endpoints: + + - [/api/v0/stats/bw](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-stats-bw) + - [/api/v0/swarm/peers](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-swarm-peers) + - [/api/v0/stats/repo](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-stats-repo) + - [/api/v0/pin/ls](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-pin-ls) + supported_platforms: + include: [] + exclude: [] + multi_instance: true + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: | + By default, it detects IPFS instances running on localhost that are listening on port 5001. + limits: + description: "" + performance_impact: + description: | + Calls to the following endpoints are disabled by default due to IPFS bugs: + + - /api/v0/stats/repo ([#7528](https://github.com/ipfs/go-ipfs/issues/7528)). + - /api/v0/pin/ls ([#3874](https://github.com/ipfs/go-ipfs/issues/3874)). + + **Disabled by default** due to potential high CPU usage. Consider enabling only if necessary. + setup: + prerequisites: + list: [] + configuration: + file: + name: go.d/ipfs.conf + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: "Config options" + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: repoapi + description: Enables querying the [/api/v0/stats/repo](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-repo-stat) endpoint for repository statistics. + default_value: false + required: false + - name: pinapi + description: Enables querying the [/api/v0/pin/ls](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-pin-ls) endpoint to retrieve a list of all pinned objects. + default_value: false + required: false + - name: url + description: Server URL. + default_value: http://127.0.0.1:5001 + required: true + - name: timeout + description: HTTP request timeout. + default_value: 1 + required: false + - name: username + description: Username for basic HTTP authentication. + default_value: "" + required: false + - name: password + description: Password for basic HTTP authentication. + default_value: "" + required: false + - name: proxy_url + description: Proxy URL. + default_value: "" + required: false + - name: proxy_username + description: Username for proxy basic HTTP authentication. + default_value: "" + required: false + - name: proxy_password + description: Password for proxy basic HTTP authentication. + default_value: "" + required: false + - name: method + description: HTTP request method. + default_value: POST + required: false + - name: body + description: HTTP request body. + default_value: "" + required: false + - name: headers + description: HTTP request headers. + default_value: "" + required: false + - name: not_follow_redirects + description: Redirect handling policy. Controls whether the client follows redirects. + default_value: false + required: false + - name: tls_skip_verify + description: Server certificate chain and hostname validation policy. Controls whether the client performs this check. + default_value: false + required: false + - name: tls_ca + description: Certification authority that the client uses when verifying the server's certificates. + default_value: "" + required: false + - name: tls_cert + description: Client TLS certificate. + default_value: "" + required: false + - name: tls_key + description: Client TLS key. + default_value: "" + required: false + examples: + folding: + enabled: true + title: "Config" + list: + - name: Basic + description: A basic example configuration. + folding: + enabled: false + config: | + jobs: + - name: local + url: http://127.0.0.1:5001 + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + url: http://127.0.0.1:5001 + + - name: remote + url: http://192.0.2.1:5001 + troubleshooting: + problems: + list: [] + alerts: + - name: ipfs_datastore_usage + link: https://github.com/netdata/netdata/blob/master/src/health/health.d/ipfs.conf + metric: ipfs.datastore_space_utilization + info: IPFS datastore utilization + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: "These metrics refer to the entire monitored application." + labels: [] + metrics: + - name: ipfs.bandwidth + description: IPFS Bandwidth + unit: "bytes/s" + chart_type: area + dimensions: + - name: in + - name: out + - name: ipfs.peers + description: IPFS Peers + unit: "peers" + chart_type: line + dimensions: + - name: peers + - name: ipfs.datastore_space_utilization + description: IPFS Datastore Space Utilization + unit: "percent" + chart_type: area + dimensions: + - name: used + - name: ipfs.repo_size + description: IPFS Repo Size + unit: "bytes" + chart_type: line + dimensions: + - name: size + - name: ipfs.repo_objects + description: IPFS Repo Objects + unit: "objects" + chart_type: line + dimensions: + - name: objects + - name: ipfs.repo_pinned_objects + description: IPFS Repo Pinned Objects + unit: "objects" + chart_type: line + dimensions: + - name: pinned + - name: recursive_pins diff --git a/src/go/plugin/go.d/modules/ipfs/testdata/api_v0_pin_ls.json b/src/go/plugin/go.d/modules/ipfs/testdata/api_v0_pin_ls.json new file mode 100644 index 00000000..b1d4d019 --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/testdata/api_v0_pin_ls.json @@ -0,0 +1,8 @@ +{ + "Keys": { + "k1i2m3c4h5i6key": { + "Type": "recursive", + "Name": "" + } + } +} diff --git a/src/go/plugin/go.d/modules/ipfs/testdata/api_v0_stats_bw.json b/src/go/plugin/go.d/modules/ipfs/testdata/api_v0_stats_bw.json new file mode 100644 index 00000000..366cb8a2 --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/testdata/api_v0_stats_bw.json @@ -0,0 +1,6 @@ +{ + "TotalIn": 20113594, + "TotalOut": 3113852, + "RateIn": 1623.2181369394084, + "RateOut": 0.13743234792898051 +} diff --git a/src/go/plugin/go.d/modules/ipfs/testdata/api_v0_stats_repo.json b/src/go/plugin/go.d/modules/ipfs/testdata/api_v0_stats_repo.json new file mode 100644 index 00000000..247fb29f --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/testdata/api_v0_stats_repo.json @@ -0,0 +1,7 @@ +{ + "RepoSize": 25495, + "StorageMax": 10000000000, + "NumObjects": 1, + "RepoPath": "/home/fotis/.ipfs", + "Version": "fs-repo@15" +} diff --git a/src/go/plugin/go.d/modules/ipfs/testdata/api_v0_swarm_peers.json b/src/go/plugin/go.d/modules/ipfs/testdata/api_v0_swarm_peers.json new file mode 100644 index 00000000..8f8386e5 --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/testdata/api_v0_swarm_peers.json @@ -0,0 +1,70 @@ +{ + "Peers": [ + { + "Addr": "/ip4/1/tcp/27963", + "Peer": "a", + "Identify": { + "ID": "", + "PublicKey": "", + "Addresses": null, + "AgentVersion": "", + "Protocols": null + } + }, + { + "Addr": "/ip4/1/udp/4001/quic-v1", + "Peer": "b", + "Identify": { + "ID": "", + "PublicKey": "", + "Addresses": null, + "AgentVersion": "", + "Protocols": null + } + }, + { + "Addr": "/ip4/1/udp/4001/quic-v1/p2p/12D3KooWCqocoHdBANn2hH5acYAU4NdjEeBqERYk1MMTX49s1syY/p2p-circuit", + "Peer": "c", + "Identify": { + "ID": "", + "PublicKey": "", + "Addresses": null, + "AgentVersion": "", + "Protocols": null + } + }, + { + "Addr": "/ip4/1/tcp/4001", + "Peer": "c", + "Identify": { + "ID": "", + "PublicKey": "", + "Addresses": null, + "AgentVersion": "", + "Protocols": null + } + }, + { + "Addr": "/ip4/1/udp/33556/quic-v1", + "Peer": "e", + "Identify": { + "ID": "", + "PublicKey": "", + "Addresses": null, + "AgentVersion": "", + "Protocols": null + } + }, + { + "Addr": "/ip6/1::1/udp/4001/quic-v1", + "Peer": "f", + "Identify": { + "ID": "", + "PublicKey": "", + "Addresses": null, + "AgentVersion": "", + "Protocols": null + } + } + ] +} diff --git a/src/go/plugin/go.d/modules/ipfs/testdata/config.json b/src/go/plugin/go.d/modules/ipfs/testdata/config.json new file mode 100644 index 00000000..b99928ca --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/testdata/config.json @@ -0,0 +1,22 @@ +{ + "update_every": 123, + "url": "ok", + "body": "ok", + "method": "ok", + "headers": { + "ok": "ok" + }, + "username": "ok", + "password": "ok", + "proxy_url": "ok", + "proxy_username": "ok", + "proxy_password": "ok", + "timeout": 123.123, + "not_follow_redirects": true, + "tls_ca": "ok", + "tls_cert": "ok", + "tls_key": "ok", + "tls_skip_verify": true, + "pinapi": false, + "repoapi": false +} diff --git a/src/go/plugin/go.d/modules/ipfs/testdata/config.yaml b/src/go/plugin/go.d/modules/ipfs/testdata/config.yaml new file mode 100644 index 00000000..271695e6 --- /dev/null +++ b/src/go/plugin/go.d/modules/ipfs/testdata/config.yaml @@ -0,0 +1,19 @@ +update_every: 123 +url: "ok" +body: "ok" +method: "ok" +headers: + ok: "ok" +username: "ok" +password: "ok" +proxy_url: "ok" +proxy_username: "ok" +proxy_password: "ok" +timeout: 123.123 +not_follow_redirects: yes +tls_ca: "ok" +tls_cert: "ok" +tls_key: "ok" +tls_skip_verify: yes +pinapi: no +repoapi: no diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/README.md b/src/go/plugin/go.d/modules/isc_dhcpd/README.md index 3385a00a..3385a00a 120000 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/README.md +++ b/src/go/plugin/go.d/modules/isc_dhcpd/README.md diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/charts.go b/src/go/plugin/go.d/modules/isc_dhcpd/charts.go index 7165bbff..a8b3581e 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/charts.go +++ b/src/go/plugin/go.d/modules/isc_dhcpd/charts.go @@ -3,7 +3,7 @@ package isc_dhcpd import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/collect.go b/src/go/plugin/go.d/modules/isc_dhcpd/collect.go index 08716a10..08716a10 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/collect.go +++ b/src/go/plugin/go.d/modules/isc_dhcpd/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/config_schema.json b/src/go/plugin/go.d/modules/isc_dhcpd/config_schema.json index e357fd86..a34e79c7 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/config_schema.json +++ b/src/go/plugin/go.d/modules/isc_dhcpd/config_schema.json @@ -39,7 +39,7 @@ }, "networks": { "title": "Networks", - "description": "A space-separated list of [IP ranges](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/iprange#supported-formats) for the pool.", + "description": "A space-separated list of [IP ranges](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/iprange#supported-formats) for the pool.", "type": "string" } }, diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/init.go b/src/go/plugin/go.d/modules/isc_dhcpd/init.go index 861ded39..d103a223 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/init.go +++ b/src/go/plugin/go.d/modules/isc_dhcpd/init.go @@ -7,8 +7,8 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/iprange" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/iprange" ) type ipPool struct { diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/integrations/isc_dhcp.md b/src/go/plugin/go.d/modules/isc_dhcpd/integrations/isc_dhcp.md index 29d657c8..4607c1a5 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/integrations/isc_dhcp.md +++ b/src/go/plugin/go.d/modules/isc_dhcpd/integrations/isc_dhcp.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/isc_dhcpd/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/isc_dhcpd/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/isc_dhcpd/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/isc_dhcpd/metadata.yaml" sidebar_label: "ISC DHCP" learn_status: "Published" learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" @@ -128,7 +128,7 @@ The following options can be defined globally: update_every, autodetection_retry List of IP pools to monitor. -- IP range syntax: see [supported formats](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/iprange#supported-formats). +- IP range syntax: see [supported formats](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/iprange#supported-formats). - Syntax: ```yaml @@ -168,6 +168,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `isc_dhcpd` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -190,4 +192,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m isc_dhcpd ``` +### Getting Logs + +If you're encountering problems with the `isc_dhcpd` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep isc_dhcpd +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep isc_dhcpd /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep isc_dhcpd +``` + diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/isc_dhcpd.go b/src/go/plugin/go.d/modules/isc_dhcpd/isc_dhcpd.go index c51abc75..1733cb22 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/isc_dhcpd.go +++ b/src/go/plugin/go.d/modules/isc_dhcpd/isc_dhcpd.go @@ -7,7 +7,7 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/isc_dhcpd_test.go b/src/go/plugin/go.d/modules/isc_dhcpd/isc_dhcpd_test.go index d91dfca1..24540ea2 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/isc_dhcpd_test.go +++ b/src/go/plugin/go.d/modules/isc_dhcpd/isc_dhcpd_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/metadata.yaml b/src/go/plugin/go.d/modules/isc_dhcpd/metadata.yaml index e6e11d72..09eee81d 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/metadata.yaml +++ b/src/go/plugin/go.d/modules/isc_dhcpd/metadata.yaml @@ -69,7 +69,7 @@ modules: detailed_description: | List of IP pools to monitor. - - IP range syntax: see [supported formats](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/iprange#supported-formats). + - IP range syntax: see [supported formats](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/iprange#supported-formats). - Syntax: ```yaml diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/parse.go b/src/go/plugin/go.d/modules/isc_dhcpd/parse.go index cb416174..cb416174 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/parse.go +++ b/src/go/plugin/go.d/modules/isc_dhcpd/parse.go diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/config.json b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/config.json index 945f8865..945f8865 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/config.json +++ b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/config.yaml b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/config.yaml index a33defc5..a33defc5 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_empty b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_empty index e69de29b..e69de29b 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_empty +++ b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_empty diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4 b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4 index 08e0e3f2..08e0e3f2 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4 +++ b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4 diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4_backup b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4_backup index e822ca84..e822ca84 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4_backup +++ b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4_backup diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4_inactive b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4_inactive index c5aed080..c5aed080 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4_inactive +++ b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_ipv4_inactive diff --git a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_ipv6 b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_ipv6 index 3a4f1520..3a4f1520 100644 --- a/src/go/collectors/go.d.plugin/modules/isc_dhcpd/testdata/dhcpd.leases_ipv6 +++ b/src/go/plugin/go.d/modules/isc_dhcpd/testdata/dhcpd.leases_ipv6 diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/README.md b/src/go/plugin/go.d/modules/k8s_kubelet/README.md index 036630b3..036630b3 120000 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/README.md +++ b/src/go/plugin/go.d/modules/k8s_kubelet/README.md diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/charts.go b/src/go/plugin/go.d/modules/k8s_kubelet/charts.go index 564f7be5..e2848ea3 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/charts.go +++ b/src/go/plugin/go.d/modules/k8s_kubelet/charts.go @@ -2,7 +2,7 @@ package k8s_kubelet -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( // Charts is an alias for module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/collect.go b/src/go/plugin/go.d/modules/k8s_kubelet/collect.go index 350c0bf4..f014617f 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/collect.go +++ b/src/go/plugin/go.d/modules/k8s_kubelet/collect.go @@ -5,11 +5,11 @@ package k8s_kubelet import ( "math" - mtx "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + mtx "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func (k *Kubelet) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/config_schema.json b/src/go/plugin/go.d/modules/k8s_kubelet/config_schema.json index ffc55b83..16f9029a 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/config_schema.json +++ b/src/go/plugin/go.d/modules/k8s_kubelet/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/init.go b/src/go/plugin/go.d/modules/k8s_kubelet/init.go index 3a076160..803cd984 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/init.go +++ b/src/go/plugin/go.d/modules/k8s_kubelet/init.go @@ -6,8 +6,8 @@ import ( "errors" "os" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (k *Kubelet) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/integrations/kubelet.md b/src/go/plugin/go.d/modules/k8s_kubelet/integrations/kubelet.md index 3421b7a7..d92f82be 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/integrations/kubelet.md +++ b/src/go/plugin/go.d/modules/k8s_kubelet/integrations/kubelet.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/k8s_kubelet/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/k8s_kubelet/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/k8s_kubelet/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/k8s_kubelet/metadata.yaml" sidebar_label: "Kubelet" learn_status: "Published" learn_rel_path: "Collecting Metrics/Kubernetes" @@ -194,6 +194,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `k8s_kubelet` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -216,4 +218,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m k8s_kubelet ``` +### Getting Logs + +If you're encountering problems with the `k8s_kubelet` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep k8s_kubelet +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep k8s_kubelet /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep k8s_kubelet +``` + diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/kubelet.go b/src/go/plugin/go.d/modules/k8s_kubelet/kubelet.go index 271950ad..19fb9dd9 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/kubelet.go +++ b/src/go/plugin/go.d/modules/k8s_kubelet/kubelet.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/kubelet_test.go b/src/go/plugin/go.d/modules/k8s_kubelet/kubelet_test.go index d4f21690..d55ee31a 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/kubelet_test.go +++ b/src/go/plugin/go.d/modules/k8s_kubelet/kubelet_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/metadata.yaml b/src/go/plugin/go.d/modules/k8s_kubelet/metadata.yaml index 0d5229bb..0d5229bb 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/metadata.yaml +++ b/src/go/plugin/go.d/modules/k8s_kubelet/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/metrics.go b/src/go/plugin/go.d/modules/k8s_kubelet/metrics.go index 15867b97..f8a4c5c5 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/metrics.go +++ b/src/go/plugin/go.d/modules/k8s_kubelet/metrics.go @@ -3,7 +3,7 @@ package k8s_kubelet import ( - mtx "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" + mtx "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" ) func newMetrics() *metrics { diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/testdata/config.json b/src/go/plugin/go.d/modules/k8s_kubelet/testdata/config.json index d8548395..d8548395 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/testdata/config.json +++ b/src/go/plugin/go.d/modules/k8s_kubelet/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/testdata/config.yaml b/src/go/plugin/go.d/modules/k8s_kubelet/testdata/config.yaml index 9e4f3fdc..9e4f3fdc 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/k8s_kubelet/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/testdata/metrics.txt b/src/go/plugin/go.d/modules/k8s_kubelet/testdata/metrics.txt index 47b63bd5..47b63bd5 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/testdata/metrics.txt +++ b/src/go/plugin/go.d/modules/k8s_kubelet/testdata/metrics.txt diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/testdata/token.txt b/src/go/plugin/go.d/modules/k8s_kubelet/testdata/token.txt index e769c538..e769c538 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubelet/testdata/token.txt +++ b/src/go/plugin/go.d/modules/k8s_kubelet/testdata/token.txt diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/README.md b/src/go/plugin/go.d/modules/k8s_kubeproxy/README.md index 02040525..02040525 120000 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/README.md +++ b/src/go/plugin/go.d/modules/k8s_kubeproxy/README.md diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/charts.go b/src/go/plugin/go.d/modules/k8s_kubeproxy/charts.go index b00097b3..3eea903f 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/charts.go +++ b/src/go/plugin/go.d/modules/k8s_kubeproxy/charts.go @@ -2,7 +2,7 @@ package k8s_kubeproxy -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( // Charts is an alias for module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/collect.go b/src/go/plugin/go.d/modules/k8s_kubeproxy/collect.go index 625713f1..8664efaa 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/collect.go +++ b/src/go/plugin/go.d/modules/k8s_kubeproxy/collect.go @@ -5,11 +5,11 @@ package k8s_kubeproxy import ( "math" - mtx "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + mtx "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func (kp *KubeProxy) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/config_schema.json b/src/go/plugin/go.d/modules/k8s_kubeproxy/config_schema.json index 9e68e80c..f5d2d342 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/config_schema.json +++ b/src/go/plugin/go.d/modules/k8s_kubeproxy/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/init.go b/src/go/plugin/go.d/modules/k8s_kubeproxy/init.go index 29386210..93e4427e 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/init.go +++ b/src/go/plugin/go.d/modules/k8s_kubeproxy/init.go @@ -5,8 +5,8 @@ package k8s_kubeproxy import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (kp *KubeProxy) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/integrations/kubeproxy.md b/src/go/plugin/go.d/modules/k8s_kubeproxy/integrations/kubeproxy.md index beea0c08..bfeb00b5 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/integrations/kubeproxy.md +++ b/src/go/plugin/go.d/modules/k8s_kubeproxy/integrations/kubeproxy.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/k8s_kubeproxy/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/k8s_kubeproxy/metadata.yaml" sidebar_label: "Kubeproxy" learn_status: "Published" learn_rel_path: "Collecting Metrics/Kubernetes" @@ -161,6 +161,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `k8s_kubeproxy` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -183,4 +185,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m k8s_kubeproxy ``` +### Getting Logs + +If you're encountering problems with the `k8s_kubeproxy` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep k8s_kubeproxy +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep k8s_kubeproxy /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep k8s_kubeproxy +``` + diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/kubeproxy.go b/src/go/plugin/go.d/modules/k8s_kubeproxy/kubeproxy.go index 3af89c12..3c984843 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/kubeproxy.go +++ b/src/go/plugin/go.d/modules/k8s_kubeproxy/kubeproxy.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/kubeproxy_test.go b/src/go/plugin/go.d/modules/k8s_kubeproxy/kubeproxy_test.go index 27a6c917..206528a2 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/kubeproxy_test.go +++ b/src/go/plugin/go.d/modules/k8s_kubeproxy/kubeproxy_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/metadata.yaml b/src/go/plugin/go.d/modules/k8s_kubeproxy/metadata.yaml index 0f8d0d72..0f8d0d72 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/metadata.yaml +++ b/src/go/plugin/go.d/modules/k8s_kubeproxy/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/metrics.go b/src/go/plugin/go.d/modules/k8s_kubeproxy/metrics.go index 1cc58f0d..f5c587a2 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/metrics.go +++ b/src/go/plugin/go.d/modules/k8s_kubeproxy/metrics.go @@ -3,7 +3,7 @@ package k8s_kubeproxy import ( - mtx "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" + mtx "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" ) func newMetrics() *metrics { diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/testdata/config.json b/src/go/plugin/go.d/modules/k8s_kubeproxy/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/testdata/config.json +++ b/src/go/plugin/go.d/modules/k8s_kubeproxy/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/testdata/config.yaml b/src/go/plugin/go.d/modules/k8s_kubeproxy/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/k8s_kubeproxy/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/testdata/metrics.txt b/src/go/plugin/go.d/modules/k8s_kubeproxy/testdata/metrics.txt index 7a10d847..7a10d847 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_kubeproxy/testdata/metrics.txt +++ b/src/go/plugin/go.d/modules/k8s_kubeproxy/testdata/metrics.txt diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/README.md b/src/go/plugin/go.d/modules/k8s_state/README.md index 72c4e5ca..72c4e5ca 120000 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/README.md +++ b/src/go/plugin/go.d/modules/k8s_state/README.md diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/charts.go b/src/go/plugin/go.d/modules/k8s_state/charts.go index 0cec1251..471d1257 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/charts.go +++ b/src/go/plugin/go.d/modules/k8s_state/charts.go @@ -7,7 +7,7 @@ import ( "regexp" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) // NETDATA_CHART_PRIO_CGROUPS_CONTAINERS 40000 diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/client.go b/src/go/plugin/go.d/modules/k8s_state/client.go index 315e823f..315e823f 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/client.go +++ b/src/go/plugin/go.d/modules/k8s_state/client.go diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/cluster_meta.go b/src/go/plugin/go.d/modules/k8s_state/cluster_meta.go index e7eb809c..e7eb809c 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/cluster_meta.go +++ b/src/go/plugin/go.d/modules/k8s_state/cluster_meta.go diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/collect.go b/src/go/plugin/go.d/modules/k8s_state/collect.go index 033d330c..081a0fdf 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/collect.go +++ b/src/go/plugin/go.d/modules/k8s_state/collect.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" corev1 "k8s.io/api/core/v1" ) @@ -68,6 +68,13 @@ func (ks *KubeState) collectKubeState(mx map[string]int64) { func (ks *KubeState) collectPodsState(mx map[string]int64) { now := time.Now() for _, ps := range ks.state.pods { + // Skip cronjobs (each of them is a unique container because name contains hash) + // to avoid overwhelming Netdata with high cardinality metrics. + // Related issue https://github.com/netdata/netdata/issues/16412 + if ps.controllerKind == "Job" { + continue + } + if ps.deleted { delete(ks.state.pods, podSource(ps.namespace, ps.name)) ks.removePodCharts(ps) diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/config_schema.json b/src/go/plugin/go.d/modules/k8s_state/config_schema.json index ae66d7cb..ae66d7cb 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/config_schema.json +++ b/src/go/plugin/go.d/modules/k8s_state/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/discover_kubernetes.go b/src/go/plugin/go.d/modules/k8s_state/discover_kubernetes.go index a4aeee97..5d435871 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/discover_kubernetes.go +++ b/src/go/plugin/go.d/modules/k8s_state/discover_kubernetes.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/discover_node.go b/src/go/plugin/go.d/modules/k8s_state/discover_node.go index 29761b20..1d91436c 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/discover_node.go +++ b/src/go/plugin/go.d/modules/k8s_state/discover_node.go @@ -5,7 +5,7 @@ package k8s_state import ( "context" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/discover_pod.go b/src/go/plugin/go.d/modules/k8s_state/discover_pod.go index 2def7ad5..53e9ceb9 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/discover_pod.go +++ b/src/go/plugin/go.d/modules/k8s_state/discover_pod.go @@ -5,7 +5,7 @@ package k8s_state import ( "context" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/init.go b/src/go/plugin/go.d/modules/k8s_state/init.go index 99813139..99813139 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/init.go +++ b/src/go/plugin/go.d/modules/k8s_state/init.go diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/integrations/kubernetes_cluster_state.md b/src/go/plugin/go.d/modules/k8s_state/integrations/kubernetes_cluster_state.md index 88d81e25..5f5e36f8 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/integrations/kubernetes_cluster_state.md +++ b/src/go/plugin/go.d/modules/k8s_state/integrations/kubernetes_cluster_state.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/k8s_state/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/k8s_state/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/k8s_state/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/k8s_state/metadata.yaml" sidebar_label: "Kubernetes Cluster State" learn_status: "Published" learn_rel_path: "Collecting Metrics/Kubernetes" @@ -193,6 +193,8 @@ There are no configuration examples. ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `k8s_state` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -215,4 +217,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m k8s_state ``` +### Getting Logs + +If you're encountering problems with the `k8s_state` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep k8s_state +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep k8s_state /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep k8s_state +``` + diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/kube_state.go b/src/go/plugin/go.d/modules/k8s_state/kube_state.go index 95fd2d1c..26962928 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/kube_state.go +++ b/src/go/plugin/go.d/modules/k8s_state/kube_state.go @@ -10,7 +10,7 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "k8s.io/client-go/kubernetes" ) diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/kube_state_test.go b/src/go/plugin/go.d/modules/k8s_state/kube_state_test.go index 99560d6d..cf52c08b 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/kube_state_test.go +++ b/src/go/plugin/go.d/modules/k8s_state/kube_state_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/metadata.yaml b/src/go/plugin/go.d/modules/k8s_state/metadata.yaml index 7617b297..7617b297 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/metadata.yaml +++ b/src/go/plugin/go.d/modules/k8s_state/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/resource.go b/src/go/plugin/go.d/modules/k8s_state/resource.go index cabd41a6..cabd41a6 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/resource.go +++ b/src/go/plugin/go.d/modules/k8s_state/resource.go diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/state.go b/src/go/plugin/go.d/modules/k8s_state/state.go index 72bac88e..72bac88e 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/state.go +++ b/src/go/plugin/go.d/modules/k8s_state/state.go diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/testdata/config.json b/src/go/plugin/go.d/modules/k8s_state/testdata/config.json index 0e3f7c40..0e3f7c40 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/testdata/config.json +++ b/src/go/plugin/go.d/modules/k8s_state/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/testdata/config.yaml b/src/go/plugin/go.d/modules/k8s_state/testdata/config.yaml index f21a3a7a..f21a3a7a 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/k8s_state/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/update_node_state.go b/src/go/plugin/go.d/modules/k8s_state/update_node_state.go index 80f5c26c..80f5c26c 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/update_node_state.go +++ b/src/go/plugin/go.d/modules/k8s_state/update_node_state.go diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/update_pod_state.go b/src/go/plugin/go.d/modules/k8s_state/update_pod_state.go index 22ef0f7f..16b0f433 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/update_pod_state.go +++ b/src/go/plugin/go.d/modules/k8s_state/update_pod_state.go @@ -149,13 +149,6 @@ func (ks *KubeState) updatePodState(r resource) { } } -func max(a, b int64) int64 { - if a < b { - return b - } - return a -} - func extractContainerID(id string) string { // docker://d98... if i := strings.LastIndexByte(id, '/'); i != -1 { diff --git a/src/go/collectors/go.d.plugin/modules/k8s_state/update_state.go b/src/go/plugin/go.d/modules/k8s_state/update_state.go index 88f3272c..88f3272c 100644 --- a/src/go/collectors/go.d.plugin/modules/k8s_state/update_state.go +++ b/src/go/plugin/go.d/modules/k8s_state/update_state.go diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/README.md b/src/go/plugin/go.d/modules/lighttpd/README.md index b0d3613b..b0d3613b 120000 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/README.md +++ b/src/go/plugin/go.d/modules/lighttpd/README.md diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/apiclient.go b/src/go/plugin/go.d/modules/lighttpd/apiclient.go index 2d4bf0fc..1686272c 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/apiclient.go +++ b/src/go/plugin/go.d/modules/lighttpd/apiclient.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/charts.go b/src/go/plugin/go.d/modules/lighttpd/charts.go index 293e5741..4780384c 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/charts.go +++ b/src/go/plugin/go.d/modules/lighttpd/charts.go @@ -2,7 +2,7 @@ package lighttpd -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( // Charts is an alias for module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/collect.go b/src/go/plugin/go.d/modules/lighttpd/collect.go index d6a0f1b8..84c88af4 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/collect.go +++ b/src/go/plugin/go.d/modules/lighttpd/collect.go @@ -5,7 +5,7 @@ package lighttpd import ( "fmt" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) func (l *Lighttpd) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/config_schema.json b/src/go/plugin/go.d/modules/lighttpd/config_schema.json index f4f26162..32700b3b 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/config_schema.json +++ b/src/go/plugin/go.d/modules/lighttpd/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/init.go b/src/go/plugin/go.d/modules/lighttpd/init.go index c0dae5e7..0923262c 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/init.go +++ b/src/go/plugin/go.d/modules/lighttpd/init.go @@ -7,7 +7,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (l *Lighttpd) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/integrations/lighttpd.md b/src/go/plugin/go.d/modules/lighttpd/integrations/lighttpd.md index 8737694a..bcf434fc 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/integrations/lighttpd.md +++ b/src/go/plugin/go.d/modules/lighttpd/integrations/lighttpd.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/lighttpd/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/lighttpd/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/lighttpd/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/lighttpd/metadata.yaml" sidebar_label: "Lighttpd" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -206,6 +206,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `lighttpd` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -228,4 +230,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m lighttpd ``` +### Getting Logs + +If you're encountering problems with the `lighttpd` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep lighttpd +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep lighttpd /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep lighttpd +``` + diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/lighttpd.go b/src/go/plugin/go.d/modules/lighttpd/lighttpd.go index 373cc406..1b17833e 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/lighttpd.go +++ b/src/go/plugin/go.d/modules/lighttpd/lighttpd.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/lighttpd_test.go b/src/go/plugin/go.d/modules/lighttpd/lighttpd_test.go index 8a015c85..05c7504e 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/lighttpd_test.go +++ b/src/go/plugin/go.d/modules/lighttpd/lighttpd_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/metadata.yaml b/src/go/plugin/go.d/modules/lighttpd/metadata.yaml index a90ac05e..a90ac05e 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/metadata.yaml +++ b/src/go/plugin/go.d/modules/lighttpd/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/metrics.go b/src/go/plugin/go.d/modules/lighttpd/metrics.go index 6c39d2d0..6c39d2d0 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/metrics.go +++ b/src/go/plugin/go.d/modules/lighttpd/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/testdata/apache-status.txt b/src/go/plugin/go.d/modules/lighttpd/testdata/apache-status.txt index 136b6936..136b6936 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/testdata/apache-status.txt +++ b/src/go/plugin/go.d/modules/lighttpd/testdata/apache-status.txt diff --git a/src/go/collectors/go.d.plugin/modules/logstash/testdata/config.json b/src/go/plugin/go.d/modules/lighttpd/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/logstash/testdata/config.json +++ b/src/go/plugin/go.d/modules/lighttpd/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/logstash/testdata/config.yaml b/src/go/plugin/go.d/modules/lighttpd/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/logstash/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/lighttpd/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/lighttpd/testdata/status.txt b/src/go/plugin/go.d/modules/lighttpd/testdata/status.txt index 07d8e06e..07d8e06e 100644 --- a/src/go/collectors/go.d.plugin/modules/lighttpd/testdata/status.txt +++ b/src/go/plugin/go.d/modules/lighttpd/testdata/status.txt diff --git a/src/go/collectors/go.d.plugin/modules/litespeed/README.md b/src/go/plugin/go.d/modules/litespeed/README.md index e7418b3d..e7418b3d 120000 --- a/src/go/collectors/go.d.plugin/modules/litespeed/README.md +++ b/src/go/plugin/go.d/modules/litespeed/README.md diff --git a/src/go/collectors/go.d.plugin/modules/litespeed/charts.go b/src/go/plugin/go.d/modules/litespeed/charts.go index 0bb25f23..b7309f28 100644 --- a/src/go/collectors/go.d.plugin/modules/litespeed/charts.go +++ b/src/go/plugin/go.d/modules/litespeed/charts.go @@ -2,7 +2,7 @@ package litespeed -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" const ( prioRequests = module.Priority + iota diff --git a/src/go/collectors/go.d.plugin/modules/litespeed/collect.go b/src/go/plugin/go.d/modules/litespeed/collect.go index a68cf119..a68cf119 100644 --- a/src/go/collectors/go.d.plugin/modules/litespeed/collect.go +++ b/src/go/plugin/go.d/modules/litespeed/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/litespeed/config_schema.json b/src/go/plugin/go.d/modules/litespeed/config_schema.json index 2ec13468..2ec13468 100644 --- a/src/go/collectors/go.d.plugin/modules/litespeed/config_schema.json +++ b/src/go/plugin/go.d/modules/litespeed/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/litespeed/integrations/litespeed.md b/src/go/plugin/go.d/modules/litespeed/integrations/litespeed.md index 5b7d3eb6..96858fda 100644 --- a/src/go/collectors/go.d.plugin/modules/litespeed/integrations/litespeed.md +++ b/src/go/plugin/go.d/modules/litespeed/integrations/litespeed.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/litespeed/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/litespeed/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/litespeed/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/litespeed/metadata.yaml" sidebar_label: "Litespeed" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -133,6 +133,8 @@ local: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `litespeed` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -155,4 +157,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m litespeed ``` +### Getting Logs + +If you're encountering problems with the `litespeed` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep litespeed +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep litespeed /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep litespeed +``` + diff --git a/src/go/collectors/go.d.plugin/modules/litespeed/litespeed.go b/src/go/plugin/go.d/modules/litespeed/litespeed.go index 3e278a37..f57c0eed 100644 --- a/src/go/collectors/go.d.plugin/modules/litespeed/litespeed.go +++ b/src/go/plugin/go.d/modules/litespeed/litespeed.go @@ -6,7 +6,7 @@ import ( _ "embed" "errors" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/litespeed/litespeed_test.go b/src/go/plugin/go.d/modules/litespeed/litespeed_test.go index 86c89d82..576609dc 100644 --- a/src/go/collectors/go.d.plugin/modules/litespeed/litespeed_test.go +++ b/src/go/plugin/go.d/modules/litespeed/litespeed_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/litespeed/metadata.yaml b/src/go/plugin/go.d/modules/litespeed/metadata.yaml index 1c795753..1c795753 100644 --- a/src/go/collectors/go.d.plugin/modules/litespeed/metadata.yaml +++ b/src/go/plugin/go.d/modules/litespeed/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/litespeed/testdata/.rtreport b/src/go/plugin/go.d/modules/litespeed/testdata/.rtreport index e262cf3c..e262cf3c 100644 --- a/src/go/collectors/go.d.plugin/modules/litespeed/testdata/.rtreport +++ b/src/go/plugin/go.d/modules/litespeed/testdata/.rtreport diff --git a/src/go/collectors/go.d.plugin/modules/litespeed/testdata/.rtreport.2 b/src/go/plugin/go.d/modules/litespeed/testdata/.rtreport.2 index e262cf3c..e262cf3c 100644 --- a/src/go/collectors/go.d.plugin/modules/litespeed/testdata/.rtreport.2 +++ b/src/go/plugin/go.d/modules/litespeed/testdata/.rtreport.2 diff --git a/src/go/collectors/go.d.plugin/modules/litespeed/testdata/config.json b/src/go/plugin/go.d/modules/litespeed/testdata/config.json index 30924549..30924549 100644 --- a/src/go/collectors/go.d.plugin/modules/litespeed/testdata/config.json +++ b/src/go/plugin/go.d/modules/litespeed/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/litespeed/testdata/config.yaml b/src/go/plugin/go.d/modules/litespeed/testdata/config.yaml index 03905e5c..03905e5c 100644 --- a/src/go/collectors/go.d.plugin/modules/litespeed/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/litespeed/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/logind/README.md b/src/go/plugin/go.d/modules/logind/README.md index 22c20d70..22c20d70 120000 --- a/src/go/collectors/go.d.plugin/modules/logind/README.md +++ b/src/go/plugin/go.d/modules/logind/README.md diff --git a/src/go/collectors/go.d.plugin/modules/logind/charts.go b/src/go/plugin/go.d/modules/logind/charts.go index 91bc0f20..61fa0490 100644 --- a/src/go/collectors/go.d.plugin/modules/logind/charts.go +++ b/src/go/plugin/go.d/modules/logind/charts.go @@ -5,7 +5,7 @@ package logind -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" const ( prioSessions = module.Priority + iota diff --git a/src/go/collectors/go.d.plugin/modules/logind/collect.go b/src/go/plugin/go.d/modules/logind/collect.go index 1f22478b..1f22478b 100644 --- a/src/go/collectors/go.d.plugin/modules/logind/collect.go +++ b/src/go/plugin/go.d/modules/logind/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/logind/config_schema.json b/src/go/plugin/go.d/modules/logind/config_schema.json index 0a861853..0a861853 100644 --- a/src/go/collectors/go.d.plugin/modules/logind/config_schema.json +++ b/src/go/plugin/go.d/modules/logind/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/logind/connection.go b/src/go/plugin/go.d/modules/logind/connection.go index b97387ac..b97387ac 100644 --- a/src/go/collectors/go.d.plugin/modules/logind/connection.go +++ b/src/go/plugin/go.d/modules/logind/connection.go diff --git a/src/go/collectors/go.d.plugin/modules/logind/doc.go b/src/go/plugin/go.d/modules/logind/doc.go index 90aa8b4e..90aa8b4e 100644 --- a/src/go/collectors/go.d.plugin/modules/logind/doc.go +++ b/src/go/plugin/go.d/modules/logind/doc.go diff --git a/src/go/collectors/go.d.plugin/modules/logind/integrations/systemd-logind_users.md b/src/go/plugin/go.d/modules/logind/integrations/systemd-logind_users.md index 9f80e924..3450ff66 100644 --- a/src/go/collectors/go.d.plugin/modules/logind/integrations/systemd-logind_users.md +++ b/src/go/plugin/go.d/modules/logind/integrations/systemd-logind_users.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/logind/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/logind/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/logind/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/logind/metadata.yaml" sidebar_label: "systemd-logind users" learn_status: "Published" learn_rel_path: "Collecting Metrics/Systemd" @@ -110,6 +110,8 @@ There are no configuration examples. ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `logind` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -132,4 +134,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m logind ``` +### Getting Logs + +If you're encountering problems with the `logind` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep logind +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep logind /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep logind +``` + diff --git a/src/go/collectors/go.d.plugin/modules/logind/logind.go b/src/go/plugin/go.d/modules/logind/logind.go index 97d2083a..ff286634 100644 --- a/src/go/collectors/go.d.plugin/modules/logind/logind.go +++ b/src/go/plugin/go.d/modules/logind/logind.go @@ -10,8 +10,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/logind/logind_test.go b/src/go/plugin/go.d/modules/logind/logind_test.go index 7ba6b225..21cbba87 100644 --- a/src/go/collectors/go.d.plugin/modules/logind/logind_test.go +++ b/src/go/plugin/go.d/modules/logind/logind_test.go @@ -10,7 +10,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/coreos/go-systemd/v22/login1" "github.com/godbus/dbus/v5" diff --git a/src/go/collectors/go.d.plugin/modules/logind/metadata.yaml b/src/go/plugin/go.d/modules/logind/metadata.yaml index 792a515f..792a515f 100644 --- a/src/go/collectors/go.d.plugin/modules/logind/metadata.yaml +++ b/src/go/plugin/go.d/modules/logind/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/lvm/testdata/config.json b/src/go/plugin/go.d/modules/logind/testdata/config.json index 291ecee3..291ecee3 100644 --- a/src/go/collectors/go.d.plugin/modules/lvm/testdata/config.json +++ b/src/go/plugin/go.d/modules/logind/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/lvm/testdata/config.yaml b/src/go/plugin/go.d/modules/logind/testdata/config.yaml index 25b0b4c7..25b0b4c7 100644 --- a/src/go/collectors/go.d.plugin/modules/lvm/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/logind/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/logstash/README.md b/src/go/plugin/go.d/modules/logstash/README.md index 7a35ae8f..7a35ae8f 120000 --- a/src/go/collectors/go.d.plugin/modules/logstash/README.md +++ b/src/go/plugin/go.d/modules/logstash/README.md diff --git a/src/go/collectors/go.d.plugin/modules/logstash/charts.go b/src/go/plugin/go.d/modules/logstash/charts.go index 555a7e3e..3fed45f4 100644 --- a/src/go/collectors/go.d.plugin/modules/logstash/charts.go +++ b/src/go/plugin/go.d/modules/logstash/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/logstash/collect.go b/src/go/plugin/go.d/modules/logstash/collect.go index 3eceb9bf..ff506d64 100644 --- a/src/go/collectors/go.d.plugin/modules/logstash/collect.go +++ b/src/go/plugin/go.d/modules/logstash/collect.go @@ -8,8 +8,8 @@ import ( "io" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const urlPathNodeStatsAPI = "/_node/stats" @@ -45,8 +45,10 @@ func (l *Logstash) updateCharts(pipelines map[string]pipelineStats) { } func (l *Logstash) queryNodeStats() (*nodeStats, error) { - req, _ := web.NewHTTPRequest(l.Request.Copy()) - req.URL.Path = urlPathNodeStatsAPI + req, err := web.NewHTTPRequestWithPath(l.Request, urlPathNodeStatsAPI) + if err != nil { + return nil, err + } var stats nodeStats diff --git a/src/go/collectors/go.d.plugin/modules/logstash/config_schema.json b/src/go/plugin/go.d/modules/logstash/config_schema.json index f9b2d570..c08d136f 100644 --- a/src/go/collectors/go.d.plugin/modules/logstash/config_schema.json +++ b/src/go/plugin/go.d/modules/logstash/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/logstash/integrations/logstash.md b/src/go/plugin/go.d/modules/logstash/integrations/logstash.md index b4715abf..0ca751eb 100644 --- a/src/go/collectors/go.d.plugin/modules/logstash/integrations/logstash.md +++ b/src/go/plugin/go.d/modules/logstash/integrations/logstash.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/logstash/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/logstash/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/logstash/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/logstash/metadata.yaml" sidebar_label: "Logstash" learn_status: "Published" learn_rel_path: "Collecting Metrics/Logs Servers" @@ -223,6 +223,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `logstash` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -245,4 +247,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m logstash ``` +### Getting Logs + +If you're encountering problems with the `logstash` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep logstash +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep logstash /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep logstash +``` + diff --git a/src/go/collectors/go.d.plugin/modules/logstash/logstash.go b/src/go/plugin/go.d/modules/logstash/logstash.go index 197616be..3ee95594 100644 --- a/src/go/collectors/go.d.plugin/modules/logstash/logstash.go +++ b/src/go/plugin/go.d/modules/logstash/logstash.go @@ -8,8 +8,8 @@ import ( "net/http" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/logstash/logstash_test.go b/src/go/plugin/go.d/modules/logstash/logstash_test.go index 6ea2e419..166d3981 100644 --- a/src/go/collectors/go.d.plugin/modules/logstash/logstash_test.go +++ b/src/go/plugin/go.d/modules/logstash/logstash_test.go @@ -3,13 +3,13 @@ package logstash import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "net/http" "net/http/httptest" "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/logstash/metadata.yaml b/src/go/plugin/go.d/modules/logstash/metadata.yaml index 00d92db2..00d92db2 100644 --- a/src/go/collectors/go.d.plugin/modules/logstash/metadata.yaml +++ b/src/go/plugin/go.d/modules/logstash/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/logstash/node_stats.go b/src/go/plugin/go.d/modules/logstash/node_stats.go index 1687f333..1687f333 100644 --- a/src/go/collectors/go.d.plugin/modules/logstash/node_stats.go +++ b/src/go/plugin/go.d/modules/logstash/node_stats.go diff --git a/src/go/collectors/go.d.plugin/modules/nginx/testdata/config.json b/src/go/plugin/go.d/modules/logstash/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/nginx/testdata/config.json +++ b/src/go/plugin/go.d/modules/logstash/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/nginx/testdata/config.yaml b/src/go/plugin/go.d/modules/logstash/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/nginx/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/logstash/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/logstash/testdata/stats.json b/src/go/plugin/go.d/modules/logstash/testdata/stats.json index 50fd7b07..50fd7b07 100644 --- a/src/go/collectors/go.d.plugin/modules/logstash/testdata/stats.json +++ b/src/go/plugin/go.d/modules/logstash/testdata/stats.json diff --git a/src/go/collectors/go.d.plugin/modules/lvm/README.md b/src/go/plugin/go.d/modules/lvm/README.md index 9b86695a..9b86695a 120000 --- a/src/go/collectors/go.d.plugin/modules/lvm/README.md +++ b/src/go/plugin/go.d/modules/lvm/README.md diff --git a/src/go/collectors/go.d.plugin/modules/lvm/charts.go b/src/go/plugin/go.d/modules/lvm/charts.go index 20db6615..8d2f0fa1 100644 --- a/src/go/collectors/go.d.plugin/modules/lvm/charts.go +++ b/src/go/plugin/go.d/modules/lvm/charts.go @@ -5,7 +5,7 @@ package lvm import ( "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/lvm/collect.go b/src/go/plugin/go.d/modules/lvm/collect.go index 8f57a1a8..8f57a1a8 100644 --- a/src/go/collectors/go.d.plugin/modules/lvm/collect.go +++ b/src/go/plugin/go.d/modules/lvm/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/lvm/config_schema.json b/src/go/plugin/go.d/modules/lvm/config_schema.json index 1e078807..1e078807 100644 --- a/src/go/collectors/go.d.plugin/modules/lvm/config_schema.json +++ b/src/go/plugin/go.d/modules/lvm/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/lvm/exec.go b/src/go/plugin/go.d/modules/lvm/exec.go index 529cbdef..66863a05 100644 --- a/src/go/collectors/go.d.plugin/modules/lvm/exec.go +++ b/src/go/plugin/go.d/modules/lvm/exec.go @@ -8,7 +8,7 @@ import ( "os/exec" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" ) func newLVMCLIExec(ndsudoPath string, timeout time.Duration, log *logger.Logger) *lvmCLIExec { diff --git a/src/go/collectors/go.d.plugin/modules/lvm/init.go b/src/go/plugin/go.d/modules/lvm/init.go index 057e51dd..5c4db1ad 100644 --- a/src/go/collectors/go.d.plugin/modules/lvm/init.go +++ b/src/go/plugin/go.d/modules/lvm/init.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" + "github.com/netdata/netdata/go/plugins/pkg/executable" ) func (l *LVM) initLVMCLIExec() (lvmCLI, error) { diff --git a/src/go/collectors/go.d.plugin/modules/lvm/integrations/lvm_logical_volumes.md b/src/go/plugin/go.d/modules/lvm/integrations/lvm_logical_volumes.md index 40463158..1d76c363 100644 --- a/src/go/collectors/go.d.plugin/modules/lvm/integrations/lvm_logical_volumes.md +++ b/src/go/plugin/go.d/modules/lvm/integrations/lvm_logical_volumes.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/lvm/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/lvm/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/lvm/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/lvm/metadata.yaml" sidebar_label: "LVM logical volumes" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -142,6 +142,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `lvm` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -164,4 +166,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m lvm ``` +### Getting Logs + +If you're encountering problems with the `lvm` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep lvm +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep lvm /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep lvm +``` + diff --git a/src/go/collectors/go.d.plugin/modules/lvm/lvm.go b/src/go/plugin/go.d/modules/lvm/lvm.go index 5435cd3a..c6754e06 100644 --- a/src/go/collectors/go.d.plugin/modules/lvm/lvm.go +++ b/src/go/plugin/go.d/modules/lvm/lvm.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/lvm/lvm_test.go b/src/go/plugin/go.d/modules/lvm/lvm_test.go index db85fc7d..a3c07283 100644 --- a/src/go/collectors/go.d.plugin/modules/lvm/lvm_test.go +++ b/src/go/plugin/go.d/modules/lvm/lvm_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/lvm/metadata.yaml b/src/go/plugin/go.d/modules/lvm/metadata.yaml index 46d03694..46d03694 100644 --- a/src/go/collectors/go.d.plugin/modules/lvm/metadata.yaml +++ b/src/go/plugin/go.d/modules/lvm/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/megacli/testdata/config.json b/src/go/plugin/go.d/modules/lvm/testdata/config.json index 291ecee3..291ecee3 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/testdata/config.json +++ b/src/go/plugin/go.d/modules/lvm/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/megacli/testdata/config.yaml b/src/go/plugin/go.d/modules/lvm/testdata/config.yaml index 25b0b4c7..25b0b4c7 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/lvm/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/lvm/testdata/lvs-report-no-thin.json b/src/go/plugin/go.d/modules/lvm/testdata/lvs-report-no-thin.json index 1fe8ec44..1fe8ec44 100644 --- a/src/go/collectors/go.d.plugin/modules/lvm/testdata/lvs-report-no-thin.json +++ b/src/go/plugin/go.d/modules/lvm/testdata/lvs-report-no-thin.json diff --git a/src/go/collectors/go.d.plugin/modules/lvm/testdata/lvs-report.json b/src/go/plugin/go.d/modules/lvm/testdata/lvs-report.json index bd04fad7..bd04fad7 100644 --- a/src/go/collectors/go.d.plugin/modules/lvm/testdata/lvs-report.json +++ b/src/go/plugin/go.d/modules/lvm/testdata/lvs-report.json diff --git a/src/go/collectors/go.d.plugin/modules/megacli/README.md b/src/go/plugin/go.d/modules/megacli/README.md index bf0d3098..bf0d3098 120000 --- a/src/go/collectors/go.d.plugin/modules/megacli/README.md +++ b/src/go/plugin/go.d/modules/megacli/README.md diff --git a/src/go/collectors/go.d.plugin/modules/megacli/charts.go b/src/go/plugin/go.d/modules/megacli/charts.go index c1ae8f33..c479d567 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/charts.go +++ b/src/go/plugin/go.d/modules/megacli/charts.go @@ -5,7 +5,7 @@ package megacli import ( "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( @@ -16,6 +16,7 @@ const ( prioBBURelativeCharge prioBBURechargeCycles + prioBBUCapDegradationPerc prioBBUTemperature ) @@ -76,6 +77,7 @@ var ( var bbuChartsTmpl = module.Charts{ bbuRelativeChargeChartsTmpl.Copy(), bbuRechargeCyclesChartsTmpl.Copy(), + bbuCapacityDegradationChartsTmpl.Copy(), bbuTemperatureChartsTmpl.Copy(), } @@ -104,6 +106,18 @@ var ( {ID: "bbu_adapter_%s_cycle_count", Name: "recharge"}, }, } + bbuCapacityDegradationChartsTmpl = module.Chart{ + ID: "bbu_adapter_%s_capacity_degradation", + Title: "BBU capacity degradation", + Units: "percent", + Fam: "bbu charge", + Ctx: "megacli.bbu_capacity_degradation", + Type: module.Line, + Priority: prioBBUCapDegradationPerc, + Dims: module.Dims{ + {ID: "bbu_adapter_%s_capacity_degradation_perc", Name: "cap_degradation"}, + }, + } bbuTemperatureChartsTmpl = module.Chart{ ID: "bbu_adapter_%s_temperature", Title: "BBU temperature", @@ -161,6 +175,10 @@ func (m *MegaCli) addPhysDriveCharts(pd *megaPhysDrive) { func (m *MegaCli) addBBUCharts(bbu *megaBBU) { charts := bbuChartsTmpl.Copy() + if _, ok := calcCapDegradationPerc(bbu); !ok { + _ = charts.Remove(bbuCapacityDegradationChartsTmpl.ID) + } + for _, chart := range *charts { chart.ID = fmt.Sprintf(chart.ID, bbu.adapterNumber) chart.Labels = []module.Label{ diff --git a/src/go/collectors/go.d.plugin/modules/megacli/collect.go b/src/go/plugin/go.d/modules/megacli/collect.go index c4e74b78..c4e74b78 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/collect.go +++ b/src/go/plugin/go.d/modules/megacli/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/megacli/collect_bbu.go b/src/go/plugin/go.d/modules/megacli/collect_bbu.go index 1ba82718..33b048e6 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/collect_bbu.go +++ b/src/go/plugin/go.d/modules/megacli/collect_bbu.go @@ -6,16 +6,19 @@ import ( "bufio" "bytes" "fmt" + "strconv" "strings" ) type megaBBU struct { - adapterNumber string - batteryType string - temperature string - relativeStateOfCharge string - absoluteStateOfCharge string // apparently can be 0 while relative > 0 (e.g. relative 91%, absolute 0%) - cycleCount string + adapterNumber string + batteryType string + temperature string + rsoc string + asoc string // apparently can be 0 while relative > 0 (e.g. relative 91%, absolute 0%) + cycleCount string + fullChargeCap string + designCap string } func (m *MegaCli) collectBBU(mx map[string]int64) error { @@ -29,6 +32,11 @@ func (m *MegaCli) collectBBU(mx map[string]int64) error { return err } + if len(bbus) == 0 { + m.Debugf("no BBUs found") + return nil + } + for _, bbu := range bbus { if !m.bbu[bbu.adapterNumber] { m.bbu[bbu.adapterNumber] = true @@ -38,11 +46,16 @@ func (m *MegaCli) collectBBU(mx map[string]int64) error { px := fmt.Sprintf("bbu_adapter_%s_", bbu.adapterNumber) writeInt(mx, px+"temperature", bbu.temperature) - writeInt(mx, px+"relative_state_of_charge", bbu.relativeStateOfCharge) - writeInt(mx, px+"absolute_state_of_charge", bbu.absoluteStateOfCharge) + writeInt(mx, px+"relative_state_of_charge", bbu.rsoc) + writeInt(mx, px+"absolute_state_of_charge", bbu.asoc) writeInt(mx, px+"cycle_count", bbu.cycleCount) + if v, ok := calcCapDegradationPerc(bbu); ok { + mx[px+"capacity_degradation_perc"] = v + } } + m.Debugf("found %d BBUs", len(m.bbu)) + return nil } @@ -69,9 +82,11 @@ func parseBBUInfo(bs []byte) (map[string]*megaBBU, error) { case strings.HasPrefix(line, "BBU Capacity Info for Adapter"): section = "capacity" continue + case strings.HasPrefix(line, "BBU Design Info for Adapter"): + section = "design" + continue case strings.HasPrefix(line, "BBU Firmware Status"), strings.HasPrefix(line, "BBU GasGauge Status"), - strings.HasPrefix(line, "BBU Design Info for Adapter"), strings.HasPrefix(line, "BBU Properties for Adapter"): section = "" continue @@ -92,14 +107,35 @@ func parseBBUInfo(bs []byte) (map[string]*megaBBU, error) { case "capacity": switch { case strings.HasPrefix(line, "Relative State of Charge:"): - bbu.relativeStateOfCharge = getColonSepNumValue(line) + bbu.rsoc = getColonSepNumValue(line) case strings.HasPrefix(line, "Absolute State of charge:"): - bbu.absoluteStateOfCharge = getColonSepNumValue(line) + bbu.asoc = getColonSepNumValue(line) + case strings.HasPrefix(line, "Full Charge Capacity:"): + bbu.fullChargeCap = getColonSepNumValue(line) case strings.HasPrefix(line, "Cycle Count:"): bbu.cycleCount = getColonSepNumValue(line) } + case "design": + if strings.HasPrefix(line, "Design Capacity:") { + bbu.designCap = getColonSepNumValue(line) + } } } return bbus, nil } + +func calcCapDegradationPerc(bbu *megaBBU) (int64, bool) { + full, err := strconv.ParseInt(bbu.fullChargeCap, 10, 64) + if err != nil || full == 0 { + return 0, false + } + design, err := strconv.ParseInt(bbu.designCap, 10, 64) + if err != nil || design == 0 { + return 0, false + } + + v := 100 - float64(full)/float64(design)*100 + + return int64(v), true +} diff --git a/src/go/collectors/go.d.plugin/modules/megacli/collect_phys_drives.go b/src/go/plugin/go.d/modules/megacli/collect_phys_drives.go index 531228f4..71d4546e 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/collect_phys_drives.go +++ b/src/go/plugin/go.d/modules/megacli/collect_phys_drives.go @@ -5,6 +5,7 @@ package megacli import ( "bufio" "bytes" + "errors" "fmt" "strings" ) @@ -45,6 +46,11 @@ func (m *MegaCli) collectPhysDrives(mx map[string]int64) error { if err != nil { return err } + if len(adapters) == 0 { + return errors.New("no adapters found") + } + + var drives int for _, ad := range adapters { if !m.adapters[ad.number] { @@ -64,6 +70,7 @@ func (m *MegaCli) collectPhysDrives(mx map[string]int64) error { m.adapters[pd.wwn] = true m.addPhysDriveCharts(pd) } + drives++ px := fmt.Sprintf("phys_drive_%s_", pd.wwn) @@ -72,6 +79,8 @@ func (m *MegaCli) collectPhysDrives(mx map[string]int64) error { } } + m.Debugf("found %d adapters, %d physical drives", len(m.adapters), drives) + return nil } diff --git a/src/go/collectors/go.d.plugin/modules/megacli/config_schema.json b/src/go/plugin/go.d/modules/megacli/config_schema.json index 6eb36519..6eb36519 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/config_schema.json +++ b/src/go/plugin/go.d/modules/megacli/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/megacli/exec.go b/src/go/plugin/go.d/modules/megacli/exec.go index 4fa971dc..846952b2 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/exec.go +++ b/src/go/plugin/go.d/modules/megacli/exec.go @@ -8,7 +8,7 @@ import ( "os/exec" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" ) func newMegaCliExec(ndsudoPath string, timeout time.Duration, log *logger.Logger) *megaCliExec { diff --git a/src/go/collectors/go.d.plugin/modules/megacli/init.go b/src/go/plugin/go.d/modules/megacli/init.go index 2b0840a7..78b7bf48 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/init.go +++ b/src/go/plugin/go.d/modules/megacli/init.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" + "github.com/netdata/netdata/go/plugins/pkg/executable" ) func (m *MegaCli) initMegaCliExec() (megaCli, error) { diff --git a/src/go/collectors/go.d.plugin/modules/megacli/integrations/megacli_megaraid.md b/src/go/plugin/go.d/modules/megacli/integrations/megacli_megaraid.md index d043d545..d1efa7df 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/integrations/megacli_megaraid.md +++ b/src/go/plugin/go.d/modules/megacli/integrations/megacli_megaraid.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/megacli/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/megacli/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/megacli/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/megacli/metadata.yaml" sidebar_label: "MegaCLI MegaRAID" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -113,8 +113,9 @@ Metrics: | Metric | Dimensions | Unit | |:------|:----------|:----| -| megacli.bbu_relative_charge | charge | percentage | +| megacli.bbu_charge | charge | percentage | | megacli.bbu_recharge_cycles | recharge | cycles | +| megacli.bbu_capacity_degradation | cap_degradation | percent | | megacli.bbu_temperature | temperature | Celsius | @@ -189,6 +190,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `megacli` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -211,4 +214,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m megacli ``` +### Getting Logs + +If you're encountering problems with the `megacli` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep megacli +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep megacli /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep megacli +``` + diff --git a/src/go/collectors/go.d.plugin/modules/megacli/megacli.go b/src/go/plugin/go.d/modules/megacli/megacli.go index f49d7ba0..41abd7a1 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/megacli.go +++ b/src/go/plugin/go.d/modules/megacli/megacli.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/megacli/megacli_test.go b/src/go/plugin/go.d/modules/megacli/megacli_test.go index ee1e56b3..4991a28c 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/megacli_test.go +++ b/src/go/plugin/go.d/modules/megacli/megacli_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -160,6 +160,7 @@ func TestMegaCli_Collect(t *testing.T) { "adapter_0_health_state_optimal": 1, "adapter_0_health_state_partially_degraded": 0, "bbu_adapter_0_absolute_state_of_charge": 63, + "bbu_adapter_0_capacity_degradation_perc": 10, "bbu_adapter_0_cycle_count": 4, "bbu_adapter_0_relative_state_of_charge": 71, "bbu_adapter_0_temperature": 33, @@ -190,6 +191,7 @@ func TestMegaCli_Collect(t *testing.T) { "adapter_0_health_state_optimal": 1, "adapter_0_health_state_partially_degraded": 0, "bbu_adapter_0_absolute_state_of_charge": 83, + "bbu_adapter_0_capacity_degradation_perc": 17, "bbu_adapter_0_cycle_count": 61, "bbu_adapter_0_relative_state_of_charge": 100, "bbu_adapter_0_temperature": 31, @@ -235,6 +237,9 @@ func TestMegaCli_Collect(t *testing.T) { assert.Equal(t, test.wantMetrics, mx) assert.Len(t, *mega.Charts(), test.wantCharts) + if len(test.wantMetrics) > 0 { + module.TestMetricsHasAllChartsDims(t, mega.Charts(), mx) + } }) } } diff --git a/src/go/collectors/go.d.plugin/modules/megacli/metadata.yaml b/src/go/plugin/go.d/modules/megacli/metadata.yaml index 5ede8f7e..da5f4fef 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/metadata.yaml +++ b/src/go/plugin/go.d/modules/megacli/metadata.yaml @@ -157,7 +157,7 @@ modules: - name: battery_type description: Battery type (e.g. BBU) metrics: - - name: megacli.bbu_relative_charge + - name: megacli.bbu_charge description: BBU relative charge unit: percentage chart_type: area @@ -169,6 +169,12 @@ modules: chart_type: line dimensions: - name: recharge + - name: megacli.bbu_capacity_degradation + description: BBU capacity degradation + unit: percent + chart_type: area + dimensions: + - name: cap_degradation - name: megacli.bbu_temperature description: BBU bbu_temperature unit: Celsius diff --git a/src/go/collectors/go.d.plugin/modules/nvme/testdata/config.json b/src/go/plugin/go.d/modules/megacli/testdata/config.json index 291ecee3..291ecee3 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/testdata/config.json +++ b/src/go/plugin/go.d/modules/megacli/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/nvme/testdata/config.yaml b/src/go/plugin/go.d/modules/megacli/testdata/config.yaml index 25b0b4c7..25b0b4c7 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/megacli/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/megacli/testdata/mega-bbu-info-old.txt b/src/go/plugin/go.d/modules/megacli/testdata/mega-bbu-info-old.txt index 054ce54d..054ce54d 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/testdata/mega-bbu-info-old.txt +++ b/src/go/plugin/go.d/modules/megacli/testdata/mega-bbu-info-old.txt diff --git a/src/go/collectors/go.d.plugin/modules/megacli/testdata/mega-bbu-info-recent.txt b/src/go/plugin/go.d/modules/megacli/testdata/mega-bbu-info-recent.txt index 948be372..948be372 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/testdata/mega-bbu-info-recent.txt +++ b/src/go/plugin/go.d/modules/megacli/testdata/mega-bbu-info-recent.txt diff --git a/src/go/collectors/go.d.plugin/modules/megacli/testdata/mega-phys-drives-info.txt b/src/go/plugin/go.d/modules/megacli/testdata/mega-phys-drives-info.txt index 142ddc82..142ddc82 100644 --- a/src/go/collectors/go.d.plugin/modules/megacli/testdata/mega-phys-drives-info.txt +++ b/src/go/plugin/go.d/modules/megacli/testdata/mega-phys-drives-info.txt diff --git a/src/go/plugin/go.d/modules/memcached/README.md b/src/go/plugin/go.d/modules/memcached/README.md new file mode 120000 index 00000000..2cb76d33 --- /dev/null +++ b/src/go/plugin/go.d/modules/memcached/README.md @@ -0,0 +1 @@ +integrations/memcached.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/memcached/charts.go b/src/go/plugin/go.d/modules/memcached/charts.go new file mode 100644 index 00000000..14cb1bf1 --- /dev/null +++ b/src/go/plugin/go.d/modules/memcached/charts.go @@ -0,0 +1,229 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package memcached + +import ( + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioCache = module.Priority + iota + prioNet + prioConnections + prioItems + prioEvictedReclaimed + prioGet + prioGetRate + prioSetRate + prioDelete + prioCas + prioIncrement + prioDecrement + prioTouch + prioTouchRate +) + +var charts = module.Charts{ + cacheChart.Copy(), + netChart.Copy(), + connectionsChart.Copy(), + itemsChart.Copy(), + EvictedReclaimedChart.Copy(), + getChart.Copy(), + getRateChart.Copy(), + setRateChart.Copy(), + deleteChart.Copy(), + casChart.Copy(), + incrementChart.Copy(), + decrementChart.Copy(), + touchChart.Copy(), + touchRateChart.Copy(), +} + +const ( + byteToMiB = 1 << 20 +) + +var ( + cacheChart = module.Chart{ + ID: "cache", + Title: "Cache Size", + Units: "MiB", + Fam: "cache", + Ctx: "memcached.cache", + Type: module.Stacked, + Priority: prioCache, + Dims: module.Dims{ + {ID: "avail", Div: byteToMiB}, + {ID: "bytes", Name: "used", Div: byteToMiB}, + }, + } + netChart = module.Chart{ + ID: "net", + Title: "Network", + Units: "kilobits/s", + Fam: "network", + Ctx: "memcached.net", + Type: module.Area, + Priority: prioNet, + Dims: module.Dims{ + {ID: "bytes_read", Name: "in", Mul: 8, Div: 1000, Algo: module.Incremental}, + {ID: "bytes_written", Name: "out", Mul: -8, Div: 1000, Algo: module.Incremental}, + }, + } + connectionsChart = module.Chart{ + ID: "connections", + Title: "Connections", + Units: "connections/s", + Fam: "connections", + Ctx: "memcached.connections", + Type: module.Line, + Priority: prioConnections, + Dims: module.Dims{ + {ID: "curr_connections", Name: "current", Algo: module.Incremental}, + {ID: "rejected_connections", Name: "rejected", Algo: module.Incremental}, + {ID: "total_connections", Name: "total", Algo: module.Incremental}, + }, + } + itemsChart = module.Chart{ + ID: "items", + Title: "Items", + Units: "items", + Fam: "items", + Ctx: "memcached.items", + Type: module.Line, + Priority: prioItems, + Dims: module.Dims{ + {ID: "curr_items", Name: "current"}, + {ID: "total_items", Name: "total"}, + }, + } + EvictedReclaimedChart = module.Chart{ + ID: "evicted_reclaimed", + Title: "Evicted and Reclaimed Items", + Units: "items", + Fam: "items", + Ctx: "memcached.evicted_reclaimed", + Type: module.Line, + Priority: prioEvictedReclaimed, + Dims: module.Dims{ + {ID: "reclaimed"}, + {ID: "evictions", Name: "evicted"}, + }, + } + getChart = module.Chart{ + ID: "get", + Title: "Get Requests", + Units: "requests", + Fam: "get ops", + Ctx: "memcached.get", + Type: module.Stacked, + Priority: prioGet, + Dims: module.Dims{ + {ID: "get_hits", Name: "hits", Algo: module.PercentOfAbsolute}, + {ID: "get_misses", Name: "misses", Algo: module.PercentOfAbsolute}, + }, + } + getRateChart = module.Chart{ + ID: "get_rate", + Title: "Get Request Rate", + Units: "requests/s", + Fam: "get ops", + Ctx: "memcached.get_rate", + Type: module.Line, + Priority: prioGetRate, + Dims: module.Dims{ + {ID: "cmd_get", Name: "rate", Algo: module.Incremental}, + }, + } + setRateChart = module.Chart{ + ID: "set_rate", + Title: "Set Request Rate", + Units: "requests/s", + Fam: "set ops", + Ctx: "memcached.set_rate", + Type: module.Line, + Priority: prioSetRate, + Dims: module.Dims{ + {ID: "cmd_set", Name: "rate", Algo: module.Incremental}, + }, + } + deleteChart = module.Chart{ + ID: "delete", + Title: "Delete Requests", + Units: "requests", + Fam: "delete ops", + Ctx: "memcached.delete", + Type: module.Stacked, + Priority: prioDelete, + Dims: module.Dims{ + {ID: "delete_hits", Name: "hits", Algo: module.PercentOfAbsolute}, + {ID: "delete_misses", Name: "misses", Algo: module.PercentOfAbsolute}, + }, + } + casChart = module.Chart{ + ID: "cas", + Title: "Check and Set Requests", + Units: "requests", + Fam: "check and set ops", + Ctx: "memcached.cas", + Type: module.Stacked, + Priority: prioCas, + Dims: module.Dims{ + {ID: "cas_hits", Name: "hits", Algo: module.PercentOfAbsolute}, + {ID: "cas_misses", Name: "misses", Algo: module.PercentOfAbsolute}, + {ID: "cas_badval", Name: "bad value", Algo: module.PercentOfAbsolute}, + }, + } + incrementChart = module.Chart{ + ID: "increment", + Title: "Increment Requests", + Units: "requests", + Fam: "increment ops", + Ctx: "memcached.increment", + Type: module.Stacked, + Priority: prioIncrement, + Dims: module.Dims{ + {ID: "incr_hits", Name: "hits", Algo: module.PercentOfAbsolute}, + {ID: "incr_misses", Name: "misses", Algo: module.PercentOfAbsolute}, + }, + } + decrementChart = module.Chart{ + ID: "decrement", + Title: "Decrement Requests", + Units: "requests", + Fam: "decrement ops", + Ctx: "memcached.decrement", + Type: module.Stacked, + Priority: prioDecrement, + Dims: module.Dims{ + {ID: "decr_hits", Name: "hits", Algo: module.PercentOfAbsolute}, + {ID: "decr_misses", Name: "misses", Algo: module.PercentOfAbsolute}, + }, + } + touchChart = module.Chart{ + ID: "touch", + Title: "Touch Requests", + Units: "requests", + Fam: "touch ops", + Ctx: "memcached.touch", + Type: module.Stacked, + Priority: prioTouch, + Dims: module.Dims{ + {ID: "touch_hits", Name: "hits", Algo: module.PercentOfAbsolute}, + {ID: "touch_misses", Name: "misses", Algo: module.PercentOfAbsolute}, + }, + } + touchRateChart = module.Chart{ + ID: "touch_rate", + Title: "Touch Requests Rate", + Units: "requests/s", + Fam: "touch ops", + Ctx: "memcached.touch_rate", + Type: module.Line, + Priority: prioTouchRate, + Dims: module.Dims{ + {ID: "cmd_touch", Name: "rate", Algo: module.Incremental}, + }, + } +) diff --git a/src/go/plugin/go.d/modules/memcached/client.go b/src/go/plugin/go.d/modules/memcached/client.go new file mode 100644 index 00000000..679e3eb0 --- /dev/null +++ b/src/go/plugin/go.d/modules/memcached/client.go @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package memcached + +import ( + "bytes" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" +) + +func newMemcachedConn(conf Config) memcachedConn { + return &memcachedClient{conn: socket.New(socket.Config{ + Address: conf.Address, + ConnectTimeout: conf.Timeout.Duration(), + ReadTimeout: conf.Timeout.Duration(), + WriteTimeout: conf.Timeout.Duration(), + })} +} + +type memcachedClient struct { + conn socket.Client +} + +func (c *memcachedClient) connect() error { + return c.conn.Connect() +} + +func (c *memcachedClient) disconnect() { + _ = c.conn.Disconnect() +} + +func (c *memcachedClient) queryStats() ([]byte, error) { + var b bytes.Buffer + err := c.conn.Command("stats\r\n", func(bytes []byte) bool { + s := strings.TrimSpace(string(bytes)) + b.WriteString(s) + b.WriteByte('\n') + return !(strings.HasPrefix(s, "END") || strings.HasPrefix(s, "ERROR")) + }) + if err != nil { + return nil, err + } + return b.Bytes(), nil +} diff --git a/src/go/plugin/go.d/modules/memcached/collect.go b/src/go/plugin/go.d/modules/memcached/collect.go new file mode 100644 index 00000000..9ead8f47 --- /dev/null +++ b/src/go/plugin/go.d/modules/memcached/collect.go @@ -0,0 +1,121 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package memcached + +import ( + "bufio" + "bytes" + "errors" + "strconv" + "strings" +) + +// https://github.com/memcached/memcached/blob/b1aefcdf8a265f8a5126e8aa107a50988fa1ec35/doc/protocol.txt#L1267 +var statsMetrics = map[string]bool{ + "limit_maxbytes": true, + "bytes": true, + "bytes_read": true, + "bytes_written": true, + "cas_badval": true, + "cas_hits": true, + "cas_misses": true, + "cmd_get": true, + "cmd_set": true, + "cmd_touch": true, + "curr_connections": true, + "curr_items": true, + "decr_hits": true, + "decr_misses": true, + "delete_hits": true, + "delete_misses": true, + "evictions": true, + "get_hits": true, + "get_misses": true, + "incr_hits": true, + "incr_misses": true, + "reclaimed": true, + "rejected_connections": true, + "total_connections": true, + "total_items": true, + "touch_hits": true, + "touch_misses": true, +} + +func (m *Memcached) collect() (map[string]int64, error) { + if m.conn == nil { + conn, err := m.establishConn() + if err != nil { + return nil, err + } + m.conn = conn + } + + stats, err := m.conn.queryStats() + if err != nil { + m.conn.disconnect() + m.conn = nil + return nil, err + } + + mx := make(map[string]int64) + + if err := m.collectStats(mx, stats); err != nil { + return nil, err + } + + return mx, nil +} + +func (m *Memcached) collectStats(mx map[string]int64, stats []byte) error { + if len(stats) == 0 { + return errors.New("empty stats response") + } + + var n int + sc := bufio.NewScanner(bytes.NewReader(stats)) + + for sc.Scan() { + line := strings.TrimSpace(sc.Text()) + + switch { + case strings.HasPrefix(line, "STAT"): + key, value := getStatKeyValue(line) + if !statsMetrics[key] { + continue + } + if v, err := strconv.ParseInt(value, 10, 64); err == nil { + mx[key] = v + n++ + } + case strings.HasPrefix(line, "ERROR"): + return errors.New("received ERROR response") + } + } + + if n == 0 { + return errors.New("unexpected memcached response") + } + + mx["avail"] = mx["limit_maxbytes"] - mx["bytes"] + + return nil +} + +func (m *Memcached) establishConn() (memcachedConn, error) { + conn := m.newMemcachedConn(m.Config) + + if err := conn.connect(); err != nil { + return nil, err + } + + return conn, nil +} + +func getStatKeyValue(line string) (string, string) { + line = strings.TrimPrefix(line, "STAT ") + i := strings.IndexByte(line, ' ') + if i < 0 { + return "", "" + } + return line[:i], line[i+1:] +} diff --git a/src/go/plugin/go.d/modules/memcached/config_schema.json b/src/go/plugin/go.d/modules/memcached/config_schema.json new file mode 100644 index 00000000..f92a8eee --- /dev/null +++ b/src/go/plugin/go.d/modules/memcached/config_schema.json @@ -0,0 +1,44 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Memcached collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "address": { + "title": "Address", + "description": "The IP address and port where the memcached service listens for connections.", + "type": "string", + "default": "127.0.0.1:11211" + }, + "timeout": { + "title": "Timeout", + "description": "Timeout for establishing a connection and communication (reading and writing) in seconds.", + "type": "number", + "minimum": 0.5, + "default": 1 + } + }, + "required": [ + "address" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + } + } +}
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/memcached/integrations/memcached.md b/src/go/plugin/go.d/modules/memcached/integrations/memcached.md new file mode 100644 index 00000000..1e653902 --- /dev/null +++ b/src/go/plugin/go.d/modules/memcached/integrations/memcached.md @@ -0,0 +1,231 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/memcached/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/memcached/metadata.yaml" +sidebar_label: "Memcached" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Databases" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Memcached + + +<img src="https://netdata.cloud/img/memcached.svg" width="150"/> + + +Plugin: go.d.plugin +Module: memcached + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +Monitor Memcached metrics for proficient in-memory key-value store operations. Track cache hits, misses, and memory usage for efficient data caching. + +It reads the server's response to the `stats` command. + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +If no configuration is given, collector will attempt to connect to memcached instance on `127.0.0.1:11211` address. + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per Memcached instance + +These metrics refer to the entire monitored application. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| memcached.cache | available, used | MiB | +| memcached.net | in, out | kilobits/s | +| memcached.connections | current, rejected, total | connections/s | +| memcached.items | current, total | items | +| memcached.evicted_reclaimed | reclaimed, evicted | items | +| memcached.get | hints, misses | requests | +| memcached.get_rate | rate | requests/s | +| memcached.set_rate | rate | requests/s | +| memcached.delete | hits, misses | requests | +| memcached.cas | hits, misses, bad value | requests | +| memcached.increment | hits, misses | requests | +| memcached.decrement | hits, misses | requests | +| memcached.touch | hits, misses | requests | +| memcached.touch_rate | rate | requests/s | + + + +## Alerts + + +The following alerts are available: + +| Alert name | On metric | Description | +|:------------|:----------|:------------| +| [ memcached_cache_memory_usage ](https://github.com/netdata/netdata/blob/master/src/health/health.d/memcached.conf) | memcached.cache | cache memory utilization | +| [ memcached_cache_fill_rate ](https://github.com/netdata/netdata/blob/master/src/health/health.d/memcached.conf) | memcached.cache | average rate the cache fills up (positive), or frees up (negative) space over the last hour | +| [ memcached_out_of_cache_space_time ](https://github.com/netdata/netdata/blob/master/src/health/health.d/memcached.conf) | memcached.cache | estimated time the cache will run out of space if the system continues to add data at the same rate as the past hour | + + +## Setup + +### Prerequisites + +No action required. + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/memcached.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/memcached.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| address | The IP address and port where the memcached service listens for connections. | 127.0.0.1:11211 | yes | +| timeout | Connection, read, and write timeout duration in seconds. The timeout includes name resolution. | 1 | no | + +</details> + +#### Examples + +##### Basic + +A basic example configuration. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:11211 + +``` +</details> + +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:11211 + + - name: remote + address: 203.0.113.0:11211 + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `memcached` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m memcached + ``` + +### Getting Logs + +If you're encountering problems with the `memcached` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep memcached +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep memcached /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep memcached +``` + + diff --git a/src/go/plugin/go.d/modules/memcached/memcached.go b/src/go/plugin/go.d/modules/memcached/memcached.go new file mode 100644 index 00000000..bd6039ae --- /dev/null +++ b/src/go/plugin/go.d/modules/memcached/memcached.go @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package memcached + +import ( + _ "embed" + "errors" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("memcached", module.Creator{ + JobConfigSchema: configSchema, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Memcached { + return &Memcached{ + Config: Config{ + Address: "127.0.0.1:11211", + Timeout: web.Duration(time.Second * 1), + }, + newMemcachedConn: newMemcachedConn, + charts: charts.Copy(), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Address string `yaml:"address" json:"address"` + Timeout web.Duration `yaml:"timeout" json:"timeout"` +} + +type ( + Memcached struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + newMemcachedConn func(Config) memcachedConn + conn memcachedConn + } + memcachedConn interface { + connect() error + disconnect() + queryStats() ([]byte, error) + } +) + +func (m *Memcached) Configuration() any { + return m.Config +} + +func (m *Memcached) Init() error { + if m.Address == "" { + m.Error("config: 'address' not set") + return errors.New("address not set") + } + + return nil +} + +func (m *Memcached) Check() error { + mx, err := m.collect() + if err != nil { + m.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (m *Memcached) Charts() *module.Charts { + return m.charts +} + +func (m *Memcached) Collect() map[string]int64 { + mx, err := m.collect() + if err != nil { + m.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (m *Memcached) Cleanup() { + if m.conn != nil { + m.conn.disconnect() + m.conn = nil + } +} diff --git a/src/go/plugin/go.d/modules/memcached/memcached_test.go b/src/go/plugin/go.d/modules/memcached/memcached_test.go new file mode 100644 index 00000000..33a85d33 --- /dev/null +++ b/src/go/plugin/go.d/modules/memcached/memcached_test.go @@ -0,0 +1,296 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package memcached + +import ( + "errors" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataMemcachedStats, _ = os.ReadFile("testdata/stats.txt") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + + "dataMemcachedStats": dataMemcachedStats, + } { + require.NotNil(t, data, name) + } +} + +func TestMemcached_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &Memcached{}, dataConfigJSON, dataConfigYAML) +} + +func TestMemcached_Init(t *testing.T) { + tests := map[string]struct { + config Config + wantFail bool + }{ + "success with default config": { + wantFail: false, + config: New().Config, + }, + "fails if address not set": { + wantFail: true, + config: func() Config { + conf := New().Config + conf.Address = "" + return conf + }(), + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + mem := New() + mem.Config = test.config + + if test.wantFail { + assert.Error(t, mem.Init()) + } else { + assert.NoError(t, mem.Init()) + } + }) + } +} + +func TestMemcached_Cleanup(t *testing.T) { + tests := map[string]struct { + prepare func() *Memcached + }{ + "not initialized": { + prepare: func() *Memcached { + return New() + }, + }, + "after check": { + prepare: func() *Memcached { + mem := New() + mem.newMemcachedConn = func(config Config) memcachedConn { return prepareMockOk() } + _ = mem.Check() + return mem + }, + }, + "after collect": { + prepare: func() *Memcached { + mem := New() + mem.newMemcachedConn = func(config Config) memcachedConn { return prepareMockOk() } + _ = mem.Collect() + return mem + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + mem := test.prepare() + + assert.NotPanics(t, mem.Cleanup) + }) + } +} + +func TestMemcached_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestMemcached_Check(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockMemcachedConn + wantFail bool + }{ + "success case": { + wantFail: false, + prepareMock: prepareMockOk, + }, + "err on connect": { + wantFail: true, + prepareMock: prepareMockErrOnConnect, + }, + "unexpected response": { + wantFail: true, + prepareMock: prepareMockUnexpectedResponse, + }, + "empty response": { + wantFail: true, + prepareMock: prepareMockEmptyResponse, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + mem := New() + mock := test.prepareMock() + mem.newMemcachedConn = func(config Config) memcachedConn { return mock } + + if test.wantFail { + assert.Error(t, mem.Check()) + } else { + assert.NoError(t, mem.Check()) + } + }) + } +} + +func TestMemcached_Collect(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockMemcachedConn + wantMetrics map[string]int64 + disconnectBeforeCleanup bool + disconnectAfterCleanup bool + }{ + "success case": { + prepareMock: prepareMockOk, + disconnectBeforeCleanup: false, + disconnectAfterCleanup: true, + wantMetrics: map[string]int64{ + "avail": 67108831, + "bytes": 33, + "bytes_read": 108662, + "bytes_written": 9761348, + "cas_badval": 0, + "cas_hits": 0, + "cas_misses": 0, + "cmd_get": 1, + "cmd_set": 1, + "cmd_touch": 0, + "curr_connections": 3, + "curr_items": 0, + "decr_hits": 0, + "decr_misses": 0, + "delete_hits": 0, + "delete_misses": 0, + "evictions": 0, + "get_hits": 0, + "get_misses": 1, + "incr_hits": 0, + "incr_misses": 0, + "limit_maxbytes": 67108864, + "reclaimed": 1, + "rejected_connections": 0, + "total_connections": 39, + "total_items": 1, + "touch_hits": 0, + "touch_misses": 0, + }, + }, + "error response": { + prepareMock: prepareMockErrorResponse, + disconnectBeforeCleanup: false, + disconnectAfterCleanup: true, + }, + "unexpected response": { + prepareMock: prepareMockUnexpectedResponse, + disconnectBeforeCleanup: false, + disconnectAfterCleanup: true, + }, + "empty response": { + prepareMock: prepareMockEmptyResponse, + disconnectBeforeCleanup: false, + disconnectAfterCleanup: true, + }, + "err on connect": { + prepareMock: prepareMockErrOnConnect, + disconnectBeforeCleanup: false, + disconnectAfterCleanup: false, + }, + "err on query stats": { + prepareMock: prepareMockErrOnQueryStats, + disconnectBeforeCleanup: true, + disconnectAfterCleanup: true, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + mem := New() + mock := test.prepareMock() + mem.newMemcachedConn = func(config Config) memcachedConn { return mock } + + mx := mem.Collect() + + require.Equal(t, test.wantMetrics, mx) + + if len(test.wantMetrics) > 0 { + module.TestMetricsHasAllChartsDims(t, mem.Charts(), mx) + } + + assert.Equal(t, test.disconnectBeforeCleanup, mock.disconnectCalled, "disconnect before cleanup") + mem.Cleanup() + assert.Equal(t, test.disconnectAfterCleanup, mock.disconnectCalled, "disconnect after cleanup") + }) + } +} + +func prepareMockOk() *mockMemcachedConn { + return &mockMemcachedConn{ + statsResponse: dataMemcachedStats, + } +} + +func prepareMockErrorResponse() *mockMemcachedConn { + return &mockMemcachedConn{ + statsResponse: []byte("ERROR"), + } +} + +func prepareMockErrOnConnect() *mockMemcachedConn { + return &mockMemcachedConn{ + errOnConnect: true, + } +} + +func prepareMockErrOnQueryStats() *mockMemcachedConn { + return &mockMemcachedConn{ + errOnQueryStats: true, + } +} + +func prepareMockUnexpectedResponse() *mockMemcachedConn { + return &mockMemcachedConn{ + statsResponse: []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit."), + } +} + +func prepareMockEmptyResponse() *mockMemcachedConn { + return &mockMemcachedConn{} +} + +type mockMemcachedConn struct { + errOnConnect bool + errOnQueryStats bool + statsResponse []byte + disconnectCalled bool +} + +func (m *mockMemcachedConn) connect() error { + if m.errOnConnect { + return errors.New("mock.connect() error") + } + return nil +} + +func (m *mockMemcachedConn) disconnect() { + m.disconnectCalled = true +} + +func (m *mockMemcachedConn) queryStats() ([]byte, error) { + if m.errOnQueryStats { + return nil, errors.New("mock.queryStats() error") + } + return m.statsResponse, nil +} diff --git a/src/go/plugin/go.d/modules/memcached/metadata.yaml b/src/go/plugin/go.d/modules/memcached/metadata.yaml new file mode 100644 index 00000000..c307ef01 --- /dev/null +++ b/src/go/plugin/go.d/modules/memcached/metadata.yaml @@ -0,0 +1,217 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-memcached + plugin_name: go.d.plugin + module_name: memcached + monitored_instance: + name: Memcached + link: https://memcached.org/ + categories: + - data-collection.database-servers + icon_filename: "memcached.svg" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - memcached + - memcache + - cache + - database + most_popular: false + overview: + data_collection: + metrics_description: "Monitor Memcached metrics for proficient in-memory key-value store operations. Track cache hits, misses, and memory usage for efficient data caching." + method_description: "It reads the server's response to the `stats` command." + supported_platforms: + include: [] + exclude: [] + multi_instance: true + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: | + If no configuration is given, collector will attempt to connect to memcached instance on `127.0.0.1:11211` address. + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: [] + configuration: + file: + name: go.d/memcached.conf + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: address + description: The IP address and port where the memcached service listens for connections. + default_value: 127.0.0.1:11211 + required: true + - name: timeout + description: Connection, read, and write timeout duration in seconds. The timeout includes name resolution. + default_value: 1 + required: false + examples: + folding: + title: Config + enabled: true + list: + - name: Basic + description: A basic example configuration. + config: | + jobs: + - name: local + address: 127.0.0.1:11211 + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + address: 127.0.0.1:11211 + + - name: remote + address: 203.0.113.0:11211 + troubleshooting: + problems: + list: [] + alerts: + - name: memcached_cache_memory_usage + link: https://github.com/netdata/netdata/blob/master/src/health/health.d/memcached.conf + metric: memcached.cache + info: cache memory utilization + - name: memcached_cache_fill_rate + link: https://github.com/netdata/netdata/blob/master/src/health/health.d/memcached.conf + metric: memcached.cache + info: average rate the cache fills up (positive), or frees up (negative) space over the last hour + - name: memcached_out_of_cache_space_time + link: https://github.com/netdata/netdata/blob/master/src/health/health.d/memcached.conf + metric: memcached.cache + info: estimated time the cache will run out of space if the system continues to add data at the same rate as the past hour + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: "These metrics refer to the entire monitored application." + labels: [] + metrics: + - name: memcached.cache + description: Cache Size + unit: "MiB" + chart_type: stacked + dimensions: + - name: available + - name: used + - name: memcached.net + description: Network + unit: "kilobits/s" + chart_type: area + dimensions: + - name: in + - name: out + - name: memcached.connections + description: Connections + unit: "connections/s" + chart_type: line + dimensions: + - name: current + - name: rejected + - name: total + - name: memcached.items + description: Items + unit: "items" + chart_type: line + dimensions: + - name: current + - name: total + - name: memcached.evicted_reclaimed + description: Evicted and Reclaimed Items + unit: "items" + chart_type: line + dimensions: + - name: reclaimed + - name: evicted + - name: memcached.get + description: Get Requests + unit: "requests" + chart_type: stacked + dimensions: + - name: hints + - name: misses + - name: memcached.get_rate + description: Get Request Rate + unit: "requests/s" + chart_type: line + dimensions: + - name: rate + - name: memcached.set_rate + description: Set Request Rate + unit: "requests/s" + chart_type: line + dimensions: + - name: rate + - name: memcached.delete + description: Delete Requests + unit: "requests" + chart_type: stacked + dimensions: + - name: hits + - name: misses + - name: memcached.cas + description: Check and Set Requests + unit: "requests" + chart_type: stacked + dimensions: + - name: hits + - name: misses + - name: bad value + - name: memcached.increment + description: Increment Requests + unit: "requests" + chart_type: stacked + dimensions: + - name: hits + - name: misses + - name: memcached.decrement + description: Decrement Requests + unit: "requests" + chart_type: stacked + dimensions: + - name: hits + - name: misses + - name: memcached.touch + description: Touch Requests + unit: "requests" + chart_type: stacked + dimensions: + - name: hits + - name: misses + - name: memcached.touch_rate + description: Touch Request Rate + unit: "requests/s" + chart_type: line + dimensions: + - name: rate diff --git a/src/go/plugin/go.d/modules/memcached/testdata/config.json b/src/go/plugin/go.d/modules/memcached/testdata/config.json new file mode 100644 index 00000000..e8683472 --- /dev/null +++ b/src/go/plugin/go.d/modules/memcached/testdata/config.json @@ -0,0 +1,5 @@ +{ + "update_every": 123, + "address": "ok", + "timeout": 123.123 +} diff --git a/src/go/plugin/go.d/modules/memcached/testdata/config.yaml b/src/go/plugin/go.d/modules/memcached/testdata/config.yaml new file mode 100644 index 00000000..1b81d09e --- /dev/null +++ b/src/go/plugin/go.d/modules/memcached/testdata/config.yaml @@ -0,0 +1,3 @@ +update_every: 123 +address: "ok" +timeout: 123.123 diff --git a/src/go/plugin/go.d/modules/memcached/testdata/stats.txt b/src/go/plugin/go.d/modules/memcached/testdata/stats.txt new file mode 100644 index 00000000..b9647cc1 --- /dev/null +++ b/src/go/plugin/go.d/modules/memcached/testdata/stats.txt @@ -0,0 +1,93 @@ +STAT pid 30783 +STAT uptime 5028 +STAT time 1721297802 +STAT version 1.6.24 +STAT libevent 2.1.12-stable +STAT pointer_size 64 +STAT rusage_user 1.026626 +STAT rusage_system 0.685365 +STAT max_connections 1024 +STAT curr_connections 3 +STAT total_connections 39 +STAT rejected_connections 0 +STAT connection_structures 6 +STAT response_obj_oom 0 +STAT response_obj_count 1 +STAT response_obj_bytes 65536 +STAT read_buf_count 9 +STAT read_buf_bytes 147456 +STAT read_buf_bytes_free 65536 +STAT read_buf_oom 0 +STAT reserved_fds 20 +STAT cmd_get 1 +STAT cmd_set 1 +STAT cmd_flush 0 +STAT cmd_touch 0 +STAT cmd_meta 0 +STAT get_hits 0 +STAT get_misses 1 +STAT get_expired 0 +STAT get_flushed 0 +STAT delete_misses 0 +STAT delete_hits 0 +STAT incr_misses 0 +STAT incr_hits 0 +STAT decr_misses 0 +STAT decr_hits 0 +STAT cas_misses 0 +STAT cas_hits 0 +STAT cas_badval 0 +STAT touch_hits 0 +STAT touch_misses 0 +STAT store_too_large 0 +STAT store_no_memory 0 +STAT auth_cmds 0 +STAT auth_errors 0 +STAT bytes_read 108662 +STAT bytes_written 9761348 +STAT limit_maxbytes 67108864 +STAT accepting_conns 1 +STAT listen_disabled_num 0 +STAT time_in_listen_disabled_us 0 +STAT threads 4 +STAT conn_yields 0 +STAT hash_power_level 16 +STAT hash_bytes 524288 +STAT hash_is_expanding 0 +STAT slab_reassign_rescues 0 +STAT slab_reassign_chunk_rescues 0 +STAT slab_reassign_evictions_nomem 0 +STAT slab_reassign_inline_reclaim 0 +STAT slab_reassign_busy_items 0 +STAT slab_reassign_busy_deletes 0 +STAT slab_reassign_running 0 +STAT slabs_moved 0 +STAT lru_crawler_running 0 +STAT lru_crawler_starts 13 +STAT lru_maintainer_juggles 9280 +STAT malloc_fails 0 +STAT log_worker_dropped 0 +STAT log_worker_written 0 +STAT log_watcher_skipped 0 +STAT log_watcher_sent 0 +STAT log_watchers 0 +STAT unexpected_napi_ids 0 +STAT round_robin_fallback 0 +STAT bytes 33 +STAT curr_items 0 +STAT total_items 1 +STAT slab_global_page_pool 0 +STAT expired_unfetched 1 +STAT evicted_unfetched 0 +STAT evicted_active 0 +STAT evictions 0 +STAT reclaimed 1 +STAT crawler_reclaimed 0 +STAT crawler_items_checked 0 +STAT lrutail_reflocked 0 +STAT moves_to_cold 1 +STAT moves_to_warm 0 +STAT moves_within_lru 0 +STAT direct_reclaims 0 +STAT lru_bumps_dropped 0 +END diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/README.md b/src/go/plugin/go.d/modules/mongodb/README.md index a2825305..a2825305 120000 --- a/src/go/collectors/go.d.plugin/modules/mongodb/README.md +++ b/src/go/plugin/go.d/modules/mongodb/README.md diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/charts.go b/src/go/plugin/go.d/modules/mongodb/charts.go index f1b9c1a0..af9dfcef 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/charts.go +++ b/src/go/plugin/go.d/modules/mongodb/charts.go @@ -3,7 +3,7 @@ package mongo import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/client.go b/src/go/plugin/go.d/modules/mongodb/client.go index eb36fa8a..eb36fa8a 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/client.go +++ b/src/go/plugin/go.d/modules/mongodb/client.go diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/collect.go b/src/go/plugin/go.d/modules/mongodb/collect.go index 232145de..232145de 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/collect.go +++ b/src/go/plugin/go.d/modules/mongodb/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/collect_dbstats.go b/src/go/plugin/go.d/modules/mongodb/collect_dbstats.go index edd7077e..3a20bee7 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/collect_dbstats.go +++ b/src/go/plugin/go.d/modules/mongodb/collect_dbstats.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func (m *Mongo) collectDbStats(mx map[string]int64) error { diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/collect_replsetgetstatus.go b/src/go/plugin/go.d/modules/mongodb/collect_replsetgetstatus.go index 235e8900..43d4168d 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/collect_replsetgetstatus.go +++ b/src/go/plugin/go.d/modules/mongodb/collect_replsetgetstatus.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) // https://www.mongodb.com/docs/manual/reference/replica-states/#replica-set-member-states diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/collect_serverstatus.go b/src/go/plugin/go.d/modules/mongodb/collect_serverstatus.go index 33fd86b7..86172638 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/collect_serverstatus.go +++ b/src/go/plugin/go.d/modules/mongodb/collect_serverstatus.go @@ -6,8 +6,8 @@ import ( "fmt" "reflect" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) // collectServerStatus creates the map[string]int64 for the available dims. diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/collect_sharding.go b/src/go/plugin/go.d/modules/mongodb/collect_sharding.go index 175004d3..43e9ae8b 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/collect_sharding.go +++ b/src/go/plugin/go.d/modules/mongodb/collect_sharding.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func (m *Mongo) collectSharding(mx map[string]int64) error { diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/config_schema.json b/src/go/plugin/go.d/modules/mongodb/config_schema.json index 40646818..fc5c42ef 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/config_schema.json +++ b/src/go/plugin/go.d/modules/mongodb/config_schema.json @@ -34,7 +34,7 @@ "properties": { "includes": { "title": "Include", - "description": "Include databases that match any of the specified include [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "description": "Include databases that match any of the specified include [patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme).", "type": [ "array", "null" @@ -47,7 +47,7 @@ }, "excludes": { "title": "Exclude", - "description": "Exclude databases that match any of the specified exclude [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "description": "Exclude databases that match any of the specified exclude [patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme).", "type": [ "array", "null" diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/documents.go b/src/go/plugin/go.d/modules/mongodb/documents.go index 5c95e952..5c95e952 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/documents.go +++ b/src/go/plugin/go.d/modules/mongodb/documents.go diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/init.go b/src/go/plugin/go.d/modules/mongodb/init.go index b881e871..b881e871 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/init.go +++ b/src/go/plugin/go.d/modules/mongodb/init.go diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/integrations/mongodb.md b/src/go/plugin/go.d/modules/mongodb/integrations/mongodb.md index ce72671c..e47c3865 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/integrations/mongodb.md +++ b/src/go/plugin/go.d/modules/mongodb/integrations/mongodb.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/mongodb/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/mongodb/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/mongodb/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/mongodb/metadata.yaml" sidebar_label: "MongoDB" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -331,6 +331,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `mongodb` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -353,4 +355,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m mongodb ``` +### Getting Logs + +If you're encountering problems with the `mongodb` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep mongodb +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep mongodb /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep mongodb +``` + diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/metadata.yaml b/src/go/plugin/go.d/modules/mongodb/metadata.yaml index bad65393..ae013539 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/metadata.yaml +++ b/src/go/plugin/go.d/modules/mongodb/metadata.yaml @@ -104,7 +104,7 @@ modules: Metrics of databases matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) - - Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#supported-format). + - Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#supported-format). - Syntax: ```yaml diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/mongodb.go b/src/go/plugin/go.d/modules/mongodb/mongodb.go index edc73f96..7b855025 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/mongodb.go +++ b/src/go/plugin/go.d/modules/mongodb/mongodb.go @@ -8,9 +8,9 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/mongodb_test.go b/src/go/plugin/go.d/modules/mongodb/mongodb_test.go index c7cf0f42..835ea20e 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/mongodb_test.go +++ b/src/go/plugin/go.d/modules/mongodb/mongodb_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/testdata/config.json b/src/go/plugin/go.d/modules/mongodb/testdata/config.json index bc3f94d8..bc3f94d8 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/testdata/config.json +++ b/src/go/plugin/go.d/modules/mongodb/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/testdata/config.yaml b/src/go/plugin/go.d/modules/mongodb/testdata/config.yaml index 03a11029..03a11029 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/mongodb/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/testdata/v6.0.3/dbStats.json b/src/go/plugin/go.d/modules/mongodb/testdata/v6.0.3/dbStats.json index 52a51320..52a51320 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/testdata/v6.0.3/dbStats.json +++ b/src/go/plugin/go.d/modules/mongodb/testdata/v6.0.3/dbStats.json diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/testdata/v6.0.3/mongod-serverStatus.json b/src/go/plugin/go.d/modules/mongodb/testdata/v6.0.3/mongod-serverStatus.json index 77f08392..77f08392 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/testdata/v6.0.3/mongod-serverStatus.json +++ b/src/go/plugin/go.d/modules/mongodb/testdata/v6.0.3/mongod-serverStatus.json diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/testdata/v6.0.3/mongos-serverStatus.json b/src/go/plugin/go.d/modules/mongodb/testdata/v6.0.3/mongos-serverStatus.json index ecf76671..ecf76671 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/testdata/v6.0.3/mongos-serverStatus.json +++ b/src/go/plugin/go.d/modules/mongodb/testdata/v6.0.3/mongos-serverStatus.json diff --git a/src/go/collectors/go.d.plugin/modules/mongodb/testdata/v6.0.3/replSetGetStatus.json b/src/go/plugin/go.d/modules/mongodb/testdata/v6.0.3/replSetGetStatus.json index c97a77f3..c97a77f3 100644 --- a/src/go/collectors/go.d.plugin/modules/mongodb/testdata/v6.0.3/replSetGetStatus.json +++ b/src/go/plugin/go.d/modules/mongodb/testdata/v6.0.3/replSetGetStatus.json diff --git a/src/go/plugin/go.d/modules/monit/README.md b/src/go/plugin/go.d/modules/monit/README.md new file mode 120000 index 00000000..ac69496f --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/README.md @@ -0,0 +1 @@ +integrations/monit.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/monit/charts.go b/src/go/plugin/go.d/modules/monit/charts.go new file mode 100644 index 00000000..58fcf6c7 --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/charts.go @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package monit + +import ( + "fmt" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioServiceCheckStatus = module.Priority + iota + prioUptime +) + +var baseCharts = module.Charts{ + uptimeChart.Copy(), +} + +var ( + uptimeChart = module.Chart{ + ID: "uptime", + Title: "Uptime", + Units: "seconds", + Fam: "uptime", + Ctx: "monit.uptime", + Priority: prioUptime, + Dims: module.Dims{ + {ID: "uptime"}, + }, + } +) + +var serviceCheckChartsTmpl = module.Charts{ + serviceCheckStatusChartTmpl.Copy(), +} + +var ( + serviceCheckStatusChartTmpl = module.Chart{ + ID: "service_check_type_%s_name_%s_status", + Title: "Service Check Status", + Units: "status", + Fam: "service status", + Ctx: "monit.service_check_status", + Priority: prioServiceCheckStatus, + Dims: module.Dims{ + {ID: "service_check_type_%s_name_%s_status_ok", Name: "ok"}, + {ID: "service_check_type_%s_name_%s_status_error", Name: "error"}, + {ID: "service_check_type_%s_name_%s_status_initializing", Name: "initializing"}, + {ID: "service_check_type_%s_name_%s_status_not_monitored", Name: "not_monitored"}, + }, + } +) + +func (m *Monit) addServiceCheckCharts(svc statusServiceCheck, srv *statusServer) { + charts := serviceCheckChartsTmpl.Copy() + + for _, chart := range *charts { + chart.ID = cleanChartId(fmt.Sprintf(chart.ID, svc.svcType(), svc.Name)) + chart.Labels = []module.Label{ + {Key: "server_hostname", Value: srv.LocalHostname}, + {Key: "service_check_name", Value: svc.Name}, + {Key: "service_check_type", Value: svc.svcType()}, + } + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf(dim.ID, svc.svcType(), svc.Name) + } + } + + if err := m.Charts().Add(*charts...); err != nil { + m.Warning(err) + } +} + +func (m *Monit) removeServiceCharts(svc statusServiceCheck) { + px := fmt.Sprintf("service_check_type_%s_name_%s_", svc.svcType(), svc.Name) + px = cleanChartId(px) + + for _, chart := range *m.Charts() { + if strings.HasPrefix(chart.ID, px) { + chart.MarkRemove() + chart.MarkNotCreated() + } + } +} + +func cleanChartId(s string) string { + r := strings.NewReplacer(" ", "_", ".", "_", ",", "_") + return r.Replace(s) +} diff --git a/src/go/plugin/go.d/modules/monit/collect.go b/src/go/plugin/go.d/modules/monit/collect.go new file mode 100644 index 00000000..580aa6d9 --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/collect.go @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package monit + +import ( + "encoding/xml" + "errors" + "fmt" + "io" + "net/http" + "net/url" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" + + "golang.org/x/net/html/charset" +) + +var ( + urlPathStatus = "/_status" + urlQueryStatus = url.Values{"format": {"xml"}, "level": {"full"}}.Encode() +) + +func (m *Monit) collect() (map[string]int64, error) { + mx := make(map[string]int64) + + if err := m.collectStatus(mx); err != nil { + return nil, err + } + + return mx, nil +} + +func (m *Monit) collectStatus(mx map[string]int64) error { + status, err := m.fetchStatus() + if err != nil { + return err + } + + if status.Server == nil { + // not Monit + return errors.New("invalid Monit status response: missing server data") + } + + mx["uptime"] = status.Server.Uptime + + seen := make(map[string]bool) + + for _, svc := range status.Services { + seen[svc.id()] = true + + if _, ok := m.seenServices[svc.id()]; !ok { + m.seenServices[svc.id()] = svc + m.addServiceCheckCharts(svc, status.Server) + } + + px := fmt.Sprintf("service_check_type_%s_name_%s_status_", svc.svcType(), svc.Name) + + for _, v := range []string{"not_monitored", "ok", "initializing", "error"} { + mx[px+v] = 0 + if svc.status() == v { + mx[px+v] = 1 + } + } + } + + for id, svc := range m.seenServices { + if !seen[id] { + delete(m.seenServices, id) + m.removeServiceCharts(svc) + } + } + + return nil +} + +func (m *Monit) fetchStatus() (*monitStatus, error) { + req, err := web.NewHTTPRequestWithPath(m.Request, urlPathStatus) + if err != nil { + return nil, err + } + req.URL.RawQuery = urlQueryStatus + + var status monitStatus + if err := m.doOKDecode(req, &status); err != nil { + return nil, err + } + + return &status, nil +} + +func (m *Monit) doOKDecode(req *http.Request, in interface{}) error { + resp, err := m.httpClient.Do(req) + if err != nil { + return fmt.Errorf("error on HTTP request '%s': %v", req.URL, err) + } + defer closeBody(resp) + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("'%s' returned HTTP status code: %d", req.URL, resp.StatusCode) + } + + dec := xml.NewDecoder(resp.Body) + dec.CharsetReader = charset.NewReaderLabel + + if err := dec.Decode(in); err != nil { + return fmt.Errorf("error on decoding XML response from '%s': %v", req.URL, err) + } + + return nil +} + +func closeBody(resp *http.Response) { + if resp != nil && resp.Body != nil { + _, _ = io.Copy(io.Discard, resp.Body) + _ = resp.Body.Close() + } +} diff --git a/src/go/plugin/go.d/modules/monit/config_schema.json b/src/go/plugin/go.d/modules/monit/config_schema.json new file mode 100644 index 00000000..4d23760b --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/config_schema.json @@ -0,0 +1,185 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Monit collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "url": { + "title": "URL", + "description": "The base URL of the Monit server.", + "type": "string", + "default": "http://127.0.0.1:2812", + "format": "uri" + }, + "timeout": { + "title": "Timeout", + "description": "The timeout in seconds for the HTTP request.", + "type": "number", + "minimum": 0.5, + "default": 1 + }, + "not_follow_redirects": { + "title": "Not follow redirects", + "description": "If set, the client will not follow HTTP redirects automatically.", + "type": "boolean" + }, + "username": { + "title": "Username", + "description": "The username for basic authentication.", + "type": "string", + "sensitive": true, + "default": "admin" + }, + "password": { + "title": "Password", + "description": "The password for basic authentication.", + "type": "string", + "sensitive": true, + "default": "monit" + }, + "proxy_url": { + "title": "Proxy URL", + "description": "The URL of the proxy server.", + "type": "string" + }, + "proxy_username": { + "title": "Proxy username", + "description": "The username for proxy authentication.", + "type": "string", + "sensitive": true + }, + "proxy_password": { + "title": "Proxy password", + "description": "The password for proxy authentication.", + "type": "string", + "sensitive": true + }, + "headers": { + "title": "Headers", + "description": "Additional HTTP headers to include in the request.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "tls_skip_verify": { + "title": "Skip TLS verification", + "description": "If set, TLS certificate verification will be skipped.", + "type": "boolean" + }, + "tls_ca": { + "title": "TLS CA", + "description": "The path to the CA certificate file for TLS verification.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_cert": { + "title": "TLS certificate", + "description": "The path to the client certificate file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_key": { + "title": "TLS key", + "description": "The path to the client key file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "body": { + "title": "Body", + "type": "string" + }, + "method": { + "title": "Method", + "type": "string" + } + }, + "required": [ + "url" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "body": { + "ui:widget": "hidden" + }, + "method": { + "ui:widget": "hidden" + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, + "password": { + "ui:widget": "password" + }, + "proxy_password": { + "ui:widget": "password" + }, + "ui:flavour": "tabs", + "ui:options": { + "tabs": [ + { + "title": "Base", + "fields": [ + "update_every", + "url", + "timeout", + "not_follow_redirects" + ] + }, + { + "title": "Auth", + "fields": [ + "username", + "password" + ] + }, + { + "title": "TLS", + "fields": [ + "tls_skip_verify", + "tls_ca", + "tls_cert", + "tls_key" + ] + }, + { + "title": "Proxy", + "fields": [ + "proxy_url", + "proxy_username", + "proxy_password" + ] + }, + { + "title": "Headers", + "fields": [ + "headers" + ] + } + ] + } + } +} diff --git a/src/go/plugin/go.d/modules/monit/integrations/monit.md b/src/go/plugin/go.d/modules/monit/integrations/monit.md new file mode 100644 index 00000000..8d3739ac --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/integrations/monit.md @@ -0,0 +1,255 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/monit/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/monit/metadata.yaml" +sidebar_label: "Monit" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Synthetic Checks" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Monit + + +<img src="https://netdata.cloud/img/monit.png" width="150"/> + + +Plugin: go.d.plugin +Module: monit + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +This collector monitors status of Monit's service checks. + + +It sends HTTP requests to the Monit `/_status?format=xml&level=full` endpoint. + + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +By default, it detects Monit instances running on localhost that are listening on port 2812. +On startup, it tries to collect metrics from: + +- http://127.0.0.1:2812 + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per service + +These metrics refer to the monitored Service. + +Labels: + +| Label | Description | +|:-----------|:----------------| +| server_hostname | Hostname of the Monit server. | +| service_check_name | Service check name. | +| service_check_type | Service check type. | + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| monit.service_check_status | ok, error, initializing, not_monitored | status | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +#### Enable TCP PORT + +See [Syntax for TCP port](https://mmonit.com/monit/documentation/monit.html#TCP-PORT) for details. + + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/monit.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/monit.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| url | Server URL. | http://127.0.0.1:2812 | yes | +| timeout | HTTP request timeout. | 1 | no | +| username | Username for basic HTTP authentication. | admin | no | +| password | Password for basic HTTP authentication. | monit | no | +| proxy_url | Proxy URL. | | no | +| proxy_username | Username for proxy basic HTTP authentication. | | no | +| proxy_password | Password for proxy basic HTTP authentication. | | no | +| method | HTTP request method. | GET | no | +| body | HTTP request body. | | no | +| headers | HTTP request headers. | | no | +| not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no | +| tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no | +| tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no | +| tls_cert | Client TLS certificate. | | no | +| tls_key | Client TLS key. | | no | + +</details> + +#### Examples + +##### HTTP authentication + +Basic HTTP authentication. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + url: http://127.0.0.1:2812 + username: admin + password: monit + +``` +</details> + +##### HTTPS with self-signed certificate + +With enabled HTTPS and self-signed certificate. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + url: http://127.0.0.1:2812 + tls_skip_verify: yes + +``` +</details> + +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + url: http://127.0.0.1:2812 + + - name: remote + url: http://192.0.2.1:2812 + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `monit` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m monit + ``` + +### Getting Logs + +If you're encountering problems with the `monit` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep monit +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep monit /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep monit +``` + + diff --git a/src/go/plugin/go.d/modules/monit/metadata.yaml b/src/go/plugin/go.d/modules/monit/metadata.yaml new file mode 100644 index 00000000..d5479398 --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/metadata.yaml @@ -0,0 +1,193 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-monit + plugin_name: go.d.plugin + module_name: monit + monitored_instance: + name: Monit + link: https://mmonit.com/monit/ + categories: + - data-collection.synthetic-checks + icon_filename: monit.png + related_resources: + integrations: + list: [] + alternative_monitored_instances: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - monit + - mmonit + - supervision tool + - monitrc + most_popular: false + overview: + data_collection: + metrics_description: | + This collector monitors status of Monit's service checks. + method_description: | + It sends HTTP requests to the Monit `/_status?format=xml&level=full` endpoint. + default_behavior: + auto_detection: + description: | + By default, it detects Monit instances running on localhost that are listening on port 2812. + On startup, it tries to collect metrics from: + + - http://127.0.0.1:2812 + limits: + description: "" + performance_impact: + description: "" + additional_permissions: + description: "" + multi_instance: true + supported_platforms: + include: [] + exclude: [] + setup: + prerequisites: + list: + - title: Enable TCP PORT + description: + See [Syntax for TCP port](https://mmonit.com/monit/documentation/monit.html#TCP-PORT) for details. + configuration: + file: + name: go.d/monit.conf + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: url + description: Server URL. + default_value: http://127.0.0.1:2812 + required: true + - name: timeout + description: HTTP request timeout. + default_value: 1 + required: false + - name: username + description: Username for basic HTTP authentication. + default_value: "admin" + required: false + - name: password + description: Password for basic HTTP authentication. + default_value: "monit" + required: false + - name: proxy_url + description: Proxy URL. + default_value: "" + required: false + - name: proxy_username + description: Username for proxy basic HTTP authentication. + default_value: "" + required: false + - name: proxy_password + description: Password for proxy basic HTTP authentication. + default_value: "" + required: false + - name: method + description: HTTP request method. + default_value: GET + required: false + - name: body + description: HTTP request body. + default_value: "" + required: false + - name: headers + description: HTTP request headers. + default_value: "" + required: false + - name: not_follow_redirects + description: Redirect handling policy. Controls whether the client follows redirects. + default_value: false + required: false + - name: tls_skip_verify + description: Server certificate chain and hostname validation policy. Controls whether the client performs this check. + default_value: false + required: false + - name: tls_ca + description: Certification authority that the client uses when verifying the server's certificates. + default_value: "" + required: false + - name: tls_cert + description: Client TLS certificate. + default_value: "" + required: false + - name: tls_key + description: Client TLS key. + default_value: "" + required: false + examples: + folding: + title: Config + enabled: true + list: + - name: HTTP authentication + description: Basic HTTP authentication. + config: | + jobs: + - name: local + url: http://127.0.0.1:2812 + username: admin + password: monit + - name: HTTPS with self-signed certificate + description: With enabled HTTPS and self-signed certificate. + config: | + jobs: + - name: local + url: http://127.0.0.1:2812 + tls_skip_verify: yes + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + url: http://127.0.0.1:2812 + + - name: remote + url: http://192.0.2.1:2812 + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: service + description: These metrics refer to the monitored Service. + labels: + - name: server_hostname + description: Hostname of the Monit server. + - name: service_check_name + description: Service check name. + - name: service_check_type + description: Service check type. + metrics: + - name: monit.service_check_status + description: Service Check Status + unit: status + chart_type: line + dimensions: + - name: ok + - name: error + - name: initializing + - name: not_monitored diff --git a/src/go/plugin/go.d/modules/monit/monit.go b/src/go/plugin/go.d/modules/monit/monit.go new file mode 100644 index 00000000..d0fe90b1 --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/monit.go @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package monit + +import ( + _ "embed" + "errors" + "net/http" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("monit", module.Creator{ + Create: func() module.Module { return New() }, + JobConfigSchema: configSchema, + Config: func() any { return &Config{} }, + }) +} + +func New() *Monit { + return &Monit{ + Config: Config{ + HTTP: web.HTTP{ + Request: web.Request{ + URL: "http://127.0.0.1:2812", + Username: "admin", + Password: "monit", + }, + Client: web.Client{ + Timeout: web.Duration(time.Second), + }, + }, + }, + charts: baseCharts.Copy(), + seenServices: make(map[string]statusServiceCheck), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + web.HTTP `yaml:",inline" json:""` +} + +type Monit struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + httpClient *http.Client + + seenServices map[string]statusServiceCheck +} + +func (m *Monit) Configuration() any { + return m.Config +} + +func (m *Monit) Init() error { + if m.URL == "" { + m.Error("config: monit url is required but not set") + return errors.New("config: missing URL") + } + + httpClient, err := web.NewHTTPClient(m.Client) + if err != nil { + m.Errorf("init HTTP client: %v", err) + return err + } + m.httpClient = httpClient + + m.Debugf("using URL %s", m.URL) + m.Debugf("using timeout: %s", m.Timeout) + + return nil +} + +func (m *Monit) Check() error { + mx, err := m.collect() + if err != nil { + m.Error(err) + return err + } + if len(mx) == 0 { + return errors.New("no metrics collected") + + } + return nil +} + +func (m *Monit) Charts() *module.Charts { + return m.charts +} + +func (m *Monit) Collect() map[string]int64 { + mx, err := m.collect() + if err != nil { + m.Error(err) + } + + if len(mx) == 0 { + return nil + } + return mx +} + +func (m *Monit) Cleanup() { + if m.httpClient != nil { + m.httpClient.CloseIdleConnections() + } +} diff --git a/src/go/plugin/go.d/modules/monit/monit_test.go b/src/go/plugin/go.d/modules/monit/monit_test.go new file mode 100644 index 00000000..7735dcdc --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/monit_test.go @@ -0,0 +1,371 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package monit + +import ( + "net/http" + "net/http/httptest" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataStatus, _ = os.ReadFile("testdata/v5.33.0/status.xml") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + "dataStatus": dataStatus, + } { + require.NotNil(t, data, name) + + } +} + +func TestMonit_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &Monit{}, dataConfigJSON, dataConfigYAML) +} + +func TestMonit_Init(t *testing.T) { + tests := map[string]struct { + wantFail bool + config Config + }{ + "success with default": { + wantFail: false, + config: New().Config, + }, + "fail when URL not set": { + wantFail: true, + config: Config{ + HTTP: web.HTTP{ + Request: web.Request{URL: ""}, + }, + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + monit := New() + monit.Config = test.config + + if test.wantFail { + assert.Error(t, monit.Init()) + } else { + assert.NoError(t, monit.Init()) + } + }) + } +} + +func TestMonit_Check(t *testing.T) { + tests := map[string]struct { + wantFail bool + prepare func(t *testing.T) (monit *Monit, cleanup func()) + }{ + "success on valid response": { + wantFail: false, + prepare: caseOk, + }, + "fail on unexpected XML response": { + wantFail: true, + prepare: caseUnexpectedXMLResponse, + }, + "fail on invalid data response": { + wantFail: true, + prepare: caseInvalidDataResponse, + }, + "fail on connection refused": { + wantFail: true, + prepare: caseConnectionRefused, + }, + "fail on 404 response": { + wantFail: true, + prepare: case404, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + monit, cleanup := test.prepare(t) + defer cleanup() + + if test.wantFail { + assert.Error(t, monit.Check()) + } else { + assert.NoError(t, monit.Check()) + } + }) + } +} + +func TestMonit_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestMonit_Collect(t *testing.T) { + tests := map[string]struct { + prepare func(t *testing.T) (monit *Monit, cleanup func()) + wantNumOfCharts int + wantMetrics map[string]int64 + }{ + "success on valid response": { + prepare: caseOk, + wantNumOfCharts: len(baseCharts) + len(serviceCheckChartsTmpl)*25, + wantMetrics: map[string]int64{ + "service_check_type_directory_name_directoryAlert_status_error": 1, + "service_check_type_directory_name_directoryAlert_status_initializing": 0, + "service_check_type_directory_name_directoryAlert_status_not_monitored": 0, + "service_check_type_directory_name_directoryAlert_status_ok": 0, + "service_check_type_directory_name_directoryDisabled_status_error": 0, + "service_check_type_directory_name_directoryDisabled_status_initializing": 0, + "service_check_type_directory_name_directoryDisabled_status_not_monitored": 1, + "service_check_type_directory_name_directoryDisabled_status_ok": 0, + "service_check_type_directory_name_directoryNotExists_status_error": 1, + "service_check_type_directory_name_directoryNotExists_status_initializing": 0, + "service_check_type_directory_name_directoryNotExists_status_not_monitored": 0, + "service_check_type_directory_name_directoryNotExists_status_ok": 0, + "service_check_type_directory_name_directoryOk_status_error": 0, + "service_check_type_directory_name_directoryOk_status_initializing": 0, + "service_check_type_directory_name_directoryOk_status_not_monitored": 0, + "service_check_type_directory_name_directoryOk_status_ok": 1, + "service_check_type_file_name_fileAlert_status_error": 1, + "service_check_type_file_name_fileAlert_status_initializing": 0, + "service_check_type_file_name_fileAlert_status_not_monitored": 0, + "service_check_type_file_name_fileAlert_status_ok": 0, + "service_check_type_file_name_fileDisabled_status_error": 0, + "service_check_type_file_name_fileDisabled_status_initializing": 0, + "service_check_type_file_name_fileDisabled_status_not_monitored": 1, + "service_check_type_file_name_fileDisabled_status_ok": 0, + "service_check_type_file_name_fileNotExists_status_error": 1, + "service_check_type_file_name_fileNotExists_status_initializing": 0, + "service_check_type_file_name_fileNotExists_status_not_monitored": 0, + "service_check_type_file_name_fileNotExists_status_ok": 0, + "service_check_type_file_name_fileOk_status_error": 0, + "service_check_type_file_name_fileOk_status_initializing": 0, + "service_check_type_file_name_fileOk_status_not_monitored": 0, + "service_check_type_file_name_fileOk_status_ok": 1, + "service_check_type_filesystem_name_filesystemAlert_status_error": 1, + "service_check_type_filesystem_name_filesystemAlert_status_initializing": 0, + "service_check_type_filesystem_name_filesystemAlert_status_not_monitored": 0, + "service_check_type_filesystem_name_filesystemAlert_status_ok": 0, + "service_check_type_filesystem_name_filesystemDisabled_status_error": 0, + "service_check_type_filesystem_name_filesystemDisabled_status_initializing": 0, + "service_check_type_filesystem_name_filesystemDisabled_status_not_monitored": 1, + "service_check_type_filesystem_name_filesystemDisabled_status_ok": 0, + "service_check_type_filesystem_name_filesystemNotExists_status_error": 1, + "service_check_type_filesystem_name_filesystemNotExists_status_initializing": 0, + "service_check_type_filesystem_name_filesystemNotExists_status_not_monitored": 0, + "service_check_type_filesystem_name_filesystemNotExists_status_ok": 0, + "service_check_type_filesystem_name_filsystemOk_status_error": 0, + "service_check_type_filesystem_name_filsystemOk_status_initializing": 0, + "service_check_type_filesystem_name_filsystemOk_status_not_monitored": 0, + "service_check_type_filesystem_name_filsystemOk_status_ok": 1, + "service_check_type_host_name_hostAlert_status_error": 1, + "service_check_type_host_name_hostAlert_status_initializing": 0, + "service_check_type_host_name_hostAlert_status_not_monitored": 0, + "service_check_type_host_name_hostAlert_status_ok": 0, + "service_check_type_host_name_hostDisabled_status_error": 0, + "service_check_type_host_name_hostDisabled_status_initializing": 0, + "service_check_type_host_name_hostDisabled_status_not_monitored": 1, + "service_check_type_host_name_hostDisabled_status_ok": 0, + "service_check_type_host_name_hostNotExists_status_error": 1, + "service_check_type_host_name_hostNotExists_status_initializing": 0, + "service_check_type_host_name_hostNotExists_status_not_monitored": 0, + "service_check_type_host_name_hostNotExists_status_ok": 0, + "service_check_type_host_name_hostOk_status_error": 0, + "service_check_type_host_name_hostOk_status_initializing": 0, + "service_check_type_host_name_hostOk_status_not_monitored": 0, + "service_check_type_host_name_hostOk_status_ok": 1, + "service_check_type_network_name_networkAlert_status_error": 1, + "service_check_type_network_name_networkAlert_status_initializing": 0, + "service_check_type_network_name_networkAlert_status_not_monitored": 0, + "service_check_type_network_name_networkAlert_status_ok": 0, + "service_check_type_network_name_networkDisabled_status_error": 0, + "service_check_type_network_name_networkDisabled_status_initializing": 0, + "service_check_type_network_name_networkDisabled_status_not_monitored": 1, + "service_check_type_network_name_networkDisabled_status_ok": 0, + "service_check_type_network_name_networkNotExists_status_error": 1, + "service_check_type_network_name_networkNotExists_status_initializing": 0, + "service_check_type_network_name_networkNotExists_status_not_monitored": 0, + "service_check_type_network_name_networkNotExists_status_ok": 0, + "service_check_type_network_name_networkOk_status_error": 0, + "service_check_type_network_name_networkOk_status_initializing": 0, + "service_check_type_network_name_networkOk_status_not_monitored": 0, + "service_check_type_network_name_networkOk_status_ok": 1, + "service_check_type_process_name_processAlert_status_error": 1, + "service_check_type_process_name_processAlert_status_initializing": 0, + "service_check_type_process_name_processAlert_status_not_monitored": 0, + "service_check_type_process_name_processAlert_status_ok": 0, + "service_check_type_process_name_processDisabled_status_error": 0, + "service_check_type_process_name_processDisabled_status_initializing": 0, + "service_check_type_process_name_processDisabled_status_not_monitored": 1, + "service_check_type_process_name_processDisabled_status_ok": 0, + "service_check_type_process_name_processNotExists_status_error": 1, + "service_check_type_process_name_processNotExists_status_initializing": 0, + "service_check_type_process_name_processNotExists_status_not_monitored": 0, + "service_check_type_process_name_processNotExists_status_ok": 0, + "service_check_type_process_name_processOk_status_error": 0, + "service_check_type_process_name_processOk_status_initializing": 0, + "service_check_type_process_name_processOk_status_not_monitored": 0, + "service_check_type_process_name_processOk_status_ok": 1, + "service_check_type_system_name_pve-deb-work_status_error": 0, + "service_check_type_system_name_pve-deb-work_status_initializing": 0, + "service_check_type_system_name_pve-deb-work_status_not_monitored": 0, + "service_check_type_system_name_pve-deb-work_status_ok": 1, + "uptime": 33, + }, + }, + "fail on unexpected XML response": { + prepare: caseUnexpectedXMLResponse, + wantNumOfCharts: len(baseCharts), + wantMetrics: nil, + }, + "fail on invalid data response": { + prepare: caseInvalidDataResponse, + wantNumOfCharts: len(baseCharts), + wantMetrics: nil, + }, + "fail on connection refused": { + prepare: caseConnectionRefused, + wantNumOfCharts: len(baseCharts), + wantMetrics: nil, + }, + "fail on 404 response": { + prepare: case404, + wantNumOfCharts: len(baseCharts), + wantMetrics: nil, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + monit, cleanup := test.prepare(t) + defer cleanup() + + _ = monit.Check() + + mx := monit.Collect() + + require.Equal(t, test.wantMetrics, mx) + + if len(test.wantMetrics) > 0 { + module.TestMetricsHasAllChartsDims(t, monit.Charts(), mx) + assert.Equal(t, test.wantNumOfCharts, len(*monit.Charts()), "want number of charts") + } + }) + } +} + +func caseOk(t *testing.T) (*Monit, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != urlPathStatus || r.URL.RawQuery != urlQueryStatus { + w.WriteHeader(http.StatusNotFound) + return + } + _, _ = w.Write(dataStatus) + })) + monit := New() + monit.URL = srv.URL + require.NoError(t, monit.Init()) + + return monit, srv.Close +} + +func caseUnexpectedXMLResponse(t *testing.T) (*Monit, func()) { + t.Helper() + data := `<?xml version="1.0" encoding="UTF-8"?> +<Response> + <Status> + <Code>200</Code> + <Message>Success</Message> + </Status> + <Data> + <User> + <ID>12345</ID> + <Name>John Doe</Name> + <Email>johndoe@example.com</Email> + <Roles> + <Role>Admin</Role> + <Role>User</Role> + </Roles> + </User> + <Order> + <OrderID>98765</OrderID> + <Date>2024-08-15</Date> + <Items> + <Item> + <Name>Widget A</Name> + <Quantity>2</Quantity> + <Price>19.99</Price> + </Item> + <Item> + <Name>Gadget B</Name> + <Quantity>1</Quantity> + <Price>99.99</Price> + </Item> + </Items> + <Total>139.97</Total> + </Order> + </Data> +</Response> +` + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte(data)) + })) + monit := New() + monit.URL = srv.URL + require.NoError(t, monit.Init()) + + return monit, srv.Close +} + +func caseInvalidDataResponse(t *testing.T) (*Monit, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte("hello and\n goodbye")) + })) + monit := New() + monit.URL = srv.URL + require.NoError(t, monit.Init()) + + return monit, srv.Close +} + +func caseConnectionRefused(t *testing.T) (*Monit, func()) { + t.Helper() + monit := New() + monit.URL = "http://127.0.0.1:65001" + require.NoError(t, monit.Init()) + + return monit, func() {} +} + +func case404(t *testing.T) (*Monit, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotFound) + })) + monit := New() + monit.URL = srv.URL + require.NoError(t, monit.Init()) + + return monit, srv.Close +} diff --git a/src/go/plugin/go.d/modules/monit/status.go b/src/go/plugin/go.d/modules/monit/status.go new file mode 100644 index 00000000..4a87e8c9 --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/status.go @@ -0,0 +1,153 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package monit + +// status_xml(): https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/http/xml.c#lines-631 +type monitStatus struct { + Server *statusServer `xml:"server"` + Services []statusServiceCheck `xml:"service"` +} + +type statusServer struct { + ID string `xml:"id"` + Version string `xml:"version"` + Uptime int64 `xml:"uptime"` + LocalHostname string `xml:"localhostname"` +} + +// status_service(): https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/http/xml.c#lines-196 +// struct Service_T: https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/monit.h#lines-1212 +type statusServiceCheck struct { + Type string `xml:"type,attr"` + Name string `xml:"name"` + + Status int `xml:"status"` // Error flags bitmap + + // https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/monit.h#lines-269 + MonitoringStatus int `xml:"monitor"` + + // https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/monit.h#lines-254 + MonitorMode int `xml:"monitormode"` + + // https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/monit.h#lines-261 + OnReboot int `xml:"onreboot"` + + // https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/monit.h#lines-248 + PendingAction int `xml:"pendingaction"` +} + +func (s *statusServiceCheck) id() string { + return s.svcType() + ":" + s.Name +} + +func (s *statusServiceCheck) svcType() string { + // See enum Service_Type https://bitbucket.org/tildeslash/monit/src/master/src/monit.h + + switch s.Type { + case "0": + return "filesystem" + case "1": + return "directory" + case "2": + return "file" + case "3": + return "process" + case "4": + return "host" + case "5": + return "system" + case "6": + return "fifo" + case "7": + return "program" + case "8": + return "network" + default: + return "unknown" + } +} + +func (s *statusServiceCheck) status() string { + // https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/http/cervlet.c#lines-2866 + + switch st := s.monitoringStatus(); st { + case "not_monitored", "initializing": + return st + default: + if s.Status != 0 { + return "error" + } + return "ok" + } +} + +func (s *statusServiceCheck) monitoringStatus() string { + switch s.MonitoringStatus { + case 0: + return "not_monitored" + case 1: + return "monitored" + case 2: + return "initializing" + case 4: + return "waiting" + default: + return "unknown" + } +} + +func (s *statusServiceCheck) monitorMode() string { + switch s.MonitorMode { + case 0: + return "active" + case 1: + return "passive" + default: + return "unknown" + } +} + +func (s *statusServiceCheck) onReboot() string { + switch s.OnReboot { + case 0: + return "start" + case 1: + return "no_start" + default: + return "unknown" + } +} + +func (s *statusServiceCheck) pendingAction() string { + switch s.PendingAction { + case 0: + return "ignored" + case 1: + return "alert" + case 2: + return "restart" + case 3: + return "stop" + case 4: + return "exec" + case 5: + return "unmonitor" + case 6: + return "start" + case 7: + return "monitor" + default: + return "unknown" + } +} + +func (s *statusServiceCheck) hasServiceStatus() bool { + // https://bitbucket.org/tildeslash/monit/src/5467d37d70c3c63c5760cddb93831bde4e17c14b/src/util.c#lines-1721 + + const eventNonExist = 512 + const eventData = 2048 + + return s.monitoringStatus() == "monitored" && + !(s.Status&eventNonExist != 0) && + !(s.Status&eventData != 0) +} diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/config.json b/src/go/plugin/go.d/modules/monit/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/config.json +++ b/src/go/plugin/go.d/modules/monit/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/config.yaml b/src/go/plugin/go.d/modules/monit/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/monit/testdata/config.yaml diff --git a/src/go/plugin/go.d/modules/monit/testdata/v5.33.0/status.xml b/src/go/plugin/go.d/modules/monit/testdata/v5.33.0/status.xml new file mode 100644 index 00000000..ca4178c6 --- /dev/null +++ b/src/go/plugin/go.d/modules/monit/testdata/v5.33.0/status.xml @@ -0,0 +1,688 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<monit> + <server> + <id>309dc5d56ccd5964cef9b42d1d8305e7</id> + <incarnation>1723810534</incarnation> + <version>5.33.0</version> + <uptime>33</uptime> + <poll>120</poll> + <startdelay>0</startdelay> + <localhostname>pve-deb-work</localhostname> + <controlfile>/etc/monit/monitrc</controlfile> + <httpd> + <address>127.0.0.1</address> + <port>2812</port> + <ssl>0</ssl> + </httpd> + </server> + <platform> + <name>Linux</name> + <release>6.1.0-23-amd64</release> + <version>#1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15)</version> + <machine>x86_64</machine> + <cpu>16</cpu> + <memory>32864100</memory> + <swap>262140</swap> + </platform> + <service type="3"> + <name>processOk</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>86510</collected_usec> + <status>0</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <pid>843</pid> + <ppid>1</ppid> + <uid>0</uid> + <euid>0</euid> + <gid>0</gid> + <uptime>66112</uptime> + <threads>1</threads> + <children>2</children> + <memory> + <percent>0.0</percent> + <percenttotal>0.1</percenttotal> + <kilobyte>5036</kilobyte> + <kilobytetotal>34156</kilobytetotal> + </memory> + <cpu> + <percent>-1.0</percent> + <percenttotal>-1.0</percenttotal> + </cpu> + <filedescriptors> + <open>9</open> + <opentotal>34</opentotal> + <limit> + <soft>8192</soft> + <hard>8192</hard> + </limit> + </filedescriptors> + <read> + <bytesgeneric> + <count>0</count> + <total>1733465</total> + </bytesgeneric> + <bytes> + <count>0</count> + <total>135168</total> + </bytes> + <operations> + <count>0</count> + <total>23145</total> + </operations> + </read> + <write> + <bytesgeneric> + <count>0</count> + <total>8842272</total> + </bytesgeneric> + <bytes> + <count>0</count> + <total>9150464</total> + </bytes> + <operations> + <count>0</count> + <total>22890</total> + </operations> + </write> + </service> + <service type="3"> + <name>processDisabled</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>68402</collected_usec> + <status>0</status> + <status_hint>0</status_hint> + <monitor>0</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + </service> + <service type="3"> + <name>processAlert</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>86548</collected_usec> + <status>2</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <pid>843</pid> + <ppid>1</ppid> + <uid>0</uid> + <euid>0</euid> + <gid>0</gid> + <uptime>66112</uptime> + <threads>1</threads> + <children>2</children> + <memory> + <percent>0.0</percent> + <percenttotal>0.1</percenttotal> + <kilobyte>5036</kilobyte> + <kilobytetotal>34156</kilobytetotal> + </memory> + <cpu> + <percent>-1.0</percent> + <percenttotal>-1.0</percenttotal> + </cpu> + <filedescriptors> + <open>9</open> + <opentotal>34</opentotal> + <limit> + <soft>8192</soft> + <hard>8192</hard> + </limit> + </filedescriptors> + <read> + <bytesgeneric> + <count>0</count> + <total>1733465</total> + </bytesgeneric> + <bytes> + <count>0</count> + <total>135168</total> + </bytes> + <operations> + <count>0</count> + <total>23145</total> + </operations> + </read> + <write> + <bytesgeneric> + <count>0</count> + <total>8842272</total> + </bytesgeneric> + <bytes> + <count>0</count> + <total>9150464</total> + </bytes> + <operations> + <count>0</count> + <total>22890</total> + </operations> + </write> + </service> + <service type="3"> + <name>processNotExists</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>86595</collected_usec> + <status>4608</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + </service> + <service type="0"> + <name>filsystemOk</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>86891</collected_usec> + <status>0</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <fstype>ext2</fstype> + <fsflags>rw,relatime</fsflags> + <mode>660</mode> + <uid>0</uid> + <gid>6</gid> + <block> + <percent>19.6</percent> + <usage>92.0</usage> + <total>469.4</total> + </block> + <inode> + <percent>0.3</percent> + <usage>356</usage> + <total>124928</total> + </inode> + <read> + <bytes> + <count>0</count> + <total>5706752</total> + </bytes> + <operations> + <count>0</count> + <total>210</total> + </operations> + </read> + <write> + <bytes> + <count>0</count> + <total>1024</total> + </bytes> + <operations> + <count>0</count> + <total>1</total> + </operations> + </write> + <servicetime> + <read>0.000</read> + <write>0.000</write> + </servicetime> + </service> + <service type="0"> + <name>filesystemDisabled</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>68613</collected_usec> + <status>0</status> + <status_hint>0</status_hint> + <monitor>0</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + </service> + <service type="0"> + <name>filesystemAlert</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>87124</collected_usec> + <status>384</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <fstype>ext2</fstype> + <fsflags>rw,relatime</fsflags> + <mode>660</mode> + <uid>0</uid> + <gid>6</gid> + <block> + <percent>19.6</percent> + <usage>92.0</usage> + <total>469.4</total> + </block> + <inode> + <percent>0.3</percent> + <usage>356</usage> + <total>124928</total> + </inode> + <read> + <bytes> + <count>0</count> + <total>5706752</total> + </bytes> + <operations> + <count>0</count> + <total>210</total> + </operations> + </read> + <write> + <bytes> + <count>0</count> + <total>1024</total> + </bytes> + <operations> + <count>0</count> + <total>1</total> + </operations> + </write> + <servicetime> + <read>0.000</read> + <write>0.000</write> + </servicetime> + </service> + <service type="0"> + <name>filesystemNotExists</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>87334</collected_usec> + <status>512</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + </service> + <service type="2"> + <name>fileOk</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>87339</collected_usec> + <status>0</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <mode>755</mode> + <uid>0</uid> + <gid>0</gid> + <timestamps> + <access>1723744256</access> + <change>1723744256</change> + <modify>1723744256</modify> + </timestamps> + <size>84820392</size> + </service> + <service type="2"> + <name>fileDisabled</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>68835</collected_usec> + <status>0</status> + <status_hint>0</status_hint> + <monitor>0</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + </service> + <service type="2"> + <name>fileAlert</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>87356</collected_usec> + <status>384</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <mode>755</mode> + <uid>0</uid> + <gid>0</gid> + <timestamps> + <access>1723744256</access> + <change>1723744256</change> + <modify>1723744256</modify> + </timestamps> + <size>84820392</size> + </service> + <service type="2"> + <name>fileNotExists</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>87371</collected_usec> + <status>512</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + </service> + <service type="1"> + <name>directoryOk</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>87375</collected_usec> + <status>0</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <mode>775</mode> + <uid>0</uid> + <gid>0</gid> + <timestamps> + <access>1723740545</access> + <change>1720694060</change> + <modify>1720694060</modify> + </timestamps> + </service> + <service type="1"> + <name>directoryDisabled</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>68957</collected_usec> + <status>0</status> + <status_hint>0</status_hint> + <monitor>0</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + </service> + <service type="1"> + <name>directoryAlert</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>87385</collected_usec> + <status>64</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <mode>775</mode> + <uid>0</uid> + <gid>0</gid> + <timestamps> + <access>1723740545</access> + <change>1720694060</change> + <modify>1720694060</modify> + </timestamps> + </service> + <service type="1"> + <name>directoryNotExists</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>87400</collected_usec> + <status>512</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + </service> + <service type="4"> + <name>hostOk</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>89652</collected_usec> + <status>0</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <icmp> + <type>Ping</type> + <responsetime>0.000144</responsetime> + </icmp> + <port> + <hostname>10.20.4.200</hostname> + <portnumber>19999</portnumber> + <request><![CDATA[/api/v1/info]]></request> + <protocol>HTTP</protocol> + <type>TCP</type> + <responsetime>0.002077</responsetime> + </port> + </service> + <service type="4"> + <name>hostDisabled</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>69066</collected_usec> + <status>0</status> + <status_hint>0</status_hint> + <monitor>0</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + </service> + <service type="4"> + <name>hostAlert</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>89857</collected_usec> + <status>32</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <icmp> + <type>Ping</type> + <responsetime>0.000069</responsetime> + </icmp> + <port> + <hostname>10.20.4.200</hostname> + <portnumber>19991</portnumber> + <request><![CDATA[/api/v1/info]]></request> + <protocol>HTTP</protocol> + <type>TCP</type> + <responsetime>-1.000000</responsetime> + </port> + </service> + <service type="4"> + <name>hostNotExists</name> + <collected_sec>1723810549</collected_sec> + <collected_usec>94459</collected_usec> + <status>16384</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <icmp> + <type>Ping</type> + <responsetime>-1.000000</responsetime> + </icmp> + <port> + <hostname>10.20.4.233</hostname> + <portnumber>19999</portnumber> + <request><![CDATA[/api/v1/info]]></request> + <protocol>HTTP</protocol> + <type>TCP</type> + <responsetime>-1.000000</responsetime> + </port> + </service> + <service type="8"> + <name>networkOk</name> + <collected_sec>1723810549</collected_sec> + <collected_usec>94801</collected_usec> + <status>0</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <link> + <state>1</state> + <speed>-1000000</speed> + <duplex>-1</duplex> + <download> + <packets> + <now>0</now> + <total>319258</total> + </packets> + <bytes> + <now>0</now> + <total>714558077</total> + </bytes> + <errors> + <now>0</now> + <total>0</total> + </errors> + </download> + <upload> + <packets> + <now>0</now> + <total>172909</total> + </packets> + <bytes> + <now>0</now> + <total>25128489</total> + </bytes> + <errors> + <now>0</now> + <total>0</total> + </errors> + </upload> + </link> + </service> + <service type="8"> + <name>networkDisabled</name> + <collected_sec>1723810534</collected_sec> + <collected_usec>69103</collected_usec> + <status>0</status> + <status_hint>0</status_hint> + <monitor>0</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + </service> + <service type="8"> + <name>networkAlert</name> + <collected_sec>1723810549</collected_sec> + <collected_usec>94969</collected_usec> + <status>8388608</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <link> + <state>0</state> + <speed>-1</speed> + <duplex>-1</duplex> + <download> + <packets> + <now>-1</now> + <total>-1</total> + </packets> + <bytes> + <now>-1</now> + <total>-1</total> + </bytes> + <errors> + <now>-1</now> + <total>-1</total> + </errors> + </download> + <upload> + <packets> + <now>-1</now> + <total>-1</total> + </packets> + <bytes> + <now>-1</now> + <total>-1</total> + </bytes> + <errors> + <now>-1</now> + <total>-1</total> + </errors> + </upload> + </link> + </service> + <service type="8"> + <name>networkNotExists</name> + <collected_sec>1723810549</collected_sec> + <collected_usec>94992</collected_usec> + <status>8388608</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <link> + <state>-1</state> + <speed>-1</speed> + <duplex>-1</duplex> + <download> + <packets> + <now>-1</now> + <total>-1</total> + </packets> + <bytes> + <now>-1</now> + <total>-1</total> + </bytes> + <errors> + <now>-1</now> + <total>-1</total> + </errors> + </download> + <upload> + <packets> + <now>-1</now> + <total>-1</total> + </packets> + <bytes> + <now>-1</now> + <total>-1</total> + </bytes> + <errors> + <now>-1</now> + <total>-1</total> + </errors> + </upload> + </link> + </service> + <service type="5"> + <name>pve-deb-work</name> + <collected_sec>1723810549</collected_sec> + <collected_usec>94992</collected_usec> + <status>0</status> + <status_hint>0</status_hint> + <monitor>1</monitor> + <monitormode>0</monitormode> + <onreboot>0</onreboot> + <pendingaction>0</pendingaction> + <filedescriptors> + <allocated>1664</allocated> + <unused>0</unused> + <maximum>9223372036854775807</maximum> + </filedescriptors> + <system> + <load> + <avg01>0.00</avg01> + <avg05>0.04</avg05> + <avg15>0.03</avg15> + </load> + <cpu> + <user>0.0</user> + <system>0.0</system> + <nice>0.0</nice> + <wait>0.0</wait> + <hardirq>0.0</hardirq> + <softirq>0.0</softirq> + <steal>0.0</steal> + <guest>0.0</guest> + <guestnice>0.0</guestnice> + </cpu> + <memory> + <percent>3.1</percent> + <kilobyte>1020120</kilobyte> + </memory> + <swap> + <percent>0.0</percent> + <kilobyte>0</kilobyte> + </swap> + </system> + </service> +</monit> diff --git a/src/go/collectors/go.d.plugin/modules/mysql/README.md b/src/go/plugin/go.d/modules/mysql/README.md index edf116de..edf116de 120000 --- a/src/go/collectors/go.d.plugin/modules/mysql/README.md +++ b/src/go/plugin/go.d/modules/mysql/README.md diff --git a/src/go/collectors/go.d.plugin/modules/mysql/charts.go b/src/go/plugin/go.d/modules/mysql/charts.go index 054e4e01..bb508911 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/charts.go +++ b/src/go/plugin/go.d/modules/mysql/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/mysql/collect.go b/src/go/plugin/go.d/modules/mysql/collect.go index 5f28cd13..5f28cd13 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/collect.go +++ b/src/go/plugin/go.d/modules/mysql/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/mysql/collect_global_status.go b/src/go/plugin/go.d/modules/mysql/collect_global_status.go index c6dff9e9..c6dff9e9 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/collect_global_status.go +++ b/src/go/plugin/go.d/modules/mysql/collect_global_status.go diff --git a/src/go/collectors/go.d.plugin/modules/mysql/collect_global_vars.go b/src/go/plugin/go.d/modules/mysql/collect_global_vars.go index ae627808..ae627808 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/collect_global_vars.go +++ b/src/go/plugin/go.d/modules/mysql/collect_global_vars.go diff --git a/src/go/collectors/go.d.plugin/modules/mysql/collect_process_list.go b/src/go/plugin/go.d/modules/mysql/collect_process_list.go index 08c08c6d..08c08c6d 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/collect_process_list.go +++ b/src/go/plugin/go.d/modules/mysql/collect_process_list.go diff --git a/src/go/collectors/go.d.plugin/modules/mysql/collect_slave_status.go b/src/go/plugin/go.d/modules/mysql/collect_slave_status.go index 37d4bf59..37d4bf59 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/collect_slave_status.go +++ b/src/go/plugin/go.d/modules/mysql/collect_slave_status.go diff --git a/src/go/collectors/go.d.plugin/modules/mysql/collect_user_statistics.go b/src/go/plugin/go.d/modules/mysql/collect_user_statistics.go index b00703a4..b00703a4 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/collect_user_statistics.go +++ b/src/go/plugin/go.d/modules/mysql/collect_user_statistics.go diff --git a/src/go/collectors/go.d.plugin/modules/mysql/collect_version.go b/src/go/plugin/go.d/modules/mysql/collect_version.go index b85922e2..b85922e2 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/collect_version.go +++ b/src/go/plugin/go.d/modules/mysql/collect_version.go diff --git a/src/go/collectors/go.d.plugin/modules/mysql/config_schema.json b/src/go/plugin/go.d/modules/mysql/config_schema.json index 20bb265c..20bb265c 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/config_schema.json +++ b/src/go/plugin/go.d/modules/mysql/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/mysql/disable_logging.go b/src/go/plugin/go.d/modules/mysql/disable_logging.go index 3a2eea6a..3a2eea6a 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/disable_logging.go +++ b/src/go/plugin/go.d/modules/mysql/disable_logging.go diff --git a/src/go/collectors/go.d.plugin/modules/mysql/integrations/mariadb.md b/src/go/plugin/go.d/modules/mysql/integrations/mariadb.md index 8bd6b151..b10e84b2 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/integrations/mariadb.md +++ b/src/go/plugin/go.d/modules/mysql/integrations/mariadb.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/mysql/integrations/mariadb.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/mysql/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/mysql/integrations/mariadb.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/mysql/metadata.yaml" sidebar_label: "MariaDB" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -45,12 +45,8 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection -By default, it detects instances running on localhost by trying to connect as root and netdata using known MySQL TCP and UNIX sockets: +By default, it detects instances running on localhost by trying to connect as root and netdata using known MySQL TCP sockets: -- /var/run/mysqld/mysqld.sock -- /var/run/mysqld/mysql.sock -- /var/lib/mysql/mysql.sock -- /tmp/mysql.sock - 127.0.0.1:3306 - "[::1]:3306" @@ -345,6 +341,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `mysql` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -367,4 +365,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m mysql ``` +### Getting Logs + +If you're encountering problems with the `mysql` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep mysql +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep mysql /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep mysql +``` + diff --git a/src/go/collectors/go.d.plugin/modules/mysql/integrations/mysql.md b/src/go/plugin/go.d/modules/mysql/integrations/mysql.md index 0acf6f88..f4f8a423 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/integrations/mysql.md +++ b/src/go/plugin/go.d/modules/mysql/integrations/mysql.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/mysql/integrations/mysql.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/mysql/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/mysql/integrations/mysql.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/mysql/metadata.yaml" sidebar_label: "MySQL" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -45,12 +45,8 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection -By default, it detects instances running on localhost by trying to connect as root and netdata using known MySQL TCP and UNIX sockets: +By default, it detects instances running on localhost by trying to connect as root and netdata using known MySQL TCP sockets: -- /var/run/mysqld/mysqld.sock -- /var/run/mysqld/mysql.sock -- /var/lib/mysql/mysql.sock -- /tmp/mysql.sock - 127.0.0.1:3306 - "[::1]:3306" @@ -345,6 +341,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `mysql` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -367,4 +365,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m mysql ``` +### Getting Logs + +If you're encountering problems with the `mysql` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep mysql +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep mysql /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep mysql +``` + diff --git a/src/go/collectors/go.d.plugin/modules/mysql/integrations/percona_mysql.md b/src/go/plugin/go.d/modules/mysql/integrations/percona_mysql.md index 1ea2ab21..2c967e22 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/integrations/percona_mysql.md +++ b/src/go/plugin/go.d/modules/mysql/integrations/percona_mysql.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/mysql/integrations/percona_mysql.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/mysql/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/mysql/integrations/percona_mysql.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/mysql/metadata.yaml" sidebar_label: "Percona MySQL" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -45,12 +45,8 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection -By default, it detects instances running on localhost by trying to connect as root and netdata using known MySQL TCP and UNIX sockets: +By default, it detects instances running on localhost by trying to connect as root and netdata using known MySQL TCP sockets: -- /var/run/mysqld/mysqld.sock -- /var/run/mysqld/mysql.sock -- /var/lib/mysql/mysql.sock -- /tmp/mysql.sock - 127.0.0.1:3306 - "[::1]:3306" @@ -345,6 +341,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `mysql` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -367,4 +365,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m mysql ``` +### Getting Logs + +If you're encountering problems with the `mysql` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep mysql +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep mysql /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep mysql +``` + diff --git a/src/go/collectors/go.d.plugin/modules/mysql/metadata.yaml b/src/go/plugin/go.d/modules/mysql/metadata.yaml index 1bc13323..6e0d1b6b 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/metadata.yaml +++ b/src/go/plugin/go.d/modules/mysql/metadata.yaml @@ -47,12 +47,8 @@ modules: default_behavior: auto_detection: description: | - By default, it detects instances running on localhost by trying to connect as root and netdata using known MySQL TCP and UNIX sockets: - - - /var/run/mysqld/mysqld.sock - - /var/run/mysqld/mysql.sock - - /var/lib/mysql/mysql.sock - - /tmp/mysql.sock + By default, it detects instances running on localhost by trying to connect as root and netdata using known MySQL TCP sockets: + - 127.0.0.1:3306 - "[::1]:3306" limits: diff --git a/src/go/collectors/go.d.plugin/modules/mysql/mycnf.go b/src/go/plugin/go.d/modules/mysql/mycnf.go index 2069af80..2069af80 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/mycnf.go +++ b/src/go/plugin/go.d/modules/mysql/mycnf.go diff --git a/src/go/collectors/go.d.plugin/modules/mysql/mycnf_test.go b/src/go/plugin/go.d/modules/mysql/mycnf_test.go index f6868027..f6868027 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/mycnf_test.go +++ b/src/go/plugin/go.d/modules/mysql/mycnf_test.go diff --git a/src/go/collectors/go.d.plugin/modules/mysql/mysql.go b/src/go/plugin/go.d/modules/mysql/mysql.go index f970395e..1e11de39 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/mysql.go +++ b/src/go/plugin/go.d/modules/mysql/mysql.go @@ -10,8 +10,8 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/blang/semver/v4" "github.com/go-sql-driver/mysql" diff --git a/src/go/collectors/go.d.plugin/modules/mysql/mysql_test.go b/src/go/plugin/go.d/modules/mysql/mysql_test.go index da64507e..300f8dab 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/mysql_test.go +++ b/src/go/plugin/go.d/modules/mysql/mysql_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/DATA-DOG/go-sqlmock" "github.com/blang/semver/v4" diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/config.json b/src/go/plugin/go.d/modules/mysql/testdata/config.json index 92a65cb5..92a65cb5 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/config.json +++ b/src/go/plugin/go.d/modules/mysql/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/config.yaml b/src/go/plugin/go.d/modules/mysql/testdata/config.yaml index 9bb474b9..9bb474b9 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/mysql/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/global_status.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/global_status.txt index 8a6b691c..8a6b691c 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/global_status.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/global_status.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/global_variables.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/global_variables.txt index 96591afd..96591afd 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/global_variables.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/global_variables.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/process_list.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/process_list.txt index a44ce5e7..a44ce5e7 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/process_list.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/process_list.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/user_statistics.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/user_statistics.txt index 7a44b8b5..7a44b8b5 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/user_statistics.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/user_statistics.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/version.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/version.txt index ee5e77d9..ee5e77d9 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/version.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4-galera-cluster/version.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/all_slaves_status_multi_source.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/all_slaves_status_multi_source.txt index b117cb6c..b117cb6c 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/all_slaves_status_multi_source.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/all_slaves_status_multi_source.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/all_slaves_status_single_source.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/all_slaves_status_single_source.txt index 61428f08..61428f08 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/all_slaves_status_single_source.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/all_slaves_status_single_source.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/global_status.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/global_status.txt index c82531c7..c82531c7 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/global_status.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/global_status.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/global_variables.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/global_variables.txt index 96591afd..96591afd 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/global_variables.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/global_variables.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/process_list.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/process_list.txt index a44ce5e7..a44ce5e7 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/process_list.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/process_list.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/user_statistics.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/user_statistics.txt index 7a44b8b5..7a44b8b5 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/user_statistics.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/user_statistics.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/version.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/version.txt index 2e7ca5b0..2e7ca5b0 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v10.8.4/version.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v10.8.4/version.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v5.5.64/global_status.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v5.5.64/global_status.txt index 7c75f061..7c75f061 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v5.5.64/global_status.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v5.5.64/global_status.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v5.5.64/global_variables.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v5.5.64/global_variables.txt index 5f0906ee..5f0906ee 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v5.5.64/global_variables.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v5.5.64/global_variables.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v5.5.64/process_list.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v5.5.64/process_list.txt index a44ce5e7..a44ce5e7 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v5.5.64/process_list.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v5.5.64/process_list.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v5.5.64/version.txt b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v5.5.64/version.txt index de684279..de684279 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mariadb/v5.5.64/version.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mariadb/v5.5.64/version.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/global_status.txt b/src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/global_status.txt index a4b2f2f9..a4b2f2f9 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/global_status.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/global_status.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/global_variables.txt b/src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/global_variables.txt index 02be0ae8..02be0ae8 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/global_variables.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/global_variables.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/process_list.txt b/src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/process_list.txt index a44ce5e7..a44ce5e7 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/process_list.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/process_list.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/replica_status_multi_source.txt b/src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/replica_status_multi_source.txt index 8a5e0683..8a5e0683 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/replica_status_multi_source.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/replica_status_multi_source.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/version.txt b/src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/version.txt index 5c553b1a..5c553b1a 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/mysql/v8.0.30/version.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/mysql/v8.0.30/version.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/global_status.txt b/src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/global_status.txt index d7ee5741..d7ee5741 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/global_status.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/global_status.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/global_variables.txt b/src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/global_variables.txt index 02be0ae8..02be0ae8 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/global_variables.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/global_variables.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/process_list.txt b/src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/process_list.txt index a44ce5e7..a44ce5e7 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/process_list.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/process_list.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/user_statistics.txt b/src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/user_statistics.txt index d7c206e4..d7c206e4 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/user_statistics.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/user_statistics.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/version.txt b/src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/version.txt index dede361e..dede361e 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/percona/v8.0.29/version.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/percona/v8.0.29/version.txt diff --git a/src/go/collectors/go.d.plugin/modules/mysql/testdata/session_variables.txt b/src/go/plugin/go.d/modules/mysql/testdata/session_variables.txt index 35875060..35875060 100644 --- a/src/go/collectors/go.d.plugin/modules/mysql/testdata/session_variables.txt +++ b/src/go/plugin/go.d/modules/mysql/testdata/session_variables.txt diff --git a/src/go/collectors/go.d.plugin/modules/nginx/README.md b/src/go/plugin/go.d/modules/nginx/README.md index 7b19fe44..7b19fe44 120000 --- a/src/go/collectors/go.d.plugin/modules/nginx/README.md +++ b/src/go/plugin/go.d/modules/nginx/README.md diff --git a/src/go/collectors/go.d.plugin/modules/nginx/apiclient.go b/src/go/plugin/go.d/modules/nginx/apiclient.go index 8e1003b4..53d9f224 100644 --- a/src/go/collectors/go.d.plugin/modules/nginx/apiclient.go +++ b/src/go/plugin/go.d/modules/nginx/apiclient.go @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/nginx/charts.go b/src/go/plugin/go.d/modules/nginx/charts.go index 95f9d8aa..3415fbae 100644 --- a/src/go/collectors/go.d.plugin/modules/nginx/charts.go +++ b/src/go/plugin/go.d/modules/nginx/charts.go @@ -2,7 +2,7 @@ package nginx -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( // Charts is an alias for module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/nginx/collect.go b/src/go/plugin/go.d/modules/nginx/collect.go index 533f9880..459570ae 100644 --- a/src/go/collectors/go.d.plugin/modules/nginx/collect.go +++ b/src/go/plugin/go.d/modules/nginx/collect.go @@ -3,7 +3,7 @@ package nginx import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) func (n *Nginx) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/nginx/config_schema.json b/src/go/plugin/go.d/modules/nginx/config_schema.json index ed361b42..25fead78 100644 --- a/src/go/collectors/go.d.plugin/modules/nginx/config_schema.json +++ b/src/go/plugin/go.d/modules/nginx/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/nginx/integrations/nginx.md b/src/go/plugin/go.d/modules/nginx/integrations/nginx.md index 63b58099..6d8338a1 100644 --- a/src/go/collectors/go.d.plugin/modules/nginx/integrations/nginx.md +++ b/src/go/plugin/go.d/modules/nginx/integrations/nginx.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/nginx/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/nginx/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/nginx/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/nginx/metadata.yaml" sidebar_label: "NGINX" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -207,6 +207,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `nginx` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -229,4 +231,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m nginx ``` +### Getting Logs + +If you're encountering problems with the `nginx` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep nginx +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep nginx /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep nginx +``` + diff --git a/src/go/collectors/go.d.plugin/modules/nginx/metadata.yaml b/src/go/plugin/go.d/modules/nginx/metadata.yaml index 49b12c4e..49b12c4e 100644 --- a/src/go/collectors/go.d.plugin/modules/nginx/metadata.yaml +++ b/src/go/plugin/go.d/modules/nginx/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/nginx/metrics.go b/src/go/plugin/go.d/modules/nginx/metrics.go index 66e6a160..66e6a160 100644 --- a/src/go/collectors/go.d.plugin/modules/nginx/metrics.go +++ b/src/go/plugin/go.d/modules/nginx/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/nginx/nginx.go b/src/go/plugin/go.d/modules/nginx/nginx.go index 2feb6bb0..4a8e7743 100644 --- a/src/go/collectors/go.d.plugin/modules/nginx/nginx.go +++ b/src/go/plugin/go.d/modules/nginx/nginx.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/nginx/nginx_test.go b/src/go/plugin/go.d/modules/nginx/nginx_test.go index 68308d14..255ea384 100644 --- a/src/go/collectors/go.d.plugin/modules/nginx/nginx_test.go +++ b/src/go/plugin/go.d/modules/nginx/nginx_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/nginxvts/testdata/config.json b/src/go/plugin/go.d/modules/nginx/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxvts/testdata/config.json +++ b/src/go/plugin/go.d/modules/nginx/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxvts/testdata/config.yaml b/src/go/plugin/go.d/modules/nginx/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxvts/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/nginx/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/nginx/testdata/status.txt b/src/go/plugin/go.d/modules/nginx/testdata/status.txt index f4835bef..f4835bef 100644 --- a/src/go/collectors/go.d.plugin/modules/nginx/testdata/status.txt +++ b/src/go/plugin/go.d/modules/nginx/testdata/status.txt diff --git a/src/go/collectors/go.d.plugin/modules/nginx/testdata/tengine-status.txt b/src/go/plugin/go.d/modules/nginx/testdata/tengine-status.txt index 1e6a62c2..1e6a62c2 100644 --- a/src/go/collectors/go.d.plugin/modules/nginx/testdata/tengine-status.txt +++ b/src/go/plugin/go.d/modules/nginx/testdata/tengine-status.txt diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/README.md b/src/go/plugin/go.d/modules/nginxplus/README.md index 16cb6c1b..16cb6c1b 120000 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/README.md +++ b/src/go/plugin/go.d/modules/nginxplus/README.md diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/cache.go b/src/go/plugin/go.d/modules/nginxplus/cache.go index af58f3a5..af58f3a5 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/cache.go +++ b/src/go/plugin/go.d/modules/nginxplus/cache.go diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/charts.go b/src/go/plugin/go.d/modules/nginxplus/charts.go index c5039098..6070ee03 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/charts.go +++ b/src/go/plugin/go.d/modules/nginxplus/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/collect.go b/src/go/plugin/go.d/modules/nginxplus/collect.go index f986778b..f986778b 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/collect.go +++ b/src/go/plugin/go.d/modules/nginxplus/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/config_schema.json b/src/go/plugin/go.d/modules/nginxplus/config_schema.json index 937c528d..fd4c38ef 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/config_schema.json +++ b/src/go/plugin/go.d/modules/nginxplus/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/integrations/nginx_plus.md b/src/go/plugin/go.d/modules/nginxplus/integrations/nginx_plus.md index f0593c21..9ebb4b19 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/integrations/nginx_plus.md +++ b/src/go/plugin/go.d/modules/nginxplus/integrations/nginx_plus.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/nginxplus/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/nginxplus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/nginxplus/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/nginxplus/metadata.yaml" sidebar_label: "NGINX Plus" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -388,6 +388,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `nginxplus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -410,4 +412,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m nginxplus ``` +### Getting Logs + +If you're encountering problems with the `nginxplus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep nginxplus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep nginxplus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep nginxplus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/metadata.yaml b/src/go/plugin/go.d/modules/nginxplus/metadata.yaml index 6bc3a29b..6bc3a29b 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/metadata.yaml +++ b/src/go/plugin/go.d/modules/nginxplus/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/nginx_http_api.go b/src/go/plugin/go.d/modules/nginxplus/nginx_http_api.go index 0f7999ac..0f7999ac 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/nginx_http_api.go +++ b/src/go/plugin/go.d/modules/nginxplus/nginx_http_api.go diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/nginx_http_api_query.go b/src/go/plugin/go.d/modules/nginxplus/nginx_http_api_query.go index b05ce1d7..b54cd142 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/nginx_http_api_query.go +++ b/src/go/plugin/go.d/modules/nginxplus/nginx_http_api_query.go @@ -10,7 +10,7 @@ import ( "net/http" "sync" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const ( @@ -46,8 +46,7 @@ type nginxMetrics struct { } func (n *NginxPlus) queryAPIVersion() (int64, error) { - req, _ := web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = urlPathAPIVersions + req, _ := web.NewHTTPRequestWithPath(n.Request, urlPathAPIVersions) var versions nginxAPIVersions if err := n.doWithDecode(&versions, req); err != nil { @@ -62,8 +61,7 @@ func (n *NginxPlus) queryAPIVersion() (int64, error) { } func (n *NginxPlus) queryAvailableEndpoints() error { - req, _ := web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPIEndpointsRoot, n.apiVersion) + req, _ := web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPIEndpointsRoot, n.apiVersion)) var endpoints []string if err := n.doWithDecode(&endpoints, req); err != nil { @@ -91,8 +89,7 @@ func (n *NginxPlus) queryAvailableEndpoints() error { if hasHTTP { endpoints = endpoints[:0] - req, _ = web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPIEndpointsHTTP, n.apiVersion) + req, _ = web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPIEndpointsHTTP, n.apiVersion)) if err := n.doWithDecode(&endpoints, req); err != nil { return err @@ -117,8 +114,7 @@ func (n *NginxPlus) queryAvailableEndpoints() error { if hasStream { endpoints = endpoints[:0] - req, _ = web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPIEndpointsStream, n.apiVersion) + req, _ = web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPIEndpointsStream, n.apiVersion)) if err := n.doWithDecode(&endpoints, req); err != nil { return err @@ -171,8 +167,7 @@ func (n *NginxPlus) queryMetrics() *nginxMetrics { } func (n *NginxPlus) queryNginxInfo(ms *nginxMetrics) { - req, _ := web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPINginx, n.apiVersion) + req, _ := web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPINginx, n.apiVersion)) var v nginxInfo @@ -186,8 +181,7 @@ func (n *NginxPlus) queryNginxInfo(ms *nginxMetrics) { } func (n *NginxPlus) queryConnections(ms *nginxMetrics) { - req, _ := web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPIConnections, n.apiVersion) + req, _ := web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPIConnections, n.apiVersion)) var v nginxConnections @@ -201,8 +195,7 @@ func (n *NginxPlus) queryConnections(ms *nginxMetrics) { } func (n *NginxPlus) querySSL(ms *nginxMetrics) { - req, _ := web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPISSL, n.apiVersion) + req, _ := web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPISSL, n.apiVersion)) var v nginxSSL @@ -216,8 +209,7 @@ func (n *NginxPlus) querySSL(ms *nginxMetrics) { } func (n *NginxPlus) queryHTTPRequests(ms *nginxMetrics) { - req, _ := web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPIHTTPRequests, n.apiVersion) + req, _ := web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPIHTTPRequests, n.apiVersion)) var v nginxHTTPRequests @@ -231,8 +223,7 @@ func (n *NginxPlus) queryHTTPRequests(ms *nginxMetrics) { } func (n *NginxPlus) queryHTTPServerZones(ms *nginxMetrics) { - req, _ := web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPIHTTPServerZones, n.apiVersion) + req, _ := web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPIHTTPServerZones, n.apiVersion)) var v nginxHTTPServerZones @@ -246,8 +237,7 @@ func (n *NginxPlus) queryHTTPServerZones(ms *nginxMetrics) { } func (n *NginxPlus) queryHTTPLocationZones(ms *nginxMetrics) { - req, _ := web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPIHTTPLocationZones, n.apiVersion) + req, _ := web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPIHTTPLocationZones, n.apiVersion)) var v nginxHTTPLocationZones @@ -261,8 +251,7 @@ func (n *NginxPlus) queryHTTPLocationZones(ms *nginxMetrics) { } func (n *NginxPlus) queryHTTPUpstreams(ms *nginxMetrics) { - req, _ := web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPIHTTPUpstreams, n.apiVersion) + req, _ := web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPIHTTPUpstreams, n.apiVersion)) var v nginxHTTPUpstreams @@ -276,8 +265,7 @@ func (n *NginxPlus) queryHTTPUpstreams(ms *nginxMetrics) { } func (n *NginxPlus) queryHTTPCaches(ms *nginxMetrics) { - req, _ := web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPIHTTPCaches, n.apiVersion) + req, _ := web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPIHTTPCaches, n.apiVersion)) var v nginxHTTPCaches @@ -291,8 +279,7 @@ func (n *NginxPlus) queryHTTPCaches(ms *nginxMetrics) { } func (n *NginxPlus) queryStreamServerZones(ms *nginxMetrics) { - req, _ := web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPIStreamServerZones, n.apiVersion) + req, _ := web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPIStreamServerZones, n.apiVersion)) var v nginxStreamServerZones @@ -306,8 +293,7 @@ func (n *NginxPlus) queryStreamServerZones(ms *nginxMetrics) { } func (n *NginxPlus) queryStreamUpstreams(ms *nginxMetrics) { - req, _ := web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPIStreamUpstreams, n.apiVersion) + req, _ := web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPIStreamUpstreams, n.apiVersion)) var v nginxStreamUpstreams @@ -321,8 +307,7 @@ func (n *NginxPlus) queryStreamUpstreams(ms *nginxMetrics) { } func (n *NginxPlus) queryResolvers(ms *nginxMetrics) { - req, _ := web.NewHTTPRequest(n.Request.Copy()) - req.URL.Path = fmt.Sprintf(urlPathAPIResolvers, n.apiVersion) + req, _ := web.NewHTTPRequestWithPath(n.Request, fmt.Sprintf(urlPathAPIResolvers, n.apiVersion)) var v nginxResolvers diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/nginxplus.go b/src/go/plugin/go.d/modules/nginxplus/nginxplus.go index 3a0c2f97..f737e681 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/nginxplus.go +++ b/src/go/plugin/go.d/modules/nginxplus/nginxplus.go @@ -8,8 +8,8 @@ import ( "net/http" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/nginxplus_test.go b/src/go/plugin/go.d/modules/nginxplus/nginxplus_test.go index 7c6f4fc7..2628cc68 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/nginxplus_test.go +++ b/src/go/plugin/go.d/modules/nginxplus/nginxplus_test.go @@ -9,8 +9,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/404.json b/src/go/plugin/go.d/modules/nginxplus/testdata/404.json index d2ed8c9a..d2ed8c9a 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/404.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/404.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/api_versions.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/api_versions.json index 9ffc3397..9ffc3397 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/api_versions.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/api_versions.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/connections.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/connections.json index 490ca13f..490ca13f 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/connections.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/connections.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/endpoints_http.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/endpoints_http.json index 57c4e4aa..57c4e4aa 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/endpoints_http.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/endpoints_http.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/endpoints_root.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/endpoints_root.json index b185c55f..b185c55f 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/endpoints_root.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/endpoints_root.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/endpoints_stream.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/endpoints_stream.json index 0da09237..0da09237 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/endpoints_stream.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/endpoints_stream.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_caches.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_caches.json index dd2d03ad..dd2d03ad 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_caches.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_caches.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_location_zones.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_location_zones.json index 8812e6df..8812e6df 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_location_zones.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_location_zones.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_requests.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_requests.json index 0c2a1750..0c2a1750 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_requests.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_requests.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_server_zones.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_server_zones.json index c2538921..c2538921 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_server_zones.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_server_zones.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_upstreams.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_upstreams.json index 0f7ba713..0f7ba713 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/http_upstreams.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/http_upstreams.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/nginx.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/nginx.json index 4480c2bc..4480c2bc 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/nginx.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/nginx.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/resolvers.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/resolvers.json index ad66f558..ad66f558 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/resolvers.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/resolvers.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/ssl.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/ssl.json index 2ca8a6a3..2ca8a6a3 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/ssl.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/ssl.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/stream_server_zones.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/stream_server_zones.json index 0c7df787..0c7df787 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/stream_server_zones.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/stream_server_zones.json diff --git a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/stream_upstreams.json b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/stream_upstreams.json index 707ad4db..707ad4db 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxplus/testdata/api-8/stream_upstreams.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/api-8/stream_upstreams.json diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/testdata/config.json b/src/go/plugin/go.d/modules/nginxplus/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/testdata/config.json +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/testdata/config.yaml b/src/go/plugin/go.d/modules/nginxplus/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/nginxplus/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/nginxvts/README.md b/src/go/plugin/go.d/modules/nginxvts/README.md index e185fa81..e185fa81 120000 --- a/src/go/collectors/go.d.plugin/modules/nginxvts/README.md +++ b/src/go/plugin/go.d/modules/nginxvts/README.md diff --git a/src/go/collectors/go.d.plugin/modules/nginxvts/charts.go b/src/go/plugin/go.d/modules/nginxvts/charts.go index 6fc859ed..8dad7910 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxvts/charts.go +++ b/src/go/plugin/go.d/modules/nginxvts/charts.go @@ -2,7 +2,7 @@ package nginxvts -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" var mainCharts = module.Charts{ { diff --git a/src/go/collectors/go.d.plugin/modules/nginxvts/collect.go b/src/go/plugin/go.d/modules/nginxvts/collect.go index c4c38968..02fe7cb6 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxvts/collect.go +++ b/src/go/plugin/go.d/modules/nginxvts/collect.go @@ -8,8 +8,8 @@ import ( "io" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (vts *NginxVTS) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/nginxvts/config_schema.json b/src/go/plugin/go.d/modules/nginxvts/config_schema.json index 1abcdb65..ef6a1d23 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxvts/config_schema.json +++ b/src/go/plugin/go.d/modules/nginxvts/config_schema.json @@ -166,6 +166,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/nginxvts/init.go b/src/go/plugin/go.d/modules/nginxvts/init.go index 17ff6302..2e738e4d 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxvts/init.go +++ b/src/go/plugin/go.d/modules/nginxvts/init.go @@ -6,8 +6,8 @@ import ( "errors" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (vts *NginxVTS) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/nginxvts/integrations/nginx_vts.md b/src/go/plugin/go.d/modules/nginxvts/integrations/nginx_vts.md index cc1f3047..59918b39 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxvts/integrations/nginx_vts.md +++ b/src/go/plugin/go.d/modules/nginxvts/integrations/nginx_vts.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/nginxvts/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/nginxvts/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/nginxvts/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/nginxvts/metadata.yaml" sidebar_label: "NGINX VTS" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -208,6 +208,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `nginxvts` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -230,4 +232,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m nginxvts ``` +### Getting Logs + +If you're encountering problems with the `nginxvts` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep nginxvts +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep nginxvts /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep nginxvts +``` + diff --git a/src/go/collectors/go.d.plugin/modules/nginxvts/metadata.yaml b/src/go/plugin/go.d/modules/nginxvts/metadata.yaml index bb602863..bb602863 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxvts/metadata.yaml +++ b/src/go/plugin/go.d/modules/nginxvts/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/nginxvts/metrics.go b/src/go/plugin/go.d/modules/nginxvts/metrics.go index 2674d4bb..2674d4bb 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxvts/metrics.go +++ b/src/go/plugin/go.d/modules/nginxvts/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/nginxvts/nginxvts.go b/src/go/plugin/go.d/modules/nginxvts/nginxvts.go index ad3aaf1e..56868ff0 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxvts/nginxvts.go +++ b/src/go/plugin/go.d/modules/nginxvts/nginxvts.go @@ -8,8 +8,8 @@ import ( "net/http" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/nginxvts/nginxvts_test.go b/src/go/plugin/go.d/modules/nginxvts/nginxvts_test.go index b9140c06..f4c11037 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxvts/nginxvts_test.go +++ b/src/go/plugin/go.d/modules/nginxvts/nginxvts_test.go @@ -8,9 +8,9 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/testdata/config.json b/src/go/plugin/go.d/modules/nginxvts/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns/testdata/config.json +++ b/src/go/plugin/go.d/modules/nginxvts/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/testdata/config.yaml b/src/go/plugin/go.d/modules/nginxvts/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/nginxvts/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/nginxvts/testdata/vts-v0.1.18.json b/src/go/plugin/go.d/modules/nginxvts/testdata/vts-v0.1.18.json index cdc331d5..cdc331d5 100644 --- a/src/go/collectors/go.d.plugin/modules/nginxvts/testdata/vts-v0.1.18.json +++ b/src/go/plugin/go.d/modules/nginxvts/testdata/vts-v0.1.18.json diff --git a/src/go/plugin/go.d/modules/nsd/README.md b/src/go/plugin/go.d/modules/nsd/README.md new file mode 120000 index 00000000..a5cb8c98 --- /dev/null +++ b/src/go/plugin/go.d/modules/nsd/README.md @@ -0,0 +1 @@ +integrations/nsd.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/nsd/charts.go b/src/go/plugin/go.d/modules/nsd/charts.go new file mode 100644 index 00000000..aed4f309 --- /dev/null +++ b/src/go/plugin/go.d/modules/nsd/charts.go @@ -0,0 +1,249 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package nsd + +import ( + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioQueries = module.Priority + iota + prioQueriesByType + prioQueriesByOpcode + prioQueriesByClass + prioQueriesByProtocol + + prioAnswersByRcode + + prioErrors + + prioDrops + + prioZones + prioZoneTransfersRequests + prioZoneTransferMemory + + prioDatabaseSize + + prioUptime +) + +var charts = module.Charts{ + queriesChart.Copy(), + queriesByTypeChart.Copy(), + queriesByOpcodeChart.Copy(), + queriesByClassChart.Copy(), + queriesByProtocolChart.Copy(), + + answersByRcodeChart.Copy(), + + zonesChart.Copy(), + zoneTransfersRequestsChart.Copy(), + zoneTransferMemoryChart.Copy(), + + databaseSizeChart.Copy(), + + errorsChart.Copy(), + + dropsChart.Copy(), + + uptimeChart.Copy(), +} + +var ( + queriesChart = module.Chart{ + ID: "queries", + Title: "Queries", + Units: "queries/s", + Fam: "queries", + Ctx: "nsd.queries", + Priority: prioQueries, + Dims: module.Dims{ + {ID: "num.queries", Name: "queries", Algo: module.Incremental}, + }, + } + queriesByTypeChart = func() module.Chart { + chart := module.Chart{ + ID: "queries_by_type", + Title: "Queries Type", + Units: "queries/s", + Fam: "queries", + Ctx: "nsd.queries_by_type", + Priority: prioQueriesByType, + Type: module.Stacked, + } + for _, v := range queryTypes { + name := v + if s, ok := queryTypeNumberMap[v]; ok { + name = s + } + chart.Dims = append(chart.Dims, &module.Dim{ + ID: "num.type." + v, + Name: name, + Algo: module.Incremental, + }) + } + return chart + }() + queriesByOpcodeChart = func() module.Chart { + chart := module.Chart{ + ID: "queries_by_opcode", + Title: "Queries Opcode", + Units: "queries/s", + Fam: "queries", + Ctx: "nsd.queries_by_opcode", + Priority: prioQueriesByOpcode, + Type: module.Stacked, + } + for _, v := range queryOpcodes { + chart.Dims = append(chart.Dims, &module.Dim{ + ID: "num.opcode." + v, + Name: v, + Algo: module.Incremental, + }) + } + return chart + }() + queriesByClassChart = func() module.Chart { + chart := module.Chart{ + ID: "queries_by_class", + Title: "Queries Class", + Units: "queries/s", + Fam: "queries", + Ctx: "nsd.queries_by_class", + Priority: prioQueriesByClass, + Type: module.Stacked, + } + for _, v := range queryClasses { + chart.Dims = append(chart.Dims, &module.Dim{ + ID: "num.class." + v, + Name: v, + Algo: module.Incremental, + }) + } + return chart + }() + queriesByProtocolChart = module.Chart{ + ID: "queries_by_protocol", + Title: "Queries Protocol", + Units: "queries/s", + Fam: "queries", + Ctx: "nsd.queries_by_protocol", + Priority: prioQueriesByProtocol, + Type: module.Stacked, + Dims: module.Dims{ + {ID: "num.udp", Name: "udp", Algo: module.Incremental}, + {ID: "num.udp6", Name: "udp6", Algo: module.Incremental}, + {ID: "num.tcp", Name: "tcp", Algo: module.Incremental}, + {ID: "num.tcp6", Name: "tcp6", Algo: module.Incremental}, + {ID: "num.tls", Name: "tls", Algo: module.Incremental}, + {ID: "num.tls6", Name: "tls6", Algo: module.Incremental}, + }, + } + + answersByRcodeChart = func() module.Chart { + chart := module.Chart{ + ID: "answers_by_rcode", + Title: "Answers Rcode", + Units: "answers/s", + Fam: "answers", + Ctx: "nsd.answers_by_rcode", + Priority: prioAnswersByRcode, + Type: module.Stacked, + } + for _, v := range answerRcodes { + chart.Dims = append(chart.Dims, &module.Dim{ + ID: "num.rcode." + v, + Name: v, + Algo: module.Incremental, + }) + } + return chart + }() + + errorsChart = module.Chart{ + ID: "errors", + Title: "Errors", + Units: "errors/s", + Fam: "errors", + Ctx: "nsd.errors", + Priority: prioErrors, + Dims: module.Dims{ + {ID: "num.rxerr", Name: "query", Algo: module.Incremental}, + {ID: "num.txerr", Name: "answer", Mul: -1, Algo: module.Incremental}, + }, + } + + dropsChart = module.Chart{ + ID: "drops", + Title: "Drops", + Units: "drops/s", + Fam: "drops", + Ctx: "nsd.drops", + Priority: prioDrops, + Dims: module.Dims{ + {ID: "num.dropped", Name: "query", Algo: module.Incremental}, + }, + } + + zonesChart = module.Chart{ + ID: "zones", + Title: "Zones", + Units: "zones", + Fam: "zones", + Ctx: "nsd.zones", + Priority: prioZones, + Dims: module.Dims{ + {ID: "zone.master", Name: "master"}, + {ID: "zone.slave", Name: "slave"}, + }, + } + zoneTransfersRequestsChart = module.Chart{ + ID: "zone_transfers_requests", + Title: "Zone Transfers", + Units: "requests/s", + Fam: "zones", + Ctx: "nsd.zone_transfers_requests", + Priority: prioZoneTransfersRequests, + Dims: module.Dims{ + {ID: "num.raxfr", Name: "AXFR", Algo: module.Incremental}, + {ID: "num.rixfr", Name: "IXFR", Algo: module.Incremental}, + }, + } + zoneTransferMemoryChart = module.Chart{ + ID: "zone_transfer_memory", + Title: "Zone Transfer Memory", + Units: "bytes", + Fam: "zones", + Ctx: "nsd.zone_transfer_memory", + Priority: prioZoneTransferMemory, + Dims: module.Dims{ + {ID: "size.xfrd.mem", Name: "used"}, + }, + } + + databaseSizeChart = module.Chart{ + ID: "database_size", + Title: "Database Size", + Units: "bytes", + Fam: "database", + Ctx: "nsd.database_size", + Priority: prioDatabaseSize, + Dims: module.Dims{ + {ID: "size.db.disk", Name: "disk"}, + {ID: "size.db.mem", Name: "mem"}, + }, + } + + uptimeChart = module.Chart{ + ID: "uptime", + Title: "Uptime", + Units: "seconds", + Fam: "uptime", + Ctx: "nsd.uptime", + Priority: prioUptime, + Dims: module.Dims{ + {ID: "time.boot", Name: "uptime"}, + }, + } +) diff --git a/src/go/plugin/go.d/modules/nsd/collect.go b/src/go/plugin/go.d/modules/nsd/collect.go new file mode 100644 index 00000000..d07341df --- /dev/null +++ b/src/go/plugin/go.d/modules/nsd/collect.go @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package nsd + +import ( + "bufio" + "bytes" + "errors" + "strconv" + "strings" +) + +func (n *Nsd) collect() (map[string]int64, error) { + stats, err := n.exec.stats() + if err != nil { + return nil, err + } + + if len(stats) == 0 { + return nil, errors.New("empty stats response") + } + + mx := make(map[string]int64) + + sc := bufio.NewScanner(bytes.NewReader(stats)) + + for sc.Scan() { + n.collectStatsLine(mx, sc.Text()) + } + + if len(mx) == 0 { + return nil, errors.New("unexpected stats response: no metrics found") + } + + addMissingMetrics(mx, "num.rcode.", answerRcodes) + addMissingMetrics(mx, "num.opcode.", queryOpcodes) + addMissingMetrics(mx, "num.class.", queryClasses) + addMissingMetrics(mx, "num.type.", queryTypes) + + return mx, nil +} + +func (n *Nsd) collectStatsLine(mx map[string]int64, line string) { + if line = strings.TrimSpace(line); line == "" { + return + } + + key, value, ok := strings.Cut(line, "=") + if !ok { + n.Debugf("invalid line in stats: '%s'", line) + return + } + + var v int64 + var f float64 + var err error + + switch key { + case "time.boot": + f, err = strconv.ParseFloat(value, 64) + v = int64(f) + default: + v, err = strconv.ParseInt(value, 10, 64) + } + + if err != nil { + n.Debugf("invalid value in stats line '%s': '%s'", line, value) + return + } + + mx[key] = v +} + +func addMissingMetrics(mx map[string]int64, prefix string, values []string) { + for _, v := range values { + k := prefix + v + if _, ok := mx[k]; !ok { + mx[k] = 0 + } + } +} diff --git a/src/go/plugin/go.d/modules/nsd/config_schema.json b/src/go/plugin/go.d/modules/nsd/config_schema.json new file mode 100644 index 00000000..d49107c7 --- /dev/null +++ b/src/go/plugin/go.d/modules/nsd/config_schema.json @@ -0,0 +1,35 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NSD collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 10 + }, + "timeout": { + "title": "Timeout", + "description": "Timeout for executing the binary, specified in seconds.", + "type": "number", + "minimum": 0.5, + "default": 2 + } + }, + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + } + } +} diff --git a/src/go/plugin/go.d/modules/nsd/exec.go b/src/go/plugin/go.d/modules/nsd/exec.go new file mode 100644 index 00000000..b05082f3 --- /dev/null +++ b/src/go/plugin/go.d/modules/nsd/exec.go @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package nsd + +import ( + "context" + "fmt" + "os/exec" + "time" + + "github.com/netdata/netdata/go/plugins/logger" +) + +type nsdControlBinary interface { + stats() ([]byte, error) +} + +func newNsdControlExec(ndsudoPath string, timeout time.Duration, log *logger.Logger) *nsdControlExec { + return &nsdControlExec{ + Logger: log, + ndsudoPath: ndsudoPath, + timeout: timeout, + } +} + +type nsdControlExec struct { + *logger.Logger + + ndsudoPath string + timeout time.Duration +} + +func (e *nsdControlExec) stats() ([]byte, error) { + ctx, cancel := context.WithTimeout(context.Background(), e.timeout) + defer cancel() + + cmd := exec.CommandContext(ctx, e.ndsudoPath, "nsd-control-stats") + + e.Debugf("executing '%s'", cmd) + + bs, err := cmd.Output() + if err != nil { + return nil, fmt.Errorf("error on '%s': %v", cmd, err) + } + + return bs, nil +} diff --git a/src/go/plugin/go.d/modules/nsd/init.go b/src/go/plugin/go.d/modules/nsd/init.go new file mode 100644 index 00000000..63843cab --- /dev/null +++ b/src/go/plugin/go.d/modules/nsd/init.go @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package nsd + +import ( + "fmt" + "os" + "path/filepath" + + "github.com/netdata/netdata/go/plugins/pkg/executable" +) + +func (n *Nsd) initNsdControlExec() (nsdControlBinary, error) { + ndsudoPath := filepath.Join(executable.Directory, "ndsudo") + if _, err := os.Stat(ndsudoPath); err != nil { + return nil, fmt.Errorf("ndsudo executable not found: %v", err) + + } + + nsdControl := newNsdControlExec(ndsudoPath, n.Timeout.Duration(), n.Logger) + + return nsdControl, nil +} diff --git a/src/go/plugin/go.d/modules/nsd/integrations/nsd.md b/src/go/plugin/go.d/modules/nsd/integrations/nsd.md new file mode 100644 index 00000000..745b872d --- /dev/null +++ b/src/go/plugin/go.d/modules/nsd/integrations/nsd.md @@ -0,0 +1,203 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/nsd/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/nsd/metadata.yaml" +sidebar_label: "NSD" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# NSD + + +<img src="https://netdata.cloud/img/nsd.svg" width="150"/> + + +Plugin: go.d.plugin +Module: nsd + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +This collector monitors NSD statistics like queries, zones, protocols, query types and more. It relies on the [`nsd-control`](https://nsd.docs.nlnetlabs.nl/en/latest/manpages/nsd-control.html) CLI tool but avoids directly executing the binary. Instead, it utilizes `ndsudo`, a Netdata helper specifically designed to run privileged commands securely within the Netdata environment. This approach eliminates the need to use `sudo`, improving security and potentially simplifying permission management. +Executed commands: +- `nsd-control stats_noreset` + + + + +This collector is supported on all platforms. + +This collector only supports collecting metrics from a single instance of this integration. + + +### Default Behavior + +#### Auto-Detection + +This integration doesn't support auto-detection. + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per NSD instance + +These metrics refer to the the entire monitored application. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| nsd.queries | queries | queries/s | +| nsd.queries_by_type | A, NS, MD, MF, CNAME, SOA, MB, MG, MR, NULL, WKS, PTR, HINFO, MINFO, MX, TXT, RP, AFSDB, X25, ISDN, RT, NSAP, SIG, KEY, PX, AAAA, LOC, NXT, SRV, NAPTR, KX, CERT, DNAME, OPT, APL, DS, SSHFP, IPSECKEY, RRSIG, NSEC, DNSKEY, DHCID, NSEC3, NSEC3PARAM, TLSA, SMIMEA, CDS, CDNSKEY, OPENPGPKEY, CSYNC, ZONEMD, SVCB, HTTPS, SPF, NID, L32, L64, LP, EUI48, EUI64, URI, CAA, AVC, DLV, IXFR, AXFR, MAILB, MAILA, ANY | queries/s | +| nsd.queries_by_opcode | QUERY, IQUERY, STATUS, NOTIFY, UPDATE, OTHER | queries/s | +| nsd.queries_by_class | IN, CS, CH, HS | queries/s | +| nsd.queries_by_protocol | udp, udp6, tcp, tcp6, tls, tls6 | queries/s | +| nsd.answers_by_rcode | NOERROR, FORMERR, SERVFAIL, NXDOMAIN, NOTIMP, REFUSED, YXDOMAIN, YXRRSET, NXRRSET, NOTAUTH, NOTZONE, RCODE11, RCODE12, RCODE13, RCODE14, RCODE15, BADVERS | answers/s | +| nsd.errors | query, answer | errors/s | +| nsd.drops | query | drops/s | +| nsd.zones | master, slave | zones | +| nsd.zone_transfers_requests | AXFR, IXFR | requests/s | +| nsd.zone_transfer_memory | used | bytes | +| nsd.database_size | disk, mem | bytes | +| nsd.uptime | uptime | seconds | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +No action required. + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/nsd.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/nsd.conf +``` +#### Options + +The following options can be defined globally: update_every. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 10 | no | +| timeout | nsd-control binary execution timeout. | 2 | no | + +</details> + +#### Examples + +##### Custom update_every + +Allows you to override the default data collection interval. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: nsd + update_every: 5 # Collect logical volume statistics every 5 seconds + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `nsd` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m nsd + ``` + +### Getting Logs + +If you're encountering problems with the `nsd` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep nsd +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep nsd /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep nsd +``` + + diff --git a/src/go/plugin/go.d/modules/nsd/metadata.yaml b/src/go/plugin/go.d/modules/nsd/metadata.yaml new file mode 100644 index 00000000..a31aa38a --- /dev/null +++ b/src/go/plugin/go.d/modules/nsd/metadata.yaml @@ -0,0 +1,272 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-nsd + plugin_name: go.d.plugin + module_name: nsd + monitored_instance: + name: NSD + link: "https://nsd.docs.nlnetlabs.nl/en/latest" + icon_filename: 'nsd.svg' + categories: + - data-collection.dns-and-dhcp-servers + keywords: + - nsd + - dns + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + most_popular: false + overview: + data_collection: + metrics_description: > + This collector monitors NSD statistics like queries, zones, protocols, query types and more. + It relies on the [`nsd-control`](https://nsd.docs.nlnetlabs.nl/en/latest/manpages/nsd-control.html) CLI tool but avoids directly executing the binary. + Instead, it utilizes `ndsudo`, a Netdata helper specifically designed to run privileged commands securely within the Netdata environment. + This approach eliminates the need to use `sudo`, improving security and potentially simplifying permission management. + + Executed commands: + + - `nsd-control stats_noreset` + method_description: "" + supported_platforms: + include: [] + exclude: [] + multi_instance: false + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: "" + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: [] + configuration: + file: + name: go.d/nsd.conf + options: + description: | + The following options can be defined globally: update_every. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 10 + required: false + - name: timeout + description: nsd-control binary execution timeout. + default_value: 2 + required: false + examples: + folding: + title: Config + enabled: true + list: + - name: Custom update_every + description: Allows you to override the default data collection interval. + config: | + jobs: + - name: nsd + update_every: 5 # Collect logical volume statistics every 5 seconds + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: These metrics refer to the the entire monitored application. + labels: [] + metrics: + - name: nsd.queries + description: Queries + unit: 'queries/s' + chart_type: line + dimensions: + - name: queries + - name: nsd.queries_by_type + description: Queries Type + unit: 'queries/s' + chart_type: stacked + dimensions: + - name: "A" + - name: "NS" + - name: "MD" + - name: "MF" + - name: "CNAME" + - name: "SOA" + - name: "MB" + - name: "MG" + - name: "MR" + - name: "NULL" + - name: "WKS" + - name: "PTR" + - name: "HINFO" + - name: "MINFO" + - name: "MX" + - name: "TXT" + - name: "RP" + - name: "AFSDB" + - name: "X25" + - name: "ISDN" + - name: "RT" + - name: "NSAP" + - name: "SIG" + - name: "KEY" + - name: "PX" + - name: "AAAA" + - name: "LOC" + - name: "NXT" + - name: "SRV" + - name: "NAPTR" + - name: "KX" + - name: "CERT" + - name: "DNAME" + - name: "OPT" + - name: "APL" + - name: "DS" + - name: "SSHFP" + - name: "IPSECKEY" + - name: "RRSIG" + - name: "NSEC" + - name: "DNSKEY" + - name: "DHCID" + - name: "NSEC3" + - name: "NSEC3PARAM" + - name: "TLSA" + - name: "SMIMEA" + - name: "CDS" + - name: "CDNSKEY" + - name: "OPENPGPKEY" + - name: "CSYNC" + - name: "ZONEMD" + - name: "SVCB" + - name: "HTTPS" + - name: "SPF" + - name: "NID" + - name: "L32" + - name: "L64" + - name: "LP" + - name: "EUI48" + - name: "EUI64" + - name: "URI" + - name: "CAA" + - name: "AVC" + - name: "DLV" + - name: "IXFR" + - name: "AXFR" + - name: "MAILB" + - name: "MAILA" + - name: "ANY" + - name: nsd.queries_by_opcode + description: Queries Opcode + unit: 'queries/s' + chart_type: stacked + dimensions: + - name: "QUERY" + - name: "IQUERY" + - name: "STATUS" + - name: "NOTIFY" + - name: "UPDATE" + - name: "OTHER" + - name: nsd.queries_by_class + description: Queries Class + unit: 'queries/s' + chart_type: stacked + dimensions: + - name: "IN" + - name: "CS" + - name: "CH" + - name: "HS" + - name: nsd.queries_by_protocol + description: Queries Protocol + unit: 'queries/s' + chart_type: stacked + dimensions: + - name: "udp" + - name: "udp6" + - name: "tcp" + - name: "tcp6" + - name: "tls" + - name: "tls6" + - name: nsd.answers_by_rcode + description: Answers Rcode + unit: 'answers/s' + chart_type: stacked + dimensions: + - name: "NOERROR" + - name: "FORMERR" + - name: "SERVFAIL" + - name: "NXDOMAIN" + - name: "NOTIMP" + - name: "REFUSED" + - name: "YXDOMAIN" + - name: "YXRRSET" + - name: "NXRRSET" + - name: "NOTAUTH" + - name: "NOTZONE" + - name: "RCODE11" + - name: "RCODE12" + - name: "RCODE13" + - name: "RCODE14" + - name: "RCODE15" + - name: "BADVERS" + - name: nsd.errors + description: Errors + unit: 'errors/s' + chart_type: line + dimensions: + - name: "query" + - name: "answer" + - name: nsd.drops + description: Drops + unit: 'drops/s' + chart_type: line + dimensions: + - name: "query" + - name: nsd.zones + description: Zones + unit: 'zones' + chart_type: line + dimensions: + - name: "master" + - name: "slave" + - name: nsd.zone_transfers_requests + description: Zone Transfers + unit: 'requests/s' + chart_type: line + dimensions: + - name: "AXFR" + - name: "IXFR" + - name: nsd.zone_transfer_memory + description: Zone Transfer Memory + unit: 'bytes' + chart_type: line + dimensions: + - name: "used" + - name: nsd.database_size + description: Database Size + unit: 'bytes' + chart_type: line + dimensions: + - name: "disk" + - name: "mem" + - name: nsd.uptime + description: Uptime + unit: 'seconds' + chart_type: line + dimensions: + - name: "uptime" diff --git a/src/go/plugin/go.d/modules/nsd/nsd.go b/src/go/plugin/go.d/modules/nsd/nsd.go new file mode 100644 index 00000000..fae0f67f --- /dev/null +++ b/src/go/plugin/go.d/modules/nsd/nsd.go @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package nsd + +import ( + _ "embed" + "errors" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("nsd", module.Creator{ + JobConfigSchema: configSchema, + Defaults: module.Defaults{ + UpdateEvery: 10, + }, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Nsd { + return &Nsd{ + Config: Config{ + Timeout: web.Duration(time.Second * 2), + }, + charts: charts.Copy(), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Timeout web.Duration `yaml:"timeout,omitempty" json:"timeout"` +} + +type Nsd struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + exec nsdControlBinary +} + +func (n *Nsd) Configuration() any { + return n.Config +} + +func (n *Nsd) Init() error { + nsdControl, err := n.initNsdControlExec() + if err != nil { + n.Errorf("nsd-control exec initialization: %v", err) + return err + } + n.exec = nsdControl + + return nil +} + +func (n *Nsd) Check() error { + mx, err := n.collect() + if err != nil { + n.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (n *Nsd) Charts() *module.Charts { + return n.charts +} + +func (n *Nsd) Collect() map[string]int64 { + mx, err := n.collect() + if err != nil { + n.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (n *Nsd) Cleanup() {} diff --git a/src/go/plugin/go.d/modules/nsd/nsd_test.go b/src/go/plugin/go.d/modules/nsd/nsd_test.go new file mode 100644 index 00000000..24f38b51 --- /dev/null +++ b/src/go/plugin/go.d/modules/nsd/nsd_test.go @@ -0,0 +1,337 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package nsd + +import ( + "errors" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataStats, _ = os.ReadFile("testdata/stats.txt") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + "dataStats": dataStats, + } { + require.NotNil(t, data, name) + + } +} + +func TestNsd_Configuration(t *testing.T) { + module.TestConfigurationSerialize(t, &Nsd{}, dataConfigJSON, dataConfigYAML) +} + +func TestNsd_Init(t *testing.T) { + tests := map[string]struct { + config Config + wantFail bool + }{ + "fails if failed to locate ndsudo": { + wantFail: true, + config: New().Config, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + nsd := New() + nsd.Config = test.config + + if test.wantFail { + assert.Error(t, nsd.Init()) + } else { + assert.NoError(t, nsd.Init()) + } + }) + } +} + +func TestNsd_Cleanup(t *testing.T) { + tests := map[string]struct { + prepare func() *Nsd + }{ + "not initialized exec": { + prepare: func() *Nsd { + return New() + }, + }, + "after check": { + prepare: func() *Nsd { + nsd := New() + nsd.exec = prepareMockOK() + _ = nsd.Check() + return nsd + }, + }, + "after collect": { + prepare: func() *Nsd { + nsd := New() + nsd.exec = prepareMockOK() + _ = nsd.Collect() + return nsd + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + nsd := test.prepare() + + assert.NotPanics(t, nsd.Cleanup) + }) + } +} + +func TestNsd_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestNsd_Check(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockNsdControl + wantFail bool + }{ + "success case": { + prepareMock: prepareMockOK, + wantFail: false, + }, + "error on stats call": { + prepareMock: prepareMockErrOnStats, + wantFail: true, + }, + "empty response": { + prepareMock: prepareMockEmptyResponse, + wantFail: true, + }, + "unexpected response": { + prepareMock: prepareMockUnexpectedResponse, + wantFail: true, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + nsd := New() + mock := test.prepareMock() + nsd.exec = mock + + if test.wantFail { + assert.Error(t, nsd.Check()) + } else { + assert.NoError(t, nsd.Check()) + } + }) + } +} + +func TestNsd_Collect(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockNsdControl + wantMetrics map[string]int64 + }{ + "success case": { + prepareMock: prepareMockOK, + wantMetrics: map[string]int64{ + "num.answer_wo_aa": 1, + "num.class.CH": 0, + "num.class.CS": 0, + "num.class.HS": 0, + "num.class.IN": 1, + "num.dropped": 1, + "num.edns": 1, + "num.ednserr": 1, + "num.opcode.IQUERY": 0, + "num.opcode.NOTIFY": 0, + "num.opcode.OTHER": 0, + "num.opcode.QUERY": 1, + "num.opcode.STATUS": 0, + "num.opcode.UPDATE": 0, + "num.queries": 1, + "num.raxfr": 1, + "num.rcode.BADVERS": 0, + "num.rcode.FORMERR": 1, + "num.rcode.NOERROR": 1, + "num.rcode.NOTAUTH": 0, + "num.rcode.NOTIMP": 1, + "num.rcode.NOTZONE": 0, + "num.rcode.NXDOMAIN": 1, + "num.rcode.NXRRSET": 0, + "num.rcode.RCODE11": 0, + "num.rcode.RCODE12": 0, + "num.rcode.RCODE13": 0, + "num.rcode.RCODE14": 0, + "num.rcode.RCODE15": 0, + "num.rcode.REFUSED": 1, + "num.rcode.SERVFAIL": 1, + "num.rcode.YXDOMAIN": 1, + "num.rcode.YXRRSET": 0, + "num.rixfr": 1, + "num.rxerr": 1, + "num.tcp": 1, + "num.tcp6": 1, + "num.tls": 1, + "num.tls6": 1, + "num.truncated": 1, + "num.txerr": 1, + "num.type.A": 1, + "num.type.AAAA": 1, + "num.type.AFSDB": 1, + "num.type.APL": 1, + "num.type.AVC": 0, + "num.type.CAA": 0, + "num.type.CDNSKEY": 1, + "num.type.CDS": 1, + "num.type.CERT": 1, + "num.type.CNAME": 1, + "num.type.CSYNC": 1, + "num.type.DHCID": 1, + "num.type.DLV": 0, + "num.type.DNAME": 1, + "num.type.DNSKEY": 1, + "num.type.DS": 1, + "num.type.EUI48": 1, + "num.type.EUI64": 1, + "num.type.HINFO": 1, + "num.type.HTTPS": 1, + "num.type.IPSECKEY": 1, + "num.type.ISDN": 1, + "num.type.KEY": 1, + "num.type.KX": 1, + "num.type.L32": 1, + "num.type.L64": 1, + "num.type.LOC": 1, + "num.type.LP": 1, + "num.type.MB": 1, + "num.type.MD": 1, + "num.type.MF": 1, + "num.type.MG": 1, + "num.type.MINFO": 1, + "num.type.MR": 1, + "num.type.MX": 1, + "num.type.NAPTR": 1, + "num.type.NID": 1, + "num.type.NS": 1, + "num.type.NSAP": 1, + "num.type.NSEC": 1, + "num.type.NSEC3": 1, + "num.type.NSEC3PARAM": 1, + "num.type.NULL": 1, + "num.type.NXT": 1, + "num.type.OPENPGPKEY": 1, + "num.type.OPT": 1, + "num.type.PTR": 1, + "num.type.PX": 1, + "num.type.RP": 1, + "num.type.RRSIG": 1, + "num.type.RT": 1, + "num.type.SIG": 1, + "num.type.SMIMEA": 1, + "num.type.SOA": 1, + "num.type.SPF": 1, + "num.type.SRV": 1, + "num.type.SSHFP": 1, + "num.type.SVCB": 1, + "num.type.TLSA": 1, + "num.type.TXT": 1, + "num.type.TYPE252": 0, + "num.type.TYPE255": 0, + "num.type.URI": 0, + "num.type.WKS": 1, + "num.type.X25": 1, + "num.type.ZONEMD": 1, + "num.udp": 1, + "num.udp6": 1, + "server0.queries": 1, + "size.config.disk": 1, + "size.config.mem": 1064, + "size.db.disk": 576, + "size.db.mem": 920, + "size.xfrd.mem": 1160464, + "time.boot": 556, + "zone.master": 1, + "zone.slave": 1, + }, + }, + "error on lvs report call": { + prepareMock: prepareMockErrOnStats, + wantMetrics: nil, + }, + "empty response": { + prepareMock: prepareMockEmptyResponse, + wantMetrics: nil, + }, + "unexpected response": { + prepareMock: prepareMockUnexpectedResponse, + wantMetrics: nil, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + nsd := New() + mock := test.prepareMock() + nsd.exec = mock + + mx := nsd.Collect() + + assert.Equal(t, test.wantMetrics, mx) + + if len(test.wantMetrics) > 0 { + assert.Len(t, *nsd.Charts(), len(charts)) + module.TestMetricsHasAllChartsDims(t, nsd.Charts(), mx) + } + }) + } +} + +func prepareMockOK() *mockNsdControl { + return &mockNsdControl{ + dataStats: dataStats, + } +} + +func prepareMockErrOnStats() *mockNsdControl { + return &mockNsdControl{ + errOnStatus: true, + } +} + +func prepareMockEmptyResponse() *mockNsdControl { + return &mockNsdControl{} +} + +func prepareMockUnexpectedResponse() *mockNsdControl { + return &mockNsdControl{ + dataStats: []byte(` +Lorem ipsum dolor sit amet, consectetur adipiscing elit. +Nulla malesuada erat id magna mattis, eu viverra tellus rhoncus. +Fusce et felis pulvinar, posuere sem non, porttitor eros. +`), + } +} + +type mockNsdControl struct { + errOnStatus bool + dataStats []byte +} + +func (m *mockNsdControl) stats() ([]byte, error) { + if m.errOnStatus { + return nil, errors.New("mock.status() error") + } + return m.dataStats, nil +} diff --git a/src/go/plugin/go.d/modules/nsd/stats_counters.go b/src/go/plugin/go.d/modules/nsd/stats_counters.go new file mode 100644 index 00000000..8ebe706a --- /dev/null +++ b/src/go/plugin/go.d/modules/nsd/stats_counters.go @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package nsd + +// Docs: https://nsd.docs.nlnetlabs.nl/en/latest/manpages/nsd-control.html?highlight=elapsed#statistics-counters +// Source: https://github.com/NLnetLabs/nsd/blob/b4a5ccd2235a1f8f71f7c640390e409bf123c963/remote.c#L2735 + +// https://github.com/NLnetLabs/nsd/blob/b4a5ccd2235a1f8f71f7c640390e409bf123c963/remote.c#L2737 +var answerRcodes = []string{ + "NOERROR", + "FORMERR", + "SERVFAIL", + "NXDOMAIN", + "NOTIMP", + "REFUSED", + "YXDOMAIN", + "YXRRSET", + "NXRRSET", + "NOTAUTH", + "NOTZONE", + "RCODE11", + "RCODE12", + "RCODE13", + "RCODE14", + "RCODE15", + "BADVERS", +} + +// https://github.com/NLnetLabs/nsd/blob/b4a5ccd2235a1f8f71f7c640390e409bf123c963/remote.c#L2706 +var queryOpcodes = []string{ + "QUERY", + "IQUERY", + "STATUS", + "NOTIFY", + "UPDATE", + "OTHER", +} + +// https://github.com/NLnetLabs/nsd/blob/b4a5ccd2235a1f8f71f7c640390e409bf123c963/dns.c#L27 +var queryClasses = []string{ + "IN", + "CS", + "CH", + "HS", +} + +// https://github.com/NLnetLabs/nsd/blob/b4a5ccd2235a1f8f71f7c640390e409bf123c963/dns.c#L35 +var queryTypes = []string{ + "A", + "NS", + "MD", + "MF", + "CNAME", + "SOA", + "MB", + "MG", + "MR", + "NULL", + "WKS", + "PTR", + "HINFO", + "MINFO", + "MX", + "TXT", + "RP", + "AFSDB", + "X25", + "ISDN", + "RT", + "NSAP", + "SIG", + "KEY", + "PX", + "AAAA", + "LOC", + "NXT", + "SRV", + "NAPTR", + "KX", + "CERT", + "DNAME", + "OPT", + "APL", + "DS", + "SSHFP", + "IPSECKEY", + "RRSIG", + "NSEC", + "DNSKEY", + "DHCID", + "NSEC3", + "NSEC3PARAM", + "TLSA", + "SMIMEA", + "CDS", + "CDNSKEY", + "OPENPGPKEY", + "CSYNC", + "ZONEMD", + "SVCB", + "HTTPS", + "SPF", + "NID", + "L32", + "L64", + "LP", + "EUI48", + "EUI64", + "URI", + "CAA", + "AVC", + "DLV", + "TYPE252", + "TYPE255", +} + +var queryTypeNumberMap = map[string]string{ + "TYPE251": "IXFR", + "TYPE252": "AXFR", + "TYPE253": "MAILB", + "TYPE254": "MAILA", + "TYPE255": "ANY", +} diff --git a/src/go/collectors/go.d.plugin/modules/storcli/testdata/config.json b/src/go/plugin/go.d/modules/nsd/testdata/config.json index 291ecee3..291ecee3 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/testdata/config.json +++ b/src/go/plugin/go.d/modules/nsd/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/storcli/testdata/config.yaml b/src/go/plugin/go.d/modules/nsd/testdata/config.yaml index 25b0b4c7..25b0b4c7 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/nsd/testdata/config.yaml diff --git a/src/go/plugin/go.d/modules/nsd/testdata/stats.txt b/src/go/plugin/go.d/modules/nsd/testdata/stats.txt new file mode 100644 index 00000000..cb6d8b82 --- /dev/null +++ b/src/go/plugin/go.d/modules/nsd/testdata/stats.txt @@ -0,0 +1,95 @@ +server0.queries=1 +num.queries=1 +time.boot=556.488415 +time.elapsed=556.488415 +size.db.disk=576 +size.db.mem=920 +size.xfrd.mem=1160464 +size.config.disk=1 +size.config.mem=1064 +num.type.A=1 +num.type.NS=1 +num.type.MD=1 +num.type.MF=1 +num.type.CNAME=1 +num.type.SOA=1 +num.type.MB=1 +num.type.MG=1 +num.type.MR=1 +num.type.NULL=1 +num.type.WKS=1 +num.type.PTR=1 +num.type.HINFO=1 +num.type.MINFO=1 +num.type.MX=1 +num.type.TXT=1 +num.type.RP=1 +num.type.AFSDB=1 +num.type.X25=1 +num.type.ISDN=1 +num.type.RT=1 +num.type.NSAP=1 +num.type.SIG=1 +num.type.KEY=1 +num.type.PX=1 +num.type.AAAA=1 +num.type.LOC=1 +num.type.NXT=1 +num.type.SRV=1 +num.type.NAPTR=1 +num.type.KX=1 +num.type.CERT=1 +num.type.DNAME=1 +num.type.OPT=1 +num.type.APL=1 +num.type.DS=1 +num.type.SSHFP=1 +num.type.IPSECKEY=1 +num.type.RRSIG=1 +num.type.NSEC=1 +num.type.DNSKEY=1 +num.type.DHCID=1 +num.type.NSEC3=1 +num.type.NSEC3PARAM=1 +num.type.TLSA=1 +num.type.SMIMEA=1 +num.type.CDS=1 +num.type.CDNSKEY=1 +num.type.OPENPGPKEY=1 +num.type.CSYNC=1 +num.type.ZONEMD=1 +num.type.SVCB=1 +num.type.HTTPS=1 +num.type.SPF=1 +num.type.NID=1 +num.type.L32=1 +num.type.L64=1 +num.type.LP=1 +num.type.EUI48=1 +num.type.EUI64=1 +num.opcode.QUERY=1 +num.class.IN=1 +num.rcode.NOERROR=1 +num.rcode.FORMERR=1 +num.rcode.SERVFAIL=1 +num.rcode.NXDOMAIN=1 +num.rcode.NOTIMP=1 +num.rcode.REFUSED=1 +num.rcode.YXDOMAIN=1 +num.edns=1 +num.ednserr=1 +num.udp=1 +num.udp6=1 +num.tcp=1 +num.tcp6=1 +num.tls=1 +num.tls6=1 +num.answer_wo_aa=1 +num.rxerr=1 +num.txerr=1 +num.raxfr=1 +num.rixfr=1 +num.truncated=1 +num.dropped=1 +zone.master=1 +zone.slave=1 diff --git a/src/go/collectors/go.d.plugin/modules/ntpd/README.md b/src/go/plugin/go.d/modules/ntpd/README.md index bad92b03..bad92b03 120000 --- a/src/go/collectors/go.d.plugin/modules/ntpd/README.md +++ b/src/go/plugin/go.d/modules/ntpd/README.md diff --git a/src/go/collectors/go.d.plugin/modules/ntpd/charts.go b/src/go/plugin/go.d/modules/ntpd/charts.go index 5726d05a..95baea47 100644 --- a/src/go/collectors/go.d.plugin/modules/ntpd/charts.go +++ b/src/go/plugin/go.d/modules/ntpd/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/ntpd/client.go b/src/go/plugin/go.d/modules/ntpd/client.go index 8e111cd7..8e111cd7 100644 --- a/src/go/collectors/go.d.plugin/modules/ntpd/client.go +++ b/src/go/plugin/go.d/modules/ntpd/client.go diff --git a/src/go/collectors/go.d.plugin/modules/ntpd/collect.go b/src/go/plugin/go.d/modules/ntpd/collect.go index 09553a65..09553a65 100644 --- a/src/go/collectors/go.d.plugin/modules/ntpd/collect.go +++ b/src/go/plugin/go.d/modules/ntpd/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/ntpd/config_schema.json b/src/go/plugin/go.d/modules/ntpd/config_schema.json index f4d763b8..f4d763b8 100644 --- a/src/go/collectors/go.d.plugin/modules/ntpd/config_schema.json +++ b/src/go/plugin/go.d/modules/ntpd/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/ntpd/integrations/ntpd.md b/src/go/plugin/go.d/modules/ntpd/integrations/ntpd.md index f75cb787..c0094c52 100644 --- a/src/go/collectors/go.d.plugin/modules/ntpd/integrations/ntpd.md +++ b/src/go/plugin/go.d/modules/ntpd/integrations/ntpd.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/ntpd/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/ntpd/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/ntpd/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/ntpd/metadata.yaml" sidebar_label: "NTPd" learn_status: "Published" learn_rel_path: "Collecting Metrics/System Clock and NTP" @@ -203,6 +203,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `ntpd` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -225,4 +227,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m ntpd ``` +### Getting Logs + +If you're encountering problems with the `ntpd` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep ntpd +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep ntpd /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep ntpd +``` + diff --git a/src/go/collectors/go.d.plugin/modules/ntpd/metadata.yaml b/src/go/plugin/go.d/modules/ntpd/metadata.yaml index 46178b03..46178b03 100644 --- a/src/go/collectors/go.d.plugin/modules/ntpd/metadata.yaml +++ b/src/go/plugin/go.d/modules/ntpd/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/ntpd/ntpd.go b/src/go/plugin/go.d/modules/ntpd/ntpd.go index 062bb14f..01162468 100644 --- a/src/go/collectors/go.d.plugin/modules/ntpd/ntpd.go +++ b/src/go/plugin/go.d/modules/ntpd/ntpd.go @@ -8,9 +8,9 @@ import ( "fmt" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/iprange" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/iprange" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/ntpd/ntpd_test.go b/src/go/plugin/go.d/modules/ntpd/ntpd_test.go index 9435485d..99c0519c 100644 --- a/src/go/collectors/go.d.plugin/modules/ntpd/ntpd_test.go +++ b/src/go/plugin/go.d/modules/ntpd/ntpd_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/ntpd/testdata/config.json b/src/go/plugin/go.d/modules/ntpd/testdata/config.json index fc8d6844..fc8d6844 100644 --- a/src/go/collectors/go.d.plugin/modules/ntpd/testdata/config.json +++ b/src/go/plugin/go.d/modules/ntpd/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/ntpd/testdata/config.yaml b/src/go/plugin/go.d/modules/ntpd/testdata/config.yaml index 94cee852..94cee852 100644 --- a/src/go/collectors/go.d.plugin/modules/ntpd/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/ntpd/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/README.md b/src/go/plugin/go.d/modules/nvidia_smi/README.md index 3527bdb4..3527bdb4 120000 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/README.md +++ b/src/go/plugin/go.d/modules/nvidia_smi/README.md diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/charts.go b/src/go/plugin/go.d/modules/nvidia_smi/charts.go index 4ffdb47b..746c8eed 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/charts.go +++ b/src/go/plugin/go.d/modules/nvidia_smi/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( @@ -53,16 +53,6 @@ var ( migDeviceFrameBufferMemoryUsageChartTmpl.Copy(), migDeviceBAR1MemoryUsageChartTmpl.Copy(), } - gpuCSVCharts = module.Charts{ - gpuFanSpeedPercChartTmpl.Copy(), - gpuUtilizationChartTmpl.Copy(), - gpuMemUtilizationChartTmpl.Copy(), - gpuFrameBufferMemoryUsageChartTmpl.Copy(), - gpuTemperatureChartTmpl.Copy(), - gpuClockFreqChartTmpl.Copy(), - gpuPowerDrawChartTmpl.Copy(), - gpuPerformanceStateChartTmpl.Copy(), - } ) var ( @@ -271,7 +261,7 @@ var ( } ) -func (nv *NvidiaSMI) addGPUXMLCharts(gpu xmlGPUInfo) { +func (nv *NvidiaSmi) addGPUXMLCharts(gpu gpuInfo) { charts := gpuXMLCharts.Copy() if !isValidValue(gpu.Utilization.GpuUtil) { @@ -318,37 +308,6 @@ func (nv *NvidiaSMI) addGPUXMLCharts(gpu xmlGPUInfo) { } } -func (nv *NvidiaSMI) addGPUCSVCharts(gpu csvGPUInfo) { - charts := gpuCSVCharts.Copy() - - if !isValidValue(gpu.utilizationGPU) { - _ = charts.Remove(gpuUtilizationChartTmpl.ID) - } - if !isValidValue(gpu.utilizationMemory) { - _ = charts.Remove(gpuMemUtilizationChartTmpl.ID) - } - if !isValidValue(gpu.fanSpeed) { - _ = charts.Remove(gpuFanSpeedPercChartTmpl.ID) - } - if !isValidValue(gpu.powerDraw) { - _ = charts.Remove(gpuPowerDrawChartTmpl.ID) - } - - for _, c := range *charts { - c.ID = fmt.Sprintf(c.ID, strings.ToLower(gpu.uuid)) - c.Labels = []module.Label{ - {Key: "product_name", Value: gpu.name}, - } - for _, d := range c.Dims { - d.ID = fmt.Sprintf(d.ID, gpu.uuid) - } - } - - if err := nv.Charts().Add(*charts...); err != nil { - nv.Warning(err) - } -} - var ( migDeviceFrameBufferMemoryUsageChartTmpl = module.Chart{ ID: "mig_instance_%s_gpu_%s_frame_buffer_memory_usage", @@ -379,7 +338,7 @@ var ( } ) -func (nv *NvidiaSMI) addMIGDeviceXMLCharts(gpu xmlGPUInfo, mig xmlMIGDeviceInfo) { +func (nv *NvidiaSmi) addMIGDeviceCharts(gpu gpuInfo, mig gpuMIGDeviceInfo) { charts := migDeviceXMLCharts.Copy() for _, c := range *charts { @@ -399,7 +358,7 @@ func (nv *NvidiaSMI) addMIGDeviceXMLCharts(gpu xmlGPUInfo, mig xmlMIGDeviceInfo) } } -func (nv *NvidiaSMI) removeCharts(prefix string) { +func (nv *NvidiaSmi) removeCharts(prefix string) { prefix = strings.ToLower(prefix) for _, c := range *nv.Charts() { diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/collect_xml.go b/src/go/plugin/go.d/modules/nvidia_smi/collect.go index 2ab3180a..f621d191 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/collect_xml.go +++ b/src/go/plugin/go.d/modules/nvidia_smi/collect.go @@ -4,18 +4,33 @@ package nvidia_smi import ( "encoding/xml" + "errors" "fmt" "strconv" "strings" ) -func (nv *NvidiaSMI) collectGPUInfoXML(mx map[string]int64) error { - bs, err := nv.exec.queryGPUInfoXML() +func (nv *NvidiaSmi) collect() (map[string]int64, error) { + if nv.exec == nil { + return nil, errors.New("nvidia-smi exec is not initialized") + } + + mx := make(map[string]int64) + + if err := nv.collectGPUInfo(mx); err != nil { + return nil, err + } + + return mx, nil +} + +func (nv *NvidiaSmi) collectGPUInfo(mx map[string]int64) error { + bs, err := nv.exec.queryGPUInfo() if err != nil { return fmt.Errorf("error on quering XML GPU info: %v", err) } - info := &xmlInfo{} + info := &gpusInfo{} if err := xml.Unmarshal(bs, info); err != nil { return fmt.Errorf("error on unmarshaling XML GPU info response: %v", err) } @@ -39,11 +54,11 @@ func (nv *NvidiaSMI) collectGPUInfoXML(mx map[string]int64) error { addMetric(mx, px+"pcie_bandwidth_usage_rx", gpu.PCI.RxUtil, 1024) // KB => bytes addMetric(mx, px+"pcie_bandwidth_usage_tx", gpu.PCI.TxUtil, 1024) // KB => bytes - if max := calcMaxPCIEBandwidth(gpu); max > 0 { + if maxBw := calcMaxPCIEBandwidth(gpu); maxBw > 0 { rx := parseFloat(gpu.PCI.RxUtil) * 1024 // KB => bytes tx := parseFloat(gpu.PCI.TxUtil) * 1024 // KB => bytes - mx[px+"pcie_bandwidth_utilization_rx"] = int64((rx * 100 / max) * 100) - mx[px+"pcie_bandwidth_utilization_tx"] = int64((tx * 100 / max) * 100) + mx[px+"pcie_bandwidth_utilization_rx"] = int64((rx * 100 / maxBw) * 100) + mx[px+"pcie_bandwidth_utilization_tx"] = int64((tx * 100 / maxBw) * 100) } addMetric(mx, px+"fan_speed_perc", gpu.FanSpeed, 0) addMetric(mx, px+"gpu_utilization", gpu.Utilization.GpuUtil, 0) @@ -88,7 +103,7 @@ func (nv *NvidiaSMI) collectGPUInfoXML(mx map[string]int64) error { if !nv.migs[px] { nv.migs[px] = true - nv.addMIGDeviceXMLCharts(gpu, mig) + nv.addMIGDeviceCharts(gpu, mig) } addMetric(mx, px+"ecc_error_sram_uncorrectable", mig.ECCErrorCount.VolatileCount.SRAMUncorrectable, 0) @@ -117,7 +132,7 @@ func (nv *NvidiaSMI) collectGPUInfoXML(mx map[string]int64) error { return nil } -func calcMaxPCIEBandwidth(gpu xmlGPUInfo) float64 { +func calcMaxPCIEBandwidth(gpu gpuInfo) float64 { gen := gpu.PCI.PCIGPULinkInfo.PCIEGen.MaxLinkGen width := strings.TrimSuffix(gpu.PCI.PCIGPULinkInfo.LinkWidths.MaxLinkWidth, "x") @@ -146,120 +161,44 @@ func calcMaxPCIEBandwidth(gpu xmlGPUInfo) float64 { return (speed*parseFloat(width)*(1-enc) - 1) * 1e9 / 8 // Gb/s => bytes } -type ( - xmlInfo struct { - GPUs []xmlGPUInfo `xml:"gpu"` +func addMetric(mx map[string]int64, key, value string, mul int) { + if !isValidValue(value) { + return } - xmlGPUInfo struct { - ID string `xml:"id,attr"` - ProductName string `xml:"product_name"` - ProductBrand string `xml:"product_brand"` - ProductArchitecture string `xml:"product_architecture"` - UUID string `xml:"uuid"` - FanSpeed string `xml:"fan_speed"` - PerformanceState string `xml:"performance_state"` - MIGMode struct { - CurrentMIG string `xml:"current_mig"` - } `xml:"mig_mode"` - MIGDevices struct { - MIGDevice []xmlMIGDeviceInfo `xml:"mig_device"` - } `xml:"mig_devices"` - PCI struct { - TxUtil string `xml:"tx_util"` - RxUtil string `xml:"rx_util"` - PCIGPULinkInfo struct { - PCIEGen struct { - MaxLinkGen string `xml:"max_link_gen"` - } `xml:"pcie_gen"` - LinkWidths struct { - MaxLinkWidth string `xml:"max_link_width"` - } `xml:"link_widths"` - } `xml:"pci_gpu_link_info"` - } `xml:"pci"` - Utilization struct { - GpuUtil string `xml:"gpu_util"` - MemoryUtil string `xml:"memory_util"` - EncoderUtil string `xml:"encoder_util"` - DecoderUtil string `xml:"decoder_util"` - } `xml:"utilization"` - FBMemoryUsage struct { - Total string `xml:"total"` - Reserved string `xml:"reserved"` - Used string `xml:"used"` - Free string `xml:"free"` - } `xml:"fb_memory_usage"` - Bar1MemoryUsage struct { - Total string `xml:"total"` - Used string `xml:"used"` - Free string `xml:"free"` - } `xml:"bar1_memory_usage"` - Temperature struct { - GpuTemp string `xml:"gpu_temp"` - GpuTempMaxThreshold string `xml:"gpu_temp_max_threshold"` - GpuTempSlowThreshold string `xml:"gpu_temp_slow_threshold"` - GpuTempMaxGpuThreshold string `xml:"gpu_temp_max_gpu_threshold"` - GpuTargetTemperature string `xml:"gpu_target_temperature"` - MemoryTemp string `xml:"memory_temp"` - GpuTempMaxMemThreshold string `xml:"gpu_temp_max_mem_threshold"` - } `xml:"temperature"` - Clocks struct { - GraphicsClock string `xml:"graphics_clock"` - SmClock string `xml:"sm_clock"` - MemClock string `xml:"mem_clock"` - VideoClock string `xml:"video_clock"` - } `xml:"clocks"` - PowerReadings *xmlPowerReadings `xml:"power_readings"` - GPUPowerReadings *xmlPowerReadings `xml:"gpu_power_readings"` - Voltage struct { - GraphicsVolt string `xml:"graphics_volt"` - } `xml:"voltage"` - Processes struct { - ProcessInfo []struct { - PID string `xml:"pid"` - ProcessName string `xml:"process_name"` - UsedMemory string `xml:"used_memory"` - } `sml:"process_info"` - } `xml:"processes"` + + value = removeUnits(value) + + v, err := strconv.ParseFloat(value, 64) + if err != nil { + return } - xmlPowerReadings struct { - //PowerState string `xml:"power_state"` - //PowerManagement string `xml:"power_management"` - PowerDraw string `xml:"power_draw"` - //PowerLimit string `xml:"power_limit"` - //DefaultPowerLimit string `xml:"default_power_limit"` - //EnforcedPowerLimit string `xml:"enforced_power_limit"` - //MinPowerLimit string `xml:"min_power_limit"` - //MaxPowerLimit string `xml:"max_power_limit"` + if mul > 0 { + v *= float64(mul) } - xmlMIGDeviceInfo struct { - Index string `xml:"index"` - GPUInstanceID string `xml:"gpu_instance_id"` - ComputeInstanceID string `xml:"compute_instance_id"` - DeviceAttributes struct { - Shared struct { - MultiprocessorCount string `xml:"multiprocessor_count"` - CopyEngineCount string `xml:"copy_engine_count"` - EncoderCount string `xml:"encoder_count"` - DecoderCount string `xml:"decoder_count"` - OFACount string `xml:"ofa_count"` - JPGCount string `xml:"jpg_count"` - } `xml:"shared"` - } `xml:"device_attributes"` - ECCErrorCount struct { - VolatileCount struct { - SRAMUncorrectable string `xml:"sram_uncorrectable"` - } `xml:"volatile_count"` - } `xml:"ecc_error_count"` - FBMemoryUsage struct { - Free string `xml:"free"` - Used string `xml:"used"` - Reserved string `xml:"reserved"` - } `xml:"fb_memory_usage"` - BAR1MemoryUsage struct { - Free string `xml:"free"` - Used string `xml:"used"` - } `xml:"bar1_memory_usage"` + mx[key] = int64(v) +} + +func isValidValue(v string) bool { + return v != "" && v != "N/A" && v != "[N/A]" +} + +func parseFloat(s string) float64 { + v, _ := strconv.ParseFloat(removeUnits(s), 64) + return v +} + +func removeUnits(s string) string { + if i := strings.IndexByte(s, ' '); i != -1 { + s = s[:i] } -) + return s +} + +func boolToInt(v bool) int64 { + if v { + return 1 + } + return 0 +} diff --git a/src/go/plugin/go.d/modules/nvidia_smi/config_schema.json b/src/go/plugin/go.d/modules/nvidia_smi/config_schema.json new file mode 100644 index 00000000..3f93badc --- /dev/null +++ b/src/go/plugin/go.d/modules/nvidia_smi/config_schema.json @@ -0,0 +1,56 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "NVIDIA SMI collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 10 + }, + "binary_path": { + "title": "Binary path", + "description": "Path to the `nvidia-smi` binary.", + "type": "string", + "default": "nvidia-smi" + }, + "timeout": { + "title": "Timeout", + "description": "Timeout for executing the binary, specified in seconds.", + "type": "number", + "minimum": 0.5, + "default": 10 + }, + "loop_mode": { + "title": "Loop Mode", + "description": "When enabled, `nvidia-smi` is executed continuously in a separate thread using the `-l` option.", + "type": "boolean", + "default": true + } + }, + "required": [ + "binary_path" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "binary_path": { + "ui:help": "If an absolute path is provided, the collector will use it directly; otherwise, it will search for the binary in directories specified in the PATH environment variable." + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + }, + "loop_mode": { + "ui:help": "In loop mode, `nvidia-smi` will repeatedly query GPU data at specified intervals, defined by the `-l SEC` or `--loop=SEC` parameter, rather than just running the query once. This enables ongoing performance tracking by putting the application to sleep between queries." + } + } +} diff --git a/src/go/plugin/go.d/modules/nvidia_smi/exec.go b/src/go/plugin/go.d/modules/nvidia_smi/exec.go new file mode 100644 index 00000000..11a26131 --- /dev/null +++ b/src/go/plugin/go.d/modules/nvidia_smi/exec.go @@ -0,0 +1,213 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package nvidia_smi + +import ( + "bufio" + "bytes" + "context" + "errors" + "fmt" + "os/exec" + "strconv" + "sync" + "time" + + "github.com/netdata/netdata/go/plugins/logger" +) + +type nvidiaSmiBinary interface { + queryGPUInfo() ([]byte, error) + stop() error +} + +func newNvidiaSmiBinary(path string, cfg Config, log *logger.Logger) (nvidiaSmiBinary, error) { + if !cfg.LoopMode { + return &nvidiaSmiExec{ + Logger: log, + binPath: path, + timeout: cfg.Timeout.Duration(), + }, nil + } + + smi := &nvidiaSmiLoopExec{ + Logger: log, + binPath: path, + updateEvery: cfg.UpdateEvery, + firstSampleTimeout: time.Second * 3, + } + + if err := smi.run(); err != nil { + return nil, err + } + + return smi, nil +} + +type nvidiaSmiExec struct { + *logger.Logger + + binPath string + timeout time.Duration +} + +func (e *nvidiaSmiExec) queryGPUInfo() ([]byte, error) { + ctx, cancel := context.WithTimeout(context.Background(), e.timeout) + defer cancel() + + cmd := exec.CommandContext(ctx, e.binPath, "-q", "-x") + + e.Debugf("executing '%s'", cmd) + bs, err := cmd.Output() + if err != nil { + return nil, fmt.Errorf("error on '%s': %v", cmd, err) + } + + return bs, nil +} + +func (e *nvidiaSmiExec) stop() error { return nil } + +type nvidiaSmiLoopExec struct { + *logger.Logger + + binPath string + + updateEvery int + firstSampleTimeout time.Duration + + cmd *exec.Cmd + done chan struct{} + + mux sync.Mutex + lastSample string +} + +func (e *nvidiaSmiLoopExec) queryGPUInfo() ([]byte, error) { + select { + case <-e.done: + return nil, errors.New("process has already exited") + default: + } + + e.mux.Lock() + defer e.mux.Unlock() + + return []byte(e.lastSample), nil +} + +func (e *nvidiaSmiLoopExec) run() error { + secs := 5 + if e.updateEvery < secs { + secs = e.updateEvery + } + + cmd := exec.Command(e.binPath, "-q", "-x", "-l", strconv.Itoa(secs)) + + e.Debugf("executing '%s'", cmd) + + r, err := cmd.StdoutPipe() + if err != nil { + return err + } + + if err := cmd.Start(); err != nil { + return err + } + + firstSample := make(chan struct{}, 1) + done := make(chan struct{}) + e.cmd = cmd + e.done = done + + go func() { + defer close(done) + + var buf bytes.Buffer + var insideLog bool + var emptyRows int64 + var outsideLogRows int64 + + const unexpectedRowsLimit = 500 + + sc := bufio.NewScanner(r) + + for sc.Scan() { + line := sc.Text() + + if !insideLog { + outsideLogRows++ + } else { + outsideLogRows = 0 + } + + if line == "" { + emptyRows++ + } else { + emptyRows = 0 + } + + if outsideLogRows >= unexpectedRowsLimit || emptyRows >= unexpectedRowsLimit { + e.Errorf("unexpected output from nvidia-smi loop: outside log rows %d, empty rows %d", outsideLogRows, emptyRows) + break + } + + switch { + case line == "<nvidia_smi_log>": + insideLog = true + buf.Reset() + + buf.WriteString(line) + buf.WriteByte('\n') + case line == "</nvidia_smi_log>": + insideLog = false + + buf.WriteString(line) + + e.mux.Lock() + e.lastSample = buf.String() + e.mux.Unlock() + + buf.Reset() + + select { + case firstSample <- struct{}{}: + default: + } + case insideLog: + buf.WriteString(line) + buf.WriteByte('\n') + default: + continue + } + } + }() + + select { + case <-e.done: + _ = e.stop() + return errors.New("process exited before the first sample was collected") + case <-time.After(e.firstSampleTimeout): + _ = e.stop() + return errors.New("timed out waiting for first sample") + case <-firstSample: + return nil + } +} + +func (e *nvidiaSmiLoopExec) stop() error { + if e.cmd == nil || e.cmd.Process == nil { + return nil + } + + _ = e.cmd.Process.Kill() + _ = e.cmd.Wait() + e.cmd = nil + + select { + case <-e.done: + return nil + case <-time.After(time.Second * 2): + return errors.New("timed out waiting for process to exit") + } +} diff --git a/src/go/plugin/go.d/modules/nvidia_smi/gpu_info.go b/src/go/plugin/go.d/modules/nvidia_smi/gpu_info.go new file mode 100644 index 00000000..506d36f6 --- /dev/null +++ b/src/go/plugin/go.d/modules/nvidia_smi/gpu_info.go @@ -0,0 +1,121 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package nvidia_smi + +type gpusInfo struct { + GPUs []gpuInfo `xml:"gpu"` +} + +type ( + gpuInfo struct { + ID string `xml:"id,attr"` + ProductName string `xml:"product_name"` + ProductBrand string `xml:"product_brand"` + ProductArchitecture string `xml:"product_architecture"` + UUID string `xml:"uuid"` + FanSpeed string `xml:"fan_speed"` + PerformanceState string `xml:"performance_state"` + MIGMode struct { + CurrentMIG string `xml:"current_mig"` + } `xml:"mig_mode"` + MIGDevices struct { + MIGDevice []gpuMIGDeviceInfo `xml:"mig_device"` + } `xml:"mig_devices"` + PCI struct { + TxUtil string `xml:"tx_util"` + RxUtil string `xml:"rx_util"` + PCIGPULinkInfo struct { + PCIEGen struct { + MaxLinkGen string `xml:"max_link_gen"` + } `xml:"pcie_gen"` + LinkWidths struct { + MaxLinkWidth string `xml:"max_link_width"` + } `xml:"link_widths"` + } `xml:"pci_gpu_link_info"` + } `xml:"pci"` + Utilization struct { + GpuUtil string `xml:"gpu_util"` + MemoryUtil string `xml:"memory_util"` + EncoderUtil string `xml:"encoder_util"` + DecoderUtil string `xml:"decoder_util"` + } `xml:"utilization"` + FBMemoryUsage struct { + Total string `xml:"total"` + Reserved string `xml:"reserved"` + Used string `xml:"used"` + Free string `xml:"free"` + } `xml:"fb_memory_usage"` + Bar1MemoryUsage struct { + Total string `xml:"total"` + Used string `xml:"used"` + Free string `xml:"free"` + } `xml:"bar1_memory_usage"` + Temperature struct { + GpuTemp string `xml:"gpu_temp"` + GpuTempMaxThreshold string `xml:"gpu_temp_max_threshold"` + GpuTempSlowThreshold string `xml:"gpu_temp_slow_threshold"` + GpuTempMaxGpuThreshold string `xml:"gpu_temp_max_gpu_threshold"` + GpuTargetTemperature string `xml:"gpu_target_temperature"` + MemoryTemp string `xml:"memory_temp"` + GpuTempMaxMemThreshold string `xml:"gpu_temp_max_mem_threshold"` + } `xml:"temperature"` + Clocks struct { + GraphicsClock string `xml:"graphics_clock"` + SmClock string `xml:"sm_clock"` + MemClock string `xml:"mem_clock"` + VideoClock string `xml:"video_clock"` + } `xml:"clocks"` + PowerReadings *gpuPowerReadings `xml:"power_readings"` + GPUPowerReadings *gpuPowerReadings `xml:"gpu_power_readings"` + Voltage struct { + GraphicsVolt string `xml:"graphics_volt"` + } `xml:"voltage"` + Processes struct { + ProcessInfo []struct { + PID string `xml:"pid"` + ProcessName string `xml:"process_name"` + UsedMemory string `xml:"used_memory"` + } `sml:"process_info"` + } `xml:"processes"` + } + gpuPowerReadings struct { + //PowerState string `xml:"power_state"` + //PowerManagement string `xml:"power_management"` + PowerDraw string `xml:"power_draw"` + //PowerLimit string `xml:"power_limit"` + //DefaultPowerLimit string `xml:"default_power_limit"` + //EnforcedPowerLimit string `xml:"enforced_power_limit"` + //MinPowerLimit string `xml:"min_power_limit"` + //MaxPowerLimit string `xml:"max_power_limit"` + } + + gpuMIGDeviceInfo struct { + Index string `xml:"index"` + GPUInstanceID string `xml:"gpu_instance_id"` + ComputeInstanceID string `xml:"compute_instance_id"` + DeviceAttributes struct { + Shared struct { + MultiprocessorCount string `xml:"multiprocessor_count"` + CopyEngineCount string `xml:"copy_engine_count"` + EncoderCount string `xml:"encoder_count"` + DecoderCount string `xml:"decoder_count"` + OFACount string `xml:"ofa_count"` + JPGCount string `xml:"jpg_count"` + } `xml:"shared"` + } `xml:"device_attributes"` + ECCErrorCount struct { + VolatileCount struct { + SRAMUncorrectable string `xml:"sram_uncorrectable"` + } `xml:"volatile_count"` + } `xml:"ecc_error_count"` + FBMemoryUsage struct { + Free string `xml:"free"` + Used string `xml:"used"` + Reserved string `xml:"reserved"` + } `xml:"fb_memory_usage"` + BAR1MemoryUsage struct { + Free string `xml:"free"` + Used string `xml:"used"` + } `xml:"bar1_memory_usage"` + } +) diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/init.go b/src/go/plugin/go.d/modules/nvidia_smi/init.go index d8a815bb..c13b2fff 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/init.go +++ b/src/go/plugin/go.d/modules/nvidia_smi/init.go @@ -8,7 +8,7 @@ import ( "os/exec" ) -func (nv *NvidiaSMI) initNvidiaSMIExec() (nvidiaSMI, error) { +func (nv *NvidiaSmi) initNvidiaSmiExec() (nvidiaSmiBinary, error) { binPath := nv.BinaryPath if _, err := os.Stat(binPath); os.IsNotExist(err) { path, err := exec.LookPath(nv.binName) @@ -18,5 +18,5 @@ func (nv *NvidiaSMI) initNvidiaSMIExec() (nvidiaSMI, error) { binPath = path } - return newNvidiaSMIExec(binPath, nv.Config, nv.Logger) + return newNvidiaSmiBinary(binPath, nv.Config, nv.Logger) } diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/integrations/nvidia_gpu.md b/src/go/plugin/go.d/modules/nvidia_smi/integrations/nvidia_gpu.md index 28016cfb..620c0963 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/integrations/nvidia_gpu.md +++ b/src/go/plugin/go.d/modules/nvidia_smi/integrations/nvidia_gpu.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/nvidia_smi/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/nvidia_smi/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/nvidia_smi/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/nvidia_smi/metadata.yaml" sidebar_label: "Nvidia GPU" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -24,8 +24,6 @@ Module: nvidia_smi This collector monitors GPUs performance metrics using the [nvidia-smi](https://developer.nvidia.com/nvidia-system-management-interface) CLI tool. -> **Warning**: under development, [loop mode](https://github.com/netdata/netdata/issues/14522) not implemented yet. - @@ -70,24 +68,24 @@ Labels: Metrics: -| Metric | Dimensions | Unit | XML | CSV | -|:------|:----------|:----|:---:|:---:| -| nvidia_smi.gpu_pcie_bandwidth_usage | rx, tx | B/s | • | | -| nvidia_smi.gpu_pcie_bandwidth_utilization | rx, tx | % | • | | -| nvidia_smi.gpu_fan_speed_perc | fan_speed | % | • | • | -| nvidia_smi.gpu_utilization | gpu | % | • | • | -| nvidia_smi.gpu_memory_utilization | memory | % | • | • | -| nvidia_smi.gpu_decoder_utilization | decoder | % | • | | -| nvidia_smi.gpu_encoder_utilization | encoder | % | • | | -| nvidia_smi.gpu_frame_buffer_memory_usage | free, used, reserved | B | • | • | -| nvidia_smi.gpu_bar1_memory_usage | free, used | B | • | | -| nvidia_smi.gpu_temperature | temperature | Celsius | • | • | -| nvidia_smi.gpu_voltage | voltage | V | • | | -| nvidia_smi.gpu_clock_freq | graphics, video, sm, mem | MHz | • | • | -| nvidia_smi.gpu_power_draw | power_draw | Watts | • | • | -| nvidia_smi.gpu_performance_state | P0-P15 | state | • | • | -| nvidia_smi.gpu_mig_mode_current_status | enabled, disabled | status | • | | -| nvidia_smi.gpu_mig_devices_count | mig | devices | • | | +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| nvidia_smi.gpu_pcie_bandwidth_usage | rx, tx | B/s | +| nvidia_smi.gpu_pcie_bandwidth_utilization | rx, tx | % | +| nvidia_smi.gpu_fan_speed_perc | fan_speed | % | +| nvidia_smi.gpu_utilization | gpu | % | +| nvidia_smi.gpu_memory_utilization | memory | % | +| nvidia_smi.gpu_decoder_utilization | decoder | % | +| nvidia_smi.gpu_encoder_utilization | encoder | % | +| nvidia_smi.gpu_frame_buffer_memory_usage | free, used, reserved | B | +| nvidia_smi.gpu_bar1_memory_usage | free, used | B | +| nvidia_smi.gpu_temperature | temperature | Celsius | +| nvidia_smi.gpu_voltage | voltage | V | +| nvidia_smi.gpu_clock_freq | graphics, video, sm, mem | MHz | +| nvidia_smi.gpu_power_draw | power_draw | Watts | +| nvidia_smi.gpu_performance_state | P0-P15 | state | +| nvidia_smi.gpu_mig_mode_current_status | enabled, disabled | status | +| nvidia_smi.gpu_mig_devices_count | mig | devices | ### Per mig @@ -103,10 +101,10 @@ Labels: Metrics: -| Metric | Dimensions | Unit | XML | CSV | -|:------|:----------|:----|:---:|:---:| -| nvidia_smi.gpu_mig_frame_buffer_memory_usage | free, used, reserved | B | • | | -| nvidia_smi.gpu_mig_bar1_memory_usage | free, used | B | • | | +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| nvidia_smi.gpu_mig_frame_buffer_memory_usage | free, used, reserved | B | +| nvidia_smi.gpu_mig_bar1_memory_usage | free, used | B | @@ -119,11 +117,7 @@ There are no alerts configured by default for this integration. ### Prerequisites -#### Enable in go.d.conf. - -This collector is disabled by default. You need to explicitly enable it in the `go.d.conf` file. - - +No action required. ### Configuration @@ -152,26 +146,12 @@ The following options can be defined globally: update_every, autodetection_retry | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | | binary_path | Path to nvidia_smi binary. The default is "nvidia_smi" and the executable is looked for in the directories specified in the PATH environment variable. | nvidia_smi | no | | timeout | nvidia_smi binary execution timeout. | 2 | no | -| use_csv_format | Used format when requesting GPU information. XML is used if set to 'no'. | no | no | +| loop_mode | When enabled, `nvidia-smi` is executed continuously in a separate thread using the `-l` option. | yes | no | </details> #### Examples -##### CSV format - -Use CSV format when requesting GPU information. - -<details open><summary>Config</summary> - -```yaml -jobs: - - name: nvidia_smi - use_csv_format: yes - -``` -</details> - ##### Custom binary path The executable is not in the directories specified in the PATH environment variable. @@ -192,6 +172,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `nvidia_smi` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -214,4 +196,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m nvidia_smi ``` +### Getting Logs + +If you're encountering problems with the `nvidia_smi` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep nvidia_smi +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep nvidia_smi /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep nvidia_smi +``` + diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/metadata.yaml b/src/go/plugin/go.d/modules/nvidia_smi/metadata.yaml index 630037d7..2a79b5ac 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/metadata.yaml +++ b/src/go/plugin/go.d/modules/nvidia_smi/metadata.yaml @@ -25,8 +25,6 @@ modules: metrics_description: | This collector monitors GPUs performance metrics using the [nvidia-smi](https://developer.nvidia.com/nvidia-system-management-interface) CLI tool. - - > **Warning**: under development, [loop mode](https://github.com/netdata/netdata/issues/14522) not implemented yet. method_description: "" supported_platforms: include: [] @@ -43,10 +41,7 @@ modules: description: "" setup: prerequisites: - list: - - title: Enable in go.d.conf. - description: | - This collector is disabled by default. You need to explicitly enable it in the `go.d.conf` file. + list: [] configuration: file: name: go.d/nvidia_smi.conf @@ -73,26 +68,15 @@ modules: description: nvidia_smi binary execution timeout. default_value: 2 required: false - - name: use_csv_format - description: Used format when requesting GPU information. XML is used if set to 'no'. - default_value: false + - name: loop_mode + description: "When enabled, `nvidia-smi` is executed continuously in a separate thread using the `-l` option." + default_value: true required: false - details: | - This module supports data collection in CSV and XML formats. The default is XML. - - - XML provides more metrics, but requesting GPU information consumes more CPU, especially if there are multiple GPUs in the system. - - CSV provides fewer metrics, but is much lighter than XML in terms of CPU usage. examples: folding: title: Config enabled: true list: - - name: CSV format - description: Use CSV format when requesting GPU information. - config: | - jobs: - - name: nvidia_smi - use_csv_format: yes - name: Custom binary path description: The executable is not in the directories specified in the PATH environment variable. config: | @@ -108,9 +92,7 @@ modules: title: Metrics enabled: false description: "" - availability: - - XML - - CSV + availability: [] scopes: - name: gpu description: These metrics refer to the GPU. @@ -121,8 +103,6 @@ modules: description: GPU product name (e.g. NVIDIA A100-SXM4-40GB) metrics: - name: nvidia_smi.gpu_pcie_bandwidth_usage - availability: - - XML description: PCI Express Bandwidth Usage unit: B/s chart_type: line @@ -130,8 +110,6 @@ modules: - name: rx - name: tx - name: nvidia_smi.gpu_pcie_bandwidth_utilization - availability: - - XML description: PCI Express Bandwidth Utilization unit: '%' chart_type: line @@ -139,52 +117,36 @@ modules: - name: rx - name: tx - name: nvidia_smi.gpu_fan_speed_perc - availability: - - XML - - CSV description: Fan speed unit: '%' chart_type: line dimensions: - name: fan_speed - name: nvidia_smi.gpu_utilization - availability: - - XML - - CSV description: GPU utilization unit: '%' chart_type: line dimensions: - name: gpu - name: nvidia_smi.gpu_memory_utilization - availability: - - XML - - CSV description: Memory utilization unit: '%' chart_type: line dimensions: - name: memory - name: nvidia_smi.gpu_decoder_utilization - availability: - - XML description: Decoder utilization unit: '%' chart_type: line dimensions: - name: decoder - name: nvidia_smi.gpu_encoder_utilization - availability: - - XML description: Encoder utilization unit: '%' chart_type: line dimensions: - name: encoder - name: nvidia_smi.gpu_frame_buffer_memory_usage - availability: - - XML - - CSV description: Frame buffer memory usage unit: B chart_type: stacked @@ -193,8 +155,6 @@ modules: - name: used - name: reserved - name: nvidia_smi.gpu_bar1_memory_usage - availability: - - XML description: BAR1 memory usage unit: B chart_type: stacked @@ -202,26 +162,18 @@ modules: - name: free - name: used - name: nvidia_smi.gpu_temperature - availability: - - XML - - CSV description: Temperature unit: Celsius chart_type: line dimensions: - name: temperature - name: nvidia_smi.gpu_voltage - availability: - - XML description: Voltage unit: V chart_type: line dimensions: - name: voltage - name: nvidia_smi.gpu_clock_freq - availability: - - XML - - CSV description: Clock current frequency unit: MHz chart_type: line @@ -231,26 +183,18 @@ modules: - name: sm - name: mem - name: nvidia_smi.gpu_power_draw - availability: - - XML - - CSV description: Power draw unit: Watts chart_type: line dimensions: - name: power_draw - name: nvidia_smi.gpu_performance_state - availability: - - XML - - CSV description: Performance state unit: state chart_type: line dimensions: - name: P0-P15 - name: nvidia_smi.gpu_mig_mode_current_status - availability: - - XML description: MIG current mode unit: status chart_type: line @@ -258,8 +202,6 @@ modules: - name: enabled - name: disabled - name: nvidia_smi.gpu_mig_devices_count - availability: - - XML description: MIG devices unit: devices chart_type: line @@ -276,8 +218,6 @@ modules: description: GPU instance id (e.g. 1) metrics: - name: nvidia_smi.gpu_mig_frame_buffer_memory_usage - availability: - - XML description: Frame buffer memory usage unit: B chart_type: stacked @@ -286,8 +226,6 @@ modules: - name: used - name: reserved - name: nvidia_smi.gpu_mig_bar1_memory_usage - availability: - - XML description: BAR1 memory usage unit: B chart_type: stacked diff --git a/src/go/plugin/go.d/modules/nvidia_smi/nvidia_smi.go b/src/go/plugin/go.d/modules/nvidia_smi/nvidia_smi.go new file mode 100644 index 00000000..3f89df05 --- /dev/null +++ b/src/go/plugin/go.d/modules/nvidia_smi/nvidia_smi.go @@ -0,0 +1,114 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package nvidia_smi + +import ( + _ "embed" + "errors" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("nvidia_smi", module.Creator{ + JobConfigSchema: configSchema, + Defaults: module.Defaults{ + UpdateEvery: 10, + }, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *NvidiaSmi { + return &NvidiaSmi{ + Config: Config{ + Timeout: web.Duration(time.Second * 10), + LoopMode: true, + }, + binName: "nvidia-smi", + charts: &module.Charts{}, + gpus: make(map[string]bool), + migs: make(map[string]bool), + } + +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Timeout web.Duration `yaml:"timeout,omitempty" json:"timeout"` + BinaryPath string `yaml:"binary_path" json:"binary_path"` + LoopMode bool `yaml:"loop_mode,omitempty" json:"loop_mode"` +} + +type NvidiaSmi struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + exec nvidiaSmiBinary + binName string + + gpus map[string]bool + migs map[string]bool +} + +func (nv *NvidiaSmi) Configuration() any { + return nv.Config +} + +func (nv *NvidiaSmi) Init() error { + if nv.exec == nil { + smi, err := nv.initNvidiaSmiExec() + if err != nil { + nv.Error(err) + return err + } + nv.exec = smi + } + + return nil +} + +func (nv *NvidiaSmi) Check() error { + mx, err := nv.collect() + if err != nil { + nv.Error(err) + return err + } + if len(mx) == 0 { + return errors.New("no metrics collected") + } + return nil +} + +func (nv *NvidiaSmi) Charts() *module.Charts { + return nv.charts +} + +func (nv *NvidiaSmi) Collect() map[string]int64 { + mx, err := nv.collect() + if err != nil { + nv.Error(err) + } + + if len(mx) == 0 { + return nil + } + return mx +} + +func (nv *NvidiaSmi) Cleanup() { + if nv.exec != nil { + if err := nv.exec.stop(); err != nil { + nv.Errorf("cleanup: %v", err) + } + nv.exec = nil + } +} diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/nvidia_smi_test.go b/src/go/plugin/go.d/modules/nvidia_smi/nvidia_smi_test.go index af2d3a15..d2070b06 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/nvidia_smi_test.go +++ b/src/go/plugin/go.d/modules/nvidia_smi/nvidia_smi_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -24,9 +24,6 @@ var ( dataXMLTeslaP100, _ = os.ReadFile("testdata/tesla-p100.xml") dataXMLA100SXM4MIG, _ = os.ReadFile("testdata/a100-sxm4-mig.xml") - - dataHelpQueryGPU, _ = os.ReadFile("testdata/help-query-gpu.txt") - dataCSVTeslaP100, _ = os.ReadFile("testdata/tesla-p100.csv") ) func Test_testDataIsValid(t *testing.T) { @@ -38,25 +35,23 @@ func Test_testDataIsValid(t *testing.T) { "dataXMLRTX3060": dataXMLRTX3060, "dataXMLTeslaP100": dataXMLTeslaP100, "dataXMLA100SXM4MIG": dataXMLA100SXM4MIG, - "dataHelpQueryGPU": dataHelpQueryGPU, - "dataCSVTeslaP100": dataCSVTeslaP100, } { require.NotNil(t, data, name) } } -func TestNvidiaSMI_ConfigurationSerialize(t *testing.T) { - module.TestConfigurationSerialize(t, &NvidiaSMI{}, dataConfigJSON, dataConfigYAML) +func TestNvidiaSmi_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &NvidiaSmi{}, dataConfigJSON, dataConfigYAML) } -func TestNvidiaSMI_Init(t *testing.T) { +func TestNvidiaSmi_Init(t *testing.T) { tests := map[string]struct { - prepare func(nv *NvidiaSMI) + prepare func(nv *NvidiaSmi) wantFail bool }{ "fails if can't local nvidia-smi": { wantFail: true, - prepare: func(nv *NvidiaSMI) { + prepare: func(nv *NvidiaSmi) { nv.binName += "!!!" }, }, @@ -77,46 +72,34 @@ func TestNvidiaSMI_Init(t *testing.T) { } } -func TestNvidiaSMI_Charts(t *testing.T) { +func TestNvidiaSmi_Charts(t *testing.T) { assert.NotNil(t, New().Charts()) } -func TestNvidiaSMI_Check(t *testing.T) { +func TestNvidiaSmi_Check(t *testing.T) { tests := map[string]struct { - prepare func(nv *NvidiaSMI) + prepare func(nv *NvidiaSmi) wantFail bool }{ - "success A100-SXM4 MIG [XML]": { - wantFail: false, - prepare: prepareCaseMIGA100formatXML, - }, - "success RTX 3060 [XML]": { + "success A100-SXM4 MIG": { wantFail: false, - prepare: prepareCaseRTX3060formatXML, + prepare: prepareCaseMIGA100, }, - "success Tesla P100 [XML]": { + "success RTX 3060": { wantFail: false, - prepare: prepareCaseTeslaP100formatXML, + prepare: prepareCaseRTX3060, }, - "success Tesla P100 [CSV]": { + "success Tesla P100": { wantFail: false, - prepare: prepareCaseTeslaP100formatCSV, + prepare: prepareCaseTeslaP100, }, - "success RTX 2080 Win [XML]": { + "success RTX 2080 Win": { wantFail: false, - prepare: prepareCaseRTX2080WinFormatXML, + prepare: prepareCaseRTX2080Win, }, - "fail on queryGPUInfoXML error": { + "fail on queryGPUInfo error": { wantFail: true, - prepare: prepareCaseErrOnQueryGPUInfoXML, - }, - "fail on queryGPUInfoCSV error": { - wantFail: true, - prepare: prepareCaseErrOnQueryGPUInfoCSV, - }, - "fail on queryHelpQueryGPU error": { - wantFail: true, - prepare: prepareCaseErrOnQueryHelpQueryGPU, + prepare: prepareCaseErrOnQueryGPUInfo, }, } @@ -135,16 +118,16 @@ func TestNvidiaSMI_Check(t *testing.T) { } } -func TestNvidiaSMI_Collect(t *testing.T) { +func TestNvidiaSmi_Collect(t *testing.T) { type testCaseStep struct { - prepare func(nv *NvidiaSMI) - check func(t *testing.T, nv *NvidiaSMI) + prepare func(nv *NvidiaSmi) + check func(t *testing.T, nv *NvidiaSmi) } tests := map[string][]testCaseStep{ - "success A100-SXM4 MIG [XML]": { + "success A100-SXM4 MIG": { { - prepare: prepareCaseMIGA100formatXML, - check: func(t *testing.T, nv *NvidiaSMI) { + prepare: prepareCaseMIGA100, + check: func(t *testing.T, nv *NvidiaSmi) { mx := nv.Collect() expected := map[string]int64{ @@ -201,10 +184,10 @@ func TestNvidiaSMI_Collect(t *testing.T) { }, }, }, - "success RTX 4090 Driver 535 [XML]": { + "success RTX 4090 Driver 535": { { - prepare: prepareCaseRTX4090Driver535formatXML, - check: func(t *testing.T, nv *NvidiaSMI) { + prepare: prepareCaseRTX4090Driver535, + check: func(t *testing.T, nv *NvidiaSmi) { mx := nv.Collect() expected := map[string]int64{ @@ -251,10 +234,10 @@ func TestNvidiaSMI_Collect(t *testing.T) { }, }, }, - "success RTX 3060 [XML]": { + "success RTX 3060": { { - prepare: prepareCaseRTX3060formatXML, - check: func(t *testing.T, nv *NvidiaSMI) { + prepare: prepareCaseRTX3060, + check: func(t *testing.T, nv *NvidiaSmi) { mx := nv.Collect() expected := map[string]int64{ @@ -300,10 +283,10 @@ func TestNvidiaSMI_Collect(t *testing.T) { }, }, }, - "success Tesla P100 [XML]": { + "success Tesla P100": { { - prepare: prepareCaseTeslaP100formatXML, - check: func(t *testing.T, nv *NvidiaSMI) { + prepare: prepareCaseTeslaP100, + check: func(t *testing.T, nv *NvidiaSmi) { mx := nv.Collect() expected := map[string]int64{ @@ -348,50 +331,10 @@ func TestNvidiaSMI_Collect(t *testing.T) { }, }, }, - "success Tesla P100 [CSV]": { - { - prepare: prepareCaseTeslaP100formatCSV, - check: func(t *testing.T, nv *NvidiaSMI) { - mx := nv.Collect() - - expected := map[string]int64{ - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_frame_buffer_memory_usage_free": 17070817280, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_frame_buffer_memory_usage_reserved": 108003328, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_frame_buffer_memory_usage_used": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_gpu_utilization": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_graphics_clock": 405, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_mem_clock": 715, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_mem_utilization": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P0": 1, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P1": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P10": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P11": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P12": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P13": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P14": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P15": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P2": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P3": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P4": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P5": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P6": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P7": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P8": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_performance_state_P9": 0, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_power_draw": 28, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_sm_clock": 405, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_temperature": 37, - "gpu_GPU-ef1b2c9b-38d8-2090-2bd1-f567a3eb42a6_video_clock": 835, - } - - assert.Equal(t, expected, mx) - }, - }, - }, - "success RTX 2080 Win [XML]": { + "success RTX 2080 Win": { { - prepare: prepareCaseRTX2080WinFormatXML, - check: func(t *testing.T, nv *NvidiaSMI) { + prepare: prepareCaseRTX2080Win, + check: func(t *testing.T, nv *NvidiaSmi) { mx := nv.Collect() expected := map[string]int64{ @@ -437,30 +380,10 @@ func TestNvidiaSMI_Collect(t *testing.T) { }, }, }, - "fail on queryGPUInfoXML error [XML]": { + "fails on queryGPUInfo error": { { - prepare: prepareCaseErrOnQueryGPUInfoXML, - check: func(t *testing.T, nv *NvidiaSMI) { - mx := nv.Collect() - - assert.Equal(t, map[string]int64(nil), mx) - }, - }, - }, - "fail on queryGPUInfoCSV error [CSV]": { - { - prepare: prepareCaseErrOnQueryGPUInfoCSV, - check: func(t *testing.T, nv *NvidiaSMI) { - mx := nv.Collect() - - assert.Equal(t, map[string]int64(nil), mx) - }, - }, - }, - "fail on queryHelpQueryGPU error": { - { - prepare: prepareCaseErrOnQueryHelpQueryGPU, - check: func(t *testing.T, nv *NvidiaSMI) { + prepare: prepareCaseErrOnQueryGPUInfo, + check: func(t *testing.T, nv *NvidiaSmi) { mx := nv.Collect() assert.Equal(t, map[string]int64(nil), mx) @@ -483,79 +406,42 @@ func TestNvidiaSMI_Collect(t *testing.T) { } } -type mockNvidiaSMI struct { - gpuInfoXML []byte - errOnQueryGPUInfoXML bool - - gpuInfoCSV []byte - errOnQueryGPUInfoCSV bool - - helpQueryGPU []byte - errOnQueryHelpQueryGPU bool +type mockNvidiaSmi struct { + gpuInfo []byte + errOnQueryGPUInfo bool } -func (m *mockNvidiaSMI) queryGPUInfoXML() ([]byte, error) { - if m.errOnQueryGPUInfoXML { - return nil, errors.New("error on mock.queryGPUInfoXML()") +func (m *mockNvidiaSmi) queryGPUInfo() ([]byte, error) { + if m.errOnQueryGPUInfo { + return nil, errors.New("error on mock.queryGPUInfo()") } - return m.gpuInfoXML, nil -} - -func (m *mockNvidiaSMI) queryGPUInfoCSV(_ []string) ([]byte, error) { - if m.errOnQueryGPUInfoCSV { - return nil, errors.New("error on mock.queryGPUInfoCSV()") - } - return m.gpuInfoCSV, nil -} - -func (m *mockNvidiaSMI) queryHelpQueryGPU() ([]byte, error) { - if m.errOnQueryHelpQueryGPU { - return nil, errors.New("error on mock.queryHelpQueryGPU()") - } - return m.helpQueryGPU, nil -} - -func prepareCaseMIGA100formatXML(nv *NvidiaSMI) { - nv.UseCSVFormat = false - nv.exec = &mockNvidiaSMI{gpuInfoXML: dataXMLA100SXM4MIG} -} - -func prepareCaseRTX3060formatXML(nv *NvidiaSMI) { - nv.UseCSVFormat = false - nv.exec = &mockNvidiaSMI{gpuInfoXML: dataXMLRTX3060} + return m.gpuInfo, nil } -func prepareCaseRTX4090Driver535formatXML(nv *NvidiaSMI) { - nv.UseCSVFormat = false - nv.exec = &mockNvidiaSMI{gpuInfoXML: dataXMLRTX4090Driver535} +func (m *mockNvidiaSmi) stop() error { + return nil } -func prepareCaseTeslaP100formatXML(nv *NvidiaSMI) { - nv.UseCSVFormat = false - nv.exec = &mockNvidiaSMI{gpuInfoXML: dataXMLTeslaP100} +func prepareCaseMIGA100(nv *NvidiaSmi) { + nv.exec = &mockNvidiaSmi{gpuInfo: dataXMLA100SXM4MIG} } -func prepareCaseRTX2080WinFormatXML(nv *NvidiaSMI) { - nv.UseCSVFormat = false - nv.exec = &mockNvidiaSMI{gpuInfoXML: dataXMLRTX2080Win} +func prepareCaseRTX3060(nv *NvidiaSmi) { + nv.exec = &mockNvidiaSmi{gpuInfo: dataXMLRTX3060} } -func prepareCaseErrOnQueryGPUInfoXML(nv *NvidiaSMI) { - nv.UseCSVFormat = false - nv.exec = &mockNvidiaSMI{errOnQueryGPUInfoXML: true} +func prepareCaseRTX4090Driver535(nv *NvidiaSmi) { + nv.exec = &mockNvidiaSmi{gpuInfo: dataXMLRTX4090Driver535} } -func prepareCaseTeslaP100formatCSV(nv *NvidiaSMI) { - nv.UseCSVFormat = true - nv.exec = &mockNvidiaSMI{helpQueryGPU: dataHelpQueryGPU, gpuInfoCSV: dataCSVTeslaP100} +func prepareCaseTeslaP100(nv *NvidiaSmi) { + nv.exec = &mockNvidiaSmi{gpuInfo: dataXMLTeslaP100} } -func prepareCaseErrOnQueryHelpQueryGPU(nv *NvidiaSMI) { - nv.UseCSVFormat = true - nv.exec = &mockNvidiaSMI{errOnQueryHelpQueryGPU: true} +func prepareCaseRTX2080Win(nv *NvidiaSmi) { + nv.exec = &mockNvidiaSmi{gpuInfo: dataXMLRTX2080Win} } -func prepareCaseErrOnQueryGPUInfoCSV(nv *NvidiaSMI) { - nv.UseCSVFormat = true - nv.exec = &mockNvidiaSMI{helpQueryGPU: dataHelpQueryGPU, errOnQueryGPUInfoCSV: true} +func prepareCaseErrOnQueryGPUInfo(nv *NvidiaSmi) { + nv.exec = &mockNvidiaSmi{errOnQueryGPUInfo: true} } diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/a100-sxm4-mig.xml b/src/go/plugin/go.d/modules/nvidia_smi/testdata/a100-sxm4-mig.xml index 74146ac7..74146ac7 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/a100-sxm4-mig.xml +++ b/src/go/plugin/go.d/modules/nvidia_smi/testdata/a100-sxm4-mig.xml diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/config.json b/src/go/plugin/go.d/modules/nvidia_smi/testdata/config.json index a251e326..6ff79539 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/config.json +++ b/src/go/plugin/go.d/modules/nvidia_smi/testdata/config.json @@ -2,5 +2,5 @@ "update_every": 123, "timeout": 123.123, "binary_path": "ok", - "use_csv_format": true + "loop_mode": true } diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/config.yaml b/src/go/plugin/go.d/modules/nvidia_smi/testdata/config.yaml index 0b580dbc..1f2fedef 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/nvidia_smi/testdata/config.yaml @@ -1,4 +1,4 @@ update_every: 123 timeout: 123.123 binary_path: "ok" -use_csv_format: yes +loop_mode: true diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/rtx-2080-win.xml b/src/go/plugin/go.d/modules/nvidia_smi/testdata/rtx-2080-win.xml index 9bc0d222..9bc0d222 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/rtx-2080-win.xml +++ b/src/go/plugin/go.d/modules/nvidia_smi/testdata/rtx-2080-win.xml diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/rtx-3060.xml b/src/go/plugin/go.d/modules/nvidia_smi/testdata/rtx-3060.xml index ad63fd51..ad63fd51 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/rtx-3060.xml +++ b/src/go/plugin/go.d/modules/nvidia_smi/testdata/rtx-3060.xml diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/rtx-4090-driver-535.xml b/src/go/plugin/go.d/modules/nvidia_smi/testdata/rtx-4090-driver-535.xml index c3c253ff..c3c253ff 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/rtx-4090-driver-535.xml +++ b/src/go/plugin/go.d/modules/nvidia_smi/testdata/rtx-4090-driver-535.xml diff --git a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/tesla-p100.xml b/src/go/plugin/go.d/modules/nvidia_smi/testdata/tesla-p100.xml index 4c43125f..4c43125f 100644 --- a/src/go/collectors/go.d.plugin/modules/nvidia_smi/testdata/tesla-p100.xml +++ b/src/go/plugin/go.d/modules/nvidia_smi/testdata/tesla-p100.xml diff --git a/src/go/collectors/go.d.plugin/modules/nvme/README.md b/src/go/plugin/go.d/modules/nvme/README.md index ca657b90..ca657b90 120000 --- a/src/go/collectors/go.d.plugin/modules/nvme/README.md +++ b/src/go/plugin/go.d/modules/nvme/README.md diff --git a/src/go/collectors/go.d.plugin/modules/nvme/charts.go b/src/go/plugin/go.d/modules/nvme/charts.go index 8404d2dc..08e215ec 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/charts.go +++ b/src/go/plugin/go.d/modules/nvme/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/nvme/collect.go b/src/go/plugin/go.d/modules/nvme/collect.go index 1cc94239..1cc94239 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/collect.go +++ b/src/go/plugin/go.d/modules/nvme/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/nvme/config_schema.json b/src/go/plugin/go.d/modules/nvme/config_schema.json index 179a24ab..179a24ab 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/config_schema.json +++ b/src/go/plugin/go.d/modules/nvme/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/nvme/exec.go b/src/go/plugin/go.d/modules/nvme/exec.go index 8c1281a2..8c1281a2 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/exec.go +++ b/src/go/plugin/go.d/modules/nvme/exec.go diff --git a/src/go/collectors/go.d.plugin/modules/nvme/init.go b/src/go/plugin/go.d/modules/nvme/init.go index 51f1400a..7196208e 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/init.go +++ b/src/go/plugin/go.d/modules/nvme/init.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" + "github.com/netdata/netdata/go/plugins/pkg/executable" ) func (n *NVMe) initNVMeCLIExec() (nvmeCLI, error) { diff --git a/src/go/collectors/go.d.plugin/modules/nvme/integrations/nvme_devices.md b/src/go/plugin/go.d/modules/nvme/integrations/nvme_devices.md index fd18c1fd..9a93c11d 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/integrations/nvme_devices.md +++ b/src/go/plugin/go.d/modules/nvme/integrations/nvme_devices.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/nvme/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/nvme/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/nvme/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/nvme/metadata.yaml" sidebar_label: "NVMe devices" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -182,6 +182,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `nvme` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -204,4 +206,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m nvme ``` +### Getting Logs + +If you're encountering problems with the `nvme` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep nvme +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep nvme /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep nvme +``` + diff --git a/src/go/collectors/go.d.plugin/modules/nvme/metadata.yaml b/src/go/plugin/go.d/modules/nvme/metadata.yaml index 98f35af6..98f35af6 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/metadata.yaml +++ b/src/go/plugin/go.d/modules/nvme/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/nvme/nvme.go b/src/go/plugin/go.d/modules/nvme/nvme.go index 76b6445b..b1b22f59 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/nvme.go +++ b/src/go/plugin/go.d/modules/nvme/nvme.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/nvme/nvme_test.go b/src/go/plugin/go.d/modules/nvme/nvme_test.go index ab814442..2009f789 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/nvme_test.go +++ b/src/go/plugin/go.d/modules/nvme/nvme_test.go @@ -9,7 +9,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/plugin/go.d/modules/nvme/testdata/config.json b/src/go/plugin/go.d/modules/nvme/testdata/config.json new file mode 100644 index 00000000..291ecee3 --- /dev/null +++ b/src/go/plugin/go.d/modules/nvme/testdata/config.json @@ -0,0 +1,4 @@ +{ + "update_every": 123, + "timeout": 123.123 +} diff --git a/src/go/plugin/go.d/modules/nvme/testdata/config.yaml b/src/go/plugin/go.d/modules/nvme/testdata/config.yaml new file mode 100644 index 00000000..25b0b4c7 --- /dev/null +++ b/src/go/plugin/go.d/modules/nvme/testdata/config.yaml @@ -0,0 +1,2 @@ +update_every: 123 +timeout: 123.123 diff --git a/src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-list-empty.json b/src/go/plugin/go.d/modules/nvme/testdata/nvme-list-empty.json index e8da2407..e8da2407 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-list-empty.json +++ b/src/go/plugin/go.d/modules/nvme/testdata/nvme-list-empty.json diff --git a/src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-list.json b/src/go/plugin/go.d/modules/nvme/testdata/nvme-list.json index 6bf159c4..6bf159c4 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-list.json +++ b/src/go/plugin/go.d/modules/nvme/testdata/nvme-list.json diff --git a/src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-smart-log-float.json b/src/go/plugin/go.d/modules/nvme/testdata/nvme-smart-log-float.json index f63dd977..f63dd977 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-smart-log-float.json +++ b/src/go/plugin/go.d/modules/nvme/testdata/nvme-smart-log-float.json diff --git a/src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-smart-log-string.json b/src/go/plugin/go.d/modules/nvme/testdata/nvme-smart-log-string.json index f582e748..f582e748 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-smart-log-string.json +++ b/src/go/plugin/go.d/modules/nvme/testdata/nvme-smart-log-string.json diff --git a/src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-smart-log.json b/src/go/plugin/go.d/modules/nvme/testdata/nvme-smart-log.json index cbd0e4c7..cbd0e4c7 100644 --- a/src/go/collectors/go.d.plugin/modules/nvme/testdata/nvme-smart-log.json +++ b/src/go/plugin/go.d/modules/nvme/testdata/nvme-smart-log.json diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/README.md b/src/go/plugin/go.d/modules/openvpn/README.md index 020da3ac..020da3ac 120000 --- a/src/go/collectors/go.d.plugin/modules/openvpn/README.md +++ b/src/go/plugin/go.d/modules/openvpn/README.md diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/charts.go b/src/go/plugin/go.d/modules/openvpn/charts.go index 435c2151..5874eced 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/charts.go +++ b/src/go/plugin/go.d/modules/openvpn/charts.go @@ -2,7 +2,7 @@ package openvpn -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( // Charts is an alias for module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/client/client.go b/src/go/plugin/go.d/modules/openvpn/client/client.go index ddbfdeaf..23ceb18d 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/client/client.go +++ b/src/go/plugin/go.d/modules/openvpn/client/client.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/socket" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" ) var ( diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/client/client_test.go b/src/go/plugin/go.d/modules/openvpn/client/client_test.go index a21672e0..d40f6ea1 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/client/client_test.go +++ b/src/go/plugin/go.d/modules/openvpn/client/client_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/pkg/socket" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" "github.com/stretchr/testify/assert" ) diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/client/commands.go b/src/go/plugin/go.d/modules/openvpn/client/commands.go index f06b05c9..f06b05c9 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/client/commands.go +++ b/src/go/plugin/go.d/modules/openvpn/client/commands.go diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/client/testdata/load-stats.txt b/src/go/plugin/go.d/modules/openvpn/client/testdata/load-stats.txt index 39c19ac5..39c19ac5 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/client/testdata/load-stats.txt +++ b/src/go/plugin/go.d/modules/openvpn/client/testdata/load-stats.txt diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/client/testdata/status3.txt b/src/go/plugin/go.d/modules/openvpn/client/testdata/status3.txt index 1986703d..1986703d 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/client/testdata/status3.txt +++ b/src/go/plugin/go.d/modules/openvpn/client/testdata/status3.txt diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/client/testdata/version.txt b/src/go/plugin/go.d/modules/openvpn/client/testdata/version.txt index e525876d..e525876d 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/client/testdata/version.txt +++ b/src/go/plugin/go.d/modules/openvpn/client/testdata/version.txt diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/client/types.go b/src/go/plugin/go.d/modules/openvpn/client/types.go index a0a28302..a0a28302 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/client/types.go +++ b/src/go/plugin/go.d/modules/openvpn/client/types.go diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/collect.go b/src/go/plugin/go.d/modules/openvpn/collect.go index 180fae3b..180fae3b 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/collect.go +++ b/src/go/plugin/go.d/modules/openvpn/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/config_schema.json b/src/go/plugin/go.d/modules/openvpn/config_schema.json index 527a06ab..8bbda1fd 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/config_schema.json +++ b/src/go/plugin/go.d/modules/openvpn/config_schema.json @@ -15,7 +15,7 @@ "title": "Address", "description": "The IP address and port where the OpenVPN [Management Interface](https://openvpn.net/community-resources/management-interface/) listens for connections.", "type": "string", - "default": "127.0.0.1:123" + "default": "127.0.0.1:7505" }, "timeout": { "title": "Timeout", @@ -34,7 +34,7 @@ "properties": { "includes": { "title": "Include", - "description": "Include users whose usernames match any of the specified inclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "description": "Include users whose usernames match any of the specified inclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme).", "type": [ "array", "null" @@ -47,7 +47,7 @@ }, "excludes": { "title": "Exclude", - "description": "Exclude users whose usernames match any of the specified exclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "description": "Exclude users whose usernames match any of the specified exclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme).", "type": [ "array", "null" diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/init.go b/src/go/plugin/go.d/modules/openvpn/init.go index cba0c86e..563edbaa 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/init.go +++ b/src/go/plugin/go.d/modules/openvpn/init.go @@ -3,9 +3,9 @@ package openvpn import ( - "github.com/netdata/netdata/go/go.d.plugin/modules/openvpn/client" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/socket" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/openvpn/client" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" ) func (o *OpenVPN) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/integrations/openvpn.md b/src/go/plugin/go.d/modules/openvpn/integrations/openvpn.md index 04cd1f50..612d5eaa 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/integrations/openvpn.md +++ b/src/go/plugin/go.d/modules/openvpn/integrations/openvpn.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/openvpn/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/openvpn/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/openvpn/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/openvpn/metadata.yaml" sidebar_label: "OpenVPN" learn_status: "Published" learn_rel_path: "Collecting Metrics/VPNs" @@ -99,7 +99,7 @@ There are no alerts configured by default for this integration. #### Enable in go.d.conf. -This collector is disabled by default. You need to explicitly enable it in [go.d.conf](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d.conf). +This collector is disabled by default. You need to explicitly enable it in [go.d.conf](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/config/go.d.conf). From the documentation for the OpenVPN Management Interface: > Currently, the OpenVPN daemon can at most support a single management client any one time. @@ -198,6 +198,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `openvpn` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -220,4 +222,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m openvpn ``` +### Getting Logs + +If you're encountering problems with the `openvpn` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep openvpn +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep openvpn /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep openvpn +``` + diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/metadata.yaml b/src/go/plugin/go.d/modules/openvpn/metadata.yaml index b1f583c9..49360b2f 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/metadata.yaml +++ b/src/go/plugin/go.d/modules/openvpn/metadata.yaml @@ -44,7 +44,7 @@ modules: list: - title: Enable in go.d.conf. description: | - This collector is disabled by default. You need to explicitly enable it in [go.d.conf](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d.conf). + This collector is disabled by default. You need to explicitly enable it in [go.d.conf](https://github.com/netdata/netdata/blob/master/src/go/plugin/go.d/config/go.d.conf). From the documentation for the OpenVPN Management Interface: > Currently, the OpenVPN daemon can at most support a single management client any one time. @@ -84,7 +84,7 @@ modules: Metrics of users matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) - - Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#supported-format). + - Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#supported-format). - Syntax: ```yaml diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/openvpn.go b/src/go/plugin/go.d/modules/openvpn/openvpn.go index 0a5edef0..52bada3e 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/openvpn.go +++ b/src/go/plugin/go.d/modules/openvpn/openvpn.go @@ -6,11 +6,11 @@ import ( _ "embed" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/modules/openvpn/client" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/socket" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/openvpn/client" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/openvpn_test.go b/src/go/plugin/go.d/modules/openvpn/openvpn_test.go index 267713b6..d81747ce 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/openvpn_test.go +++ b/src/go/plugin/go.d/modules/openvpn/openvpn_test.go @@ -6,10 +6,10 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/modules/openvpn/client" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/socket" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/openvpn/client" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/testdata/config.json b/src/go/plugin/go.d/modules/openvpn/testdata/config.json index 30411ebf..30411ebf 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/testdata/config.json +++ b/src/go/plugin/go.d/modules/openvpn/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/openvpn/testdata/config.yaml b/src/go/plugin/go.d/modules/openvpn/testdata/config.yaml index 22296ce5..22296ce5 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/openvpn/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/README.md b/src/go/plugin/go.d/modules/openvpn_status_log/README.md index 603c8249..603c8249 120000 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/README.md +++ b/src/go/plugin/go.d/modules/openvpn_status_log/README.md diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/charts.go b/src/go/plugin/go.d/modules/openvpn_status_log/charts.go index cb8d7c89..56716d29 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/charts.go +++ b/src/go/plugin/go.d/modules/openvpn_status_log/charts.go @@ -5,7 +5,7 @@ package openvpn_status_log import ( "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) var charts = module.Charts{ diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/collect.go b/src/go/plugin/go.d/modules/openvpn_status_log/collect.go index f6a442fd..f6a442fd 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/collect.go +++ b/src/go/plugin/go.d/modules/openvpn_status_log/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/config_schema.json b/src/go/plugin/go.d/modules/openvpn_status_log/config_schema.json index 5a31078d..db3af2cc 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/config_schema.json +++ b/src/go/plugin/go.d/modules/openvpn_status_log/config_schema.json @@ -28,7 +28,7 @@ "properties": { "includes": { "title": "Include", - "description": "Include users whose usernames match any of the specified inclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "description": "Include users whose usernames match any of the specified inclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme).", "type": [ "array", "null" @@ -41,7 +41,7 @@ }, "excludes": { "title": "Exclude", - "description": "Exclude users whose usernames match any of the specified exclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme).", + "description": "Exclude users whose usernames match any of the specified exclusion [patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme).", "type": [ "array", "null" diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/init.go b/src/go/plugin/go.d/modules/openvpn_status_log/init.go index de75d096..f2e6bee3 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/init.go +++ b/src/go/plugin/go.d/modules/openvpn_status_log/init.go @@ -4,7 +4,7 @@ package openvpn_status_log import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" ) func (o *OpenVPNStatusLog) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/integrations/openvpn_status_log.md b/src/go/plugin/go.d/modules/openvpn_status_log/integrations/openvpn_status_log.md index fdbf54e8..9a5b5666 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/integrations/openvpn_status_log.md +++ b/src/go/plugin/go.d/modules/openvpn_status_log/integrations/openvpn_status_log.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/openvpn_status_log/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/openvpn_status_log/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/openvpn_status_log/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/openvpn_status_log/metadata.yaml" sidebar_label: "OpenVPN status log" learn_status: "Published" learn_rel_path: "Collecting Metrics/VPNs" @@ -153,6 +153,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `openvpn_status_log` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -175,4 +177,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m openvpn_status_log ``` +### Getting Logs + +If you're encountering problems with the `openvpn_status_log` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep openvpn_status_log +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep openvpn_status_log /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep openvpn_status_log +``` + diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/metadata.yaml b/src/go/plugin/go.d/modules/openvpn_status_log/metadata.yaml index fbe3ff61..8636de63 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/metadata.yaml +++ b/src/go/plugin/go.d/modules/openvpn_status_log/metadata.yaml @@ -71,7 +71,7 @@ modules: details: | Metrics of users matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) - - Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#supported-format). + - Pattern syntax: [matcher](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#supported-format). - Syntax: ```yaml per_user_stats: diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/openvpn.go b/src/go/plugin/go.d/modules/openvpn_status_log/openvpn.go index 975da02f..7b2914df 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/openvpn.go +++ b/src/go/plugin/go.d/modules/openvpn_status_log/openvpn.go @@ -6,8 +6,8 @@ import ( _ "embed" "errors" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/openvpn_test.go b/src/go/plugin/go.d/modules/openvpn_status_log/openvpn_test.go index 1e6071e0..f3d852d5 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/openvpn_test.go +++ b/src/go/plugin/go.d/modules/openvpn_status_log/openvpn_test.go @@ -7,8 +7,8 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/parser.go b/src/go/plugin/go.d/modules/openvpn_status_log/parser.go index c734fd5f..c734fd5f 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/parser.go +++ b/src/go/plugin/go.d/modules/openvpn_status_log/parser.go diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/config.json b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/config.json index 078a1ae5..078a1ae5 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/config.json +++ b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/config.yaml b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/config.yaml index 1a27ab97..1a27ab97 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/empty.txt b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/empty.txt index e69de29b..e69de29b 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/empty.txt +++ b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/empty.txt diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/static-key.txt b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/static-key.txt index 64b691fc..64b691fc 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/static-key.txt +++ b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/static-key.txt diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version1-no-clients.txt b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version1-no-clients.txt index 34d7a748..34d7a748 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version1-no-clients.txt +++ b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version1-no-clients.txt diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version1.txt b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version1.txt index 0d2f33ba..0d2f33ba 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version1.txt +++ b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version1.txt diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version2-no-clients.txt b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version2-no-clients.txt index 6d1ea1e3..6d1ea1e3 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version2-no-clients.txt +++ b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version2-no-clients.txt diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version2.txt b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version2.txt index d0f4ac8e..d0f4ac8e 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version2.txt +++ b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version2.txt diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version3-no-clients.txt b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version3-no-clients.txt index 6ab671f2..6ab671f2 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version3-no-clients.txt +++ b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version3-no-clients.txt diff --git a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version3.txt b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version3.txt index 7d732042..7d732042 100644 --- a/src/go/collectors/go.d.plugin/modules/openvpn_status_log/testdata/v2.5.1/version3.txt +++ b/src/go/plugin/go.d/modules/openvpn_status_log/testdata/v2.5.1/version3.txt diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/README.md b/src/go/plugin/go.d/modules/pgbouncer/README.md index 3bfcaba0..3bfcaba0 120000 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/README.md +++ b/src/go/plugin/go.d/modules/pgbouncer/README.md diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/charts.go b/src/go/plugin/go.d/modules/pgbouncer/charts.go index bd94f0fd..4ee7b2bc 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/charts.go +++ b/src/go/plugin/go.d/modules/pgbouncer/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/collect.go b/src/go/plugin/go.d/modules/pgbouncer/collect.go index c0e4bf2d..c0e4bf2d 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/collect.go +++ b/src/go/plugin/go.d/modules/pgbouncer/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/config_schema.json b/src/go/plugin/go.d/modules/pgbouncer/config_schema.json index d8d08bc5..d8d08bc5 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/config_schema.json +++ b/src/go/plugin/go.d/modules/pgbouncer/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/init.go b/src/go/plugin/go.d/modules/pgbouncer/init.go index 14633508..14633508 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/init.go +++ b/src/go/plugin/go.d/modules/pgbouncer/init.go diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/integrations/pgbouncer.md b/src/go/plugin/go.d/modules/pgbouncer/integrations/pgbouncer.md index ca8e020e..1b5e6e71 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/integrations/pgbouncer.md +++ b/src/go/plugin/go.d/modules/pgbouncer/integrations/pgbouncer.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/pgbouncer/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/pgbouncer/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/pgbouncer/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/pgbouncer/metadata.yaml" sidebar_label: "PgBouncer" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -229,6 +229,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `pgbouncer` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -251,4 +253,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m pgbouncer ``` +### Getting Logs + +If you're encountering problems with the `pgbouncer` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep pgbouncer +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep pgbouncer /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep pgbouncer +``` + diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/metadata.yaml b/src/go/plugin/go.d/modules/pgbouncer/metadata.yaml index e4a098bc..e4a098bc 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/metadata.yaml +++ b/src/go/plugin/go.d/modules/pgbouncer/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/metrics.go b/src/go/plugin/go.d/modules/pgbouncer/metrics.go index eaac5277..eaac5277 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/metrics.go +++ b/src/go/plugin/go.d/modules/pgbouncer/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/pgbouncer.go b/src/go/plugin/go.d/modules/pgbouncer/pgbouncer.go index a77b35a3..fbe554dc 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/pgbouncer.go +++ b/src/go/plugin/go.d/modules/pgbouncer/pgbouncer.go @@ -8,8 +8,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/blang/semver/v4" _ "github.com/jackc/pgx/v4/stdlib" diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/pgbouncer_test.go b/src/go/plugin/go.d/modules/pgbouncer/pgbouncer_test.go index 988d406c..51c838ac 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/pgbouncer_test.go +++ b/src/go/plugin/go.d/modules/pgbouncer/pgbouncer_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/DATA-DOG/go-sqlmock" "github.com/stretchr/testify/assert" diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/config.json b/src/go/plugin/go.d/modules/pgbouncer/testdata/config.json index ed8b72dc..ed8b72dc 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/config.json +++ b/src/go/plugin/go.d/modules/pgbouncer/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/config.yaml b/src/go/plugin/go.d/modules/pgbouncer/testdata/config.yaml index caff4903..caff4903 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/pgbouncer/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/config.txt b/src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/config.txt index da1aba60..da1aba60 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/config.txt +++ b/src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/config.txt diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/databases.txt b/src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/databases.txt index 9e8f1469..9e8f1469 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/databases.txt +++ b/src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/databases.txt diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/pools.txt b/src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/pools.txt index dec3326a..dec3326a 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/pools.txt +++ b/src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/pools.txt diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/stats.txt b/src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/stats.txt index 3b66fc32..3b66fc32 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/stats.txt +++ b/src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/stats.txt diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/version.txt b/src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/version.txt index fa2c806a..fa2c806a 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.17.0/version.txt +++ b/src/go/plugin/go.d/modules/pgbouncer/testdata/v1.17.0/version.txt diff --git a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.7.0/version.txt b/src/go/plugin/go.d/modules/pgbouncer/testdata/v1.7.0/version.txt index ff0fd70a..ff0fd70a 100644 --- a/src/go/collectors/go.d.plugin/modules/pgbouncer/testdata/v1.7.0/version.txt +++ b/src/go/plugin/go.d/modules/pgbouncer/testdata/v1.7.0/version.txt diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/README.md b/src/go/plugin/go.d/modules/phpdaemon/README.md index 2f2fca9f..2f2fca9f 120000 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/README.md +++ b/src/go/plugin/go.d/modules/phpdaemon/README.md diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/charts.go b/src/go/plugin/go.d/modules/phpdaemon/charts.go index 8d414b1a..e96a209b 100644 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/charts.go +++ b/src/go/plugin/go.d/modules/phpdaemon/charts.go @@ -2,7 +2,7 @@ package phpdaemon -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( // Charts is an alias for module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/client.go b/src/go/plugin/go.d/modules/phpdaemon/client.go index e860ec40..bc54265d 100644 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/client.go +++ b/src/go/plugin/go.d/modules/phpdaemon/client.go @@ -8,7 +8,7 @@ import ( "io" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) type decodeFunc func(dst interface{}, reader io.Reader) error diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/collect.go b/src/go/plugin/go.d/modules/phpdaemon/collect.go index 901c1268..9be718ea 100644 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/collect.go +++ b/src/go/plugin/go.d/modules/phpdaemon/collect.go @@ -2,7 +2,7 @@ package phpdaemon -import "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" func (p *PHPDaemon) collect() (map[string]int64, error) { s, err := p.client.queryFullStatus() diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/config_schema.json b/src/go/plugin/go.d/modules/phpdaemon/config_schema.json index 572925d7..a154aaa5 100644 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/config_schema.json +++ b/src/go/plugin/go.d/modules/phpdaemon/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/init.go b/src/go/plugin/go.d/modules/phpdaemon/init.go index 0f05d01e..ec9925b7 100644 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/init.go +++ b/src/go/plugin/go.d/modules/phpdaemon/init.go @@ -5,7 +5,7 @@ package phpdaemon import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (p *PHPDaemon) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/integrations/phpdaemon.md b/src/go/plugin/go.d/modules/phpdaemon/integrations/phpdaemon.md index cb9682ce..11445455 100644 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/integrations/phpdaemon.md +++ b/src/go/plugin/go.d/modules/phpdaemon/integrations/phpdaemon.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/phpdaemon/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/phpdaemon/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/phpdaemon/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/phpdaemon/metadata.yaml" sidebar_label: "phpDaemon" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -273,6 +273,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `phpdaemon` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -295,4 +297,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m phpdaemon ``` +### Getting Logs + +If you're encountering problems with the `phpdaemon` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep phpdaemon +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep phpdaemon /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep phpdaemon +``` + diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/metadata.yaml b/src/go/plugin/go.d/modules/phpdaemon/metadata.yaml index bd3ae8e5..bd3ae8e5 100644 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/metadata.yaml +++ b/src/go/plugin/go.d/modules/phpdaemon/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/metrics.go b/src/go/plugin/go.d/modules/phpdaemon/metrics.go index 1be3c0be..1be3c0be 100644 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/metrics.go +++ b/src/go/plugin/go.d/modules/phpdaemon/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/phpdaemon.go b/src/go/plugin/go.d/modules/phpdaemon/phpdaemon.go index 8272b6be..d9af1059 100644 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/phpdaemon.go +++ b/src/go/plugin/go.d/modules/phpdaemon/phpdaemon.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/phpdaemon_test.go b/src/go/plugin/go.d/modules/phpdaemon/phpdaemon_test.go index 70cf4743..e9e35af6 100644 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/phpdaemon_test.go +++ b/src/go/plugin/go.d/modules/phpdaemon/phpdaemon_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/testdata/config.json b/src/go/plugin/go.d/modules/phpdaemon/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/testdata/config.json +++ b/src/go/plugin/go.d/modules/phpdaemon/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/testdata/config.yaml b/src/go/plugin/go.d/modules/phpdaemon/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/phpdaemon/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/phpdaemon/testdata/fullstatus.json b/src/go/plugin/go.d/modules/phpdaemon/testdata/fullstatus.json index b7d2a5e7..b7d2a5e7 100644 --- a/src/go/collectors/go.d.plugin/modules/phpdaemon/testdata/fullstatus.json +++ b/src/go/plugin/go.d/modules/phpdaemon/testdata/fullstatus.json diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/README.md b/src/go/plugin/go.d/modules/phpfpm/README.md index 2953ff4d..2953ff4d 120000 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/README.md +++ b/src/go/plugin/go.d/modules/phpfpm/README.md diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/charts.go b/src/go/plugin/go.d/modules/phpfpm/charts.go index 6b69d4c7..2e1e35cf 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/charts.go +++ b/src/go/plugin/go.d/modules/phpfpm/charts.go @@ -2,7 +2,7 @@ package phpfpm -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( // Charts is an alias for module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/client.go b/src/go/plugin/go.d/modules/phpfpm/client.go index 5d72041e..4e8e8cec 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/client.go +++ b/src/go/plugin/go.d/modules/phpfpm/client.go @@ -11,8 +11,8 @@ import ( "strconv" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" fcgiclient "github.com/kanocz/fcgi_client" ) diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/collect.go b/src/go/plugin/go.d/modules/phpfpm/collect.go index f720252a..08a3b9f6 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/collect.go +++ b/src/go/plugin/go.d/modules/phpfpm/collect.go @@ -5,7 +5,7 @@ package phpfpm import ( "math" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) func (p *Phpfpm) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/config_schema.json b/src/go/plugin/go.d/modules/phpfpm/config_schema.json index 252d8a08..81b4005a 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/config_schema.json +++ b/src/go/plugin/go.d/modules/phpfpm/config_schema.json @@ -149,6 +149,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/decode.go b/src/go/plugin/go.d/modules/phpfpm/decode.go index 021e1fb4..021e1fb4 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/decode.go +++ b/src/go/plugin/go.d/modules/phpfpm/decode.go diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/init.go b/src/go/plugin/go.d/modules/phpfpm/init.go index 33fbc540..5615012f 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/init.go +++ b/src/go/plugin/go.d/modules/phpfpm/init.go @@ -7,7 +7,7 @@ import ( "fmt" "os" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (p *Phpfpm) initClient() (client, error) { diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/integrations/php-fpm.md b/src/go/plugin/go.d/modules/phpfpm/integrations/php-fpm.md index 33e0d7a9..1839d00d 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/integrations/php-fpm.md +++ b/src/go/plugin/go.d/modules/phpfpm/integrations/php-fpm.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/phpfpm/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/phpfpm/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/phpfpm/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/phpfpm/metadata.yaml" sidebar_label: "PHP-FPM" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -204,6 +204,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `phpfpm` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -226,4 +228,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m phpfpm ``` +### Getting Logs + +If you're encountering problems with the `phpfpm` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep phpfpm +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep phpfpm /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep phpfpm +``` + diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/metadata.yaml b/src/go/plugin/go.d/modules/phpfpm/metadata.yaml index 739e7b7b..739e7b7b 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/metadata.yaml +++ b/src/go/plugin/go.d/modules/phpfpm/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/phpfpm.go b/src/go/plugin/go.d/modules/phpfpm/phpfpm.go index bff4d06c..76057c8f 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/phpfpm.go +++ b/src/go/plugin/go.d/modules/phpfpm/phpfpm.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/phpfpm_test.go b/src/go/plugin/go.d/modules/phpfpm/phpfpm_test.go index 8b44c64a..b089c1ef 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/phpfpm_test.go +++ b/src/go/plugin/go.d/modules/phpfpm/phpfpm_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/config.json b/src/go/plugin/go.d/modules/phpfpm/testdata/config.json index 458343f7..458343f7 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/config.json +++ b/src/go/plugin/go.d/modules/phpfpm/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/config.yaml b/src/go/plugin/go.d/modules/phpfpm/testdata/config.yaml index 6c7bea09..6c7bea09 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/phpfpm/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status-full-no-idle.json b/src/go/plugin/go.d/modules/phpfpm/testdata/status-full-no-idle.json index e5b63acc..e5b63acc 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status-full-no-idle.json +++ b/src/go/plugin/go.d/modules/phpfpm/testdata/status-full-no-idle.json diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status-full.json b/src/go/plugin/go.d/modules/phpfpm/testdata/status-full.json index 456f6253..456f6253 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status-full.json +++ b/src/go/plugin/go.d/modules/phpfpm/testdata/status-full.json diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status-full.txt b/src/go/plugin/go.d/modules/phpfpm/testdata/status-full.txt index a5e90987..a5e90987 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status-full.txt +++ b/src/go/plugin/go.d/modules/phpfpm/testdata/status-full.txt diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status.json b/src/go/plugin/go.d/modules/phpfpm/testdata/status.json index 80af3e0b..80af3e0b 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status.json +++ b/src/go/plugin/go.d/modules/phpfpm/testdata/status.json diff --git a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status.txt b/src/go/plugin/go.d/modules/phpfpm/testdata/status.txt index 08dc158f..08dc158f 100644 --- a/src/go/collectors/go.d.plugin/modules/phpfpm/testdata/status.txt +++ b/src/go/plugin/go.d/modules/phpfpm/testdata/status.txt diff --git a/src/go/collectors/go.d.plugin/modules/pihole/README.md b/src/go/plugin/go.d/modules/pihole/README.md index b8d3a7b4..b8d3a7b4 120000 --- a/src/go/collectors/go.d.plugin/modules/pihole/README.md +++ b/src/go/plugin/go.d/modules/pihole/README.md diff --git a/src/go/collectors/go.d.plugin/modules/pihole/charts.go b/src/go/plugin/go.d/modules/pihole/charts.go index d8e0bd00..862a2544 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/charts.go +++ b/src/go/plugin/go.d/modules/pihole/charts.go @@ -3,7 +3,7 @@ package pihole import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/pihole/collect.go b/src/go/plugin/go.d/modules/pihole/collect.go index ab0e48ff..c9e6d845 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/collect.go +++ b/src/go/plugin/go.d/modules/pihole/collect.go @@ -12,7 +12,7 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const wantAPIVersion = 3 @@ -131,13 +131,12 @@ func (p *Pihole) queryMetrics(pmx *piholeMetrics, doConcurrently bool) { } func (p *Pihole) querySummary(pmx *piholeMetrics) { - req, err := web.NewHTTPRequest(p.Request) + req, err := web.NewHTTPRequestWithPath(p.Request, urlPathAPI) if err != nil { p.Error(err) return } - req.URL.Path = urlPathAPI req.URL.RawQuery = url.Values{ urlQueryKeyAuth: []string{p.Password}, urlQueryKeySummaryRaw: []string{"true"}, @@ -153,13 +152,12 @@ func (p *Pihole) querySummary(pmx *piholeMetrics) { } func (p *Pihole) queryQueryTypes(pmx *piholeMetrics) { - req, err := web.NewHTTPRequest(p.Request) + req, err := web.NewHTTPRequestWithPath(p.Request, urlPathAPI) if err != nil { p.Error(err) return } - req.URL.Path = urlPathAPI req.URL.RawQuery = url.Values{ urlQueryKeyAuth: []string{p.Password}, urlQueryKeyGetQueryTypes: []string{"true"}, @@ -176,13 +174,12 @@ func (p *Pihole) queryQueryTypes(pmx *piholeMetrics) { } func (p *Pihole) queryForwardedDestinations(pmx *piholeMetrics) { - req, err := web.NewHTTPRequest(p.Request) + req, err := web.NewHTTPRequestWithPath(p.Request, urlPathAPI) if err != nil { p.Error(err) return } - req.URL.Path = urlPathAPI req.URL.RawQuery = url.Values{ urlQueryKeyAuth: []string{p.Password}, urlQueryKeyGetForwardDestinations: []string{"true"}, @@ -199,12 +196,11 @@ func (p *Pihole) queryForwardedDestinations(pmx *piholeMetrics) { } func (p *Pihole) queryAPIVersion() (int, error) { - req, err := web.NewHTTPRequest(p.Request) + req, err := web.NewHTTPRequestWithPath(p.Request, urlPathAPI) if err != nil { return 0, err } - req.URL.Path = urlPathAPI req.URL.RawQuery = url.Values{ urlQueryKeyAuth: []string{p.Password}, urlQueryKeyAPIVersion: []string{"true"}, diff --git a/src/go/collectors/go.d.plugin/modules/pihole/config_schema.json b/src/go/plugin/go.d/modules/pihole/config_schema.json index d33e3583..14523a2e 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/config_schema.json +++ b/src/go/plugin/go.d/modules/pihole/config_schema.json @@ -174,6 +174,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/pihole/init.go b/src/go/plugin/go.d/modules/pihole/init.go index 98284945..bd5d952c 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/init.go +++ b/src/go/plugin/go.d/modules/pihole/init.go @@ -10,7 +10,7 @@ import ( "os" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (p *Pihole) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/pihole/integrations/pi-hole.md b/src/go/plugin/go.d/modules/pihole/integrations/pi-hole.md index e50bbe92..290dfcb0 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/integrations/pi-hole.md +++ b/src/go/plugin/go.d/modules/pihole/integrations/pi-hole.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/pihole/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/pihole/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/pihole/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/pihole/metadata.yaml" sidebar_label: "Pi-hole" learn_status: "Published" learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" @@ -199,6 +199,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `pihole` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -221,4 +223,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m pihole ``` +### Getting Logs + +If you're encountering problems with the `pihole` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep pihole +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep pihole /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep pihole +``` + diff --git a/src/go/collectors/go.d.plugin/modules/pihole/metadata.yaml b/src/go/plugin/go.d/modules/pihole/metadata.yaml index b6ef9656..b6ef9656 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/metadata.yaml +++ b/src/go/plugin/go.d/modules/pihole/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/pihole/metrics.go b/src/go/plugin/go.d/modules/pihole/metrics.go index dd4b3b64..dd4b3b64 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/metrics.go +++ b/src/go/plugin/go.d/modules/pihole/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/pihole/pihole.go b/src/go/plugin/go.d/modules/pihole/pihole.go index 818feddc..9c93d051 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/pihole.go +++ b/src/go/plugin/go.d/modules/pihole/pihole.go @@ -9,8 +9,8 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/pihole/pihole_test.go b/src/go/plugin/go.d/modules/pihole/pihole_test.go index 6af8267f..86b17b62 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/pihole_test.go +++ b/src/go/plugin/go.d/modules/pihole/pihole_test.go @@ -9,8 +9,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/pihole/testdata/config.json b/src/go/plugin/go.d/modules/pihole/testdata/config.json index 2d82443b..2d82443b 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/testdata/config.json +++ b/src/go/plugin/go.d/modules/pihole/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/pihole/testdata/config.yaml b/src/go/plugin/go.d/modules/pihole/testdata/config.yaml index a9361246..a9361246 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/pihole/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/pihole/testdata/getForwardDestinations.json b/src/go/plugin/go.d/modules/pihole/testdata/getForwardDestinations.json index 3bfc646d..3bfc646d 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/testdata/getForwardDestinations.json +++ b/src/go/plugin/go.d/modules/pihole/testdata/getForwardDestinations.json diff --git a/src/go/collectors/go.d.plugin/modules/pihole/testdata/getQueryTypes.json b/src/go/plugin/go.d/modules/pihole/testdata/getQueryTypes.json index cf7f19f9..cf7f19f9 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/testdata/getQueryTypes.json +++ b/src/go/plugin/go.d/modules/pihole/testdata/getQueryTypes.json diff --git a/src/go/collectors/go.d.plugin/modules/pihole/testdata/setupVars.conf b/src/go/plugin/go.d/modules/pihole/testdata/setupVars.conf index 97f26029..97f26029 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/testdata/setupVars.conf +++ b/src/go/plugin/go.d/modules/pihole/testdata/setupVars.conf diff --git a/src/go/collectors/go.d.plugin/modules/pihole/testdata/summaryRaw.json b/src/go/plugin/go.d/modules/pihole/testdata/summaryRaw.json index 8a4e59c1..8a4e59c1 100644 --- a/src/go/collectors/go.d.plugin/modules/pihole/testdata/summaryRaw.json +++ b/src/go/plugin/go.d/modules/pihole/testdata/summaryRaw.json diff --git a/src/go/collectors/go.d.plugin/modules/pika/README.md b/src/go/plugin/go.d/modules/pika/README.md index 5e3a8da7..5e3a8da7 120000 --- a/src/go/collectors/go.d.plugin/modules/pika/README.md +++ b/src/go/plugin/go.d/modules/pika/README.md diff --git a/src/go/collectors/go.d.plugin/modules/pika/charts.go b/src/go/plugin/go.d/modules/pika/charts.go index cdaa68f6..6ba0e5d4 100644 --- a/src/go/collectors/go.d.plugin/modules/pika/charts.go +++ b/src/go/plugin/go.d/modules/pika/charts.go @@ -2,7 +2,7 @@ package pika -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" var pikaCharts = module.Charts{ chartConnections.Copy(), diff --git a/src/go/collectors/go.d.plugin/modules/pika/collect.go b/src/go/plugin/go.d/modules/pika/collect.go index 72a4961d..72a4961d 100644 --- a/src/go/collectors/go.d.plugin/modules/pika/collect.go +++ b/src/go/plugin/go.d/modules/pika/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/pika/collect_info.go b/src/go/plugin/go.d/modules/pika/collect_info.go index 2dc68f52..0494ae57 100644 --- a/src/go/collectors/go.d.plugin/modules/pika/collect_info.go +++ b/src/go/plugin/go.d/modules/pika/collect_info.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) // https://github.com/Qihoo360/pika/blob/master/src/pika_admin.cc diff --git a/src/go/collectors/go.d.plugin/modules/pika/config_schema.json b/src/go/plugin/go.d/modules/pika/config_schema.json index 885cbed0..885cbed0 100644 --- a/src/go/collectors/go.d.plugin/modules/pika/config_schema.json +++ b/src/go/plugin/go.d/modules/pika/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/pika/init.go b/src/go/plugin/go.d/modules/pika/init.go index 8cb62aa5..b5115295 100644 --- a/src/go/collectors/go.d.plugin/modules/pika/init.go +++ b/src/go/plugin/go.d/modules/pika/init.go @@ -5,8 +5,8 @@ package pika import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" "github.com/go-redis/redis/v8" ) diff --git a/src/go/collectors/go.d.plugin/modules/pika/integrations/pika.md b/src/go/plugin/go.d/modules/pika/integrations/pika.md index 1214dcad..04a2b329 100644 --- a/src/go/collectors/go.d.plugin/modules/pika/integrations/pika.md +++ b/src/go/plugin/go.d/modules/pika/integrations/pika.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/pika/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/pika/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/pika/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/pika/metadata.yaml" sidebar_label: "Pika" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -196,6 +196,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `pika` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -218,4 +220,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m pika ``` +### Getting Logs + +If you're encountering problems with the `pika` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep pika +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep pika /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep pika +``` + diff --git a/src/go/collectors/go.d.plugin/modules/pika/metadata.yaml b/src/go/plugin/go.d/modules/pika/metadata.yaml index c87cd9b2..c87cd9b2 100644 --- a/src/go/collectors/go.d.plugin/modules/pika/metadata.yaml +++ b/src/go/plugin/go.d/modules/pika/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/pika/pika.go b/src/go/plugin/go.d/modules/pika/pika.go index c7cbd019..705c3db4 100644 --- a/src/go/collectors/go.d.plugin/modules/pika/pika.go +++ b/src/go/plugin/go.d/modules/pika/pika.go @@ -8,9 +8,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/blang/semver/v4" "github.com/go-redis/redis/v8" diff --git a/src/go/collectors/go.d.plugin/modules/pika/pika_test.go b/src/go/plugin/go.d/modules/pika/pika_test.go index 5a4e460d..94061925 100644 --- a/src/go/collectors/go.d.plugin/modules/pika/pika_test.go +++ b/src/go/plugin/go.d/modules/pika/pika_test.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" "github.com/go-redis/redis/v8" "github.com/stretchr/testify/assert" diff --git a/src/go/collectors/go.d.plugin/modules/pika/testdata/config.json b/src/go/plugin/go.d/modules/pika/testdata/config.json index d8ba812a..d8ba812a 100644 --- a/src/go/collectors/go.d.plugin/modules/pika/testdata/config.json +++ b/src/go/plugin/go.d/modules/pika/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/pika/testdata/config.yaml b/src/go/plugin/go.d/modules/pika/testdata/config.yaml index 6a6f6ae6..6a6f6ae6 100644 --- a/src/go/collectors/go.d.plugin/modules/pika/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/pika/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/pika/testdata/redis/info_all.txt b/src/go/plugin/go.d/modules/pika/testdata/redis/info_all.txt index 8ab38162..8ab38162 100644 --- a/src/go/collectors/go.d.plugin/modules/pika/testdata/redis/info_all.txt +++ b/src/go/plugin/go.d/modules/pika/testdata/redis/info_all.txt diff --git a/src/go/collectors/go.d.plugin/modules/pika/testdata/v3.4.0/info_all.txt b/src/go/plugin/go.d/modules/pika/testdata/v3.4.0/info_all.txt index ec58524c..ec58524c 100644 --- a/src/go/collectors/go.d.plugin/modules/pika/testdata/v3.4.0/info_all.txt +++ b/src/go/plugin/go.d/modules/pika/testdata/v3.4.0/info_all.txt diff --git a/src/go/collectors/go.d.plugin/modules/ping/README.md b/src/go/plugin/go.d/modules/ping/README.md index a1381e57..a1381e57 120000 --- a/src/go/collectors/go.d.plugin/modules/ping/README.md +++ b/src/go/plugin/go.d/modules/ping/README.md diff --git a/src/go/collectors/go.d.plugin/modules/ping/charts.go b/src/go/plugin/go.d/modules/ping/charts.go index e117a18d..04dfc17d 100644 --- a/src/go/collectors/go.d.plugin/modules/ping/charts.go +++ b/src/go/plugin/go.d/modules/ping/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/ping/collect.go b/src/go/plugin/go.d/modules/ping/collect.go index c162a2b1..c162a2b1 100644 --- a/src/go/collectors/go.d.plugin/modules/ping/collect.go +++ b/src/go/plugin/go.d/modules/ping/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/ping/config_schema.json b/src/go/plugin/go.d/modules/ping/config_schema.json index 007dd45b..1168e338 100644 --- a/src/go/collectors/go.d.plugin/modules/ping/config_schema.json +++ b/src/go/plugin/go.d/modules/ping/config_schema.json @@ -13,7 +13,7 @@ }, "privileged": { "title": "Privileged mode", - "description": "If unset, sends unprivileged UDP ping packets (require [additional configuration](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/modules/ping#overview)); otherwise, sends raw ICMP ping packets ([not recommended](https://github.com/netdata/netdata/issues/15410)).", + "description": "If unset, sends unprivileged UDP ping packets (require [additional configuration](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/ping#overview)); otherwise, sends raw ICMP ping packets ([not recommended](https://github.com/netdata/netdata/issues/15410)).", "type": "boolean", "default": false }, diff --git a/src/go/collectors/go.d.plugin/modules/ping/init.go b/src/go/plugin/go.d/modules/ping/init.go index 62d78c8e..62d78c8e 100644 --- a/src/go/collectors/go.d.plugin/modules/ping/init.go +++ b/src/go/plugin/go.d/modules/ping/init.go diff --git a/src/go/collectors/go.d.plugin/modules/ping/integrations/ping.md b/src/go/plugin/go.d/modules/ping/integrations/ping.md index 4b073050..db97288b 100644 --- a/src/go/collectors/go.d.plugin/modules/ping/integrations/ping.md +++ b/src/go/plugin/go.d/modules/ping/integrations/ping.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/ping/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/ping/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/ping/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/ping/metadata.yaml" sidebar_label: "Ping" learn_status: "Published" learn_rel_path: "Collecting Metrics/Synthetic Checks" @@ -39,7 +39,7 @@ There are two operational modes: ```bash sudo sysctl -w net.ipv4.ping_group_range="0 2147483647" ``` - To persist the change add `net.ipv4.ping_group_range="0 2147483647"` to `/etc/sysctl.conf` and + To persist the change add `net.ipv4.ping_group_range=0 2147483647` to `/etc/sysctl.conf` and execute `sudo sysctl -p`. @@ -211,6 +211,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `ping` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -233,4 +235,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m ping ``` +### Getting Logs + +If you're encountering problems with the `ping` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep ping +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep ping /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep ping +``` + diff --git a/src/go/collectors/go.d.plugin/modules/ping/metadata.yaml b/src/go/plugin/go.d/modules/ping/metadata.yaml index d70c8a3f..8686d103 100644 --- a/src/go/collectors/go.d.plugin/modules/ping/metadata.yaml +++ b/src/go/plugin/go.d/modules/ping/metadata.yaml @@ -39,7 +39,7 @@ modules: ```bash sudo sysctl -w net.ipv4.ping_group_range="0 2147483647" ``` - To persist the change add `net.ipv4.ping_group_range="0 2147483647"` to `/etc/sysctl.conf` and + To persist the change add `net.ipv4.ping_group_range=0 2147483647` to `/etc/sysctl.conf` and execute `sudo sysctl -p`. method_description: "" supported_platforms: diff --git a/src/go/collectors/go.d.plugin/modules/ping/ping.go b/src/go/plugin/go.d/modules/ping/ping.go index 5171afc0..9d1ef929 100644 --- a/src/go/collectors/go.d.plugin/modules/ping/ping.go +++ b/src/go/plugin/go.d/modules/ping/ping.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/logger" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" probing "github.com/prometheus-community/pro-bing" ) diff --git a/src/go/collectors/go.d.plugin/modules/ping/ping_test.go b/src/go/plugin/go.d/modules/ping/ping_test.go index 856449d3..52d16dd3 100644 --- a/src/go/collectors/go.d.plugin/modules/ping/ping_test.go +++ b/src/go/plugin/go.d/modules/ping/ping_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" probing "github.com/prometheus-community/pro-bing" "github.com/stretchr/testify/assert" diff --git a/src/go/collectors/go.d.plugin/modules/ping/prober.go b/src/go/plugin/go.d/modules/ping/prober.go index e0d9925b..70c31dcd 100644 --- a/src/go/collectors/go.d.plugin/modules/ping/prober.go +++ b/src/go/plugin/go.d/modules/ping/prober.go @@ -8,7 +8,7 @@ import ( "net" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" probing "github.com/prometheus-community/pro-bing" ) diff --git a/src/go/collectors/go.d.plugin/modules/ping/testdata/config.json b/src/go/plugin/go.d/modules/ping/testdata/config.json index 18df6452..18df6452 100644 --- a/src/go/collectors/go.d.plugin/modules/ping/testdata/config.json +++ b/src/go/plugin/go.d/modules/ping/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/ping/testdata/config.yaml b/src/go/plugin/go.d/modules/ping/testdata/config.yaml index 5eacb941..5eacb941 100644 --- a/src/go/collectors/go.d.plugin/modules/ping/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/ping/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/portcheck/README.md b/src/go/plugin/go.d/modules/portcheck/README.md index 4bee556e..4bee556e 120000 --- a/src/go/collectors/go.d.plugin/modules/portcheck/README.md +++ b/src/go/plugin/go.d/modules/portcheck/README.md diff --git a/src/go/collectors/go.d.plugin/modules/portcheck/charts.go b/src/go/plugin/go.d/modules/portcheck/charts.go index 6b88f7a8..6797f00a 100644 --- a/src/go/collectors/go.d.plugin/modules/portcheck/charts.go +++ b/src/go/plugin/go.d/modules/portcheck/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strconv" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/portcheck/collect.go b/src/go/plugin/go.d/modules/portcheck/collect.go index dab45ec4..dab45ec4 100644 --- a/src/go/collectors/go.d.plugin/modules/portcheck/collect.go +++ b/src/go/plugin/go.d/modules/portcheck/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/portcheck/config_schema.json b/src/go/plugin/go.d/modules/portcheck/config_schema.json index 025b78f8..025b78f8 100644 --- a/src/go/collectors/go.d.plugin/modules/portcheck/config_schema.json +++ b/src/go/plugin/go.d/modules/portcheck/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/portcheck/init.go b/src/go/plugin/go.d/modules/portcheck/init.go index 29c0e43a..17b40234 100644 --- a/src/go/collectors/go.d.plugin/modules/portcheck/init.go +++ b/src/go/plugin/go.d/modules/portcheck/init.go @@ -7,7 +7,7 @@ import ( "net" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) type dialFunc func(network, address string, timeout time.Duration) (net.Conn, error) diff --git a/src/go/collectors/go.d.plugin/modules/portcheck/integrations/tcp_endpoints.md b/src/go/plugin/go.d/modules/portcheck/integrations/tcp_endpoints.md index d6434273..9259afd3 100644 --- a/src/go/collectors/go.d.plugin/modules/portcheck/integrations/tcp_endpoints.md +++ b/src/go/plugin/go.d/modules/portcheck/integrations/tcp_endpoints.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/portcheck/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/portcheck/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/portcheck/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/portcheck/metadata.yaml" sidebar_label: "TCP Endpoints" learn_status: "Published" learn_rel_path: "Collecting Metrics/Synthetic Checks" @@ -192,6 +192,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `portcheck` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -214,4 +216,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m portcheck ``` +### Getting Logs + +If you're encountering problems with the `portcheck` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep portcheck +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep portcheck /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep portcheck +``` + diff --git a/src/go/collectors/go.d.plugin/modules/portcheck/metadata.yaml b/src/go/plugin/go.d/modules/portcheck/metadata.yaml index c0ccfde1..c0ccfde1 100644 --- a/src/go/collectors/go.d.plugin/modules/portcheck/metadata.yaml +++ b/src/go/plugin/go.d/modules/portcheck/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/portcheck/portcheck.go b/src/go/plugin/go.d/modules/portcheck/portcheck.go index 68f275a2..3a6da78a 100644 --- a/src/go/collectors/go.d.plugin/modules/portcheck/portcheck.go +++ b/src/go/plugin/go.d/modules/portcheck/portcheck.go @@ -7,8 +7,8 @@ import ( "net" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/portcheck/portcheck_test.go b/src/go/plugin/go.d/modules/portcheck/portcheck_test.go index 01ed9f16..86a2c967 100644 --- a/src/go/collectors/go.d.plugin/modules/portcheck/portcheck_test.go +++ b/src/go/plugin/go.d/modules/portcheck/portcheck_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/portcheck/testdata/config.json b/src/go/plugin/go.d/modules/portcheck/testdata/config.json index a69a6ac3..a69a6ac3 100644 --- a/src/go/collectors/go.d.plugin/modules/portcheck/testdata/config.json +++ b/src/go/plugin/go.d/modules/portcheck/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/portcheck/testdata/config.yaml b/src/go/plugin/go.d/modules/portcheck/testdata/config.yaml index 72bdfd54..72bdfd54 100644 --- a/src/go/collectors/go.d.plugin/modules/portcheck/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/portcheck/testdata/config.yaml diff --git a/src/go/plugin/go.d/modules/postfix/README.md b/src/go/plugin/go.d/modules/postfix/README.md new file mode 120000 index 00000000..c62eb5c2 --- /dev/null +++ b/src/go/plugin/go.d/modules/postfix/README.md @@ -0,0 +1 @@ +integrations/postfix.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/postfix/charts.go b/src/go/plugin/go.d/modules/postfix/charts.go new file mode 100644 index 00000000..69c67246 --- /dev/null +++ b/src/go/plugin/go.d/modules/postfix/charts.go @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package postfix + +import ( + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioPostfixQueueEmailsCount = module.Priority + iota + prioPostfixQueueSize +) + +var charts = module.Charts{ + queueEmailsCountChart.Copy(), + queueSizeChart.Copy(), +} + +var ( + queueEmailsCountChart = module.Chart{ + ID: "postfix_queue_emails", + Title: "Postfix Queue Emails", + Units: "emails", + Fam: "queue", + Ctx: "postfix.qemails", + Type: module.Line, + Priority: prioPostfixQueueEmailsCount, + Dims: module.Dims{ + {ID: "emails"}, + }, + } + queueSizeChart = module.Chart{ + ID: "postfix_queue_size", + Title: "Postfix Queue Size", + Units: "KiB", + Fam: "queue", + Ctx: "postfix.qsize", + Type: module.Area, + Priority: prioPostfixQueueSize, + Dims: module.Dims{ + {ID: "size"}, + }, + } +) diff --git a/src/go/plugin/go.d/modules/postfix/collect.go b/src/go/plugin/go.d/modules/postfix/collect.go new file mode 100644 index 00000000..7afcd769 --- /dev/null +++ b/src/go/plugin/go.d/modules/postfix/collect.go @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package postfix + +import ( + "bufio" + "bytes" + "errors" + "fmt" + "strconv" + "strings" +) + +type postqueueStats struct { + sizeKbyte int64 + requests int64 +} + +func (p *Postfix) collect() (map[string]int64, error) { + bs, err := p.exec.list() + if err != nil { + return nil, err + } + + stats, err := parsePostqueueOutput(bs) + if err != nil { + return nil, err + } + + mx := make(map[string]int64) + + mx["emails"] = stats.requests + mx["size"] = stats.sizeKbyte + + return mx, nil +} + +func parsePostqueueOutput(bs []byte) (*postqueueStats, error) { + if len(bs) == 0 { + return nil, errors.New("empty postqueue output") + } + + var lastLine string + sc := bufio.NewScanner(bytes.NewReader(bs)) + for sc.Scan() { + if line := strings.TrimSpace(sc.Text()); line != "" { + lastLine = strings.TrimSpace(sc.Text()) + } + } + + if lastLine == "Mail queue is empty" { + return &postqueueStats{}, nil + } + + // -- 3 Kbytes in 3 Requests. + parts := strings.Fields(lastLine) + if len(parts) < 5 { + return nil, fmt.Errorf("unexpected postqueue output ('%s')", lastLine) + } + + size, err := strconv.ParseInt(parts[1], 10, 64) + if err != nil { + return nil, fmt.Errorf("unexpected postqueue output ('%s')", lastLine) + } + requests, err := strconv.ParseInt(parts[4], 10, 64) + if err != nil { + return nil, fmt.Errorf("unexpected postqueue output ('%s')", lastLine) + } + + return &postqueueStats{sizeKbyte: size, requests: requests}, nil +} diff --git a/src/go/plugin/go.d/modules/postfix/config_schema.json b/src/go/plugin/go.d/modules/postfix/config_schema.json new file mode 100644 index 00000000..da416f14 --- /dev/null +++ b/src/go/plugin/go.d/modules/postfix/config_schema.json @@ -0,0 +1,47 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Postfix collector configuration", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 10 + }, + "binary_path": { + "title": "Binary path", + "description": "Path to the `postqueue` binary.", + "type": "string", + "default": "/usr/sbin/postqueue" + }, + "timeout": { + "title": "Timeout", + "description": "Timeout for executing the binary, specified in seconds.", + "type": "number", + "minimum": 0.5, + "default": 2 + } + }, + "required": [ + "binary_path" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "binary_path": { + "ui:help": "If an absolute path is provided, the collector will use it directly; otherwise, it will search for the binary in directories specified in the PATH environment variable." + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + } + } +}
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/postfix/exec.go b/src/go/plugin/go.d/modules/postfix/exec.go new file mode 100644 index 00000000..1ca29331 --- /dev/null +++ b/src/go/plugin/go.d/modules/postfix/exec.go @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package postfix + +import ( + "context" + "fmt" + "os/exec" + "time" + + "github.com/netdata/netdata/go/plugins/logger" +) + +func newPostqueueExec(binPath string, timeout time.Duration) *postqueueExec { + return &postqueueExec{ + binPath: binPath, + timeout: timeout, + } +} + +type postqueueExec struct { + *logger.Logger + + binPath string + timeout time.Duration +} + +func (p *postqueueExec) list() ([]byte, error) { + ctx, cancel := context.WithTimeout(context.Background(), p.timeout) + defer cancel() + + cmd := exec.CommandContext(ctx, p.binPath, "-p") + p.Debugf("executing '%s'", cmd) + + bs, err := cmd.Output() + if err != nil { + return nil, fmt.Errorf("error on '%s': %v", cmd, err) + } + + return bs, nil +} diff --git a/src/go/plugin/go.d/modules/postfix/init.go b/src/go/plugin/go.d/modules/postfix/init.go new file mode 100644 index 00000000..ffa50af8 --- /dev/null +++ b/src/go/plugin/go.d/modules/postfix/init.go @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package postfix + +import ( + "errors" + "os" + "os/exec" + "strings" +) + +func (p *Postfix) validateConfig() error { + if p.BinaryPath == "" { + return errors.New("no postqueue binary path specified") + } + return nil +} + +func (p *Postfix) initPostqueueExec() (postqueueBinary, error) { + binPath := p.BinaryPath + + if !strings.HasPrefix(binPath, "/") { + path, err := exec.LookPath(binPath) + if err != nil { + return nil, err + } + binPath = path + } + + if _, err := os.Stat(binPath); err != nil { + return nil, err + } + + pq := newPostqueueExec(binPath, p.Timeout.Duration()) + pq.Logger = p.Logger + + return pq, nil +} diff --git a/src/go/plugin/go.d/modules/postfix/integrations/postfix.md b/src/go/plugin/go.d/modules/postfix/integrations/postfix.md new file mode 100644 index 00000000..503a8c66 --- /dev/null +++ b/src/go/plugin/go.d/modules/postfix/integrations/postfix.md @@ -0,0 +1,195 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/postfix/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/postfix/metadata.yaml" +sidebar_label: "Postfix" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Mail Servers" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Postfix + + +<img src="https://netdata.cloud/img/postfix.svg" width="150"/> + + +Plugin: go.d.plugin +Module: postfix + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +This collector retrieves statistics about the Postfix mail queue using the [postqueue](https://www.postfix.org/postqueue.1.html) command-line tool. + + +It periodically executes the `postqueue -p` command. The collection interval is set to 10 seconds by default, but this can be configurable. + + +This collector is supported on all platforms. + +This collector only supports collecting metrics from a single instance of this integration. + +Postfix has internal access controls for the mail queue. By default, all users can view the queue. If your system has stricter controls, grant the `netdata` user access by adding it to `authorized_mailq_users` in the `/etc/postfix/main.cf `file. For more details, refer to the `authorized_mailq_users` setting in the [Postfix documentation](https://www.postfix.org/postconf.5.html). + + +### Default Behavior + +#### Auto-Detection + +The collector executes `postqueue -p` to get Postfix queue statistics. + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per Postfix instance + +These metrics refer to the entire monitored application. + + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| postfix.qemails | emails | emails | +| postfix.qsize | size | KiB | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +No action required. + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/postfix.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/postfix.conf +``` +#### Options + +The following options can be defined globally: update_every. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 10 | no | +| binary_path | Path to the `postqueue` binary. If an absolute path is provided, the collector will use it directly; otherwise, it will search for the binary in directories specified in the PATH environment variable. | /usr/sbin/postqueue | yes | +| timeout | Timeout for executing the binary, specified in seconds. | 2 | no | + +</details> + +#### Examples + +##### Custom binary path + +The executable is not in the directories specified in the PATH environment variable. + +<details open><summary></summary> + +```yaml +jobs: + - name: custom_path + binary_path: /usr/local/sbin/postqueue + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `postfix` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m postfix + ``` + +### Getting Logs + +If you're encountering problems with the `postfix` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep postfix +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep postfix /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep postfix +``` + + diff --git a/src/go/plugin/go.d/modules/postfix/metadata.yaml b/src/go/plugin/go.d/modules/postfix/metadata.yaml new file mode 100644 index 00000000..3407ebb3 --- /dev/null +++ b/src/go/plugin/go.d/modules/postfix/metadata.yaml @@ -0,0 +1,106 @@ +plugin_name: go.d.plugin +modules: + - meta: + plugin_name: go.d.plugin + module_name: postfix + monitored_instance: + name: Postfix + link: https://www.postfix.org/ + categories: + - data-collection.mail-servers + icon_filename: "postfix.svg" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - postfix + - mail + - mail server + most_popular: false + overview: + data_collection: + metrics_description: > + This collector retrieves statistics about the Postfix mail queue using the [postqueue](https://www.postfix.org/postqueue.1.html) command-line tool. + method_description: > + It periodically executes the `postqueue -p` command. The collection interval is set to 10 seconds by default, but this can be configurable. + supported_platforms: + include: [] + exclude: [] + multi_instance: false + additional_permissions: + description: > + Postfix has internal access controls for the mail queue. By default, all users can view the queue. If your system has stricter controls, grant the `netdata` user access by adding it to `authorized_mailq_users` in the `/etc/postfix/main.cf `file. + For more details, refer to the `authorized_mailq_users` setting in the [Postfix documentation](https://www.postfix.org/postconf.5.html). + default_behavior: + auto_detection: + description: "The collector executes `postqueue -p` to get Postfix queue statistics." + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: [] + configuration: + file: + name: "go.d/postfix.conf" + options: + description: | + The following options can be defined globally: update_every. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 10 + required: false + - name: binary_path + description: Path to the `postqueue` binary. If an absolute path is provided, the collector will use it directly; otherwise, it will search for the binary in directories specified in the PATH environment variable. + default_value: /usr/sbin/postqueue + required: true + - name: timeout + description: Timeout for executing the binary, specified in seconds. + default_value: 2 + required: false + examples: + folding: + enabled: true + title: "" + list: + - name: Custom binary path + description: The executable is not in the directories specified in the PATH environment variable. + config: | + jobs: + - name: custom_path + binary_path: /usr/local/sbin/postqueue + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: | + These metrics refer to the entire monitored application. + labels: [] + metrics: + - name: postfix.qemails + description: Postfix Queue Emails + unit: emails + chart_type: line + dimensions: + - name: emails + - name: postfix.qsize + description: Postfix Queue Emails Size + unit: KiB + chart_type: area + dimensions: + - name: size diff --git a/src/go/plugin/go.d/modules/postfix/postfix.go b/src/go/plugin/go.d/modules/postfix/postfix.go new file mode 100644 index 00000000..3622811e --- /dev/null +++ b/src/go/plugin/go.d/modules/postfix/postfix.go @@ -0,0 +1,109 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package postfix + +import ( + _ "embed" + "errors" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("postfix", module.Creator{ + JobConfigSchema: configSchema, + Defaults: module.Defaults{ + UpdateEvery: 10, + }, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Postfix { + return &Postfix{ + Config: Config{ + BinaryPath: "/usr/sbin/postqueue", + Timeout: web.Duration(time.Second * 2), + }, + charts: charts.Copy(), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Timeout web.Duration `yaml:"timeout,omitempty" json:"timeout"` + BinaryPath string `yaml:"binary_path,omitempty" json:"binary_path"` +} + +type ( + Postfix struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + exec postqueueBinary + } + postqueueBinary interface { + list() ([]byte, error) + } +) + +func (p *Postfix) Configuration() any { + return p.Config +} + +func (p *Postfix) Init() error { + if err := p.validateConfig(); err != nil { + p.Errorf("config validation: %s", err) + return err + } + + pq, err := p.initPostqueueExec() + if err != nil { + p.Errorf("postqueue exec initialization: %v", err) + return err + } + p.exec = pq + + return nil +} + +func (p *Postfix) Check() error { + mx, err := p.collect() + if err != nil { + p.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (p *Postfix) Charts() *module.Charts { + return p.charts +} + +func (p *Postfix) Collect() map[string]int64 { + mx, err := p.collect() + if err != nil { + p.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (p *Postfix) Cleanup() {} diff --git a/src/go/collectors/go.d.plugin/modules/zfspool/zfspool_test.go b/src/go/plugin/go.d/modules/postfix/postfix_test.go index ea40aa06..daccaaa6 100644 --- a/src/go/collectors/go.d.plugin/modules/zfspool/zfspool_test.go +++ b/src/go/plugin/go.d/modules/postfix/postfix_test.go @@ -1,13 +1,13 @@ // SPDX-License-Identifier: GPL-3.0-or-later -package zfspool +package postfix import ( "errors" "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -17,26 +17,24 @@ var ( dataConfigJSON, _ = os.ReadFile("testdata/config.json") dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") - dataZpoolList, _ = os.ReadFile("testdata/zpool-list.txt") + dataPostqueue, _ = os.ReadFile("testdata/postqueue.txt") ) func Test_testDataIsValid(t *testing.T) { for name, data := range map[string][]byte{ "dataConfigJSON": dataConfigJSON, "dataConfigYAML": dataConfigYAML, - - "dataZpoolList": dataZpoolList, + "dataPostqueue": dataPostqueue, } { require.NotNil(t, data, name) - } } -func TestZFSPool_Configuration(t *testing.T) { - module.TestConfigurationSerialize(t, &ZFSPool{}, dataConfigJSON, dataConfigYAML) +func TestPostfix_Configuration(t *testing.T) { + module.TestConfigurationSerialize(t, &Postfix{}, dataConfigJSON, dataConfigYAML) } -func TestZFSPool_Init(t *testing.T) { +func TestPostfix_Init(t *testing.T) { tests := map[string]struct { config Config wantFail bool @@ -50,130 +48,124 @@ func TestZFSPool_Init(t *testing.T) { "fails if failed to find binary": { wantFail: true, config: Config{ - BinaryPath: "zpool!!!", + BinaryPath: "postqueue!!!", }, }, } for name, test := range tests { t.Run(name, func(t *testing.T) { - zp := New() - zp.Config = test.config + pf := New() + pf.Config = test.config if test.wantFail { - assert.Error(t, zp.Init()) + assert.Error(t, pf.Init()) } else { - assert.NoError(t, zp.Init()) + assert.NoError(t, pf.Init()) } }) } } -func TestZFSPool_Cleanup(t *testing.T) { +func TestPostfix_Cleanup(t *testing.T) { tests := map[string]struct { - prepare func() *ZFSPool + prepare func() *Postfix }{ "not initialized exec": { - prepare: func() *ZFSPool { + prepare: func() *Postfix { return New() }, }, "after check": { - prepare: func() *ZFSPool { - zp := New() - zp.exec = prepareMockOK() - _ = zp.Check() - return zp + prepare: func() *Postfix { + pf := New() + pf.exec = prepareMockOK() + _ = pf.Check() + return pf }, }, "after collect": { - prepare: func() *ZFSPool { - zp := New() - zp.exec = prepareMockOK() - _ = zp.Collect() - return zp + prepare: func() *Postfix { + pf := New() + pf.exec = prepareMockOK() + _ = pf.Collect() + return pf }, }, } for name, test := range tests { t.Run(name, func(t *testing.T) { - zp := test.prepare() + pf := test.prepare() - assert.NotPanics(t, zp.Cleanup) + assert.NotPanics(t, pf.Cleanup) }) } } -func TestZFSPool_Charts(t *testing.T) { +func TestPostfix_Charts(t *testing.T) { assert.NotNil(t, New().Charts()) } -func TestZFSPool_Check(t *testing.T) { +func TestPostfix_Check(t *testing.T) { tests := map[string]struct { - prepareMock func() *mockZpoolCLIExec + prepareMock func() *mockPostqueueExec wantFail bool }{ "success case": { + wantFail: false, prepareMock: prepareMockOK, + }, + "mail queue is empty": { wantFail: false, + prepareMock: prepareMockEmptyMailQueue, }, "error on list call": { - prepareMock: prepareMockErrOnList, wantFail: true, + prepareMock: prepareMockErrOnList, }, "empty response": { - prepareMock: prepareMockEmptyResponse, wantFail: true, + prepareMock: prepareMockEmptyResponse, }, "unexpected response": { - prepareMock: prepareMockUnexpectedResponse, wantFail: true, + prepareMock: prepareMockUnexpectedResponse, }, } for name, test := range tests { t.Run(name, func(t *testing.T) { - zp := New() + pf := New() mock := test.prepareMock() - zp.exec = mock + pf.exec = mock if test.wantFail { - assert.Error(t, zp.Check()) + assert.Error(t, pf.Check()) } else { - assert.NoError(t, zp.Check()) + assert.NoError(t, pf.Check()) } }) } } -func TestZFSPool_Collect(t *testing.T) { +func TestPostfix_Collect(t *testing.T) { tests := map[string]struct { - prepareMock func() *mockZpoolCLIExec + prepareMock func() *mockPostqueueExec wantMetrics map[string]int64 }{ "success case": { prepareMock: prepareMockOK, wantMetrics: map[string]int64{ - "zpool_rpool_alloc": 9051643576, - "zpool_rpool_cap": 42, - "zpool_rpool_frag": 33, - "zpool_rpool_free": 12240656794, - "zpool_rpool_health_state_degraded": 0, - "zpool_rpool_health_state_faulted": 0, - "zpool_rpool_health_state_offline": 0, - "zpool_rpool_health_state_online": 1, - "zpool_rpool_health_state_removed": 0, - "zpool_rpool_health_state_suspended": 0, - "zpool_rpool_health_state_unavail": 0, - "zpool_rpool_size": 21367462298, - "zpool_zion_health_state_degraded": 0, - "zpool_zion_health_state_faulted": 1, - "zpool_zion_health_state_offline": 0, - "zpool_zion_health_state_online": 0, - "zpool_zion_health_state_removed": 0, - "zpool_zion_health_state_suspended": 0, - "zpool_zion_health_state_unavail": 0, + "emails": 12991, + "size": 132422, + }, + }, + "mail queue is empty": { + prepareMock: prepareMockEmptyMailQueue, + wantMetrics: map[string]int64{ + "emails": 0, + "size": 0, }, }, "error on list call": { @@ -192,38 +184,41 @@ func TestZFSPool_Collect(t *testing.T) { for name, test := range tests { t.Run(name, func(t *testing.T) { - zp := New() + pf := New() mock := test.prepareMock() - zp.exec = mock + pf.exec = mock - mx := zp.Collect() + mx := pf.Collect() assert.Equal(t, test.wantMetrics, mx) - if len(test.wantMetrics) > 0 { - assert.Len(t, *zp.Charts(), len(zpoolChartsTmpl)*len(zp.zpools)) - } }) } } -func prepareMockOK() *mockZpoolCLIExec { - return &mockZpoolCLIExec{ - listData: dataZpoolList, +func prepareMockOK() *mockPostqueueExec { + return &mockPostqueueExec{ + listData: dataPostqueue, + } +} + +func prepareMockEmptyMailQueue() *mockPostqueueExec { + return &mockPostqueueExec{ + listData: []byte("Mail queue is empty"), } } -func prepareMockErrOnList() *mockZpoolCLIExec { - return &mockZpoolCLIExec{ +func prepareMockErrOnList() *mockPostqueueExec { + return &mockPostqueueExec{ errOnList: true, } } -func prepareMockEmptyResponse() *mockZpoolCLIExec { - return &mockZpoolCLIExec{} +func prepareMockEmptyResponse() *mockPostqueueExec { + return &mockPostqueueExec{} } -func prepareMockUnexpectedResponse() *mockZpoolCLIExec { - return &mockZpoolCLIExec{ +func prepareMockUnexpectedResponse() *mockPostqueueExec { + return &mockPostqueueExec{ listData: []byte(` Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla malesuada erat id magna mattis, eu viverra tellus rhoncus. @@ -232,12 +227,12 @@ Fusce et felis pulvinar, posuere sem non, porttitor eros. } } -type mockZpoolCLIExec struct { +type mockPostqueueExec struct { errOnList bool listData []byte } -func (m *mockZpoolCLIExec) list() ([]byte, error) { +func (m *mockPostqueueExec) list() ([]byte, error) { if m.errOnList { return nil, errors.New("mock.list() error") } diff --git a/src/go/plugin/go.d/modules/postfix/testdata/config.json b/src/go/plugin/go.d/modules/postfix/testdata/config.json new file mode 100644 index 00000000..d13d2cc1 --- /dev/null +++ b/src/go/plugin/go.d/modules/postfix/testdata/config.json @@ -0,0 +1,5 @@ +{ + "update_every": 123, + "timeout": 123.123, + "binary_path": "/usr/sbin/postqueue" +}
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/postfix/testdata/config.yaml b/src/go/plugin/go.d/modules/postfix/testdata/config.yaml new file mode 100644 index 00000000..0ea793d3 --- /dev/null +++ b/src/go/plugin/go.d/modules/postfix/testdata/config.yaml @@ -0,0 +1,3 @@ +update_every: 123 +timeout: 123.123 +binary_path: "/usr/sbin/postqueue" diff --git a/src/go/plugin/go.d/modules/postfix/testdata/postqueue.txt b/src/go/plugin/go.d/modules/postfix/testdata/postqueue.txt new file mode 100644 index 00000000..5a4b822c --- /dev/null +++ b/src/go/plugin/go.d/modules/postfix/testdata/postqueue.txt @@ -0,0 +1,34 @@ +1FC3A100A1FF* 10438 Wed Jun 26 13:39:27 root@localhost.test + fotis@localhost.test + +D4BBA10097DF* 10438 Wed Jun 26 13:39:25 root@localhost.test + fotis@localhost.test + +078D8100A90D* 10438 Wed Jun 26 13:39:28 root@localhost.test + fotis@localhost.test + +A23BB100961F* 10438 Wed Jun 26 13:39:25 root@localhost.test + fotis@localhost.test + +CCF1D1009798* 10438 Wed Jun 26 13:39:25 root@localhost.test + fotis@localhost.test + +58897100885C* 10438 Wed Jun 26 13:39:24 root@localhost.test + fotis@localhost.test + +F1A951003C07* 10438 Wed Jun 26 13:39:23 root@localhost.test + fotis@localhost.test + +3A24A1003239* 10438 Wed Jun 26 13:39:23 root@localhost.test + fotis@localhost.test + +CAF5E1009FCC* 10438 Wed Jun 26 13:39:26 root@localhost.test + fotis@localhost.test + +752741009D2A* 10438 Wed Jun 26 13:39:26 root@localhost.test + fotis@localhost.test + +6B5FA10033D4* 10438 Wed Jun 26 13:39:23 root@localhost.test + fotis@localhost.test + +-- 132422 Kbytes in 12991 Requests. diff --git a/src/go/collectors/go.d.plugin/modules/postgres/README.md b/src/go/plugin/go.d/modules/postgres/README.md index 73b67b98..73b67b98 120000 --- a/src/go/collectors/go.d.plugin/modules/postgres/README.md +++ b/src/go/plugin/go.d/modules/postgres/README.md diff --git a/src/go/collectors/go.d.plugin/modules/postgres/charts.go b/src/go/plugin/go.d/modules/postgres/charts.go index 8003ab9f..da9b04af 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/charts.go +++ b/src/go/plugin/go.d/modules/postgres/charts.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/postgres/collect.go b/src/go/plugin/go.d/modules/postgres/collect.go index b43e2806..6186932c 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/collect.go +++ b/src/go/plugin/go.d/modules/postgres/collect.go @@ -6,11 +6,12 @@ import ( "context" "database/sql" "fmt" + "regexp" "strconv" "time" - "github.com/jackc/pgx/v4" - "github.com/jackc/pgx/v4/stdlib" + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/stdlib" ) const ( @@ -264,3 +265,9 @@ func calcPercentage(value, total int64) (v int64) { func calcDeltaPercentage(a, b incDelta) int64 { return calcPercentage(a.delta(), a.delta()+b.delta()) } + +func removeSpaces(s string) string { + return reSpace.ReplaceAllString(s, "_") +} + +var reSpace = regexp.MustCompile(`\s+`) diff --git a/src/go/collectors/go.d.plugin/modules/postgres/collect_metrics.go b/src/go/plugin/go.d/modules/postgres/collect_metrics.go index 84f9abbc..84f9abbc 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/collect_metrics.go +++ b/src/go/plugin/go.d/modules/postgres/collect_metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/postgres/config_schema.json b/src/go/plugin/go.d/modules/postgres/config_schema.json index 42bff329..42bff329 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/config_schema.json +++ b/src/go/plugin/go.d/modules/postgres/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/postgres/do_query.go b/src/go/plugin/go.d/modules/postgres/do_query.go index 3b90be0d..3b90be0d 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/do_query.go +++ b/src/go/plugin/go.d/modules/postgres/do_query.go diff --git a/src/go/collectors/go.d.plugin/modules/postgres/do_query_bloat.go b/src/go/plugin/go.d/modules/postgres/do_query_bloat.go index ae1add4a..484bfdd9 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/do_query_bloat.go +++ b/src/go/plugin/go.d/modules/postgres/do_query_bloat.go @@ -52,7 +52,7 @@ func (p *Postgres) doDBQueryBloat(db *sql.DB) error { case "wastedbytes": tableWasted = parseFloat(value) case "iname": - iname = value + iname = removeSpaces(value) case "wastedibytes": idxWasted = parseFloat(value) } diff --git a/src/go/collectors/go.d.plugin/modules/postgres/do_query_columns.go b/src/go/plugin/go.d/modules/postgres/do_query_columns.go index 1da655aa..1da655aa 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/do_query_columns.go +++ b/src/go/plugin/go.d/modules/postgres/do_query_columns.go diff --git a/src/go/collectors/go.d.plugin/modules/postgres/do_query_databases.go b/src/go/plugin/go.d/modules/postgres/do_query_databases.go index 0cee7a0c..0cee7a0c 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/do_query_databases.go +++ b/src/go/plugin/go.d/modules/postgres/do_query_databases.go diff --git a/src/go/collectors/go.d.plugin/modules/postgres/do_query_global.go b/src/go/plugin/go.d/modules/postgres/do_query_global.go index c70772a2..c70772a2 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/do_query_global.go +++ b/src/go/plugin/go.d/modules/postgres/do_query_global.go diff --git a/src/go/collectors/go.d.plugin/modules/postgres/do_query_indexes.go b/src/go/plugin/go.d/modules/postgres/do_query_indexes.go index f5eb15bb..309b4d10 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/do_query_indexes.go +++ b/src/go/plugin/go.d/modules/postgres/do_query_indexes.go @@ -42,7 +42,7 @@ func (p *Postgres) doDBQueryStatUserIndexes(db *sql.DB) error { case "relname": table = value case "indexrelname": - name = value + name = removeSpaces(value) p.getIndexMetrics(name, table, dbname, schema).updated = true case "parent_relname": p.getIndexMetrics(name, table, dbname, schema).parentTable = value diff --git a/src/go/collectors/go.d.plugin/modules/postgres/do_query_misc.go b/src/go/plugin/go.d/modules/postgres/do_query_misc.go index a2299c8b..2877650c 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/do_query_misc.go +++ b/src/go/plugin/go.d/modules/postgres/do_query_misc.go @@ -6,7 +6,7 @@ import ( "database/sql" "strconv" - "github.com/jackc/pgx/v4/stdlib" + "github.com/jackc/pgx/v5/stdlib" ) func (p *Postgres) doQueryServerVersion() (int, error) { diff --git a/src/go/collectors/go.d.plugin/modules/postgres/do_query_replication.go b/src/go/plugin/go.d/modules/postgres/do_query_replication.go index 22ff4700..e60287e6 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/do_query_replication.go +++ b/src/go/plugin/go.d/modules/postgres/do_query_replication.go @@ -36,7 +36,7 @@ func (p *Postgres) doQueryReplStandbyAppWALDelta() error { app = value p.getReplAppMetrics(app).updated = true default: - // TODO: delta calculation was changed in https://github.com/netdata/netdata/go/go.d.plugin/pull/1039 + // TODO: delta calculation was changed in https://github.com/netdata/netdata/go/plugins/plugin/go.d/pull/1039 // - 'replay_delta' (probably other deltas too?) can be negative // - Also, WAL delta != WAL lag after that PR v := parseInt(value) diff --git a/src/go/collectors/go.d.plugin/modules/postgres/do_query_tables.go b/src/go/plugin/go.d/modules/postgres/do_query_tables.go index 5b3e2c71..5b3e2c71 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/do_query_tables.go +++ b/src/go/plugin/go.d/modules/postgres/do_query_tables.go diff --git a/src/go/collectors/go.d.plugin/modules/postgres/init.go b/src/go/plugin/go.d/modules/postgres/init.go index 315a876a..e2bbecc1 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/init.go +++ b/src/go/plugin/go.d/modules/postgres/init.go @@ -5,7 +5,7 @@ package postgres import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" ) func (p *Postgres) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/postgres/integrations/postgresql.md b/src/go/plugin/go.d/modules/postgres/integrations/postgresql.md index 2122f3d6..4f2a9110 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/integrations/postgresql.md +++ b/src/go/plugin/go.d/modules/postgres/integrations/postgresql.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/postgres/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/postgres/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/postgres/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/postgres/metadata.yaml" sidebar_label: "PostgreSQL" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -299,7 +299,7 @@ The following options can be defined globally: update_every, autodetection_retry | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | | dsn | Postgres server DSN (Data Source Name). See [DSN syntax](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING). | postgres://postgres:postgres@127.0.0.1:5432/postgres | yes | | timeout | Query timeout in seconds. | 2 | no | -| collect_databases_matching | Databases selector. Determines which database metrics will be collected. Syntax is [simple patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#simple-patterns-matcher). | | no | +| collect_databases_matching | Databases selector. Determines which database metrics will be collected. Syntax is [simple patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#simple-patterns-matcher). | | no | | max_db_tables | Maximum number of tables in the database. Table metrics will not be collected for databases that have more tables than max_db_tables. 0 means no limit. | 50 | no | | max_db_indexes | Maximum number of indexes in the database. Index metrics will not be collected for databases that have more indexes than max_db_indexes. 0 means no limit. | 250 | no | @@ -357,6 +357,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `postgres` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -379,4 +381,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m postgres ``` +### Getting Logs + +If you're encountering problems with the `postgres` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep postgres +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep postgres /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep postgres +``` + diff --git a/src/go/collectors/go.d.plugin/modules/postgres/metadata.yaml b/src/go/plugin/go.d/modules/postgres/metadata.yaml index 799dd6d0..aacd19ad 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/metadata.yaml +++ b/src/go/plugin/go.d/modules/postgres/metadata.yaml @@ -98,7 +98,7 @@ modules: default_value: 2 required: false - name: collect_databases_matching - description: Databases selector. Determines which database metrics will be collected. Syntax is [simple patterns](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#simple-patterns-matcher). + description: Databases selector. Determines which database metrics will be collected. Syntax is [simple patterns](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#simple-patterns-matcher). default_value: "" required: false - name: max_db_tables diff --git a/src/go/collectors/go.d.plugin/modules/postgres/metrics.go b/src/go/plugin/go.d/modules/postgres/metrics.go index b60fbdf8..a42ccba1 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/metrics.go +++ b/src/go/plugin/go.d/modules/postgres/metrics.go @@ -2,7 +2,7 @@ package postgres -import "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" type pgMetrics struct { srvMetrics diff --git a/src/go/collectors/go.d.plugin/modules/postgres/postgres.go b/src/go/plugin/go.d/modules/postgres/postgres.go index 7928c0b6..57491039 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/postgres.go +++ b/src/go/plugin/go.d/modules/postgres/postgres.go @@ -9,13 +9,13 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" - "github.com/jackc/pgx/v4/stdlib" - _ "github.com/jackc/pgx/v4/stdlib" + "github.com/jackc/pgx/v5/stdlib" + _ "github.com/jackc/pgx/v5/stdlib" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/postgres/postgres_test.go b/src/go/plugin/go.d/modules/postgres/postgres_test.go index 051f9c38..7e91b288 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/postgres_test.go +++ b/src/go/plugin/go.d/modules/postgres/postgres_test.go @@ -12,8 +12,8 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" "github.com/DATA-DOG/go-sqlmock" "github.com/stretchr/testify/assert" diff --git a/src/go/collectors/go.d.plugin/modules/postgres/queries.go b/src/go/plugin/go.d/modules/postgres/queries.go index f6afc934..f6afc934 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/queries.go +++ b/src/go/plugin/go.d/modules/postgres/queries.go diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/config.json b/src/go/plugin/go.d/modules/postgres/testdata/config.json index 6b39278c..6b39278c 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/config.json +++ b/src/go/plugin/go.d/modules/postgres/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/config.yaml b/src/go/plugin/go.d/modules/postgres/testdata/config.yaml index 36ff5f0b..36ff5f0b 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/postgres/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/autovacuum_workers.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/autovacuum_workers.txt index 7adc787b..7adc787b 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/autovacuum_workers.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/autovacuum_workers.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/bloat_tables.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/bloat_tables.txt index 30769536..30769536 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/bloat_tables.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/bloat_tables.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/catalog_relations.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/catalog_relations.txt index cd05e89a..cd05e89a 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/catalog_relations.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/catalog_relations.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/checkpoints.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/checkpoints.txt index 851ff132..851ff132 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/checkpoints.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/checkpoints.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/database_conflicts.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/database_conflicts.txt index 34229182..34229182 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/database_conflicts.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/database_conflicts.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/database_locks.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/database_locks.txt index 8d92f314..8d92f314 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/database_locks.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/database_locks.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/database_size.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/database_size.txt index 367cb6f2..367cb6f2 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/database_size.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/database_size.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/database_stats.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/database_stats.txt index d3ce24c6..d3ce24c6 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/database_stats.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/database_stats.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/is_super_user-false.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/is_super_user-false.txt index 6cb2222d..6cb2222d 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/is_super_user-false.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/is_super_user-false.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/is_super_user-true.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/is_super_user-true.txt index 84cd8088..84cd8088 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/is_super_user-true.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/is_super_user-true.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/pg_is_in_recovery-true.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/pg_is_in_recovery-true.txt index b684948e..b684948e 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/pg_is_in_recovery-true.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/pg_is_in_recovery-true.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/queryable_database_list.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/queryable_database_list.txt index b3f2af4f..b3f2af4f 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/queryable_database_list.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/queryable_database_list.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/replication_slot_files.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/replication_slot_files.txt index 59fcd8fe..59fcd8fe 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/replication_slot_files.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/replication_slot_files.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/replication_standby_app_wal_delta.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/replication_standby_app_wal_delta.txt index 98c3cd99..98c3cd99 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/replication_standby_app_wal_delta.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/replication_standby_app_wal_delta.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/replication_standby_app_wal_lag.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/replication_standby_app_wal_lag.txt index c2e25379..c2e25379 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/replication_standby_app_wal_lag.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/replication_standby_app_wal_lag.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/server_connections_state.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/server_connections_state.txt index 7387f4df..7387f4df 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/server_connections_state.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/server_connections_state.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/server_current_connections.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/server_current_connections.txt index 065188d9..065188d9 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/server_current_connections.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/server_current_connections.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/server_version_num.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/server_version_num.txt index 18d769b3..18d769b3 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/server_version_num.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/server_version_num.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/settings_max_connections.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/settings_max_connections.txt index 4d59df21..4d59df21 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/settings_max_connections.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/settings_max_connections.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/settings_max_locks_held.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/settings_max_locks_held.txt index e72bd71a..e72bd71a 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/settings_max_locks_held.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/settings_max_locks_held.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/stat_user_indexes_db_postgres.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/stat_user_indexes_db_postgres.txt index db73fa4e..db73fa4e 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/stat_user_indexes_db_postgres.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/stat_user_indexes_db_postgres.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/stat_user_tables_db_postgres.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/stat_user_tables_db_postgres.txt index f6f9edb0..f6f9edb0 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/stat_user_tables_db_postgres.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/stat_user_tables_db_postgres.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/statio_user_tables_db_postgres.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/statio_user_tables_db_postgres.txt index f52b1806..f52b1806 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/statio_user_tables_db_postgres.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/statio_user_tables_db_postgres.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/table_columns_stats.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/table_columns_stats.txt index 645d847d..645d847d 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/table_columns_stats.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/table_columns_stats.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/txid_wraparound.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/txid_wraparound.txt index 9e05f12a..9e05f12a 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/txid_wraparound.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/txid_wraparound.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/uptime.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/uptime.txt index 95464bc3..95464bc3 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/uptime.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/uptime.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/wal_archive_files.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/wal_archive_files.txt index 8b7a8626..8b7a8626 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/wal_archive_files.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/wal_archive_files.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/wal_files.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/wal_files.txt index f18aefdc..f18aefdc 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/wal_files.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/wal_files.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/wal_writes.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/wal_writes.txt index 3bb8f9e9..3bb8f9e9 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/wal_writes.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/wal_writes.txt diff --git a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/xact_query_running_time.txt b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/xact_query_running_time.txt index 52617f74..52617f74 100644 --- a/src/go/collectors/go.d.plugin/modules/postgres/testdata/v14.4/xact_query_running_time.txt +++ b/src/go/plugin/go.d/modules/postgres/testdata/v14.4/xact_query_running_time.txt diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/README.md b/src/go/plugin/go.d/modules/powerdns/README.md index 3e598971..3e598971 120000 --- a/src/go/collectors/go.d.plugin/modules/powerdns/README.md +++ b/src/go/plugin/go.d/modules/powerdns/README.md diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/authoritativens.go b/src/go/plugin/go.d/modules/powerdns/authoritativens.go index 55b5b811..b9c02b86 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns/authoritativens.go +++ b/src/go/plugin/go.d/modules/powerdns/authoritativens.go @@ -8,8 +8,8 @@ import ( "net/http" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/authoritativens_test.go b/src/go/plugin/go.d/modules/powerdns/authoritativens_test.go index ddf68467..d506c977 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns/authoritativens_test.go +++ b/src/go/plugin/go.d/modules/powerdns/authoritativens_test.go @@ -8,9 +8,9 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/charts.go b/src/go/plugin/go.d/modules/powerdns/charts.go index 119ca4a2..331a94a2 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns/charts.go +++ b/src/go/plugin/go.d/modules/powerdns/charts.go @@ -2,7 +2,7 @@ package powerdns -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" var charts = module.Charts{ { diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/collect.go b/src/go/plugin/go.d/modules/powerdns/collect.go index 359d4198..c2831e0f 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns/collect.go +++ b/src/go/plugin/go.d/modules/powerdns/collect.go @@ -10,7 +10,7 @@ import ( "net/http" "strconv" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const ( @@ -65,8 +65,7 @@ func (ns *AuthoritativeNS) collectStatistics(collected map[string]int64, statist } func (ns *AuthoritativeNS) scrapeStatistics() ([]statisticMetric, error) { - req, _ := web.NewHTTPRequest(ns.Request) - req.URL.Path = urlPathLocalStatistics + req, _ := web.NewHTTPRequestWithPath(ns.Request, urlPathLocalStatistics) var statistics statisticMetrics if err := ns.doOKDecode(req, &statistics); err != nil { diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/config_schema.json b/src/go/plugin/go.d/modules/powerdns/config_schema.json index 53c1c313..2ec6565c 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns/config_schema.json +++ b/src/go/plugin/go.d/modules/powerdns/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/init.go b/src/go/plugin/go.d/modules/powerdns/init.go index 9190f7e4..0819459f 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns/init.go +++ b/src/go/plugin/go.d/modules/powerdns/init.go @@ -6,8 +6,8 @@ import ( "errors" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (ns *AuthoritativeNS) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/integrations/powerdns_authoritative_server.md b/src/go/plugin/go.d/modules/powerdns/integrations/powerdns_authoritative_server.md index f768dec5..b4060a61 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns/integrations/powerdns_authoritative_server.md +++ b/src/go/plugin/go.d/modules/powerdns/integrations/powerdns_authoritative_server.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/powerdns/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/powerdns/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/powerdns/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/powerdns/metadata.yaml" sidebar_label: "PowerDNS Authoritative Server" learn_status: "Published" learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" @@ -198,6 +198,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `powerdns` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -220,4 +222,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m powerdns ``` +### Getting Logs + +If you're encountering problems with the `powerdns` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep powerdns +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep powerdns /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep powerdns +``` + diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/metadata.yaml b/src/go/plugin/go.d/modules/powerdns/metadata.yaml index ea4dec0b..ea4dec0b 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns/metadata.yaml +++ b/src/go/plugin/go.d/modules/powerdns/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/metrics.go b/src/go/plugin/go.d/modules/powerdns/metrics.go index 3efa2c98..3efa2c98 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns/metrics.go +++ b/src/go/plugin/go.d/modules/powerdns/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/rspamd/testdata/config.json b/src/go/plugin/go.d/modules/powerdns/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/rspamd/testdata/config.json +++ b/src/go/plugin/go.d/modules/powerdns/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/rspamd/testdata/config.yaml b/src/go/plugin/go.d/modules/powerdns/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/rspamd/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/powerdns/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/testdata/recursor/statistics.json b/src/go/plugin/go.d/modules/powerdns/testdata/recursor/statistics.json index a3147795..a3147795 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns/testdata/recursor/statistics.json +++ b/src/go/plugin/go.d/modules/powerdns/testdata/recursor/statistics.json diff --git a/src/go/collectors/go.d.plugin/modules/powerdns/testdata/v4.3.0/statistics.json b/src/go/plugin/go.d/modules/powerdns/testdata/v4.3.0/statistics.json index 30813d3d..30813d3d 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns/testdata/v4.3.0/statistics.json +++ b/src/go/plugin/go.d/modules/powerdns/testdata/v4.3.0/statistics.json diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/README.md b/src/go/plugin/go.d/modules/powerdns_recursor/README.md index 810e6330..810e6330 120000 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/README.md +++ b/src/go/plugin/go.d/modules/powerdns_recursor/README.md diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/charts.go b/src/go/plugin/go.d/modules/powerdns_recursor/charts.go index d0bd7c36..ea63fd1c 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/charts.go +++ b/src/go/plugin/go.d/modules/powerdns_recursor/charts.go @@ -2,7 +2,7 @@ package powerdns_recursor -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" var charts = module.Charts{ { diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/collect.go b/src/go/plugin/go.d/modules/powerdns_recursor/collect.go index ec2e99c9..784093cc 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/collect.go +++ b/src/go/plugin/go.d/modules/powerdns_recursor/collect.go @@ -10,7 +10,7 @@ import ( "net/http" "strconv" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const ( @@ -65,8 +65,7 @@ func (r *Recursor) collectStatistics(collected map[string]int64, statistics stat } func (r *Recursor) scrapeStatistics() ([]statisticMetric, error) { - req, _ := web.NewHTTPRequest(r.Request) - req.URL.Path = urlPathLocalStatistics + req, _ := web.NewHTTPRequestWithPath(r.Request, urlPathLocalStatistics) var statistics statisticMetrics if err := r.doOKDecode(req, &statistics); err != nil { diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/config_schema.json b/src/go/plugin/go.d/modules/powerdns_recursor/config_schema.json index f175548b..1b76938c 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/config_schema.json +++ b/src/go/plugin/go.d/modules/powerdns_recursor/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/init.go b/src/go/plugin/go.d/modules/powerdns_recursor/init.go index d242950f..cadc6d2c 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/init.go +++ b/src/go/plugin/go.d/modules/powerdns_recursor/init.go @@ -6,8 +6,8 @@ import ( "errors" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (r *Recursor) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/integrations/powerdns_recursor.md b/src/go/plugin/go.d/modules/powerdns_recursor/integrations/powerdns_recursor.md index 4821aac5..68a3da0a 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/integrations/powerdns_recursor.md +++ b/src/go/plugin/go.d/modules/powerdns_recursor/integrations/powerdns_recursor.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/powerdns_recursor/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/powerdns_recursor/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/powerdns_recursor/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/powerdns_recursor/metadata.yaml" sidebar_label: "PowerDNS Recursor" learn_status: "Published" learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" @@ -201,6 +201,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `powerdns_recursor` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -223,4 +225,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m powerdns_recursor ``` +### Getting Logs + +If you're encountering problems with the `powerdns_recursor` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep powerdns_recursor +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep powerdns_recursor /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep powerdns_recursor +``` + diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/metadata.yaml b/src/go/plugin/go.d/modules/powerdns_recursor/metadata.yaml index 82cb9912..82cb9912 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/metadata.yaml +++ b/src/go/plugin/go.d/modules/powerdns_recursor/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/metrics.go b/src/go/plugin/go.d/modules/powerdns_recursor/metrics.go index a7fbd63c..a7fbd63c 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/metrics.go +++ b/src/go/plugin/go.d/modules/powerdns_recursor/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/recursor.go b/src/go/plugin/go.d/modules/powerdns_recursor/recursor.go index ec5d8da6..4b9c3e72 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/recursor.go +++ b/src/go/plugin/go.d/modules/powerdns_recursor/recursor.go @@ -8,8 +8,8 @@ import ( "net/http" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/recursor_test.go b/src/go/plugin/go.d/modules/powerdns_recursor/recursor_test.go index f4ab0535..09475e22 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/recursor_test.go +++ b/src/go/plugin/go.d/modules/powerdns_recursor/recursor_test.go @@ -8,9 +8,9 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/testdata/authoritative/statistics.json b/src/go/plugin/go.d/modules/powerdns_recursor/testdata/authoritative/statistics.json index 72bb2f0a..72bb2f0a 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/testdata/authoritative/statistics.json +++ b/src/go/plugin/go.d/modules/powerdns_recursor/testdata/authoritative/statistics.json diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/testdata/config.json b/src/go/plugin/go.d/modules/powerdns_recursor/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/testdata/config.json +++ b/src/go/plugin/go.d/modules/powerdns_recursor/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/testdata/config.yaml b/src/go/plugin/go.d/modules/powerdns_recursor/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/powerdns_recursor/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/testdata/v4.3.1/statistics.json b/src/go/plugin/go.d/modules/powerdns_recursor/testdata/v4.3.1/statistics.json index a3147795..a3147795 100644 --- a/src/go/collectors/go.d.plugin/modules/powerdns_recursor/testdata/v4.3.1/statistics.json +++ b/src/go/plugin/go.d/modules/powerdns_recursor/testdata/v4.3.1/statistics.json diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/README.md b/src/go/plugin/go.d/modules/prometheus/README.md index 13e59d14..13e59d14 120000 --- a/src/go/collectors/go.d.plugin/modules/prometheus/README.md +++ b/src/go/plugin/go.d/modules/prometheus/README.md diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/cache.go b/src/go/plugin/go.d/modules/prometheus/cache.go index 7fc34f8c..12a4d24f 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/cache.go +++ b/src/go/plugin/go.d/modules/prometheus/cache.go @@ -3,7 +3,7 @@ package prometheus import ( - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func newCache() *cache { diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/charts.go b/src/go/plugin/go.d/modules/prometheus/charts.go index f0e7226b..c78f9b1b 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/charts.go +++ b/src/go/plugin/go.d/modules/prometheus/charts.go @@ -6,8 +6,8 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" "github.com/prometheus/prometheus/model/labels" ) diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/collect.go b/src/go/plugin/go.d/modules/prometheus/collect.go index a6df302f..8711745c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/collect.go +++ b/src/go/plugin/go.d/modules/prometheus/collect.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/config_schema.json b/src/go/plugin/go.d/modules/prometheus/config_schema.json index 10d1a2be..2df96b04 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/config_schema.json +++ b/src/go/plugin/go.d/modules/prometheus/config_schema.json @@ -49,7 +49,7 @@ "properties": { "allow": { "title": "Allow", - "description": "Allow time series that match any of the specified [selectors](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/prometheus/selector#readme).", + "description": "Allow time series that match any of the specified [selectors](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/prometheus/selector#readme).", "type": [ "array", "null" @@ -62,7 +62,7 @@ }, "deny": { "title": "Deny", - "description": "Deny time series that match any of the specified [selectors](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/prometheus/selector#readme).", + "description": "Deny time series that match any of the specified [selectors](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/prometheus/selector#readme).", "type": [ "array", "null" @@ -289,6 +289,12 @@ "selector": { "ui:help": "The logic is as follows: `(allow1 OR allow2) AND !(deny1 OR deny2)`." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/init.go b/src/go/plugin/go.d/modules/prometheus/init.go index f5cc8bca..afb92af3 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/init.go +++ b/src/go/plugin/go.d/modules/prometheus/init.go @@ -7,9 +7,9 @@ import ( "fmt" "os" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (p *Prometheus) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/4d_server.md b/src/go/plugin/go.d/modules/prometheus/integrations/4d_server.md index ce924154..479fbe13 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/4d_server.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/4d_server.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/4d_server.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/4d_server.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "4D Server" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/8430ft_modem.md b/src/go/plugin/go.d/modules/prometheus/integrations/8430ft_modem.md index 9e419e18..d5087d8c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/8430ft_modem.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/8430ft_modem.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/8430ft_modem.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/8430ft_modem.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "8430FT modem" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/a10_acos_network_devices.md b/src/go/plugin/go.d/modules/prometheus/integrations/a10_acos_network_devices.md index e08fffa2..886572d8 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/a10_acos_network_devices.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/a10_acos_network_devices.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/a10_acos_network_devices.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/a10_acos_network_devices.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "A10 ACOS network devices" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/airthings_waveplus_air_sensor.md b/src/go/plugin/go.d/modules/prometheus/integrations/airthings_waveplus_air_sensor.md index 275b8cca..d6353d5c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/airthings_waveplus_air_sensor.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/airthings_waveplus_air_sensor.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/airthings_waveplus_air_sensor.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/airthings_waveplus_air_sensor.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Airthings Waveplus air sensor" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/akamai_edge_dns_traffic.md b/src/go/plugin/go.d/modules/prometheus/integrations/akamai_edge_dns_traffic.md index e8e8c8ab..d61275eb 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/akamai_edge_dns_traffic.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/akamai_edge_dns_traffic.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/akamai_edge_dns_traffic.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/akamai_edge_dns_traffic.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Akamai Edge DNS Traffic" learn_status: "Published" learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/akamai_global_traffic_management.md b/src/go/plugin/go.d/modules/prometheus/integrations/akamai_global_traffic_management.md index 1fbd6bf2..6c1dbbf3 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/akamai_global_traffic_management.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/akamai_global_traffic_management.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/akamai_global_traffic_management.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/akamai_global_traffic_management.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Akamai Global Traffic Management" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/akami_cloudmonitor.md b/src/go/plugin/go.d/modules/prometheus/integrations/akami_cloudmonitor.md index 736cf25f..48089240 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/akami_cloudmonitor.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/akami_cloudmonitor.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/akami_cloudmonitor.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/akami_cloudmonitor.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Akami Cloudmonitor" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/alamos_fe2_server.md b/src/go/plugin/go.d/modules/prometheus/integrations/alamos_fe2_server.md index b29363d1..1f5552ac 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/alamos_fe2_server.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/alamos_fe2_server.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/alamos_fe2_server.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/alamos_fe2_server.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Alamos FE2 server" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/alibaba_cloud.md b/src/go/plugin/go.d/modules/prometheus/integrations/alibaba_cloud.md index ec11ff2f..51a5203f 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/alibaba_cloud.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/alibaba_cloud.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/alibaba_cloud.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/alibaba_cloud.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Alibaba Cloud" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/altaro_backup.md b/src/go/plugin/go.d/modules/prometheus/integrations/altaro_backup.md index 8f2509ff..c5200c88 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/altaro_backup.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/altaro_backup.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/altaro_backup.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/altaro_backup.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Altaro Backup" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/amd_cpu_&_gpu.md b/src/go/plugin/go.d/modules/prometheus/integrations/amd_cpu_&_gpu.md index 5e9b8448..0eb58274 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/amd_cpu_&_gpu.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/amd_cpu_&_gpu.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/amd_cpu_&_gpu.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/amd_cpu_&_gpu.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "AMD CPU & GPU" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/andrews_&_arnold_line_status.md b/src/go/plugin/go.d/modules/prometheus/integrations/andrews_&_arnold_line_status.md index 85c1cc1d..52d282ba 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/andrews_&_arnold_line_status.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/andrews_&_arnold_line_status.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/andrews_&_arnold_line_status.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/andrews_&_arnold_line_status.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Andrews & Arnold line status" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/apache_airflow.md b/src/go/plugin/go.d/modules/prometheus/integrations/apache_airflow.md index 139d0f6e..5a5d1507 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/apache_airflow.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/apache_airflow.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/apache_airflow.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/apache_airflow.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Apache Airflow" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/apache_flink.md b/src/go/plugin/go.d/modules/prometheus/integrations/apache_flink.md index 90560fa8..325b15d6 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/apache_flink.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/apache_flink.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/apache_flink.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/apache_flink.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Apache Flink" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/apicast.md b/src/go/plugin/go.d/modules/prometheus/integrations/apicast.md index ed4b089d..7c36df05 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/apicast.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/apicast.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/apicast.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/apicast.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "APIcast" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/apple_time_machine.md b/src/go/plugin/go.d/modules/prometheus/integrations/apple_time_machine.md index e42d25a2..e3a916eb 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/apple_time_machine.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/apple_time_machine.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/apple_time_machine.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/apple_time_machine.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Apple Time Machine" learn_status: "Published" learn_rel_path: "Collecting Metrics/macOS Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/arm_hwcpipe.md b/src/go/plugin/go.d/modules/prometheus/integrations/arm_hwcpipe.md index 9cbb3b50..14a4386f 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/arm_hwcpipe.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/arm_hwcpipe.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/arm_hwcpipe.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/arm_hwcpipe.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "ARM HWCPipe" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aruba_devices.md b/src/go/plugin/go.d/modules/prometheus/integrations/aruba_devices.md index d11a520e..c848873b 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aruba_devices.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/aruba_devices.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aruba_devices.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/aruba_devices.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Aruba devices" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/arvancloud_cdn.md b/src/go/plugin/go.d/modules/prometheus/integrations/arvancloud_cdn.md index e8c31e4f..81bcbd70 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/arvancloud_cdn.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/arvancloud_cdn.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/arvancloud_cdn.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/arvancloud_cdn.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "ArvanCloud CDN" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/audisto.md b/src/go/plugin/go.d/modules/prometheus/integrations/audisto.md index 51e27fa2..81c45088 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/audisto.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/audisto.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/audisto.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/audisto.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Audisto" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/authlog.md b/src/go/plugin/go.d/modules/prometheus/integrations/authlog.md index 4c3e86e7..86f20e30 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/authlog.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/authlog.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/authlog.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/authlog.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "AuthLog" learn_status: "Published" learn_rel_path: "Collecting Metrics/Logs Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_ec2_compute_instances.md b/src/go/plugin/go.d/modules/prometheus/integrations/aws_ec2_compute_instances.md index 11f1bea8..c31b72dc 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_ec2_compute_instances.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/aws_ec2_compute_instances.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_ec2_compute_instances.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/aws_ec2_compute_instances.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "AWS EC2 Compute instances" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_ec2_spot_instance.md b/src/go/plugin/go.d/modules/prometheus/integrations/aws_ec2_spot_instance.md index ad8b625e..908624b4 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_ec2_spot_instance.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/aws_ec2_spot_instance.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_ec2_spot_instance.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/aws_ec2_spot_instance.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "AWS EC2 Spot Instance" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_ecs.md b/src/go/plugin/go.d/modules/prometheus/integrations/aws_ecs.md index 8192a4f1..aed1877b 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_ecs.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/aws_ecs.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_ecs.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/aws_ecs.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "AWS ECS" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_health_events.md b/src/go/plugin/go.d/modules/prometheus/integrations/aws_health_events.md index 531159d0..dd1d4bc6 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_health_events.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/aws_health_events.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_health_events.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/aws_health_events.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "AWS Health events" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_instance_health.md b/src/go/plugin/go.d/modules/prometheus/integrations/aws_instance_health.md index 39d44f05..82da72d2 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_instance_health.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/aws_instance_health.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_instance_health.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/aws_instance_health.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "AWS instance health" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_quota.md b/src/go/plugin/go.d/modules/prometheus/integrations/aws_quota.md index 45f8e46c..67970fdf 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_quota.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/aws_quota.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_quota.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/aws_quota.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "AWS Quota" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_rds.md b/src/go/plugin/go.d/modules/prometheus/integrations/aws_rds.md index aa41d233..acd1e710 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_rds.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/aws_rds.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_rds.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/aws_rds.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "AWS RDS" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_s3_buckets.md b/src/go/plugin/go.d/modules/prometheus/integrations/aws_s3_buckets.md index e60ccc95..e4628d71 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_s3_buckets.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/aws_s3_buckets.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_s3_buckets.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/aws_s3_buckets.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "AWS S3 buckets" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_sqs.md b/src/go/plugin/go.d/modules/prometheus/integrations/aws_sqs.md index c47c9ab5..b2760e20 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_sqs.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/aws_sqs.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/aws_sqs.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/aws_sqs.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "AWS SQS" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_ad_app_passwords.md b/src/go/plugin/go.d/modules/prometheus/integrations/azure_ad_app_passwords.md index 7cc470b5..1f1ce0a8 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_ad_app_passwords.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/azure_ad_app_passwords.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_ad_app_passwords.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/azure_ad_app_passwords.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Azure AD App passwords" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_application.md b/src/go/plugin/go.d/modules/prometheus/integrations/azure_application.md index 0506121d..55f12465 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_application.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/azure_application.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_application.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/azure_application.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Azure application" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_elastic_pool_sql.md b/src/go/plugin/go.d/modules/prometheus/integrations/azure_elastic_pool_sql.md index 9b4fa439..0fa89bff 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_elastic_pool_sql.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/azure_elastic_pool_sql.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_elastic_pool_sql.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/azure_elastic_pool_sql.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Azure Elastic Pool SQL" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_resources.md b/src/go/plugin/go.d/modules/prometheus/integrations/azure_resources.md index f4bf49a2..c63e0ad1 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_resources.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/azure_resources.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_resources.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/azure_resources.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Azure Resources" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_service_bus.md b/src/go/plugin/go.d/modules/prometheus/integrations/azure_service_bus.md index 98ea56cd..c1a641aa 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_service_bus.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/azure_service_bus.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_service_bus.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/azure_service_bus.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Azure Service Bus" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_sql.md b/src/go/plugin/go.d/modules/prometheus/integrations/azure_sql.md index 84519f1f..98a933eb 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_sql.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/azure_sql.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/azure_sql.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/azure_sql.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Azure SQL" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bigquery.md b/src/go/plugin/go.d/modules/prometheus/integrations/bigquery.md index dd380355..a76ff8fb 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bigquery.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/bigquery.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bigquery.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/bigquery.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "BigQuery" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bird_routing_daemon.md b/src/go/plugin/go.d/modules/prometheus/integrations/bird_routing_daemon.md index 5b54fe19..43318c4c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bird_routing_daemon.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/bird_routing_daemon.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bird_routing_daemon.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/bird_routing_daemon.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Bird Routing Daemon" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/blackbox.md b/src/go/plugin/go.d/modules/prometheus/integrations/blackbox.md index d46e0f72..d37019b6 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/blackbox.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/blackbox.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/blackbox.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/blackbox.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Blackbox" learn_status: "Published" learn_rel_path: "Collecting Metrics/Synthetic Checks" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bobcat_miner_300.md b/src/go/plugin/go.d/modules/prometheus/integrations/bobcat_miner_300.md index 66038390..c00ccaa7 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bobcat_miner_300.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/bobcat_miner_300.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bobcat_miner_300.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/bobcat_miner_300.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Bobcat Miner 300" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/borg_backup.md b/src/go/plugin/go.d/modules/prometheus/integrations/borg_backup.md index 07317828..67a17534 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/borg_backup.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/borg_backup.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/borg_backup.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/borg_backup.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Borg backup" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bosh.md b/src/go/plugin/go.d/modules/prometheus/integrations/bosh.md index b7a17027..c8fc354f 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bosh.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/bosh.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bosh.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/bosh.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "BOSH" learn_status: "Published" learn_rel_path: "Collecting Metrics/Provisioning Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bpftrace_variables.md b/src/go/plugin/go.d/modules/prometheus/integrations/bpftrace_variables.md index fc29c245..76ed9a2f 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bpftrace_variables.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/bpftrace_variables.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bpftrace_variables.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/bpftrace_variables.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "bpftrace variables" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bungeecord.md b/src/go/plugin/go.d/modules/prometheus/integrations/bungeecord.md index 5412b431..cebba3d2 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bungeecord.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/bungeecord.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/bungeecord.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/bungeecord.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "BungeeCord" learn_status: "Published" learn_rel_path: "Collecting Metrics/Gaming" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cadvisor.md b/src/go/plugin/go.d/modules/prometheus/integrations/cadvisor.md index 549311c3..a40221af 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cadvisor.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/cadvisor.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cadvisor.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/cadvisor.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "cAdvisor" learn_status: "Published" learn_rel_path: "Collecting Metrics/Containers and VMs" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/celery.md b/src/go/plugin/go.d/modules/prometheus/integrations/celery.md index b8d72eaa..2cb4e821 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/celery.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/celery.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/celery.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/celery.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Celery" learn_status: "Published" learn_rel_path: "Collecting Metrics/Task Queues" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/certificate_transparency.md b/src/go/plugin/go.d/modules/prometheus/integrations/certificate_transparency.md index 9f541e8e..b741f95f 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/certificate_transparency.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/certificate_transparency.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/certificate_transparency.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/certificate_transparency.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Certificate Transparency" learn_status: "Published" learn_rel_path: "Collecting Metrics/Security Systems" @@ -38,7 +38,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -139,7 +138,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -267,6 +266,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -289,4 +290,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/checkpoint_device.md b/src/go/plugin/go.d/modules/prometheus/integrations/checkpoint_device.md index a84fae41..4d63f806 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/checkpoint_device.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/checkpoint_device.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/checkpoint_device.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/checkpoint_device.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Checkpoint device" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/chia.md b/src/go/plugin/go.d/modules/prometheus/integrations/chia.md index 45755773..158b6990 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/chia.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/chia.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/chia.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/chia.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Chia" learn_status: "Published" learn_rel_path: "Collecting Metrics/Blockchain Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/christ_elektronik_clm5ip_power_panel.md b/src/go/plugin/go.d/modules/prometheus/integrations/christ_elektronik_clm5ip_power_panel.md index d315fbe4..71f6460f 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/christ_elektronik_clm5ip_power_panel.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/christ_elektronik_clm5ip_power_panel.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/christ_elektronik_clm5ip_power_panel.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/christ_elektronik_clm5ip_power_panel.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Christ Elektronik CLM5IP power panel" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cilium_agent.md b/src/go/plugin/go.d/modules/prometheus/integrations/cilium_agent.md index d2285aa3..77369ada 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cilium_agent.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/cilium_agent.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cilium_agent.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/cilium_agent.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Cilium Agent" learn_status: "Published" learn_rel_path: "Collecting Metrics/Kubernetes" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cilium_operator.md b/src/go/plugin/go.d/modules/prometheus/integrations/cilium_operator.md index b1bb16cf..4083f7b0 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cilium_operator.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/cilium_operator.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cilium_operator.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/cilium_operator.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Cilium Operator" learn_status: "Published" learn_rel_path: "Collecting Metrics/Kubernetes" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cilium_proxy.md b/src/go/plugin/go.d/modules/prometheus/integrations/cilium_proxy.md index 685c3229..cfffa629 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cilium_proxy.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/cilium_proxy.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cilium_proxy.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/cilium_proxy.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Cilium Proxy" learn_status: "Published" learn_rel_path: "Collecting Metrics/Kubernetes" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cisco_aci.md b/src/go/plugin/go.d/modules/prometheus/integrations/cisco_aci.md index b452a6cc..9766e88d 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cisco_aci.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/cisco_aci.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cisco_aci.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/cisco_aci.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Cisco ACI" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/citrix_netscaler.md b/src/go/plugin/go.d/modules/prometheus/integrations/citrix_netscaler.md index 5a1d47cc..e6b70403 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/citrix_netscaler.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/citrix_netscaler.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/citrix_netscaler.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/citrix_netscaler.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Citrix NetScaler" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/clamav_daemon.md b/src/go/plugin/go.d/modules/prometheus/integrations/clamav_daemon.md index abe4e205..ea0398be 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/clamav_daemon.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/clamav_daemon.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/clamav_daemon.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/clamav_daemon.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "ClamAV daemon" learn_status: "Published" learn_rel_path: "Collecting Metrics/Security Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/clamscan_results.md b/src/go/plugin/go.d/modules/prometheus/integrations/clamscan_results.md index 48910ea6..4cc488b1 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/clamscan_results.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/clamscan_results.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/clamscan_results.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/clamscan_results.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Clamscan results" learn_status: "Published" learn_rel_path: "Collecting Metrics/Security Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/clash.md b/src/go/plugin/go.d/modules/prometheus/integrations/clash.md index 76d092e1..23b80bd3 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/clash.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/clash.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/clash.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/clash.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Clash" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloud_foundry.md b/src/go/plugin/go.d/modules/prometheus/integrations/cloud_foundry.md index ea3136e9..2d1b36c2 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloud_foundry.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/cloud_foundry.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloud_foundry.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/cloud_foundry.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Cloud Foundry" learn_status: "Published" learn_rel_path: "Collecting Metrics/Provisioning Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloud_foundry_firehose.md b/src/go/plugin/go.d/modules/prometheus/integrations/cloud_foundry_firehose.md index 704613da..d6405b41 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloud_foundry_firehose.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/cloud_foundry_firehose.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloud_foundry_firehose.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/cloud_foundry_firehose.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Cloud Foundry Firehose" learn_status: "Published" learn_rel_path: "Collecting Metrics/Provisioning Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloudflare_pcap.md b/src/go/plugin/go.d/modules/prometheus/integrations/cloudflare_pcap.md index fd260668..2c1c479a 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloudflare_pcap.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/cloudflare_pcap.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloudflare_pcap.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/cloudflare_pcap.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Cloudflare PCAP" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloudwatch.md b/src/go/plugin/go.d/modules/prometheus/integrations/cloudwatch.md index 32a5eee3..816c0450 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloudwatch.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/cloudwatch.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cloudwatch.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/cloudwatch.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "CloudWatch" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/clustercontrol_cmon.md b/src/go/plugin/go.d/modules/prometheus/integrations/clustercontrol_cmon.md index 82f853b8..c69cb434 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/clustercontrol_cmon.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/clustercontrol_cmon.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/clustercontrol_cmon.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/clustercontrol_cmon.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "ClusterControl CMON" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/collectd.md b/src/go/plugin/go.d/modules/prometheus/integrations/collectd.md index 9f2def2b..97214688 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/collectd.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/collectd.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/collectd.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/collectd.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Collectd" learn_status: "Published" learn_rel_path: "Collecting Metrics/Observability" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/concourse.md b/src/go/plugin/go.d/modules/prometheus/integrations/concourse.md index d6c04ab3..ce7baff4 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/concourse.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/concourse.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/concourse.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/concourse.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Concourse" learn_status: "Published" learn_rel_path: "Collecting Metrics/CICD Platforms" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/craftbeerpi.md b/src/go/plugin/go.d/modules/prometheus/integrations/craftbeerpi.md index 80975020..f4dae54c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/craftbeerpi.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/craftbeerpi.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/craftbeerpi.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/craftbeerpi.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "CraftBeerPi" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/crowdsec.md b/src/go/plugin/go.d/modules/prometheus/integrations/crowdsec.md index d7aebeb8..a59069dd 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/crowdsec.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/crowdsec.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/crowdsec.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/crowdsec.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Crowdsec" learn_status: "Published" learn_rel_path: "Collecting Metrics/Security Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/crypto_exchanges.md b/src/go/plugin/go.d/modules/prometheus/integrations/crypto_exchanges.md index c6b4a9c8..a56ed0db 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/crypto_exchanges.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/crypto_exchanges.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/crypto_exchanges.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/crypto_exchanges.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Crypto exchanges" learn_status: "Published" learn_rel_path: "Collecting Metrics/Blockchain Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cryptowatch.md b/src/go/plugin/go.d/modules/prometheus/integrations/cryptowatch.md index 599c83b1..55491078 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cryptowatch.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/cryptowatch.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cryptowatch.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/cryptowatch.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Cryptowatch" learn_status: "Published" learn_rel_path: "Collecting Metrics/Blockchain Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/custom_exporter.md b/src/go/plugin/go.d/modules/prometheus/integrations/custom_exporter.md index 950baef8..9d309e62 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/custom_exporter.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/custom_exporter.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/custom_exporter.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/custom_exporter.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Custom Exporter" learn_status: "Published" learn_rel_path: "Collecting Metrics/Generic Collecting Metrics" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cvmfs_clients.md b/src/go/plugin/go.d/modules/prometheus/integrations/cvmfs_clients.md index 6015b27e..b283f220 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cvmfs_clients.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/cvmfs_clients.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/cvmfs_clients.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/cvmfs_clients.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "CVMFS clients" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ddwrt_routers.md b/src/go/plugin/go.d/modules/prometheus/integrations/ddwrt_routers.md index efff8ee2..e0b898fb 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ddwrt_routers.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/ddwrt_routers.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ddwrt_routers.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/ddwrt_routers.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "DDWRT Routers" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_emc_ecs_cluster.md b/src/go/plugin/go.d/modules/prometheus/integrations/dell_emc_ecs_cluster.md index ea1954df..6d268ca6 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_emc_ecs_cluster.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/dell_emc_ecs_cluster.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_emc_ecs_cluster.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/dell_emc_ecs_cluster.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Dell EMC ECS cluster" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_emc_isilon_cluster.md b/src/go/plugin/go.d/modules/prometheus/integrations/dell_emc_isilon_cluster.md index 96be281d..5f29528a 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_emc_isilon_cluster.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/dell_emc_isilon_cluster.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_emc_isilon_cluster.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/dell_emc_isilon_cluster.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Dell EMC Isilon cluster" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_emc_xtremio_cluster.md b/src/go/plugin/go.d/modules/prometheus/integrations/dell_emc_xtremio_cluster.md index cc658d4a..fe728523 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_emc_xtremio_cluster.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/dell_emc_xtremio_cluster.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_emc_xtremio_cluster.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/dell_emc_xtremio_cluster.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Dell EMC XtremIO cluster" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_powermax.md b/src/go/plugin/go.d/modules/prometheus/integrations/dell_powermax.md index 87657569..200e2f04 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_powermax.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/dell_powermax.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dell_powermax.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/dell_powermax.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Dell PowerMax" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dependency-track.md b/src/go/plugin/go.d/modules/prometheus/integrations/dependency-track.md index 854d67a8..22d41e64 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dependency-track.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/dependency-track.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dependency-track.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/dependency-track.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Dependency-Track" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/digitalocean.md b/src/go/plugin/go.d/modules/prometheus/integrations/digitalocean.md index 04ab3e76..8978434c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/digitalocean.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/digitalocean.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/digitalocean.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/digitalocean.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "DigitalOcean" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/discourse.md b/src/go/plugin/go.d/modules/prometheus/integrations/discourse.md index 68db6908..adffe3fc 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/discourse.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/discourse.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/discourse.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/discourse.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Discourse" learn_status: "Published" learn_rel_path: "Collecting Metrics/Media Services" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dmarc.md b/src/go/plugin/go.d/modules/prometheus/integrations/dmarc.md index 6dc0bbed..2d02e75a 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dmarc.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/dmarc.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dmarc.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/dmarc.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "DMARC" learn_status: "Published" learn_rel_path: "Collecting Metrics/Mail Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dnsbl.md b/src/go/plugin/go.d/modules/prometheus/integrations/dnsbl.md index 05cdb983..e7951796 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dnsbl.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/dnsbl.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dnsbl.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/dnsbl.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "DNSBL" learn_status: "Published" learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dutch_electricity_smart_meter.md b/src/go/plugin/go.d/modules/prometheus/integrations/dutch_electricity_smart_meter.md index d169be7d..cf2dabd7 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dutch_electricity_smart_meter.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/dutch_electricity_smart_meter.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dutch_electricity_smart_meter.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/dutch_electricity_smart_meter.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Dutch Electricity Smart Meter" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dynatrace.md b/src/go/plugin/go.d/modules/prometheus/integrations/dynatrace.md index ad8b25ad..96e3969d 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dynatrace.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/dynatrace.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/dynatrace.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/dynatrace.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Dynatrace" learn_status: "Published" learn_rel_path: "Collecting Metrics/Observability" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/eaton_ups.md b/src/go/plugin/go.d/modules/prometheus/integrations/eaton_ups.md index 0c161ec9..c6c1823c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/eaton_ups.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/eaton_ups.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/eaton_ups.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/eaton_ups.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Eaton UPS" learn_status: "Published" learn_rel_path: "Collecting Metrics/UPS" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/elgato_key_light_devices..md b/src/go/plugin/go.d/modules/prometheus/integrations/elgato_key_light_devices..md index 1b374c1e..b4bc8d5d 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/elgato_key_light_devices..md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/elgato_key_light_devices..md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/elgato_key_light_devices..md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/elgato_key_light_devices..md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Elgato Key Light devices." learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/energomera_smart_power_meters.md b/src/go/plugin/go.d/modules/prometheus/integrations/energomera_smart_power_meters.md index 20d66176..74764ae5 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/energomera_smart_power_meters.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/energomera_smart_power_meters.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/energomera_smart_power_meters.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/energomera_smart_power_meters.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Energomera smart power meters" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/eos.md b/src/go/plugin/go.d/modules/prometheus/integrations/eos.md index c60e269c..b2e3d590 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/eos.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/eos.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/eos.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/eos.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "EOS" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/etcd.md b/src/go/plugin/go.d/modules/prometheus/integrations/etcd.md index acd763b3..b24d6b24 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/etcd.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/etcd.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/etcd.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/etcd.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "etcd" learn_status: "Published" learn_rel_path: "Collecting Metrics/Service Discovery / Registry" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -134,7 +133,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -262,6 +261,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -284,4 +285,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/excel_spreadsheet.md b/src/go/plugin/go.d/modules/prometheus/integrations/excel_spreadsheet.md index 8e4c88df..6039ee83 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/excel_spreadsheet.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/excel_spreadsheet.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/excel_spreadsheet.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/excel_spreadsheet.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Excel spreadsheet" learn_status: "Published" learn_rel_path: "Collecting Metrics/Generic Collecting Metrics" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/fastd.md b/src/go/plugin/go.d/modules/prometheus/integrations/fastd.md index bb4eeede..2442dff8 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/fastd.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/fastd.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/fastd.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/fastd.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Fastd" learn_status: "Published" learn_rel_path: "Collecting Metrics/VPNs" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/fortigate_firewall.md b/src/go/plugin/go.d/modules/prometheus/integrations/fortigate_firewall.md index 6c22c8b3..b89853a9 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/fortigate_firewall.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/fortigate_firewall.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/fortigate_firewall.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/fortigate_firewall.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Fortigate firewall" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/freebsd_nfs.md b/src/go/plugin/go.d/modules/prometheus/integrations/freebsd_nfs.md index f2105ab2..cf60803a 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/freebsd_nfs.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/freebsd_nfs.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/freebsd_nfs.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/freebsd_nfs.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "FreeBSD NFS" learn_status: "Published" learn_rel_path: "Collecting Metrics/FreeBSD" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/freebsd_rctl-racct.md b/src/go/plugin/go.d/modules/prometheus/integrations/freebsd_rctl-racct.md index db61bd9c..bfe6e9e9 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/freebsd_rctl-racct.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/freebsd_rctl-racct.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/freebsd_rctl-racct.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/freebsd_rctl-racct.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "FreeBSD RCTL-RACCT" learn_status: "Published" learn_rel_path: "Collecting Metrics/FreeBSD" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/freifunk_network.md b/src/go/plugin/go.d/modules/prometheus/integrations/freifunk_network.md index b716bfa2..847e305d 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/freifunk_network.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/freifunk_network.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/freifunk_network.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/freifunk_network.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Freifunk network" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/fritzbox_network_devices.md b/src/go/plugin/go.d/modules/prometheus/integrations/fritzbox_network_devices.md index 7410803f..0158b0ba 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/fritzbox_network_devices.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/fritzbox_network_devices.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/fritzbox_network_devices.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/fritzbox_network_devices.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Fritzbox network devices" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/frrouting.md b/src/go/plugin/go.d/modules/prometheus/integrations/frrouting.md index 651a028e..5f492a47 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/frrouting.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/frrouting.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/frrouting.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/frrouting.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "FRRouting" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gcp_gce.md b/src/go/plugin/go.d/modules/prometheus/integrations/gcp_gce.md index 87c3f294..34c6d767 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gcp_gce.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/gcp_gce.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gcp_gce.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/gcp_gce.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "GCP GCE" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gcp_quota.md b/src/go/plugin/go.d/modules/prometheus/integrations/gcp_quota.md index 1fcc61ed..85959b67 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gcp_quota.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/gcp_quota.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gcp_quota.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/gcp_quota.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "GCP Quota" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/generic_command_line_output.md b/src/go/plugin/go.d/modules/prometheus/integrations/generic_command_line_output.md index 49d4f716..27f1cb64 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/generic_command_line_output.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/generic_command_line_output.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/generic_command_line_output.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/generic_command_line_output.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Generic Command Line Output" learn_status: "Published" learn_rel_path: "Collecting Metrics/Generic Collecting Metrics" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/generic_storage_enclosure_tool.md b/src/go/plugin/go.d/modules/prometheus/integrations/generic_storage_enclosure_tool.md index 1ba08a42..ac8f74a4 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/generic_storage_enclosure_tool.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/generic_storage_enclosure_tool.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/generic_storage_enclosure_tool.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/generic_storage_enclosure_tool.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Generic storage enclosure tool" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/github_api_rate_limit.md b/src/go/plugin/go.d/modules/prometheus/integrations/github_api_rate_limit.md index 6e9abc58..54843034 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/github_api_rate_limit.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/github_api_rate_limit.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/github_api_rate_limit.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/github_api_rate_limit.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "GitHub API rate limit" learn_status: "Published" learn_rel_path: "Collecting Metrics/Other" @@ -38,7 +38,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -139,7 +138,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -267,6 +266,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -289,4 +290,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/github_repository.md b/src/go/plugin/go.d/modules/prometheus/integrations/github_repository.md index f01cbf61..f96fc527 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/github_repository.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/github_repository.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/github_repository.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/github_repository.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "GitHub repository" learn_status: "Published" learn_rel_path: "Collecting Metrics/Other" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gitlab_runner.md b/src/go/plugin/go.d/modules/prometheus/integrations/gitlab_runner.md index 52854303..6982b7a5 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gitlab_runner.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/gitlab_runner.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gitlab_runner.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/gitlab_runner.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "GitLab Runner" learn_status: "Published" learn_rel_path: "Collecting Metrics/CICD Platforms" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gobetween.md b/src/go/plugin/go.d/modules/prometheus/integrations/gobetween.md index 39b74b78..7ea5ec62 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gobetween.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/gobetween.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gobetween.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/gobetween.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Gobetween" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -134,7 +133,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -262,6 +261,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -284,4 +285,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/google_cloud_platform.md b/src/go/plugin/go.d/modules/prometheus/integrations/google_cloud_platform.md index 4575a9ed..50fad926 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/google_cloud_platform.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/google_cloud_platform.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/google_cloud_platform.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/google_cloud_platform.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Google Cloud Platform" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/google_pagespeed.md b/src/go/plugin/go.d/modules/prometheus/integrations/google_pagespeed.md index a76cf48f..a3a3ecef 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/google_pagespeed.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/google_pagespeed.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/google_pagespeed.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/google_pagespeed.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Google Pagespeed" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/google_stackdriver.md b/src/go/plugin/go.d/modules/prometheus/integrations/google_stackdriver.md index b5497993..ef8fc573 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/google_stackdriver.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/google_stackdriver.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/google_stackdriver.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/google_stackdriver.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Google Stackdriver" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gpsd.md b/src/go/plugin/go.d/modules/prometheus/integrations/gpsd.md index 48716d99..68a58851 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gpsd.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/gpsd.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gpsd.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/gpsd.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "gpsd" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/grafana.md b/src/go/plugin/go.d/modules/prometheus/integrations/grafana.md index c099fa86..2c0baa39 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/grafana.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/grafana.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/grafana.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/grafana.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Grafana" learn_status: "Published" learn_rel_path: "Collecting Metrics/Observability" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -134,7 +133,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -262,6 +261,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -284,4 +285,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/graylog_server.md b/src/go/plugin/go.d/modules/prometheus/integrations/graylog_server.md index c62c03f8..8888ae21 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/graylog_server.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/graylog_server.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/graylog_server.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/graylog_server.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Graylog Server" learn_status: "Published" learn_rel_path: "Collecting Metrics/Logs Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gtp.md b/src/go/plugin/go.d/modules/prometheus/integrations/gtp.md index f0ad36c0..edd3b3a5 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gtp.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/gtp.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/gtp.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/gtp.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "GTP" learn_status: "Published" learn_rel_path: "Collecting Metrics/Telephony Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/halon.md b/src/go/plugin/go.d/modules/prometheus/integrations/halon.md index 41b61157..3a288e53 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/halon.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/halon.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/halon.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/halon.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Halon" learn_status: "Published" learn_rel_path: "Collecting Metrics/Mail Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hana.md b/src/go/plugin/go.d/modules/prometheus/integrations/hana.md index eb421d9e..75d84fef 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hana.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/hana.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hana.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/hana.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "HANA" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hashicorp_vault_secrets.md b/src/go/plugin/go.d/modules/prometheus/integrations/hashicorp_vault_secrets.md index 9eb74f79..c619344d 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hashicorp_vault_secrets.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/hashicorp_vault_secrets.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hashicorp_vault_secrets.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/hashicorp_vault_secrets.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "HashiCorp Vault secrets" learn_status: "Published" learn_rel_path: "Collecting Metrics/Authentication and Authorization" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hasura_graphql_server.md b/src/go/plugin/go.d/modules/prometheus/integrations/hasura_graphql_server.md index 0597a033..d95a9199 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hasura_graphql_server.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/hasura_graphql_server.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hasura_graphql_server.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/hasura_graphql_server.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Hasura GraphQL Server" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -38,7 +38,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -139,7 +138,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -267,6 +266,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -289,4 +290,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hdsentinel.md b/src/go/plugin/go.d/modules/prometheus/integrations/hdsentinel.md index 49cce578..1daad64a 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hdsentinel.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/hdsentinel.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hdsentinel.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/hdsentinel.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "HDSentinel" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/helium_hotspot.md b/src/go/plugin/go.d/modules/prometheus/integrations/helium_hotspot.md index adf9a4cf..6ce0d334 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/helium_hotspot.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/helium_hotspot.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/helium_hotspot.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/helium_hotspot.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Helium hotspot" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/helium_miner_validator.md b/src/go/plugin/go.d/modules/prometheus/integrations/helium_miner_validator.md index 6f38b8e8..a8fdb281 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/helium_miner_validator.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/helium_miner_validator.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/helium_miner_validator.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/helium_miner_validator.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Helium miner (validator)" learn_status: "Published" learn_rel_path: "Collecting Metrics/Blockchain Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hhvm.md b/src/go/plugin/go.d/modules/prometheus/integrations/hhvm.md index 20511dc1..4201947b 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hhvm.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/hhvm.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hhvm.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/hhvm.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "HHVM" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -38,7 +38,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -139,7 +138,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -267,6 +266,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -289,4 +290,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hitron_cgn_series_cpe.md b/src/go/plugin/go.d/modules/prometheus/integrations/hitron_cgn_series_cpe.md index 519e7626..069062f6 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hitron_cgn_series_cpe.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/hitron_cgn_series_cpe.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hitron_cgn_series_cpe.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/hitron_cgn_series_cpe.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Hitron CGN series CPE" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hitron_coda_cable_modem.md b/src/go/plugin/go.d/modules/prometheus/integrations/hitron_coda_cable_modem.md index 17119f3a..c62b7b24 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hitron_coda_cable_modem.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/hitron_coda_cable_modem.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hitron_coda_cable_modem.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/hitron_coda_cable_modem.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Hitron CODA Cable Modem" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/homebridge.md b/src/go/plugin/go.d/modules/prometheus/integrations/homebridge.md index e7dba473..ca56a764 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/homebridge.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/homebridge.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/homebridge.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/homebridge.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Homebridge" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/homey.md b/src/go/plugin/go.d/modules/prometheus/integrations/homey.md index cad04c0d..b17aae57 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/homey.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/homey.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/homey.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/homey.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Homey" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/honeypot.md b/src/go/plugin/go.d/modules/prometheus/integrations/honeypot.md index 70ab5350..28fdf70b 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/honeypot.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/honeypot.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/honeypot.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/honeypot.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Honeypot" learn_status: "Published" learn_rel_path: "Collecting Metrics/Security Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hp_ilo.md b/src/go/plugin/go.d/modules/prometheus/integrations/hp_ilo.md index 47a18b3d..54de557c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hp_ilo.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/hp_ilo.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hp_ilo.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/hp_ilo.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "HP iLO" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/huawei_devices.md b/src/go/plugin/go.d/modules/prometheus/integrations/huawei_devices.md index 1e4e207e..2f1e9573 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/huawei_devices.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/huawei_devices.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/huawei_devices.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/huawei_devices.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Huawei devices" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hubble.md b/src/go/plugin/go.d/modules/prometheus/integrations/hubble.md index ebfb3469..36bd86d6 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hubble.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/hubble.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/hubble.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/hubble.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Hubble" learn_status: "Published" learn_rel_path: "Collecting Metrics/Observability" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_aix_systems_njmon.md b/src/go/plugin/go.d/modules/prometheus/integrations/ibm_aix_systems_njmon.md index 0b9a6027..5a4499e6 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_aix_systems_njmon.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/ibm_aix_systems_njmon.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_aix_systems_njmon.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/ibm_aix_systems_njmon.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "IBM AIX systems Njmon" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_cryptoexpress_cex_cards.md b/src/go/plugin/go.d/modules/prometheus/integrations/ibm_cryptoexpress_cex_cards.md index e745b88c..f32cdd0c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_cryptoexpress_cex_cards.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/ibm_cryptoexpress_cex_cards.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_cryptoexpress_cex_cards.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/ibm_cryptoexpress_cex_cards.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "IBM CryptoExpress (CEX) cards" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_mq.md b/src/go/plugin/go.d/modules/prometheus/integrations/ibm_mq.md index a0721922..d41219bb 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_mq.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/ibm_mq.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_mq.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/ibm_mq.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "IBM MQ" learn_status: "Published" learn_rel_path: "Collecting Metrics/Message Brokers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_spectrum.md b/src/go/plugin/go.d/modules/prometheus/integrations/ibm_spectrum.md index f1bff1f6..edffab95 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_spectrum.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/ibm_spectrum.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_spectrum.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/ibm_spectrum.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "IBM Spectrum" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_spectrum_virtualize.md b/src/go/plugin/go.d/modules/prometheus/integrations/ibm_spectrum_virtualize.md index de55933d..5d3dab9e 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_spectrum_virtualize.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/ibm_spectrum_virtualize.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_spectrum_virtualize.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/ibm_spectrum_virtualize.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "IBM Spectrum Virtualize" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_z_hardware_management_console.md b/src/go/plugin/go.d/modules/prometheus/integrations/ibm_z_hardware_management_console.md index 715c6a4e..5cca9c2a 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_z_hardware_management_console.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/ibm_z_hardware_management_console.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ibm_z_hardware_management_console.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/ibm_z_hardware_management_console.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "IBM Z Hardware Management Console" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/influxdb.md b/src/go/plugin/go.d/modules/prometheus/integrations/influxdb.md index 11b340d3..817144ef 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/influxdb.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/influxdb.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/influxdb.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/influxdb.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "InfluxDB" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/iota_full_node.md b/src/go/plugin/go.d/modules/prometheus/integrations/iota_full_node.md index b81e4eac..74ba5a3e 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/iota_full_node.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/iota_full_node.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/iota_full_node.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/iota_full_node.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "IOTA full node" learn_status: "Published" learn_rel_path: "Collecting Metrics/Blockchain Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ipmi_by_soundcloud.md b/src/go/plugin/go.d/modules/prometheus/integrations/ipmi_by_soundcloud.md index 089c68c0..52966c72 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ipmi_by_soundcloud.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/ipmi_by_soundcloud.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ipmi_by_soundcloud.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/ipmi_by_soundcloud.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "IPMI (By SoundCloud)" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/iqair_airvisual_air_quality_monitors.md b/src/go/plugin/go.d/modules/prometheus/integrations/iqair_airvisual_air_quality_monitors.md index 33663960..9e2ed89a 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/iqair_airvisual_air_quality_monitors.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/iqair_airvisual_air_quality_monitors.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/iqair_airvisual_air_quality_monitors.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/iqair_airvisual_air_quality_monitors.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "iqAir AirVisual air quality monitors" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jarvis_standing_desk.md b/src/go/plugin/go.d/modules/prometheus/integrations/jarvis_standing_desk.md index 3ba765fe..cd392a29 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jarvis_standing_desk.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/jarvis_standing_desk.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jarvis_standing_desk.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/jarvis_standing_desk.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Jarvis Standing Desk" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jenkins.md b/src/go/plugin/go.d/modules/prometheus/integrations/jenkins.md index aeaf8bc2..203ae3d6 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jenkins.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/jenkins.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jenkins.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/jenkins.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Jenkins" learn_status: "Published" learn_rel_path: "Collecting Metrics/CICD Platforms" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jetbrains_floating_license_server.md b/src/go/plugin/go.d/modules/prometheus/integrations/jetbrains_floating_license_server.md index 88eae33c..cde4e22a 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jetbrains_floating_license_server.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/jetbrains_floating_license_server.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jetbrains_floating_license_server.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/jetbrains_floating_license_server.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "JetBrains Floating License Server" learn_status: "Published" learn_rel_path: "Collecting Metrics/Generic Collecting Metrics" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jmx.md b/src/go/plugin/go.d/modules/prometheus/integrations/jmx.md index 4473dd62..6813a808 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jmx.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/jmx.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jmx.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/jmx.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "JMX" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jolokia.md b/src/go/plugin/go.d/modules/prometheus/integrations/jolokia.md index c4c5f26a..187b40be 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jolokia.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/jolokia.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/jolokia.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/jolokia.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "jolokia" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/journald.md b/src/go/plugin/go.d/modules/prometheus/integrations/journald.md index 36a9eeaf..0d016ad2 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/journald.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/journald.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/journald.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/journald.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "journald" learn_status: "Published" learn_rel_path: "Collecting Metrics/Logs Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka.md b/src/go/plugin/go.d/modules/prometheus/integrations/kafka.md index 83e94397..fb328f74 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/kafka.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/kafka.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Kafka" learn_status: "Published" learn_rel_path: "Collecting Metrics/Message Brokers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka_connect.md b/src/go/plugin/go.d/modules/prometheus/integrations/kafka_connect.md index 6709ce17..c28c90f4 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka_connect.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/kafka_connect.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka_connect.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/kafka_connect.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Kafka Connect" learn_status: "Published" learn_rel_path: "Collecting Metrics/Message Brokers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka_consumer_lag.md b/src/go/plugin/go.d/modules/prometheus/integrations/kafka_consumer_lag.md index 95d5fc56..6003d3af 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka_consumer_lag.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/kafka_consumer_lag.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka_consumer_lag.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/kafka_consumer_lag.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Kafka Consumer Lag" learn_status: "Published" learn_rel_path: "Collecting Metrics/Service Discovery / Registry" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka_zookeeper.md b/src/go/plugin/go.d/modules/prometheus/integrations/kafka_zookeeper.md index 907aeaf4..cbf799ca 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka_zookeeper.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/kafka_zookeeper.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kafka_zookeeper.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/kafka_zookeeper.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Kafka ZooKeeper" learn_status: "Published" learn_rel_path: "Collecting Metrics/Message Brokers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kannel.md b/src/go/plugin/go.d/modules/prometheus/integrations/kannel.md index 98fe1466..a2264e9d 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kannel.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/kannel.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kannel.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/kannel.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Kannel" learn_status: "Published" learn_rel_path: "Collecting Metrics/Telephony Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/keepalived.md b/src/go/plugin/go.d/modules/prometheus/integrations/keepalived.md index c82813cb..aeb0d99b 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/keepalived.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/keepalived.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/keepalived.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/keepalived.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Keepalived" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kubernetes_cluster_cloud_cost.md b/src/go/plugin/go.d/modules/prometheus/integrations/kubernetes_cluster_cloud_cost.md index 01d0fc60..759ce0cb 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kubernetes_cluster_cloud_cost.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/kubernetes_cluster_cloud_cost.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/kubernetes_cluster_cloud_cost.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/kubernetes_cluster_cloud_cost.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Kubernetes Cluster Cloud Cost" learn_status: "Published" learn_rel_path: "Collecting Metrics/Kubernetes" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/lagerist_disk_latency.md b/src/go/plugin/go.d/modules/prometheus/integrations/lagerist_disk_latency.md index e878d16c..73019995 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/lagerist_disk_latency.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/lagerist_disk_latency.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/lagerist_disk_latency.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/lagerist_disk_latency.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Lagerist Disk latency" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ldap.md b/src/go/plugin/go.d/modules/prometheus/integrations/ldap.md index 2c4bd0ba..705d1e19 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ldap.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/ldap.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ldap.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/ldap.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "LDAP" learn_status: "Published" learn_rel_path: "Collecting Metrics/Authentication and Authorization" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/linode.md b/src/go/plugin/go.d/modules/prometheus/integrations/linode.md index 046a57e3..eff67ae7 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/linode.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/linode.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/linode.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/linode.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Linode" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/loki.md b/src/go/plugin/go.d/modules/prometheus/integrations/loki.md index bd607a23..002634a1 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/loki.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/loki.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/loki.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/loki.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "loki" learn_status: "Published" learn_rel_path: "Collecting Metrics/Logs Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/lustre_metadata.md b/src/go/plugin/go.d/modules/prometheus/integrations/lustre_metadata.md index a13c2502..2fe27331 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/lustre_metadata.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/lustre_metadata.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/lustre_metadata.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/lustre_metadata.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Lustre metadata" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/lynis_audit_reports.md b/src/go/plugin/go.d/modules/prometheus/integrations/lynis_audit_reports.md index 13b2ef30..47b87c2d 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/lynis_audit_reports.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/lynis_audit_reports.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/lynis_audit_reports.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/lynis_audit_reports.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Lynis audit reports" learn_status: "Published" learn_rel_path: "Collecting Metrics/Security Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/machbase.md b/src/go/plugin/go.d/modules/prometheus/integrations/machbase.md index 48dd9aee..23e92829 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/machbase.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/machbase.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/machbase.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/machbase.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Machbase" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/maildir.md b/src/go/plugin/go.d/modules/prometheus/integrations/maildir.md index 69c8003e..a7c106e8 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/maildir.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/maildir.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/maildir.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/maildir.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Maildir" learn_status: "Published" learn_rel_path: "Collecting Metrics/Mail Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/meilisearch.md b/src/go/plugin/go.d/modules/prometheus/integrations/meilisearch.md index 3b22f13c..60cad4a9 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/meilisearch.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/meilisearch.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/meilisearch.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/meilisearch.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Meilisearch" learn_status: "Published" learn_rel_path: "Collecting Metrics/Search Engines" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/memcached_community.md b/src/go/plugin/go.d/modules/prometheus/integrations/memcached_community.md index 83b53f8c..45acae16 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/memcached_community.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/memcached_community.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/memcached_community.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/memcached_community.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Memcached (community)" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/meraki_dashboard.md b/src/go/plugin/go.d/modules/prometheus/integrations/meraki_dashboard.md index 83bb309f..28626195 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/meraki_dashboard.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/meraki_dashboard.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/meraki_dashboard.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/meraki_dashboard.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Meraki dashboard" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mesos.md b/src/go/plugin/go.d/modules/prometheus/integrations/mesos.md index 094d53b8..c1f7cd0e 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mesos.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/mesos.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mesos.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/mesos.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Mesos" learn_status: "Published" learn_rel_path: "Collecting Metrics/Task Queues" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mikrotik_devices.md b/src/go/plugin/go.d/modules/prometheus/integrations/mikrotik_devices.md index cac9a8c6..8d846fd2 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mikrotik_devices.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/mikrotik_devices.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mikrotik_devices.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/mikrotik_devices.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "MikroTik devices" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mikrotik_routeros_devices.md b/src/go/plugin/go.d/modules/prometheus/integrations/mikrotik_routeros_devices.md index 5060a2d2..e988add2 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mikrotik_routeros_devices.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/mikrotik_routeros_devices.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mikrotik_routeros_devices.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/mikrotik_routeros_devices.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Mikrotik RouterOS devices" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/minecraft.md b/src/go/plugin/go.d/modules/prometheus/integrations/minecraft.md index 7926ef8a..f8649bbc 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/minecraft.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/minecraft.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/minecraft.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/minecraft.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Minecraft" learn_status: "Published" learn_rel_path: "Collecting Metrics/Gaming" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/modbus_protocol.md b/src/go/plugin/go.d/modules/prometheus/integrations/modbus_protocol.md index 8712f31c..f6266cd4 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/modbus_protocol.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/modbus_protocol.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/modbus_protocol.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/modbus_protocol.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Modbus protocol" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mogilefs.md b/src/go/plugin/go.d/modules/prometheus/integrations/mogilefs.md index c1759ded..becc6c19 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mogilefs.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/mogilefs.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mogilefs.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/mogilefs.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "MogileFS" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/monnit_sensors_mqtt.md b/src/go/plugin/go.d/modules/prometheus/integrations/monnit_sensors_mqtt.md index 0e854c1b..05517f39 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/monnit_sensors_mqtt.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/monnit_sensors_mqtt.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/monnit_sensors_mqtt.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/monnit_sensors_mqtt.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Monnit Sensors MQTT" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mosquitto.md b/src/go/plugin/go.d/modules/prometheus/integrations/mosquitto.md index 9f560636..115dde09 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mosquitto.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/mosquitto.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mosquitto.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/mosquitto.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "mosquitto" learn_status: "Published" learn_rel_path: "Collecting Metrics/Message Brokers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mp707_usb_thermometer.md b/src/go/plugin/go.d/modules/prometheus/integrations/mp707_usb_thermometer.md index 7beeaa20..f032dcfb 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mp707_usb_thermometer.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/mp707_usb_thermometer.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mp707_usb_thermometer.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/mp707_usb_thermometer.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "MP707 USB thermometer" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mqtt_blackbox.md b/src/go/plugin/go.d/modules/prometheus/integrations/mqtt_blackbox.md index 79b295cf..2f6e6ca5 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mqtt_blackbox.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/mqtt_blackbox.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mqtt_blackbox.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/mqtt_blackbox.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "MQTT Blackbox" learn_status: "Published" learn_rel_path: "Collecting Metrics/Message Brokers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mtail.md b/src/go/plugin/go.d/modules/prometheus/integrations/mtail.md index 35ddb22d..e44f88d4 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mtail.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/mtail.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/mtail.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/mtail.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "mtail" learn_status: "Published" learn_rel_path: "Collecting Metrics/Logs Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/naemon.md b/src/go/plugin/go.d/modules/prometheus/integrations/naemon.md index 061b4f72..208777b9 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/naemon.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/naemon.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/naemon.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/naemon.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Naemon" learn_status: "Published" learn_rel_path: "Collecting Metrics/Observability" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nagios.md b/src/go/plugin/go.d/modules/prometheus/integrations/nagios.md index 97374994..bdd669c7 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nagios.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/nagios.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nagios.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/nagios.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Nagios" learn_status: "Published" learn_rel_path: "Collecting Metrics/Observability" @@ -38,7 +38,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -139,7 +138,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -267,6 +266,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -289,4 +290,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nature_remo_e_lite_devices.md b/src/go/plugin/go.d/modules/prometheus/integrations/nature_remo_e_lite_devices.md index da5030d6..c102e4a7 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nature_remo_e_lite_devices.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/nature_remo_e_lite_devices.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nature_remo_e_lite_devices.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/nature_remo_e_lite_devices.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Nature Remo E lite devices" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netapp_ontap_api.md b/src/go/plugin/go.d/modules/prometheus/integrations/netapp_ontap_api.md index 6a502546..80e4dce3 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netapp_ontap_api.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/netapp_ontap_api.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netapp_ontap_api.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/netapp_ontap_api.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Netapp ONTAP API" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netapp_solidfire.md b/src/go/plugin/go.d/modules/prometheus/integrations/netapp_solidfire.md index eab756cf..a15aef5f 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netapp_solidfire.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/netapp_solidfire.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netapp_solidfire.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/netapp_solidfire.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "NetApp Solidfire" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netatmo_sensors.md b/src/go/plugin/go.d/modules/prometheus/integrations/netatmo_sensors.md index 08d17d59..8420a5fe 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netatmo_sensors.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/netatmo_sensors.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netatmo_sensors.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/netatmo_sensors.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Netatmo sensors" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netflow.md b/src/go/plugin/go.d/modules/prometheus/integrations/netflow.md index a5023d7b..0b23e39b 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netflow.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/netflow.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netflow.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/netflow.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "NetFlow" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netmeter.md b/src/go/plugin/go.d/modules/prometheus/integrations/netmeter.md index 6311eeac..97c9893d 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netmeter.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/netmeter.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/netmeter.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/netmeter.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "NetMeter" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/new_relic.md b/src/go/plugin/go.d/modules/prometheus/integrations/new_relic.md index fb237679..9ca6b4c8 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/new_relic.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/new_relic.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/new_relic.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/new_relic.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "New Relic" learn_status: "Published" learn_rel_path: "Collecting Metrics/Observability" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nextcloud_servers.md b/src/go/plugin/go.d/modules/prometheus/integrations/nextcloud_servers.md index 134a7352..9e61c6be 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nextcloud_servers.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/nextcloud_servers.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nextcloud_servers.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/nextcloud_servers.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Nextcloud servers" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nextdns.md b/src/go/plugin/go.d/modules/prometheus/integrations/nextdns.md index 9989c80e..3d5bc0a6 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nextdns.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/nextdns.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nextdns.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/nextdns.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "NextDNS" learn_status: "Published" learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nftables.md b/src/go/plugin/go.d/modules/prometheus/integrations/nftables.md index 30b04d5b..acce8b8a 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nftables.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/nftables.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nftables.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/nftables.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "nftables" learn_status: "Published" learn_rel_path: "Collecting Metrics/Linux Systems/Firewall" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nrpe_daemon.md b/src/go/plugin/go.d/modules/prometheus/integrations/nrpe_daemon.md index f6378aaa..e3a03e35 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nrpe_daemon.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/nrpe_daemon.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nrpe_daemon.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/nrpe_daemon.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "NRPE daemon" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nsx-t.md b/src/go/plugin/go.d/modules/prometheus/integrations/nsx-t.md index ec158120..4e670ba5 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nsx-t.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/nsx-t.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nsx-t.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/nsx-t.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "NSX-T" learn_status: "Published" learn_rel_path: "Collecting Metrics/Containers and VMs" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nvml.md b/src/go/plugin/go.d/modules/prometheus/integrations/nvml.md index a6d863dc..54bb3f1f 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nvml.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/nvml.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/nvml.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/nvml.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "NVML" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/obs_studio.md b/src/go/plugin/go.d/modules/prometheus/integrations/obs_studio.md index eb97ee51..254833af 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/obs_studio.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/obs_studio.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/obs_studio.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/obs_studio.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "OBS Studio" learn_status: "Published" learn_rel_path: "Collecting Metrics/Media Services" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/odbc.md b/src/go/plugin/go.d/modules/prometheus/integrations/odbc.md index 553571c8..d128b647 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/odbc.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/odbc.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/odbc.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/odbc.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "ODBC" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/open_vswitch.md b/src/go/plugin/go.d/modules/prometheus/integrations/open_vswitch.md index b317cb9f..c8d24a87 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/open_vswitch.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/open_vswitch.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/open_vswitch.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/open_vswitch.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Open vSwitch" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openhab.md b/src/go/plugin/go.d/modules/prometheus/integrations/openhab.md index 1e0d9fa0..52a2ac94 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openhab.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/openhab.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openhab.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/openhab.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "OpenHAB" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openldap_community.md b/src/go/plugin/go.d/modules/prometheus/integrations/openldap_community.md index 29ab99e8..c1a54721 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openldap_community.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/openldap_community.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openldap_community.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/openldap_community.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "OpenLDAP (community)" learn_status: "Published" learn_rel_path: "Collecting Metrics/Authentication and Authorization" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openrc.md b/src/go/plugin/go.d/modules/prometheus/integrations/openrc.md index 112f95ff..bc5dfa90 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openrc.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/openrc.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openrc.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/openrc.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "OpenRC" learn_status: "Published" learn_rel_path: "Collecting Metrics/Linux Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openrct2.md b/src/go/plugin/go.d/modules/prometheus/integrations/openrct2.md index a6b6b422..7995839b 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openrct2.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/openrct2.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openrct2.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/openrct2.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "OpenRCT2" learn_status: "Published" learn_rel_path: "Collecting Metrics/Gaming" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openroadm_devices.md b/src/go/plugin/go.d/modules/prometheus/integrations/openroadm_devices.md index b6c30bd8..d1e23dc3 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openroadm_devices.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/openroadm_devices.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openroadm_devices.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/openroadm_devices.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "OpenROADM devices" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openstack.md b/src/go/plugin/go.d/modules/prometheus/integrations/openstack.md index babb2721..874cf5ce 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openstack.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/openstack.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openstack.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/openstack.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "OpenStack" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openvas.md b/src/go/plugin/go.d/modules/prometheus/integrations/openvas.md index fcafa2e2..09681ae7 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openvas.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/openvas.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openvas.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/openvas.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "OpenVAS" learn_status: "Published" learn_rel_path: "Collecting Metrics/Security Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openweathermap.md b/src/go/plugin/go.d/modules/prometheus/integrations/openweathermap.md index 63ea81b8..624478e2 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openweathermap.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/openweathermap.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/openweathermap.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/openweathermap.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "OpenWeatherMap" learn_status: "Published" learn_rel_path: "Collecting Metrics/Generic Collecting Metrics" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/oracle_db_community.md b/src/go/plugin/go.d/modules/prometheus/integrations/oracle_db_community.md index 18efb8d5..ab59c318 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/oracle_db_community.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/oracle_db_community.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/oracle_db_community.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/oracle_db_community.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Oracle DB (community)" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/otrs.md b/src/go/plugin/go.d/modules/prometheus/integrations/otrs.md index 6bb6adab..8eadb341 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/otrs.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/otrs.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/otrs.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/otrs.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "OTRS" learn_status: "Published" learn_rel_path: "Collecting Metrics/Incident Management" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/patroni.md b/src/go/plugin/go.d/modules/prometheus/integrations/patroni.md index a3ac52cb..e4fe2012 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/patroni.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/patroni.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/patroni.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/patroni.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Patroni" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/personal_weather_station.md b/src/go/plugin/go.d/modules/prometheus/integrations/personal_weather_station.md index 97e6bf5b..af148206 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/personal_weather_station.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/personal_weather_station.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/personal_weather_station.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/personal_weather_station.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Personal Weather Station" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/pgbackrest.md b/src/go/plugin/go.d/modules/prometheus/integrations/pgbackrest.md index e61b9e0a..19c60d95 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/pgbackrest.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/pgbackrest.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/pgbackrest.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/pgbackrest.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "pgBackRest" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/pgpool-ii.md b/src/go/plugin/go.d/modules/prometheus/integrations/pgpool-ii.md index 153304e5..a7cfd941 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/pgpool-ii.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/pgpool-ii.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/pgpool-ii.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/pgpool-ii.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Pgpool-II" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/philips_hue.md b/src/go/plugin/go.d/modules/prometheus/integrations/philips_hue.md index 0ee87903..47dd77b0 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/philips_hue.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/philips_hue.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/philips_hue.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/philips_hue.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Philips Hue" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/pimoroni_enviro+.md b/src/go/plugin/go.d/modules/prometheus/integrations/pimoroni_enviro+.md index 8c93b99b..12b5719c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/pimoroni_enviro+.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/pimoroni_enviro+.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/pimoroni_enviro+.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/pimoroni_enviro+.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Pimoroni Enviro+" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/pingdom.md b/src/go/plugin/go.d/modules/prometheus/integrations/pingdom.md index b28271a4..758b80ef 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/pingdom.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/pingdom.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/pingdom.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/pingdom.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Pingdom" learn_status: "Published" learn_rel_path: "Collecting Metrics/Synthetic Checks" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/podman.md b/src/go/plugin/go.d/modules/prometheus/integrations/podman.md index fe7fd0cd..346e765c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/podman.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/podman.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/podman.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/podman.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Podman" learn_status: "Published" learn_rel_path: "Collecting Metrics/Containers and VMs" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/powerpal_devices.md b/src/go/plugin/go.d/modules/prometheus/integrations/powerpal_devices.md index eacd9b91..cc7b681e 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/powerpal_devices.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/powerpal_devices.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/powerpal_devices.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/powerpal_devices.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Powerpal devices" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/proftpd.md b/src/go/plugin/go.d/modules/prometheus/integrations/proftpd.md index 9853deac..f9261238 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/proftpd.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/proftpd.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/proftpd.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/proftpd.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "ProFTPD" learn_status: "Published" learn_rel_path: "Collecting Metrics/FTP Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/prometheus_endpoint.md b/src/go/plugin/go.d/modules/prometheus/integrations/prometheus_endpoint.md index fb24711a..18bbd9d0 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/prometheus_endpoint.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/prometheus_endpoint.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/prometheus_endpoint.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/prometheus_endpoint.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Prometheus endpoint" learn_status: "Published" learn_rel_path: "Collecting Metrics/Generic Collecting Metrics" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -134,7 +133,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -262,6 +261,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -284,4 +285,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/proxmox_ve.md b/src/go/plugin/go.d/modules/prometheus/integrations/proxmox_ve.md index 9ac69820..ad4bdfe6 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/proxmox_ve.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/proxmox_ve.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/proxmox_ve.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/proxmox_ve.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Proxmox VE" learn_status: "Published" learn_rel_path: "Collecting Metrics/Containers and VMs" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/radio_thermostat.md b/src/go/plugin/go.d/modules/prometheus/integrations/radio_thermostat.md index 3418c68c..8004e7ff 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/radio_thermostat.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/radio_thermostat.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/radio_thermostat.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/radio_thermostat.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Radio Thermostat" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/radius.md b/src/go/plugin/go.d/modules/prometheus/integrations/radius.md index 11a4625e..22e2567e 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/radius.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/radius.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/radius.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/radius.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "RADIUS" learn_status: "Published" learn_rel_path: "Collecting Metrics/Authentication and Authorization" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/rancher.md b/src/go/plugin/go.d/modules/prometheus/integrations/rancher.md index 8a00fcf5..945813b1 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/rancher.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/rancher.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/rancher.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/rancher.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Rancher" learn_status: "Published" learn_rel_path: "Collecting Metrics/Kubernetes" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/raritan_pdu.md b/src/go/plugin/go.d/modules/prometheus/integrations/raritan_pdu.md index f7b1720e..2781c3af 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/raritan_pdu.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/raritan_pdu.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/raritan_pdu.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/raritan_pdu.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Raritan PDU" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/redis_queue.md b/src/go/plugin/go.d/modules/prometheus/integrations/redis_queue.md index 5dc63005..d3fb16d4 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/redis_queue.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/redis_queue.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/redis_queue.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/redis_queue.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Redis Queue" learn_status: "Published" learn_rel_path: "Collecting Metrics/Message Brokers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ripe_atlas.md b/src/go/plugin/go.d/modules/prometheus/integrations/ripe_atlas.md index 4c666ffd..7aa35e8d 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ripe_atlas.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/ripe_atlas.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ripe_atlas.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/ripe_atlas.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "RIPE Atlas" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sabnzbd.md b/src/go/plugin/go.d/modules/prometheus/integrations/sabnzbd.md index f1e46ab9..3c98fa9e 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sabnzbd.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/sabnzbd.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sabnzbd.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/sabnzbd.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "SABnzbd" learn_status: "Published" learn_rel_path: "Collecting Metrics/Media Services" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/salicru_eqx_inverter.md b/src/go/plugin/go.d/modules/prometheus/integrations/salicru_eqx_inverter.md index 4863484b..b7c5b46c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/salicru_eqx_inverter.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/salicru_eqx_inverter.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/salicru_eqx_inverter.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/salicru_eqx_inverter.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Salicru EQX inverter" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sense_energy.md b/src/go/plugin/go.d/modules/prometheus/integrations/sense_energy.md index d65773ac..837d30ce 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sense_energy.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/sense_energy.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sense_energy.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/sense_energy.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Sense Energy" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sentry.md b/src/go/plugin/go.d/modules/prometheus/integrations/sentry.md index 0837ad0a..ae878ced 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sentry.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/sentry.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sentry.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/sentry.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Sentry" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/servertech.md b/src/go/plugin/go.d/modules/prometheus/integrations/servertech.md index f1846b34..d287fb65 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/servertech.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/servertech.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/servertech.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/servertech.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "ServerTech" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/shell_command.md b/src/go/plugin/go.d/modules/prometheus/integrations/shell_command.md index 91f4449b..dec29a66 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/shell_command.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/shell_command.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/shell_command.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/shell_command.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Shell command" learn_status: "Published" learn_rel_path: "Collecting Metrics/Generic Collecting Metrics" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/shelly_humidity_sensor.md b/src/go/plugin/go.d/modules/prometheus/integrations/shelly_humidity_sensor.md index 256b9a94..baf6fa58 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/shelly_humidity_sensor.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/shelly_humidity_sensor.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/shelly_humidity_sensor.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/shelly_humidity_sensor.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Shelly humidity sensor" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sia.md b/src/go/plugin/go.d/modules/prometheus/integrations/sia.md index 41f80e7c..6fe4a368 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sia.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/sia.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sia.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/sia.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Sia" learn_status: "Published" learn_rel_path: "Collecting Metrics/Blockchain Servers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/siemens_s7_plc.md b/src/go/plugin/go.d/modules/prometheus/integrations/siemens_s7_plc.md index 33483d79..c6aec71e 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/siemens_s7_plc.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/siemens_s7_plc.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/siemens_s7_plc.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/siemens_s7_plc.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Siemens S7 PLC" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/site_24x7.md b/src/go/plugin/go.d/modules/prometheus/integrations/site_24x7.md index 50a47c89..8faefa53 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/site_24x7.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/site_24x7.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/site_24x7.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/site_24x7.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Site 24x7" learn_status: "Published" learn_rel_path: "Collecting Metrics/Synthetic Checks" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/slurm.md b/src/go/plugin/go.d/modules/prometheus/integrations/slurm.md index 003b975c..00d27ca1 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/slurm.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/slurm.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/slurm.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/slurm.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Slurm" learn_status: "Published" learn_rel_path: "Collecting Metrics/Task Queues" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sma_inverters.md b/src/go/plugin/go.d/modules/prometheus/integrations/sma_inverters.md index 08072b85..f739362e 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sma_inverters.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/sma_inverters.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sma_inverters.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/sma_inverters.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "SMA Inverters" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/smart_meters_sml.md b/src/go/plugin/go.d/modules/prometheus/integrations/smart_meters_sml.md index 30578d06..1201475a 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/smart_meters_sml.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/smart_meters_sml.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/smart_meters_sml.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/smart_meters_sml.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Smart meters SML" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/smartrg_808ac_cable_modem.md b/src/go/plugin/go.d/modules/prometheus/integrations/smartrg_808ac_cable_modem.md index 06cb9975..1dadc3d8 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/smartrg_808ac_cable_modem.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/smartrg_808ac_cable_modem.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/smartrg_808ac_cable_modem.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/smartrg_808ac_cable_modem.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "SmartRG 808AC Cable Modem" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/softether_vpn_server.md b/src/go/plugin/go.d/modules/prometheus/integrations/softether_vpn_server.md index 5188707f..30fd7cb6 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/softether_vpn_server.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/softether_vpn_server.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/softether_vpn_server.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/softether_vpn_server.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "SoftEther VPN Server" learn_status: "Published" learn_rel_path: "Collecting Metrics/VPNs" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/solar_logging_stick.md b/src/go/plugin/go.d/modules/prometheus/integrations/solar_logging_stick.md index caee6ce8..35c78085 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/solar_logging_stick.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/solar_logging_stick.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/solar_logging_stick.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/solar_logging_stick.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Solar logging stick" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/solaredge_inverters.md b/src/go/plugin/go.d/modules/prometheus/integrations/solaredge_inverters.md index ad9a6702..266f2d05 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/solaredge_inverters.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/solaredge_inverters.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/solaredge_inverters.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/solaredge_inverters.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "SolarEdge inverters" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/solis_ginlong_5g_inverters.md b/src/go/plugin/go.d/modules/prometheus/integrations/solis_ginlong_5g_inverters.md index 46c2b521..d0d0658f 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/solis_ginlong_5g_inverters.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/solis_ginlong_5g_inverters.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/solis_ginlong_5g_inverters.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/solis_ginlong_5g_inverters.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Solis Ginlong 5G inverters" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sonic_nos.md b/src/go/plugin/go.d/modules/prometheus/integrations/sonic_nos.md index 109f8fde..455f14fb 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sonic_nos.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/sonic_nos.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sonic_nos.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/sonic_nos.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "SONiC NOS" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/spacelift.md b/src/go/plugin/go.d/modules/prometheus/integrations/spacelift.md index fec5255c..ab83110b 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/spacelift.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/spacelift.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/spacelift.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/spacelift.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Spacelift" learn_status: "Published" learn_rel_path: "Collecting Metrics/Provisioning Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/speedify_cli.md b/src/go/plugin/go.d/modules/prometheus/integrations/speedify_cli.md index 98551c62..beed0bd1 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/speedify_cli.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/speedify_cli.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/speedify_cli.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/speedify_cli.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Speedify CLI" learn_status: "Published" learn_rel_path: "Collecting Metrics/VPNs" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sphinx.md b/src/go/plugin/go.d/modules/prometheus/integrations/sphinx.md index d52f6b97..1116f91e 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sphinx.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/sphinx.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sphinx.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/sphinx.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Sphinx" learn_status: "Published" learn_rel_path: "Collecting Metrics/Search Engines" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sql_database_agnostic.md b/src/go/plugin/go.d/modules/prometheus/integrations/sql_database_agnostic.md index 2716b751..6a0a523c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sql_database_agnostic.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/sql_database_agnostic.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sql_database_agnostic.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/sql_database_agnostic.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "SQL Database agnostic" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ssh.md b/src/go/plugin/go.d/modules/prometheus/integrations/ssh.md index 55090280..7ffe9b20 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ssh.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/ssh.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ssh.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/ssh.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "SSH" learn_status: "Published" learn_rel_path: "Collecting Metrics/Authentication and Authorization" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ssl_certificate.md b/src/go/plugin/go.d/modules/prometheus/integrations/ssl_certificate.md index 577cc19d..2c1d519a 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ssl_certificate.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/ssl_certificate.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ssl_certificate.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/ssl_certificate.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "SSL Certificate" learn_status: "Published" learn_rel_path: "Collecting Metrics/Security Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/starlink_spacex.md b/src/go/plugin/go.d/modules/prometheus/integrations/starlink_spacex.md index 838d817d..b48f32c9 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/starlink_spacex.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/starlink_spacex.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/starlink_spacex.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/starlink_spacex.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Starlink (SpaceX)" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/starwind_vsan_vsphere_edition.md b/src/go/plugin/go.d/modules/prometheus/integrations/starwind_vsan_vsphere_edition.md index 5cc7847d..9b7409b8 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/starwind_vsan_vsphere_edition.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/starwind_vsan_vsphere_edition.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/starwind_vsan_vsphere_edition.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/starwind_vsan_vsphere_edition.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Starwind VSAN VSphere Edition" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/statuspage.md b/src/go/plugin/go.d/modules/prometheus/integrations/statuspage.md index 06fd21b9..6038729d 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/statuspage.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/statuspage.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/statuspage.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/statuspage.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "StatusPage" learn_status: "Published" learn_rel_path: "Collecting Metrics/Incident Management" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/steam.md b/src/go/plugin/go.d/modules/prometheus/integrations/steam.md index deceacc5..44b34659 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/steam.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/steam.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/steam.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/steam.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Steam" learn_status: "Published" learn_rel_path: "Collecting Metrics/Gaming" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/storidge.md b/src/go/plugin/go.d/modules/prometheus/integrations/storidge.md index c3115de3..48a320ce 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/storidge.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/storidge.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/storidge.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/storidge.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Storidge" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/stream.md b/src/go/plugin/go.d/modules/prometheus/integrations/stream.md index d1902ab8..fb21cb4d 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/stream.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/stream.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/stream.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/stream.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Stream" learn_status: "Published" learn_rel_path: "Collecting Metrics/Media Services" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/strongswan.md b/src/go/plugin/go.d/modules/prometheus/integrations/strongswan.md index 234fe450..ffddfb02 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/strongswan.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/strongswan.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/strongswan.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/strongswan.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "strongSwan" learn_status: "Published" learn_rel_path: "Collecting Metrics/VPNs" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sunspec_solar_energy.md b/src/go/plugin/go.d/modules/prometheus/integrations/sunspec_solar_energy.md index fad10307..552c5583 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sunspec_solar_energy.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/sunspec_solar_energy.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sunspec_solar_energy.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/sunspec_solar_energy.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Sunspec Solar Energy" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/suricata.md b/src/go/plugin/go.d/modules/prometheus/integrations/suricata.md index 0f6fbd1e..d5bdd01b 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/suricata.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/suricata.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/suricata.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/suricata.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Suricata" learn_status: "Published" learn_rel_path: "Collecting Metrics/Security Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/synology_activebackup.md b/src/go/plugin/go.d/modules/prometheus/integrations/synology_activebackup.md index 530f7b91..b558bbf9 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/synology_activebackup.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/synology_activebackup.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/synology_activebackup.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/synology_activebackup.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Synology ActiveBackup" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sysload.md b/src/go/plugin/go.d/modules/prometheus/integrations/sysload.md index f697caa3..369a4302 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sysload.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/sysload.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/sysload.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/sysload.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Sysload" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/t-rex_nvidia_gpu_miner.md b/src/go/plugin/go.d/modules/prometheus/integrations/t-rex_nvidia_gpu_miner.md index 79a23a66..55b26bf9 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/t-rex_nvidia_gpu_miner.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/t-rex_nvidia_gpu_miner.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/t-rex_nvidia_gpu_miner.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/t-rex_nvidia_gpu_miner.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "T-Rex NVIDIA GPU Miner" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tacacs.md b/src/go/plugin/go.d/modules/prometheus/integrations/tacacs.md index 3443b6ab..5d353439 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tacacs.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/tacacs.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tacacs.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/tacacs.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "TACACS" learn_status: "Published" learn_rel_path: "Collecting Metrics/Authentication and Authorization" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tado_smart_heating_solution.md b/src/go/plugin/go.d/modules/prometheus/integrations/tado_smart_heating_solution.md index f0434445..ece7fb67 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tado_smart_heating_solution.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/tado_smart_heating_solution.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tado_smart_heating_solution.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/tado_smart_heating_solution.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Tado smart heating solution" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tankerkoenig_api.md b/src/go/plugin/go.d/modules/prometheus/integrations/tankerkoenig_api.md index 5911debe..01eb6557 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tankerkoenig_api.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/tankerkoenig_api.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tankerkoenig_api.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/tankerkoenig_api.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Tankerkoenig API" learn_status: "Published" learn_rel_path: "Collecting Metrics/Generic Collecting Metrics" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tesla_powerwall.md b/src/go/plugin/go.d/modules/prometheus/integrations/tesla_powerwall.md index f1424add..c2416311 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tesla_powerwall.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/tesla_powerwall.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tesla_powerwall.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/tesla_powerwall.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Tesla Powerwall" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tesla_vehicle.md b/src/go/plugin/go.d/modules/prometheus/integrations/tesla_vehicle.md index 10f22fbb..56617aff 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tesla_vehicle.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/tesla_vehicle.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tesla_vehicle.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/tesla_vehicle.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Tesla vehicle" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tesla_wall_connector.md b/src/go/plugin/go.d/modules/prometheus/integrations/tesla_wall_connector.md index d2a12b29..8e3c0e90 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tesla_wall_connector.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/tesla_wall_connector.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tesla_wall_connector.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/tesla_wall_connector.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Tesla Wall Connector" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tp-link_p110.md b/src/go/plugin/go.d/modules/prometheus/integrations/tp-link_p110.md index 1d835bde..5dd15041 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tp-link_p110.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/tp-link_p110.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/tp-link_p110.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/tp-link_p110.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "TP-Link P110" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/traceroute.md b/src/go/plugin/go.d/modules/prometheus/integrations/traceroute.md index d2f8d5c4..0896fd9c 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/traceroute.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/traceroute.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/traceroute.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/traceroute.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Traceroute" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/twincat_ads_web_service.md b/src/go/plugin/go.d/modules/prometheus/integrations/twincat_ads_web_service.md index 9f8878c6..e276e598 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/twincat_ads_web_service.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/twincat_ads_web_service.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/twincat_ads_web_service.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/twincat_ads_web_service.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "TwinCAT ADS Web Service" learn_status: "Published" learn_rel_path: "Collecting Metrics/Generic Collecting Metrics" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/twitch.md b/src/go/plugin/go.d/modules/prometheus/integrations/twitch.md index 9cf82aaa..f08f81bd 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/twitch.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/twitch.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/twitch.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/twitch.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Twitch" learn_status: "Published" learn_rel_path: "Collecting Metrics/Media Services" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ubiquiti_ufiber_olt.md b/src/go/plugin/go.d/modules/prometheus/integrations/ubiquiti_ufiber_olt.md index d5d978ee..810ebbea 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ubiquiti_ufiber_olt.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/ubiquiti_ufiber_olt.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/ubiquiti_ufiber_olt.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/ubiquiti_ufiber_olt.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Ubiquiti UFiber OLT" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/uptimerobot.md b/src/go/plugin/go.d/modules/prometheus/integrations/uptimerobot.md index fda2004c..9c6b5395 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/uptimerobot.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/uptimerobot.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/uptimerobot.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/uptimerobot.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Uptimerobot" learn_status: "Published" learn_rel_path: "Collecting Metrics/Synthetic Checks" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/vault_pki.md b/src/go/plugin/go.d/modules/prometheus/integrations/vault_pki.md index 0954f084..a7d11cd1 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/vault_pki.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/vault_pki.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/vault_pki.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/vault_pki.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Vault PKI" learn_status: "Published" learn_rel_path: "Collecting Metrics/Security Systems" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/vertica.md b/src/go/plugin/go.d/modules/prometheus/integrations/vertica.md index 666123c8..8463d713 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/vertica.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/vertica.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/vertica.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/vertica.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Vertica" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/vscode.md b/src/go/plugin/go.d/modules/prometheus/integrations/vscode.md index d72a5bf2..5fcffca0 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/vscode.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/vscode.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/vscode.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/vscode.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "VSCode" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/warp10.md b/src/go/plugin/go.d/modules/prometheus/integrations/warp10.md index 5fd9e7c2..e9e60dea 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/warp10.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/warp10.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/warp10.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/warp10.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Warp10" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/xiaomi_mi_flora.md b/src/go/plugin/go.d/modules/prometheus/integrations/xiaomi_mi_flora.md index 882c1022..51314b8b 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/xiaomi_mi_flora.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/xiaomi_mi_flora.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/xiaomi_mi_flora.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/xiaomi_mi_flora.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Xiaomi Mi Flora" learn_status: "Published" learn_rel_path: "Collecting Metrics/IoT Devices" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/xmpp_server.md b/src/go/plugin/go.d/modules/prometheus/integrations/xmpp_server.md index 336282e2..eacae839 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/xmpp_server.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/xmpp_server.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/xmpp_server.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/xmpp_server.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "XMPP Server" learn_status: "Published" learn_rel_path: "Collecting Metrics/Message Brokers" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/yourls_url_shortener.md b/src/go/plugin/go.d/modules/prometheus/integrations/yourls_url_shortener.md index 01562261..6b84c5ee 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/yourls_url_shortener.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/yourls_url_shortener.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/yourls_url_shortener.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/yourls_url_shortener.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "YOURLS URL Shortener" learn_status: "Published" learn_rel_path: "Collecting Metrics/APM" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/zerto.md b/src/go/plugin/go.d/modules/prometheus/integrations/zerto.md index 612c6ec1..3d316461 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/zerto.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/zerto.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/zerto.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/zerto.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Zerto" learn_status: "Published" learn_rel_path: "Collecting Metrics/Cloud Provider Managed" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/zulip.md b/src/go/plugin/go.d/modules/prometheus/integrations/zulip.md index eb931759..91e652c4 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/zulip.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/zulip.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/zulip.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/zulip.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Zulip" learn_status: "Published" learn_rel_path: "Collecting Metrics/Media Services" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/zyxel_gs1200-8.md b/src/go/plugin/go.d/modules/prometheus/integrations/zyxel_gs1200-8.md index d4917f63..4f0b4343 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/integrations/zyxel_gs1200-8.md +++ b/src/go/plugin/go.d/modules/prometheus/integrations/zyxel_gs1200-8.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/integrations/zyxel_gs1200-8.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/integrations/zyxel_gs1200-8.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/prometheus/metadata.yaml" sidebar_label: "Zyxel GS1200-8" learn_status: "Published" learn_rel_path: "Collecting Metrics/Networking Stack and Network Interfaces" @@ -37,7 +37,6 @@ This collector supports collecting metrics from multiple instances of this integ #### Auto-Detection By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). -The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). #### Limits @@ -138,7 +137,7 @@ The following options can be defined globally: update_every, autodetection_retry This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) -- Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). +- Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml @@ -266,6 +265,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `prometheus` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -288,4 +289,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m prometheus ``` +### Getting Logs + +If you're encountering problems with the `prometheus` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep prometheus +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep prometheus /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep prometheus +``` + diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml b/src/go/plugin/go.d/modules/prometheus/metadata.yaml index 8d1555f3..fee2b820 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/metadata.yaml +++ b/src/go/plugin/go.d/modules/prometheus/metadata.yaml @@ -37,7 +37,6 @@ modules: auto_detection: description: | By default, it detects instances running on the local host by trying to connect to known ports that are [allocated to exporters](https://github.com/prometheus/prometheus/wiki/Default-port-allocations). - The full list of endpoints is available in the collector's [configuration file](https://github.com/netdata/netdata/blob/master/src/go/collectors/go.d.plugin/config/go.d/prometheus.conf). limits: description: "" performance_impact: @@ -75,7 +74,7 @@ modules: This option allows you to filter out unwanted time series. Only metrics matching the selector will be collected. - Logic: (pattern1 OR pattern2) AND !(pattern3 or pattern4) - - Pattern syntax: [selector](/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md). + - Pattern syntax: [selector](/src/go/plugin/go.d/pkg/prometheus/selector/README.md). - Option syntax: ```yaml diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/prometheus.go b/src/go/plugin/go.d/modules/prometheus/prometheus.go index c5dcb739..b3f97fbd 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/prometheus.go +++ b/src/go/plugin/go.d/modules/prometheus/prometheus.go @@ -7,11 +7,11 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus/selector" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus/selector" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/prometheus_test.go b/src/go/plugin/go.d/modules/prometheus/prometheus_test.go index 52c30f14..5a5475cc 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/prometheus_test.go +++ b/src/go/plugin/go.d/modules/prometheus/prometheus_test.go @@ -9,9 +9,9 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus/selector" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus/selector" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/testdata/config.json b/src/go/plugin/go.d/modules/prometheus/testdata/config.json index 2e9b2e13..2e9b2e13 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/testdata/config.json +++ b/src/go/plugin/go.d/modules/prometheus/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/prometheus/testdata/config.yaml b/src/go/plugin/go.d/modules/prometheus/testdata/config.yaml index 37a411b9..37a411b9 100644 --- a/src/go/collectors/go.d.plugin/modules/prometheus/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/prometheus/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/README.md b/src/go/plugin/go.d/modules/proxysql/README.md index 06223157..06223157 120000 --- a/src/go/collectors/go.d.plugin/modules/proxysql/README.md +++ b/src/go/plugin/go.d/modules/proxysql/README.md diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/cache.go b/src/go/plugin/go.d/modules/proxysql/cache.go index c4fcceff..c4fcceff 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/cache.go +++ b/src/go/plugin/go.d/modules/proxysql/cache.go diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/charts.go b/src/go/plugin/go.d/modules/proxysql/charts.go index 34e01274..c36efa5c 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/charts.go +++ b/src/go/plugin/go.d/modules/proxysql/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) // TODO: check https://github.com/ProxySQL/proxysql-grafana-prometheus/blob/main/grafana/provisioning/dashboards/ProxySQL-Host-Statistics.json diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/collect.go b/src/go/plugin/go.d/modules/proxysql/collect.go index dfc559a9..dfc559a9 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/collect.go +++ b/src/go/plugin/go.d/modules/proxysql/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/config_schema.json b/src/go/plugin/go.d/modules/proxysql/config_schema.json index c0c880a2..c0c880a2 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/config_schema.json +++ b/src/go/plugin/go.d/modules/proxysql/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/integrations/proxysql.md b/src/go/plugin/go.d/modules/proxysql/integrations/proxysql.md index 2cfb0b06..90d42114 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/integrations/proxysql.md +++ b/src/go/plugin/go.d/modules/proxysql/integrations/proxysql.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/proxysql/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/proxysql/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/proxysql/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/proxysql/metadata.yaml" sidebar_label: "ProxySQL" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -249,6 +249,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `proxysql` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -271,4 +273,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m proxysql ``` +### Getting Logs + +If you're encountering problems with the `proxysql` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep proxysql +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep proxysql /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep proxysql +``` + diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/metadata.yaml b/src/go/plugin/go.d/modules/proxysql/metadata.yaml index 2c9562d9..2c9562d9 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/metadata.yaml +++ b/src/go/plugin/go.d/modules/proxysql/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/proxysql.go b/src/go/plugin/go.d/modules/proxysql/proxysql.go index 4fe08b8b..fc4677b1 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/proxysql.go +++ b/src/go/plugin/go.d/modules/proxysql/proxysql.go @@ -10,8 +10,8 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/proxysql_test.go b/src/go/plugin/go.d/modules/proxysql/proxysql_test.go index 3dfaf1bf..860e9032 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/proxysql_test.go +++ b/src/go/plugin/go.d/modules/proxysql/proxysql_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/DATA-DOG/go-sqlmock" "github.com/stretchr/testify/assert" diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/config.json b/src/go/plugin/go.d/modules/proxysql/testdata/config.json index ed8b72dc..ed8b72dc 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/config.json +++ b/src/go/plugin/go.d/modules/proxysql/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/config.yaml b/src/go/plugin/go.d/modules/proxysql/testdata/config.yaml index caff4903..caff4903 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/proxysql/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_memory_metrics.txt b/src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_memory_metrics.txt index 99ec093e..99ec093e 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_memory_metrics.txt +++ b/src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_memory_metrics.txt diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_mysql_commands_counters.txt b/src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_mysql_commands_counters.txt index 6ab6bb83..6ab6bb83 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_mysql_commands_counters.txt +++ b/src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_mysql_commands_counters.txt diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_mysql_connection_pool .txt b/src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_mysql_connection_pool .txt index 80b53e1a..80b53e1a 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_mysql_connection_pool .txt +++ b/src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_mysql_connection_pool .txt diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_mysql_global.txt b/src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_mysql_global.txt index 442266c4..442266c4 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_mysql_global.txt +++ b/src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_mysql_global.txt diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_mysql_users.txt b/src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_mysql_users.txt index 900776b7..900776b7 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/stats_mysql_users.txt +++ b/src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/stats_mysql_users.txt diff --git a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/version.txt b/src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/version.txt index 429a880b..429a880b 100644 --- a/src/go/collectors/go.d.plugin/modules/proxysql/testdata/v2.0.10/version.txt +++ b/src/go/plugin/go.d/modules/proxysql/testdata/v2.0.10/version.txt diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/README.md b/src/go/plugin/go.d/modules/pulsar/README.md index dfa55301..dfa55301 120000 --- a/src/go/collectors/go.d.plugin/modules/pulsar/README.md +++ b/src/go/plugin/go.d/modules/pulsar/README.md diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/cache.go b/src/go/plugin/go.d/modules/pulsar/cache.go index 7f113bf8..7f113bf8 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/cache.go +++ b/src/go/plugin/go.d/modules/pulsar/cache.go diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/charts.go b/src/go/plugin/go.d/modules/pulsar/charts.go index 3ddff66f..e6bb9bde 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/charts.go +++ b/src/go/plugin/go.d/modules/pulsar/charts.go @@ -6,9 +6,9 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) type ( diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/collect.go b/src/go/plugin/go.d/modules/pulsar/collect.go index f28e6cb2..10ff48b3 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/collect.go +++ b/src/go/plugin/go.d/modules/pulsar/collect.go @@ -6,8 +6,8 @@ import ( "errors" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) func isValidPulsarMetrics(pms prometheus.Series) bool { diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/config_schema.json b/src/go/plugin/go.d/modules/pulsar/config_schema.json index 0336255c..b4bc8b45 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/config_schema.json +++ b/src/go/plugin/go.d/modules/pulsar/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/init.go b/src/go/plugin/go.d/modules/pulsar/init.go index 2b17b5df..f165327a 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/init.go +++ b/src/go/plugin/go.d/modules/pulsar/init.go @@ -5,9 +5,9 @@ package pulsar import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (p *Pulsar) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/integrations/apache_pulsar.md b/src/go/plugin/go.d/modules/pulsar/integrations/apache_pulsar.md index b23e03d5..8538fbf9 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/integrations/apache_pulsar.md +++ b/src/go/plugin/go.d/modules/pulsar/integrations/apache_pulsar.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/pulsar/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/pulsar/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/pulsar/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/pulsar/metadata.yaml" sidebar_label: "Apache Pulsar" learn_status: "Published" learn_rel_path: "Collecting Metrics/Message Brokers" @@ -254,6 +254,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `pulsar` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -276,4 +278,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m pulsar ``` +### Getting Logs + +If you're encountering problems with the `pulsar` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep pulsar +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep pulsar /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep pulsar +``` + diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/metadata.yaml b/src/go/plugin/go.d/modules/pulsar/metadata.yaml index f21389fd..f21389fd 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/metadata.yaml +++ b/src/go/plugin/go.d/modules/pulsar/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/metrics.go b/src/go/plugin/go.d/modules/pulsar/metrics.go index 9e38e5b9..9e38e5b9 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/metrics.go +++ b/src/go/plugin/go.d/modules/pulsar/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/pulsar.go b/src/go/plugin/go.d/modules/pulsar/pulsar.go index 507b1235..aa5ac35f 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/pulsar.go +++ b/src/go/plugin/go.d/modules/pulsar/pulsar.go @@ -8,10 +8,10 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/pulsar_test.go b/src/go/plugin/go.d/modules/pulsar/pulsar_test.go index d6b5376d..33065615 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/pulsar_test.go +++ b/src/go/plugin/go.d/modules/pulsar/pulsar_test.go @@ -9,10 +9,10 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/testdata/config.json b/src/go/plugin/go.d/modules/pulsar/testdata/config.json index ab4f38fe..ab4f38fe 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/testdata/config.json +++ b/src/go/plugin/go.d/modules/pulsar/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/testdata/config.yaml b/src/go/plugin/go.d/modules/pulsar/testdata/config.yaml index f2645d9e..f2645d9e 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/pulsar/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/testdata/non-pulsar.txt b/src/go/plugin/go.d/modules/pulsar/testdata/non-pulsar.txt index f5f0ae08..f5f0ae08 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/testdata/non-pulsar.txt +++ b/src/go/plugin/go.d/modules/pulsar/testdata/non-pulsar.txt diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/testdata/standalone-v2.5.0-namespaces.txt b/src/go/plugin/go.d/modules/pulsar/testdata/standalone-v2.5.0-namespaces.txt index bbc3de4a..bbc3de4a 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/testdata/standalone-v2.5.0-namespaces.txt +++ b/src/go/plugin/go.d/modules/pulsar/testdata/standalone-v2.5.0-namespaces.txt diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/testdata/standalone-v2.5.0-topics-2.txt b/src/go/plugin/go.d/modules/pulsar/testdata/standalone-v2.5.0-topics-2.txt index ba500609..ba500609 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/testdata/standalone-v2.5.0-topics-2.txt +++ b/src/go/plugin/go.d/modules/pulsar/testdata/standalone-v2.5.0-topics-2.txt diff --git a/src/go/collectors/go.d.plugin/modules/pulsar/testdata/standalone-v2.5.0-topics.txt b/src/go/plugin/go.d/modules/pulsar/testdata/standalone-v2.5.0-topics.txt index 7e0f0212..7e0f0212 100644 --- a/src/go/collectors/go.d.plugin/modules/pulsar/testdata/standalone-v2.5.0-topics.txt +++ b/src/go/plugin/go.d/modules/pulsar/testdata/standalone-v2.5.0-topics.txt diff --git a/src/go/plugin/go.d/modules/puppet/README.md b/src/go/plugin/go.d/modules/puppet/README.md new file mode 120000 index 00000000..b6c4c83f --- /dev/null +++ b/src/go/plugin/go.d/modules/puppet/README.md @@ -0,0 +1 @@ +integrations/puppet.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/puppet/charts.go b/src/go/plugin/go.d/modules/puppet/charts.go new file mode 100644 index 00000000..c1da8d16 --- /dev/null +++ b/src/go/plugin/go.d/modules/puppet/charts.go @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package puppet + +import ( + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioJVMHeap = module.Priority + iota + prioJVMNonHeap + prioCPUUsage + prioFileDescriptors +) + +const ( + byteToMiB = 1 << 20 +) + +var charts = module.Charts{ + jvmHeapChart.Copy(), + jvmNonHeapChart.Copy(), + cpuUsageChart.Copy(), + fileDescriptorsChart.Copy(), +} + +var ( + jvmHeapChart = module.Chart{ + ID: "jvm_heap", + Title: "JVM Heap", + Units: "MiB", + Fam: "resources", + Ctx: "puppet.jvm_heap", + Type: module.Area, + Priority: prioJVMHeap, + Dims: module.Dims{ + {ID: "jvm_heap_committed", Name: "committed", Div: byteToMiB}, + {ID: "jvm_heap_used", Name: "used", Div: byteToMiB}, + }, + Vars: module.Vars{ + {ID: "jvm_heap_max"}, + {ID: "jvm_heap_init"}, + }, + } + + jvmNonHeapChart = module.Chart{ + ID: "jvm_nonheap", + Title: "JVM Non-Heap", + Units: "MiB", + Fam: "resources", + Ctx: "puppet.jvm_nonheap", + Type: module.Area, + Priority: prioJVMNonHeap, + Dims: module.Dims{ + {ID: "jvm_nonheap_committed", Name: "committed", Div: byteToMiB}, + {ID: "jvm_nonheap_used", Name: "used", Div: byteToMiB}, + }, + Vars: module.Vars{ + {ID: "jvm_nonheap_max"}, + {ID: "jvm_nonheap_init"}, + }, + } + + cpuUsageChart = module.Chart{ + ID: "cpu", + Title: "CPU usage", + Units: "percentage", + Fam: "resources", + Ctx: "puppet.cpu", + Type: module.Stacked, + Priority: prioCPUUsage, + Dims: module.Dims{ + {ID: "cpu_usage", Name: "execution", Div: 1000}, + {ID: "gc_cpu_usage", Name: "GC", Div: 1000}, + }, + } + + fileDescriptorsChart = module.Chart{ + ID: "fd_open", + Title: "File Descriptors", + Units: "descriptors", + Fam: "resources", + Ctx: "puppet.fdopen", + Type: module.Line, + Priority: prioFileDescriptors, + Dims: module.Dims{ + {ID: "fd_used", Name: "used"}, + }, + Vars: module.Vars{ + {ID: "fd_max"}, + }, + } +) diff --git a/src/go/plugin/go.d/modules/puppet/collect.go b/src/go/plugin/go.d/modules/puppet/collect.go new file mode 100644 index 00000000..a1b95e09 --- /dev/null +++ b/src/go/plugin/go.d/modules/puppet/collect.go @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package puppet + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +var ( + //https://puppet.com/docs/puppet/8/server/status-api/v1/services + urlPathStatusService = "/status/v1/services" + urlQueryStatusService = url.Values{"level": {"debug"}}.Encode() +) + +func (p *Puppet) collect() (map[string]int64, error) { + stats, err := p.queryStatsService() + if err != nil { + return nil, err + } + + mx := stm.ToMap(stats) + + return mx, nil +} + +func (p *Puppet) queryStatsService() (*statusServiceResponse, error) { + req, err := web.NewHTTPRequestWithPath(p.Request, urlPathStatusService) + if err != nil { + return nil, err + } + + req.URL.RawQuery = urlQueryStatusService + + var stats statusServiceResponse + if err := p.doOKDecode(req, &stats); err != nil { + return nil, err + } + + if stats.StatusService == nil { + return nil, fmt.Errorf("unexpected response: not puppet service status data") + } + + return &stats, nil +} + +func (p *Puppet) doOKDecode(req *http.Request, in interface{}) error { + resp, err := p.httpClient.Do(req) + if err != nil { + return fmt.Errorf("error on HTTP request '%s': %v", req.URL, err) + } + defer closeBody(resp) + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("'%s' returned HTTP status code: %d", req.URL, resp.StatusCode) + } + + if err := json.NewDecoder(resp.Body).Decode(in); err != nil { + return fmt.Errorf("error on decoding response from '%s': %v", req.URL, err) + } + return nil +} + +func closeBody(resp *http.Response) { + if resp != nil && resp.Body != nil { + _, _ = io.Copy(io.Discard, resp.Body) + _ = resp.Body.Close() + } +} diff --git a/src/go/plugin/go.d/modules/puppet/config_schema.json b/src/go/plugin/go.d/modules/puppet/config_schema.json new file mode 100644 index 00000000..92cbcb87 --- /dev/null +++ b/src/go/plugin/go.d/modules/puppet/config_schema.json @@ -0,0 +1,177 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Puppet collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "url": { + "title": "URL", + "description": "The base URL where the Puppet instance can be accessed.", + "type": "string", + "default": "https://127.0.0.1:8140", + "format": "uri" + }, + "timeout": { + "title": "Timeout", + "description": "The timeout in seconds for the HTTP request.", + "type": "number", + "minimum": 0.5, + "default": 1 + }, + "not_follow_redirects": { + "title": "Not follow redirects", + "description": "If set, the client will not follow HTTP redirects automatically.", + "type": "boolean" + }, + "username": { + "title": "Username", + "description": "The username for basic authentication.", + "type": "string", + "sensitive": true + }, + "password": { + "title": "Password", + "description": "The password for basic authentication.", + "type": "string", + "sensitive": true + }, + "proxy_url": { + "title": "Proxy URL", + "description": "The URL of the proxy server.", + "type": "string" + }, + "proxy_username": { + "title": "Proxy username", + "description": "The username for proxy authentication.", + "type": "string", + "sensitive": true + }, + "proxy_password": { + "title": "Proxy password", + "description": "The password for proxy authentication.", + "type": "string", + "sensitive": true + }, + "headers": { + "title": "Headers", + "description": "Additional HTTP headers to include in the request.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "tls_skip_verify": { + "title": "Skip TLS verification", + "description": "If set, TLS certificate verification will be skipped.", + "type": "boolean" + }, + "tls_ca": { + "title": "TLS CA", + "description": "The path to the CA certificate file for TLS verification.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_cert": { + "title": "TLS certificate", + "description": "The path to the client certificate file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_key": { + "title": "TLS key", + "description": "The path to the client key file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "body": { + "title": "Body", + "type": "string" + }, + "method": { + "title": "Method", + "type": "string" + } + }, + "required": [ + "url" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "body": { + "ui:widget": "hidden" + }, + "method": { + "ui:widget": "hidden" + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + }, + "password": { + "ui:widget": "password" + }, + "proxy_password": { + "ui:widget": "password" + }, + "ui:flavour": "tabs", + "ui:options": { + "tabs": [ + { + "title": "Base", + "fields": [ + "update_every", + "url", + "timeout", + "not_follow_redirects" + ] + }, + { + "title": "Auth", + "fields": [ + "username", + "password" + ] + }, + { + "title": "TLS", + "fields": [ + "tls_skip_verify", + "tls_ca", + "tls_cert", + "tls_key" + ] + }, + { + "title": "Proxy", + "fields": [ + "proxy_url", + "proxy_username", + "proxy_password" + ] + }, + { + "title": "Headers", + "fields": [ + "headers" + ] + } + ] + } + } +} diff --git a/src/go/plugin/go.d/modules/puppet/integrations/puppet.md b/src/go/plugin/go.d/modules/puppet/integrations/puppet.md new file mode 100644 index 00000000..23e85dc4 --- /dev/null +++ b/src/go/plugin/go.d/modules/puppet/integrations/puppet.md @@ -0,0 +1,233 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/puppet/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/puppet/metadata.yaml" +sidebar_label: "Puppet" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/CICD Platforms" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Puppet + + +<img src="https://netdata.cloud/img/puppet.svg" width="150"/> + + +Plugin: go.d.plugin +Module: puppet + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +This collector monitors Puppet metrics, including JVM heap and non-heap memory, CPU usage, and file descriptors. + + +It uses Puppet's metrics API endpoint [/status/v1/services](https://www.puppet.com/docs/puppetserver/5.3/status-api/v1/services.html) to gather the metrics. + + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +By default, it detects Puppet instances running on localhost that are listening on port 8140. +On startup, it tries to collect metrics from: + +- https://127.0.0.1:8140 + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per Puppet instance + +These metrics refer to the entire monitored application. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| puppet.jvm_heap | committed, used | MiB | +| puppet.jvm_nonheap | committed, used | MiB | +| puppet.cpu | execution, GC | percentage | +| puppet.fdopen | used | descriptors | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +No action required. + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/puppet.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/puppet.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary></summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| url | The base URL where the Puppet instance can be accessed. | https://127.0.0.1:8140 | yes | +| timeout | HTTPS request timeout. | 1 | no | +| username | Username for basic HTTPS authentication. | | no | +| password | Password for basic HTTPS authentication. | | no | +| proxy_url | Proxy URL. | | no | +| proxy_username | Username for proxy basic HTTPS authentication. | | no | +| proxy_password | Password for proxy basic HTTPS authentication. | | no | +| method | HTTPS request method. | POST | no | +| body | HTTPS request body. | | no | +| headers | HTTPS request headers. | | no | +| not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no | +| tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no | +| tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no | +| tls_cert | Client TLS certificate. | | no | +| tls_key | Client TLS key. | | no | + +</details> + +#### Examples + +##### Basic with self-signed certificate + +Puppet with self-signed TLS certificate. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + url: https://127.0.0.1:8140 + tls_skip_verify: yes + +``` +</details> + +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + url: https://127.0.0.1:8140 + tls_skip_verify: yes + + - name: remote + url: https://192.0.2.1:8140 + tls_skip_verify: yes + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `puppet` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m puppet + ``` + +### Getting Logs + +If you're encountering problems with the `puppet` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep puppet +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep puppet /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep puppet +``` + + diff --git a/src/go/plugin/go.d/modules/puppet/metadata.yaml b/src/go/plugin/go.d/modules/puppet/metadata.yaml new file mode 100644 index 00000000..fa96ea8f --- /dev/null +++ b/src/go/plugin/go.d/modules/puppet/metadata.yaml @@ -0,0 +1,184 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-puppet + plugin_name: go.d.plugin + module_name: puppet + monitored_instance: + name: Puppet + link: "https://www.puppet.com/" + categories: + - data-collection.ci-cd-systems + icon_filename: "puppet.svg" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - puppet + most_popular: false + overview: + data_collection: + metrics_description: | + This collector monitors Puppet metrics, including JVM heap and non-heap memory, CPU usage, and file descriptors. + method_description: | + It uses Puppet's metrics API endpoint [/status/v1/services](https://www.puppet.com/docs/puppetserver/5.3/status-api/v1/services.html) to gather the metrics. + supported_platforms: + include: [] + exclude: [] + multi_instance: true + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: | + By default, it detects Puppet instances running on localhost that are listening on port 8140. + On startup, it tries to collect metrics from: + + - https://127.0.0.1:8140 + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: [] + configuration: + file: + name: "go.d/puppet.conf" + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: "" + enabled: true + list: + - name: url + description: The base URL where the Puppet instance can be accessed. + default_value: https://127.0.0.1:8140 + required: true + - name: timeout + description: HTTPS request timeout. + default_value: 1 + required: false + - name: username + description: Username for basic HTTPS authentication. + default_value: "" + required: false + - name: password + description: Password for basic HTTPS authentication. + default_value: "" + required: false + - name: proxy_url + description: Proxy URL. + default_value: "" + required: false + - name: proxy_username + description: Username for proxy basic HTTPS authentication. + default_value: "" + required: false + - name: proxy_password + description: Password for proxy basic HTTPS authentication. + default_value: "" + required: false + - name: method + description: HTTPS request method. + default_value: POST + required: false + - name: body + description: HTTPS request body. + default_value: "" + required: false + - name: headers + description: HTTPS request headers. + default_value: "" + required: false + - name: not_follow_redirects + description: Redirect handling policy. Controls whether the client follows redirects. + default_value: false + required: false + - name: tls_skip_verify + description: Server certificate chain and hostname validation policy. Controls whether the client performs this check. + default_value: false + required: false + - name: tls_ca + description: Certification authority that the client uses when verifying the server's certificates. + default_value: "" + required: false + - name: tls_cert + description: Client TLS certificate. + default_value: "" + required: false + - name: tls_key + description: Client TLS key. + default_value: "" + required: false + examples: + folding: + enabled: true + title: "Config" + list: + - name: Basic with self-signed certificate + description: Puppet with self-signed TLS certificate. + config: | + jobs: + - name: local + url: https://127.0.0.1:8140 + tls_skip_verify: yes + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + url: https://127.0.0.1:8140 + tls_skip_verify: yes + + - name: remote + url: https://192.0.2.1:8140 + tls_skip_verify: yes + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: "These metrics refer to the entire monitored application." + labels: [] + metrics: + - name: puppet.jvm_heap + description: JVM Heap + unit: "MiB" + chart_type: area + dimensions: + - name: committed + - name: used + - name: puppet.jvm_nonheap + description: JVM Non-Heap + unit: "MiB" + chart_type: area + dimensions: + - name: committed + - name: used + - name: puppet.cpu + description: CPU usage + unit: "percentage" + chart_type: stacked + dimensions: + - name: execution + - name: GC + - name: puppet.fdopen + description: File Descriptors + unit: "descriptors" + chart_type: line + dimensions: + - name: used diff --git a/src/go/plugin/go.d/modules/puppet/puppet.go b/src/go/plugin/go.d/modules/puppet/puppet.go new file mode 100644 index 00000000..e6eb7b05 --- /dev/null +++ b/src/go/plugin/go.d/modules/puppet/puppet.go @@ -0,0 +1,114 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package puppet + +import ( + _ "embed" + "errors" + "net/http" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("puppet", module.Creator{ + JobConfigSchema: configSchema, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Puppet { + return &Puppet{ + Config: Config{ + HTTP: web.HTTP{ + Request: web.Request{ + URL: "https://127.0.0.1:8140", + }, + Client: web.Client{ + Timeout: web.Duration(time.Second * 1), + }, + }, + }, + charts: charts.Copy(), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + web.HTTP `yaml:",inline" json:""` +} + +type Puppet struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + httpClient *http.Client +} + +func (p *Puppet) Configuration() any { + return p.Config +} + +func (p *Puppet) Init() error { + if p.URL == "" { + p.Error("URL not set") + return errors.New("url not set") + } + + client, err := web.NewHTTPClient(p.Client) + if err != nil { + p.Error(err) + return err + } + p.httpClient = client + + p.Debugf("using URL %s", p.URL) + p.Debugf("using timeout: %s", p.Timeout) + + return nil +} + +func (p *Puppet) Check() error { + mx, err := p.collect() + if err != nil { + p.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (p *Puppet) Charts() *module.Charts { + return p.charts +} + +func (p *Puppet) Collect() map[string]int64 { + mx, err := p.collect() + if err != nil { + p.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (p *Puppet) Cleanup() { + if p.httpClient != nil { + p.httpClient.CloseIdleConnections() + } +} diff --git a/src/go/plugin/go.d/modules/puppet/puppet_test.go b/src/go/plugin/go.d/modules/puppet/puppet_test.go new file mode 100644 index 00000000..7c80a638 --- /dev/null +++ b/src/go/plugin/go.d/modules/puppet/puppet_test.go @@ -0,0 +1,252 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package puppet + +import ( + "net/http" + "net/http/httptest" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + serviceStatusResponse, _ = os.ReadFile("testdata/serviceStatusResponse.json") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + "serviceStatusResponse": serviceStatusResponse, + } { + require.NotNil(t, data, name) + } +} + +func TestPuppet_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &Puppet{}, dataConfigJSON, dataConfigYAML) +} + +func TestPuppet_Init(t *testing.T) { + tests := map[string]struct { + wantFail bool + config Config + }{ + "success with default": { + wantFail: false, + config: New().Config, + }, + "fail when URL not set": { + wantFail: true, + config: Config{ + HTTP: web.HTTP{ + Request: web.Request{URL: ""}, + }, + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + puppet := New() + puppet.Config = test.config + + if test.wantFail { + assert.Error(t, puppet.Init()) + } else { + assert.NoError(t, puppet.Init()) + } + }) + } +} + +func TestPuppet_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestPuppet_Check(t *testing.T) { + tests := map[string]struct { + wantFail bool + prepare func(t *testing.T) (*Puppet, func()) + }{ + "success default config": { + wantFail: false, + prepare: prepareCaseOkDefault, + }, + "fails on unexpected json response": { + wantFail: true, + prepare: prepareCaseUnexpectedJsonResponse, + }, + "fails on invalid format response": { + wantFail: true, + prepare: prepareCaseInvalidFormatResponse, + }, + "fails on connection refused": { + wantFail: true, + prepare: prepareCaseConnectionRefused, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + puppet, cleanup := test.prepare(t) + defer cleanup() + + if test.wantFail { + assert.Error(t, puppet.Check()) + } else { + assert.NoError(t, puppet.Check()) + } + }) + } +} + +func TestPuppet_Collect(t *testing.T) { + tests := map[string]struct { + prepare func(t *testing.T) (*Puppet, func()) + wantMetrics map[string]int64 + }{ + "success default config": { + prepare: prepareCaseOkDefault, + wantMetrics: map[string]int64{ + "cpu_usage": 49, + "fd_max": 524288, + "fd_used": 234, + "gc_cpu_usage": 0, + "jvm_heap_committed": 1073741824, + "jvm_heap_init": 1073741824, + "jvm_heap_max": 1073741824, + "jvm_heap_used": 550502400, + "jvm_nonheap_committed": 334102528, + "jvm_nonheap_init": 7667712, + "jvm_nonheap_max": -1, + "jvm_nonheap_used": 291591160, + }, + }, + "fails on unexpected json response": { + prepare: prepareCaseUnexpectedJsonResponse, + }, + "fails on invalid format response": { + prepare: prepareCaseInvalidFormatResponse, + }, + "fails on connection refused": { + prepare: prepareCaseConnectionRefused, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + puppet, cleanup := test.prepare(t) + defer cleanup() + + mx := puppet.Collect() + + require.Equal(t, test.wantMetrics, mx) + if len(test.wantMetrics) > 0 { + testMetricsHasAllChartsDims(t, puppet, mx) + } + }) + } +} + +func testMetricsHasAllChartsDims(t *testing.T, puppet *Puppet, mx map[string]int64) { + for _, chart := range *puppet.Charts() { + if chart.Obsolete { + continue + } + for _, dim := range chart.Dims { + _, ok := mx[dim.ID] + assert.Truef(t, ok, "collected metrics has no data for dim '%s' chart '%s'", dim.ID, chart.ID) + } + for _, v := range chart.Vars { + _, ok := mx[v.ID] + assert.Truef(t, ok, "collected metrics has no data for var '%s' chart '%s'", v.ID, chart.ID) + } + } +} + +func prepareCaseOkDefault(t *testing.T) (*Puppet, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case "/status/v1/services": + if r.URL.RawQuery != urlQueryStatusService { + w.WriteHeader(http.StatusNotFound) + } else { + _, _ = w.Write(serviceStatusResponse) + } + default: + w.WriteHeader(http.StatusNotFound) + } + })) + + puppet := New() + puppet.URL = srv.URL + require.NoError(t, puppet.Init()) + + return puppet, srv.Close +} + +func prepareCaseUnexpectedJsonResponse(t *testing.T) (*Puppet, func()) { + t.Helper() + resp := ` +{ + "elephant": { + "burn": false, + "mountain": true, + "fog": false, + "skin": -1561907625, + "burst": "anyway", + "shadow": 1558616893 + }, + "start": "ever", + "base": 2093056027, + "mission": -2007590351, + "victory": 999053756, + "die": false +} +` + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte(resp)) + })) + + puppet := New() + puppet.URL = srv.URL + require.NoError(t, puppet.Init()) + + return puppet, srv.Close +} + +func prepareCaseInvalidFormatResponse(t *testing.T) (*Puppet, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte("hello and\n goodbye")) + })) + + puppet := New() + puppet.URL = srv.URL + require.NoError(t, puppet.Init()) + + return puppet, srv.Close +} + +func prepareCaseConnectionRefused(t *testing.T) (*Puppet, func()) { + t.Helper() + puppet := New() + puppet.URL = "http://127.0.0.1:65001" + require.NoError(t, puppet.Init()) + + return puppet, func() {} +} diff --git a/src/go/plugin/go.d/modules/puppet/response.go b/src/go/plugin/go.d/modules/puppet/response.go new file mode 100644 index 00000000..dc903d0a --- /dev/null +++ b/src/go/plugin/go.d/modules/puppet/response.go @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package puppet + +type statusServiceResponse struct { + StatusService *struct { + Status struct { + Experimental struct { + JVMMetrics *struct { + CPUUsage float64 `json:"cpu-usage" stm:"cpu_usage,1000,1"` + GCCPUUsage float64 `json:"gc-cpu-usage" stm:"gc_cpu_usage,1000,1"` + HeapMemory struct { + Committed int64 `json:"committed" stm:"committed"` + Init int64 `json:"init" stm:"init"` + Max int64 `json:"max" stm:"max"` + Used int64 `json:"used" stm:"used"` + } `json:"heap-memory" stm:"jvm_heap"` + FileDescriptors struct { + Used int `json:"used" stm:"used"` + Max int `json:"max" stm:"max"` + } `json:"file-descriptors" stm:"fd"` + NonHeapMemory struct { + Committed int64 `json:"committed" stm:"committed"` + Init int64 `json:"init" stm:"init"` + Max int64 `json:"max" stm:"max"` + Used int64 `json:"used" stm:"used"` + } `json:"non-heap-memory" stm:"jvm_nonheap"` + } `json:"jvm-metrics" stm:""` + } `json:"experimental" stm:""` + } `json:"status" stm:""` + } `json:"status-service" stm:""` +} diff --git a/src/go/collectors/go.d.plugin/modules/tengine/testdata/config.json b/src/go/plugin/go.d/modules/puppet/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/tengine/testdata/config.json +++ b/src/go/plugin/go.d/modules/puppet/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/tengine/testdata/config.yaml b/src/go/plugin/go.d/modules/puppet/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/tengine/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/puppet/testdata/config.yaml diff --git a/src/go/plugin/go.d/modules/puppet/testdata/serviceStatusResponse.json b/src/go/plugin/go.d/modules/puppet/testdata/serviceStatusResponse.json new file mode 100644 index 00000000..a0eee869 --- /dev/null +++ b/src/go/plugin/go.d/modules/puppet/testdata/serviceStatusResponse.json @@ -0,0 +1,497 @@ +{ + "puppet-profiler": { + "service_version": "8.4.0", + "service_status_version": 1, + "detail_level": "debug", + "state": "running", + "status": { + "experimental": { + "function-metrics": [], + "resource-metrics": [], + "catalog-metrics": [], + "puppetdb-metrics": [], + "inline-metrics": [] + } + }, + "active_alerts": [] + }, + "jruby-metrics": { + "service_version": "8.4.0", + "service_status_version": 1, + "detail_level": "debug", + "state": "running", + "status": { + "experimental": { + "jruby-pool-lock-status": { + "current-state": ":not-in-use", + "last-change-time": "2024-07-05T06:23:20.120Z" + }, + "metrics": { + "average-lock-wait-time": 0, + "num-free-jrubies": 4, + "borrow-count": 0, + "average-requested-jrubies": 0.0, + "borrow-timeout-count": 0, + "return-count": 0, + "borrow-timers": { + "total": { + "count": 0, + "mean": 0, + "max": 0, + "rate": 0.0 + } + }, + "borrow-retry-count": 0, + "borrowed-instances": [], + "average-borrow-time": 0, + "num-jrubies": 4, + "requested-count": 0, + "queue-limit-hit-rate": 0.0, + "average-lock-held-time": 0, + "requested-instances": [], + "queue-limit-hit-count": 0, + "average-free-jrubies": 3.3019592583652217, + "num-pool-locks": 0, + "average-wait-time": 0 + } + } + }, + "active_alerts": [] + }, + "ca": { + "service_version": "8.4.0", + "service_status_version": 1, + "detail_level": "debug", + "state": "running", + "status": {}, + "active_alerts": [] + }, + "master": { + "service_version": "8.4.0", + "service_status_version": 1, + "detail_level": "debug", + "state": "running", + "status": { + "experimental": { + "http-metrics": [ + { + "route-id": "puppet-v3-static_file_content-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-file_content-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-environments", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-tasks-:module-name-:task-name", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-file_metadata-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-facts-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "other", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-tasks", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-compile", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-report-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-node-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-catalog-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-plans-:module-name-:plan-name", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-file_metadatas-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-file_bucket_file-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v4-catalog", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "total", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-environment_modules-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-environment_classes-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-plans", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-environment_transports-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + } + ], + "http-client-metrics": [] + } + }, + "active_alerts": [] + }, + "server": { + "service_version": "8.4.0", + "service_status_version": 1, + "detail_level": "debug", + "state": "running", + "status": { + "experimental": { + "http-metrics": [ + { + "route-id": "puppet-v3-static_file_content-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-file_content-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-environments", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-tasks-:module-name-:task-name", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-file_metadata-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-facts-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "other", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-tasks", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-compile", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-report-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-node-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-catalog-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-plans-:module-name-:plan-name", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-file_metadatas-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-file_bucket_file-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v4-catalog", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "total", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-environment_modules-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-environment_classes-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-plans", + "count": 0, + "mean": 0, + "aggregate": 0 + }, + { + "route-id": "puppet-v3-environment_transports-/*/", + "count": 0, + "mean": 0, + "aggregate": 0 + } + ], + "http-client-metrics": [] + } + }, + "active_alerts": [] + }, + "status-service": { + "service_version": "1.1.1", + "service_status_version": 1, + "detail_level": "debug", + "state": "running", + "status": { + "experimental": { + "jvm-metrics": { + "cpu-usage": 0.04997002, + "up-time-ms": 51328, + "memory-pools": { + "Metaspace": { + "type": "NON_HEAP", + "usage": { + "committed": 214106112, + "init": 0, + "max": -1, + "used": 183450600 + } + }, + "CodeHeap 'non-nmethods'": { + "type": "NON_HEAP", + "usage": { + "committed": 2555904, + "init": 2555904, + "max": 5840896, + "used": 1923072 + } + }, + "CodeHeap 'profiled nmethods'": { + "type": "NON_HEAP", + "usage": { + "committed": 52559872, + "init": 2555904, + "max": 122908672, + "used": 52545664 + } + }, + "Compressed Class Space": { + "type": "NON_HEAP", + "usage": { + "committed": 49020928, + "init": 0, + "max": 1073741824, + "used": 37887856 + } + }, + "G1 Eden Space": { + "type": "HEAP", + "usage": { + "committed": 542113792, + "init": 53477376, + "max": -1, + "used": 146800640 + } + }, + "G1 Old Gen": { + "type": "HEAP", + "usage": { + "committed": 462422016, + "init": 1020264448, + "max": 1073741824, + "used": 335020032 + } + }, + "G1 Survivor Space": { + "type": "HEAP", + "usage": { + "committed": 69206016, + "init": 0, + "max": -1, + "used": 68681728 + } + }, + "CodeHeap 'non-profiled nmethods'": { + "type": "NON_HEAP", + "usage": { + "committed": 15597568, + "init": 2555904, + "max": 122908672, + "used": 15588736 + } + } + }, + "gc-cpu-usage": 0.0, + "threading": { + "thread-count": 59, + "peak-thread-count": 59 + }, + "heap-memory": { + "committed": 1073741824, + "init": 1073741824, + "max": 1073741824, + "used": 550502400 + }, + "gc-stats": { + "G1 Young Generation": { + "count": 18, + "total-time-ms": 550, + "last-gc-info": { + "duration-ms": 75 + } + }, + "G1 Old Generation": { + "count": 0, + "total-time-ms": 0 + }, + "G1 Concurrent GC": { + "count": 10, + "total-time-ms": 49, + "last-gc-info": { + "duration-ms": 0 + } + } + }, + "start-time-ms": 1720160584298, + "file-descriptors": { + "used": 234, + "max": 524288 + }, + "non-heap-memory": { + "committed": 334102528, + "init": 7667712, + "max": -1, + "used": 291591160 + }, + "nio-buffer-pools": { + "mapped": { + "count": 0, + "memory-used": 0, + "total-capacity": 0 + }, + "direct": { + "count": 11, + "memory-used": 197631, + "total-capacity": 197631 + }, + "mapped - 'non-volatile memory'": { + "count": 0, + "memory-used": 0, + "total-capacity": 0 + } + } + } + } + }, + "active_alerts": [] + } +} diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/README.md b/src/go/plugin/go.d/modules/rabbitmq/README.md index 0119db91..0119db91 120000 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/README.md +++ b/src/go/plugin/go.d/modules/rabbitmq/README.md diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/charts.go b/src/go/plugin/go.d/modules/rabbitmq/charts.go index 99b43190..f580a2f2 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/charts.go +++ b/src/go/plugin/go.d/modules/rabbitmq/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/collect.go b/src/go/plugin/go.d/modules/rabbitmq/collect.go index 665dfdfc..70b2aa03 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/collect.go +++ b/src/go/plugin/go.d/modules/rabbitmq/collect.go @@ -9,8 +9,8 @@ import ( "net/http" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const ( @@ -145,13 +145,11 @@ func (r *RabbitMQ) collectQueuesStats(mx map[string]int64) error { } func (r *RabbitMQ) doOKDecode(urlPath string, in interface{}) error { - req, err := web.NewHTTPRequest(r.Request.Copy()) + req, err := web.NewHTTPRequestWithPath(r.Request, urlPath) if err != nil { return fmt.Errorf("error on creating request: %v", err) } - req.URL.Path = urlPath - r.Debugf("doing HTTP %s to '%s'", req.Method, req.URL) resp, err := r.httpClient.Do(req) if err != nil { diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/config_schema.json b/src/go/plugin/go.d/modules/rabbitmq/config_schema.json index 3636513e..defa7014 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/config_schema.json +++ b/src/go/plugin/go.d/modules/rabbitmq/config_schema.json @@ -176,6 +176,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/integrations/rabbitmq.md b/src/go/plugin/go.d/modules/rabbitmq/integrations/rabbitmq.md index 519b807e..e4c9df58 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/integrations/rabbitmq.md +++ b/src/go/plugin/go.d/modules/rabbitmq/integrations/rabbitmq.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/rabbitmq/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/rabbitmq/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/rabbitmq/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/rabbitmq/metadata.yaml" sidebar_label: "RabbitMQ" learn_status: "Published" learn_rel_path: "Collecting Metrics/Message Brokers" @@ -240,6 +240,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `rabbitmq` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -262,4 +264,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m rabbitmq ``` +### Getting Logs + +If you're encountering problems with the `rabbitmq` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep rabbitmq +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep rabbitmq /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep rabbitmq +``` + diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/metadata.yaml b/src/go/plugin/go.d/modules/rabbitmq/metadata.yaml index f0a17b9e..f0a17b9e 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/metadata.yaml +++ b/src/go/plugin/go.d/modules/rabbitmq/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/metrics.go b/src/go/plugin/go.d/modules/rabbitmq/metrics.go index 871dfd57..871dfd57 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/metrics.go +++ b/src/go/plugin/go.d/modules/rabbitmq/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/rabbitmq.go b/src/go/plugin/go.d/modules/rabbitmq/rabbitmq.go index b07e50ed..74805dab 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/rabbitmq.go +++ b/src/go/plugin/go.d/modules/rabbitmq/rabbitmq.go @@ -8,8 +8,8 @@ import ( "net/http" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/rabbitmq_test.go b/src/go/plugin/go.d/modules/rabbitmq/rabbitmq_test.go index 0d46d496..7c4fe719 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/rabbitmq_test.go +++ b/src/go/plugin/go.d/modules/rabbitmq/rabbitmq_test.go @@ -9,8 +9,8 @@ import ( "path/filepath" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/config.json b/src/go/plugin/go.d/modules/rabbitmq/testdata/config.json index b3f637f0..b3f637f0 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/config.json +++ b/src/go/plugin/go.d/modules/rabbitmq/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/config.yaml b/src/go/plugin/go.d/modules/rabbitmq/testdata/config.yaml index 12bb79be..12bb79be 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/rabbitmq/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/v3.11.5/api-nodes-node.json b/src/go/plugin/go.d/modules/rabbitmq/testdata/v3.11.5/api-nodes-node.json index cc0a0ceb..cc0a0ceb 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/v3.11.5/api-nodes-node.json +++ b/src/go/plugin/go.d/modules/rabbitmq/testdata/v3.11.5/api-nodes-node.json diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/v3.11.5/api-overview.json b/src/go/plugin/go.d/modules/rabbitmq/testdata/v3.11.5/api-overview.json index 5c71aaf5..5c71aaf5 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/v3.11.5/api-overview.json +++ b/src/go/plugin/go.d/modules/rabbitmq/testdata/v3.11.5/api-overview.json diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/v3.11.5/api-queues.json b/src/go/plugin/go.d/modules/rabbitmq/testdata/v3.11.5/api-queues.json index 40c6e6c8..40c6e6c8 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/v3.11.5/api-queues.json +++ b/src/go/plugin/go.d/modules/rabbitmq/testdata/v3.11.5/api-queues.json diff --git a/src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/v3.11.5/api-vhosts.json b/src/go/plugin/go.d/modules/rabbitmq/testdata/v3.11.5/api-vhosts.json index ed2c3418..ed2c3418 100644 --- a/src/go/collectors/go.d.plugin/modules/rabbitmq/testdata/v3.11.5/api-vhosts.json +++ b/src/go/plugin/go.d/modules/rabbitmq/testdata/v3.11.5/api-vhosts.json diff --git a/src/go/collectors/go.d.plugin/modules/redis/README.md b/src/go/plugin/go.d/modules/redis/README.md index e4166625..e4166625 120000 --- a/src/go/collectors/go.d.plugin/modules/redis/README.md +++ b/src/go/plugin/go.d/modules/redis/README.md diff --git a/src/go/collectors/go.d.plugin/modules/redis/charts.go b/src/go/plugin/go.d/modules/redis/charts.go index 9fcf2338..6d4f638b 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/charts.go +++ b/src/go/plugin/go.d/modules/redis/charts.go @@ -2,7 +2,7 @@ package redis -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" const ( prioConnections = module.Priority + iota diff --git a/src/go/collectors/go.d.plugin/modules/redis/collect.go b/src/go/plugin/go.d/modules/redis/collect.go index 02616467..02616467 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/collect.go +++ b/src/go/plugin/go.d/modules/redis/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/redis/collect_info.go b/src/go/plugin/go.d/modules/redis/collect_info.go index ce6cae06..81f3646d 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/collect_info.go +++ b/src/go/plugin/go.d/modules/redis/collect_info.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/redis/collect_ping_latency.go b/src/go/plugin/go.d/modules/redis/collect_ping_latency.go index 063673c2..063673c2 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/collect_ping_latency.go +++ b/src/go/plugin/go.d/modules/redis/collect_ping_latency.go diff --git a/src/go/collectors/go.d.plugin/modules/redis/config_schema.json b/src/go/plugin/go.d/modules/redis/config_schema.json index c1ea6768..c57b06ac 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/config_schema.json +++ b/src/go/plugin/go.d/modules/redis/config_schema.json @@ -15,7 +15,7 @@ "title": "URI", "description": "The URI specifying the connection details for the Redis server.", "type": "string", - "default": "redis://@localhost:9221" + "default": "redis://@localhost:6379" }, "timeout": { "title": "Timeout", @@ -83,6 +83,9 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/redis/init.go b/src/go/plugin/go.d/modules/redis/init.go index 6fcf4379..8190be77 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/init.go +++ b/src/go/plugin/go.d/modules/redis/init.go @@ -5,8 +5,8 @@ package redis import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" "github.com/go-redis/redis/v8" ) diff --git a/src/go/collectors/go.d.plugin/modules/redis/integrations/redis.md b/src/go/plugin/go.d/modules/redis/integrations/redis.md index 4bf20074..52dfbf8f 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/integrations/redis.md +++ b/src/go/plugin/go.d/modules/redis/integrations/redis.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/redis/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/redis/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/redis/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/redis/metadata.yaml" sidebar_label: "Redis" learn_status: "Published" learn_rel_path: "Collecting Metrics/Databases" @@ -227,6 +227,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `redis` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -249,4 +251,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m redis ``` +### Getting Logs + +If you're encountering problems with the `redis` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep redis +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep redis /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep redis +``` + diff --git a/src/go/collectors/go.d.plugin/modules/redis/metadata.yaml b/src/go/plugin/go.d/modules/redis/metadata.yaml index 2d94017d..2d94017d 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/metadata.yaml +++ b/src/go/plugin/go.d/modules/redis/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/redis/redis.go b/src/go/plugin/go.d/modules/redis/redis.go index 009f3477..954205e1 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/redis.go +++ b/src/go/plugin/go.d/modules/redis/redis.go @@ -9,10 +9,10 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/blang/semver/v4" "github.com/go-redis/redis/v8" diff --git a/src/go/collectors/go.d.plugin/modules/redis/redis_test.go b/src/go/plugin/go.d/modules/redis/redis_test.go index c96232c3..e295f0f9 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/redis_test.go +++ b/src/go/plugin/go.d/modules/redis/redis_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" "github.com/go-redis/redis/v8" "github.com/stretchr/testify/assert" diff --git a/src/go/collectors/go.d.plugin/modules/redis/testdata/config.json b/src/go/plugin/go.d/modules/redis/testdata/config.json index 050cfa3f..050cfa3f 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/testdata/config.json +++ b/src/go/plugin/go.d/modules/redis/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/redis/testdata/config.yaml b/src/go/plugin/go.d/modules/redis/testdata/config.yaml index 57c5cf7e..57c5cf7e 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/redis/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/redis/testdata/pika/info_all.txt b/src/go/plugin/go.d/modules/redis/testdata/pika/info_all.txt index a2bebf72..a2bebf72 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/testdata/pika/info_all.txt +++ b/src/go/plugin/go.d/modules/redis/testdata/pika/info_all.txt diff --git a/src/go/collectors/go.d.plugin/modules/redis/testdata/v6.0.9/info_all.txt b/src/go/plugin/go.d/modules/redis/testdata/v6.0.9/info_all.txt index 9f161898..9f161898 100644 --- a/src/go/collectors/go.d.plugin/modules/redis/testdata/v6.0.9/info_all.txt +++ b/src/go/plugin/go.d/modules/redis/testdata/v6.0.9/info_all.txt diff --git a/src/go/plugin/go.d/modules/rethinkdb/README.md b/src/go/plugin/go.d/modules/rethinkdb/README.md new file mode 120000 index 00000000..78ddcfa1 --- /dev/null +++ b/src/go/plugin/go.d/modules/rethinkdb/README.md @@ -0,0 +1 @@ +integrations/rethinkdb.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/rethinkdb/charts.go b/src/go/plugin/go.d/modules/rethinkdb/charts.go new file mode 100644 index 00000000..989a8c1e --- /dev/null +++ b/src/go/plugin/go.d/modules/rethinkdb/charts.go @@ -0,0 +1,189 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package rethinkdb + +import ( + "fmt" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioClusterServersStatsRequest = module.Priority + iota + prioClusterClientConnections + prioClusterActiveClients + prioClusterQueries + prioClusterDocuments + + prioServerStatsRequestStatus + prioServerClientConnections + prioServerActiveClients + prioServerQueries + prioServerDocuments +) + +var clusterCharts = module.Charts{ + clusterServersStatsRequestChart.Copy(), + clusterClientConnectionsChart.Copy(), + clusterActiveClientsChart.Copy(), + clusterQueriesChart.Copy(), + clusterDocumentsChart.Copy(), +} + +var ( + clusterServersStatsRequestChart = module.Chart{ + ID: "cluster_cluster_servers_stats_request", + Title: "Cluster Servers Stats Request", + Units: "servers", + Fam: "servers", + Ctx: "rethinkdb.cluster_servers_stats_request", + Priority: prioClusterServersStatsRequest, + Dims: module.Dims{ + {ID: "cluster_servers_stats_request_success", Name: "success"}, + {ID: "cluster_servers_stats_request_timeout", Name: "timeout"}, + }, + } + clusterClientConnectionsChart = module.Chart{ + ID: "cluster_client_connections", + Title: "Cluster Client Connections", + Units: "connections", + Fam: "connections", + Ctx: "rethinkdb.cluster_client_connections", + Priority: prioClusterClientConnections, + Dims: module.Dims{ + {ID: "cluster_client_connections", Name: "connections"}, + }, + } + clusterActiveClientsChart = module.Chart{ + ID: "cluster_active_clients", + Title: "Cluster Active Clients", + Units: "clients", + Fam: "clients", + Ctx: "rethinkdb.cluster_active_clients", + Priority: prioClusterActiveClients, + Dims: module.Dims{ + {ID: "cluster_clients_active", Name: "active"}, + }, + } + clusterQueriesChart = module.Chart{ + ID: "cluster_queries", + Title: "Cluster Queries", + Units: "queries/s", + Fam: "queries", + Ctx: "rethinkdb.cluster_queries", + Priority: prioClusterQueries, + Dims: module.Dims{ + {ID: "cluster_queries_total", Name: "queries", Algo: module.Incremental}, + }, + } + clusterDocumentsChart = module.Chart{ + ID: "cluster_documents", + Title: "Cluster Documents", + Units: "documents/s", + Fam: "documents", + Ctx: "rethinkdb.cluster_documents", + Priority: prioClusterDocuments, + Dims: module.Dims{ + {ID: "cluster_read_docs_total", Name: "read", Algo: module.Incremental}, + {ID: "cluster_written_docs_total", Name: "written", Mul: -1, Algo: module.Incremental}, + }, + } +) + +var serverChartsTmpl = module.Charts{ + serverStatsRequestStatusChartTmpl.Copy(), + serverConnectionsChartTmpl.Copy(), + serverActiveClientsChartTmpl.Copy(), + serverQueriesChartTmpl.Copy(), + serverDocumentsChartTmpl.Copy(), +} + +var ( + serverStatsRequestStatusChartTmpl = module.Chart{ + ID: "server_%s_stats_request_status", + Title: "Server Stats Request Status", + Units: "status", + Fam: "srv status", + Ctx: "rethinkdb.server_stats_request_status", + Priority: prioServerStatsRequestStatus, + Dims: module.Dims{ + {ID: "server_%s_stats_request_status_success", Name: "success"}, + {ID: "server_%s_stats_request_status_timeout", Name: "timeout"}, + }, + } + serverConnectionsChartTmpl = module.Chart{ + ID: "server_%s_client_connections", + Title: "Server Client Connections", + Units: "connections", + Fam: "srv connections", + Ctx: "rethinkdb.server_client_connections", + Priority: prioServerClientConnections, + Dims: module.Dims{ + {ID: "server_%s_client_connections", Name: "connections"}, + }, + } + serverActiveClientsChartTmpl = module.Chart{ + ID: "server_%s_active_clients", + Title: "Server Active Clients", + Units: "clients", + Fam: "srv clients", + Ctx: "rethinkdb.server_active_clients", + Priority: prioServerActiveClients, + Dims: module.Dims{ + {ID: "server_%s_clients_active", Name: "active"}, + }, + } + serverQueriesChartTmpl = module.Chart{ + ID: "server_%s_queries", + Title: "Server Queries", + Units: "queries/s", + Fam: "srv queries", + Ctx: "rethinkdb.server_queries", + Priority: prioServerQueries, + Dims: module.Dims{ + {ID: "server_%s_queries_total", Name: "queries", Algo: module.Incremental}, + }, + } + serverDocumentsChartTmpl = module.Chart{ + ID: "server_%s_documents", + Title: "Server Documents", + Units: "documents/s", + Fam: "srv documents", + Ctx: "rethinkdb.server_documents", + Priority: prioServerDocuments, + Dims: module.Dims{ + {ID: "server_%s_read_docs_total", Name: "read", Algo: module.Incremental}, + {ID: "server_%s_written_docs_total", Name: "written", Mul: -1, Algo: module.Incremental}, + }, + } +) + +func (r *Rethinkdb) addServerCharts(srvUUID, srvName string) { + charts := serverChartsTmpl.Copy() + + for _, chart := range *charts { + chart.ID = fmt.Sprintf(chart.ID, srvUUID) + chart.Labels = []module.Label{ + {Key: "sever_uuid", Value: srvUUID}, + {Key: "sever_name", Value: srvName}, + } + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf(dim.ID, srvUUID) + } + } + + if err := r.Charts().Add(*charts...); err != nil { + r.Warningf("failed to add chart for '%s' server: %v", srvName, err) + } +} + +func (r *Rethinkdb) removeServerCharts(srvUUID string) { + px := fmt.Sprintf("server_%s_", srvUUID) + for _, chart := range *r.Charts() { + if strings.HasPrefix(chart.ID, px) { + chart.MarkRemove() + chart.MarkNotCreated() + } + } +} diff --git a/src/go/plugin/go.d/modules/rethinkdb/client.go b/src/go/plugin/go.d/modules/rethinkdb/client.go new file mode 100644 index 00000000..d790d543 --- /dev/null +++ b/src/go/plugin/go.d/modules/rethinkdb/client.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package rethinkdb + +import ( + "context" + "errors" + "time" + + "gopkg.in/rethinkdb/rethinkdb-go.v6" +) + +type rdbConn interface { + stats() ([][]byte, error) + close() error +} + +func newRethinkdbConn(cfg Config) (rdbConn, error) { + sess, err := rethinkdb.Connect(rethinkdb.ConnectOpts{ + Address: cfg.Address, + Username: cfg.Username, + Password: cfg.Password, + }) + if err != nil { + return nil, err + } + + client := &rethinkdbClient{ + timeout: cfg.Timeout.Duration(), + sess: sess, + } + + return client, nil +} + +type rethinkdbClient struct { + timeout time.Duration + + sess *rethinkdb.Session +} + +func (c *rethinkdbClient) stats() ([][]byte, error) { + ctx, cancel := context.WithTimeout(context.Background(), c.timeout) + defer cancel() + + opts := rethinkdb.RunOpts{Context: ctx} + + cur, err := rethinkdb.DB("rethinkdb").Table("stats").Run(c.sess, opts) + if err != nil { + return nil, err + } + + if cur.IsNil() { + return nil, errors.New("no stats found (cursor is nil)") + } + defer func() { _ = cur.Close() }() + + var stats [][]byte + for { + bs, ok := cur.NextResponse() + if !ok { + break + } + stats = append(stats, bs) + } + + return stats, nil +} + +func (c *rethinkdbClient) close() (err error) { + return c.sess.Close() +} diff --git a/src/go/plugin/go.d/modules/rethinkdb/collect.go b/src/go/plugin/go.d/modules/rethinkdb/collect.go new file mode 100644 index 00000000..6c2bc32c --- /dev/null +++ b/src/go/plugin/go.d/modules/rethinkdb/collect.go @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package rethinkdb + +import ( + "encoding/json" + "errors" + "fmt" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" +) + +type ( + // https://rethinkdb.com/docs/system-stats/ + serverStats struct { + ID []string `json:"id"` + Server string `json:"server"` + QueryEngine struct { + ClientConnections int64 `json:"client_connections" stm:"client_connections"` + ClientsActive int64 `json:"clients_active" stm:"clients_active"` + QueriesTotal int64 `json:"queries_total" stm:"queries_total"` + ReadDocsTotal int64 `json:"read_docs_total" stm:"read_docs_total"` + WrittenDocsTotal int64 `json:"written_docs_total" stm:"written_docs_total"` + } `json:"query_engine" stm:""` + + Error string `json:"error"` + } +) + +func (r *Rethinkdb) collect() (map[string]int64, error) { + if r.rdb == nil { + conn, err := r.newConn(r.Config) + if err != nil { + return nil, err + } + r.rdb = conn + } + + mx := make(map[string]int64) + + if err := r.collectStats(mx); err != nil { + return nil, err + } + + return mx, nil +} + +func (r *Rethinkdb) collectStats(mx map[string]int64) error { + resp, err := r.rdb.stats() + if err != nil { + return err + } + + if len(resp) == 0 { + return errors.New("empty stats response from server") + } + + for _, v := range []string{ + "cluster_servers_stats_request_success", + "cluster_servers_stats_request_timeout", + "cluster_client_connections", + "cluster_clients_active", + "cluster_queries_total", + "cluster_read_docs_total", + "cluster_written_docs_total", + } { + mx[v] = 0 + } + + seen := make(map[string]bool) + + for _, bs := range resp[1:] { // skip cluster + var srv serverStats + + if err := json.Unmarshal(bs, &srv); err != nil { + return fmt.Errorf("invalid stats response: failed to unmarshal server data: %v", err) + } + if len(srv.ID[0]) == 0 { + return errors.New("invalid stats response: empty id") + } + if srv.ID[0] != "server" { + continue + } + if len(srv.ID) != 2 { + return fmt.Errorf("invalid stats response: unexpected server id: '%v'", srv.ID) + } + + srvUUID := srv.ID[1] + + seen[srvUUID] = true + + if !r.seenServers[srvUUID] { + r.seenServers[srvUUID] = true + r.addServerCharts(srvUUID, srv.Server) + } + + px := fmt.Sprintf("server_%s_", srv.ID[1]) // uuid + + mx[px+"stats_request_status_success"] = 0 + mx[px+"stats_request_status_timeout"] = 0 + if srv.Error != "" { + mx["cluster_servers_stats_request_timeout"]++ + mx[px+"stats_request_status_timeout"] = 1 + continue + } + mx["cluster_servers_stats_request_success"]++ + mx[px+"stats_request_status_success"] = 1 + + for k, v := range stm.ToMap(srv.QueryEngine) { + mx["cluster_"+k] += v + mx[px+k] = v + } + } + + for k := range r.seenServers { + if !seen[k] { + delete(r.seenServers, k) + r.removeServerCharts(k) + } + } + + return nil +} diff --git a/src/go/plugin/go.d/modules/rethinkdb/config_schema.json b/src/go/plugin/go.d/modules/rethinkdb/config_schema.json new file mode 100644 index 00000000..9a84aeca --- /dev/null +++ b/src/go/plugin/go.d/modules/rethinkdb/config_schema.json @@ -0,0 +1,82 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RethinkDB collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "address": { + "title": "Address", + "description": "The IP address and port where the RethinkDB service listens for connections.", + "type": "string", + "default": "127.0.0.1:28015" + }, + "timeout": { + "title": "Timeout", + "description": "Timeout for establishing a connection and communication (reading and writing) in seconds.", + "type": "number", + "minimum": 0.5, + "default": 1 + }, + "username": { + "title": "Username", + "description": "The username for basic authentication.", + "type": "string", + "sensitive": true + }, + "password": { + "title": "Password", + "description": "The password for basic authentication.", + "type": "string", + "sensitive": true + } + }, + "required": [ + "address" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + }, + "username": { + "ui:widget": "password" + }, + "password": { + "ui:widget": "password" + }, + "ui:flavour": "tabs", + "ui:options": { + "tabs": [ + { + "title": "Base", + "fields": [ + "update_every", + "address", + "timeout" + ] + }, + { + "title": "Auth", + "fields": [ + "username", + "password" + ] + } + ] + } + } +} diff --git a/src/go/plugin/go.d/modules/rethinkdb/integrations/rethinkdb.md b/src/go/plugin/go.d/modules/rethinkdb/integrations/rethinkdb.md new file mode 100644 index 00000000..3cc116e4 --- /dev/null +++ b/src/go/plugin/go.d/modules/rethinkdb/integrations/rethinkdb.md @@ -0,0 +1,257 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/rethinkdb/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/rethinkdb/metadata.yaml" +sidebar_label: "RethinkDB" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Databases" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# RethinkDB + + +<img src="https://netdata.cloud/img/rethinkdb.png" width="150"/> + + +Plugin: go.d.plugin +Module: rethinkdb + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +It collects cluster-wide metrics such as server status, client connections, active clients, query rate, and document read/write rates. +For each server, it offers similar metrics. + + +The data is gathered by querying the stats table in RethinkDB, which stores real-time statistics related to the cluster and its individual servers. + + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +If no configuration is given, collector will attempt to connect to RethinkDB instance on `127.0.0.1:28015` address. + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per RethinkDB instance + +These metrics refer to the entire monitored application. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| rethinkdb.cluster_servers_stats_request | success, timeout | servers | +| rethinkdb.cluster_client_connections | connections | connections | +| rethinkdb.cluster_active_clients | active | clients | +| rethinkdb.cluster_queries | queries | queries/s | +| rethinkdb.cluster_documents | read, written | documents/s | + +### Per server + +These metrics refer to the server (cluster member). + +Labels: + +| Label | Description | +|:-----------|:----------------| +| server_uuid | Server UUID. | +| server_name | Server name. | + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| rethinkdb.server_stats_request_status | success, timeout | status | +| rethinkdb.server_client_connections | connections | connections | +| rethinkdb.server_active_clients | active | clients | +| rethinkdb.server_queries | queries | queries/s | +| rethinkdb.server_documents | read, written | documents/s | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +No action required. + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/rethinkdb.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/rethinkdb.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| address | The IP address and port where the RethinkDB service listens for connections. | 127.0.0.1:28015 | yes | +| timeout | Connection, read, and write timeout duration in seconds. The timeout includes name resolution. | 1 | no | +| username | Username used for authentication. | | no | +| password | Password used for authentication. | | no | + +</details> + +#### Examples + +##### Basic + +A basic example configuration. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:28015 + +``` +</details> + +##### With authentication + +An example configuration with authentication. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:28015 + username: name + password: pass + +``` +</details> + +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:28015 + + - name: remote + address: 203.0.113.0:28015 + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `rethinkdb` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m rethinkdb + ``` + +### Getting Logs + +If you're encountering problems with the `rethinkdb` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep rethinkdb +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep rethinkdb /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep rethinkdb +``` + + diff --git a/src/go/plugin/go.d/modules/rethinkdb/metadata.yaml b/src/go/plugin/go.d/modules/rethinkdb/metadata.yaml new file mode 100644 index 00000000..057d71a0 --- /dev/null +++ b/src/go/plugin/go.d/modules/rethinkdb/metadata.yaml @@ -0,0 +1,198 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-rethinkdb + plugin_name: go.d.plugin + module_name: rethinkdb + monitored_instance: + name: RethinkDB + link: https://rethinkdb.com + categories: + - data-collection.database-servers + icon_filename: "rethinkdb.png" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - rethinkdb + - database + - db + most_popular: false + overview: + data_collection: + metrics_description: | + It collects cluster-wide metrics such as server status, client connections, active clients, query rate, and document read/write rates. + For each server, it offers similar metrics. + method_description: | + The data is gathered by querying the stats table in RethinkDB, which stores real-time statistics related to the cluster and its individual servers. + supported_platforms: + include: [] + exclude: [] + multi_instance: true + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: | + If no configuration is given, collector will attempt to connect to RethinkDB instance on `127.0.0.1:28015` address. + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: [] + configuration: + file: + name: go.d/rethinkdb.conf + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: address + description: The IP address and port where the RethinkDB service listens for connections. + default_value: 127.0.0.1:28015 + required: true + - name: timeout + description: Connection, read, and write timeout duration in seconds. The timeout includes name resolution. + default_value: 1 + required: false + - name: username + description: Username used for authentication. + default_value: "" + required: false + - name: password + description: Password used for authentication. + default_value: "" + required: false + examples: + folding: + title: Config + enabled: true + list: + - name: Basic + description: A basic example configuration. + config: | + jobs: + - name: local + address: 127.0.0.1:28015 + - name: With authentication + description: An example configuration with authentication. + config: | + jobs: + - name: local + address: 127.0.0.1:28015 + username: name + password: pass + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + address: 127.0.0.1:28015 + + - name: remote + address: 203.0.113.0:28015 + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: "These metrics refer to the entire monitored application." + labels: [] + metrics: + - name: rethinkdb.cluster_servers_stats_request + description: Cluster Servers Stats Request + unit: "servers" + chart_type: line + dimensions: + - name: success + - name: timeout + - name: rethinkdb.cluster_client_connections + description: Cluster Client Connections + unit: "connections" + chart_type: line + dimensions: + - name: connections + - name: rethinkdb.cluster_active_clients + description: Cluster Active Clients + unit: "clients" + chart_type: line + dimensions: + - name: active + - name: rethinkdb.cluster_queries + description: Cluster Queries + unit: "queries/s" + chart_type: line + dimensions: + - name: queries + - name: rethinkdb.cluster_documents + description: Cluster Documents + unit: "documents/s" + chart_type: line + dimensions: + - name: read + - name: written + - name: server + description: "These metrics refer to the server (cluster member)." + labels: + - name: server_uuid + description: Server UUID. + - name: server_name + description: Server name. + metrics: + - name: rethinkdb.server_stats_request_status + description: Server Stats Request Status + unit: "status" + chart_type: line + dimensions: + - name: success + - name: timeout + - name: rethinkdb.server_client_connections + description: Server Client Connections + unit: "connections" + chart_type: line + dimensions: + - name: connections + - name: rethinkdb.server_active_clients + description: Server Active Clients + unit: "clients" + chart_type: line + dimensions: + - name: active + - name: rethinkdb.server_queries + description: Server Queries + unit: "queries/s" + chart_type: line + dimensions: + - name: queries + - name: rethinkdb.server_documents + description: Server Documents + unit: "documents/s" + chart_type: line + dimensions: + - name: read + - name: written diff --git a/src/go/plugin/go.d/modules/rethinkdb/rethinkdb.go b/src/go/plugin/go.d/modules/rethinkdb/rethinkdb.go new file mode 100644 index 00000000..ccde593d --- /dev/null +++ b/src/go/plugin/go.d/modules/rethinkdb/rethinkdb.go @@ -0,0 +1,107 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package rethinkdb + +import ( + _ "embed" + "errors" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("rethinkdb", module.Creator{ + JobConfigSchema: configSchema, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Rethinkdb { + return &Rethinkdb{ + Config: Config{ + Address: "127.0.0.1:28015", + Timeout: web.Duration(time.Second * 1), + }, + + charts: clusterCharts.Copy(), + newConn: newRethinkdbConn, + seenServers: make(map[string]bool), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Address string `yaml:"address" json:"address"` + Timeout web.Duration `yaml:"timeout,omitempty" json:"timeout"` + Username string `yaml:"username,omitempty" json:"username"` + Password string `yaml:"password,omitempty" json:"password"` +} + +type ( + Rethinkdb struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + newConn func(cfg Config) (rdbConn, error) + rdb rdbConn + + seenServers map[string]bool + } +) + +func (r *Rethinkdb) Configuration() any { + return r.Config +} + +func (r *Rethinkdb) Init() error { + if r.Address == "" { + r.Error("address is not set") + return errors.New("address is not set") + } + return nil +} + +func (r *Rethinkdb) Check() error { + mx, err := r.collect() + if err != nil { + r.Error(err) + return err + } + if len(mx) == 0 { + return errors.New("no metrics collected") + } + return nil +} + +func (r *Rethinkdb) Charts() *module.Charts { + return r.charts +} + +func (r *Rethinkdb) Collect() map[string]int64 { + ms, err := r.collect() + if err != nil { + r.Error(err) + } + + if len(ms) == 0 { + return nil + } + return ms +} + +func (r *Rethinkdb) Cleanup() { + if r.rdb != nil { + if err := r.rdb.close(); err != nil { + r.Warningf("cleanup: error on closing client [%s]: %v", r.Address, err) + } + r.rdb = nil + } +} diff --git a/src/go/plugin/go.d/modules/rethinkdb/rethinkdb_test.go b/src/go/plugin/go.d/modules/rethinkdb/rethinkdb_test.go new file mode 100644 index 00000000..f23c4974 --- /dev/null +++ b/src/go/plugin/go.d/modules/rethinkdb/rethinkdb_test.go @@ -0,0 +1,267 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package rethinkdb + +import ( + "bytes" + "errors" + "fmt" + "os" + "strings" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataStats, _ = os.ReadFile("testdata/v2.4.4/stats.txt") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + + "dataStats": dataStats, + } { + require.NotNil(t, data, name) + } +} + +func TestRethinkdb_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &Rethinkdb{}, dataConfigJSON, dataConfigYAML) +} + +func TestRethinkdb_Init(t *testing.T) { + tests := map[string]struct { + config Config + wantFail bool + }{ + "success with default config": { + wantFail: false, + config: New().Config, + }, + "fails if address not set": { + wantFail: true, + config: func() Config { + conf := New().Config + conf.Address = "" + return conf + }(), + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + rdb := New() + rdb.Config = test.config + + if test.wantFail { + assert.Error(t, rdb.Init()) + } else { + assert.NoError(t, rdb.Init()) + } + }) + } +} + +func TestRethinkdb_Cleanup(t *testing.T) { + tests := map[string]struct { + prepare func() *Rethinkdb + }{ + "not initialized": { + prepare: func() *Rethinkdb { + return New() + }, + }, + "after check": { + prepare: func() *Rethinkdb { + rdb := New() + rdb.newConn = func(config Config) (rdbConn, error) { + return &mockRethinkdbConn{dataStats: dataStats}, nil + } + _ = rdb.Check() + return rdb + }, + }, + "after collect": { + prepare: func() *Rethinkdb { + rdb := New() + rdb.newConn = func(config Config) (rdbConn, error) { + return &mockRethinkdbConn{dataStats: dataStats}, nil + } + _ = rdb.Check() + return rdb + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + rdb := test.prepare() + + assert.NotPanics(t, rdb.Cleanup) + }) + } +} + +func TestRethinkdb_Check(t *testing.T) { + tests := map[string]struct { + prepare func() *Rethinkdb + wantFail bool + }{ + "success on valid response": { + wantFail: false, + prepare: prepareCaseOk, + }, + "fails if error on stats": { + wantFail: true, + prepare: prepareCaseErrOnStats, + }, + "fails if error on connect": { + wantFail: true, + prepare: prepareCaseErrOnConnect, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + rdb := test.prepare() + + if test.wantFail { + assert.Error(t, rdb.Check()) + } else { + assert.NoError(t, rdb.Check()) + } + + if m, ok := rdb.rdb.(*mockRethinkdbConn); ok { + assert.False(t, m.disconnectCalled, "rdb close before cleanup") + rdb.Cleanup() + assert.True(t, m.disconnectCalled, "rdb close after cleanup") + } + }) + } +} + +func TestRethinkdb_Collect(t *testing.T) { + tests := map[string]struct { + prepare func() *Rethinkdb + wantMetrics map[string]int64 + wantCharts int + skipChart func(chart *module.Chart) bool + }{ + "success on valid response": { + prepare: prepareCaseOk, + wantCharts: len(clusterCharts) + len(serverChartsTmpl)*3, + skipChart: func(chart *module.Chart) bool { + return strings.HasPrefix(chart.ID, "server_0f74c641-af5f-48d6-a005-35b8983c576a") && + !strings.Contains(chart.ID, "stats_request_status") + }, + wantMetrics: map[string]int64{ + "cluster_client_connections": 3, + "cluster_clients_active": 3, + "cluster_queries_total": 27, + "cluster_read_docs_total": 3, + "cluster_servers_stats_request_success": 2, + "cluster_servers_stats_request_timeout": 1, + "cluster_written_docs_total": 3, + "server_0f74c641-af5f-48d6-a005-35b8983c576a_stats_request_status_success": 0, + "server_0f74c641-af5f-48d6-a005-35b8983c576a_stats_request_status_timeout": 1, + "server_b7730db2-4303-4719-aef8-2a3c339c672b_client_connections": 1, + "server_b7730db2-4303-4719-aef8-2a3c339c672b_clients_active": 1, + "server_b7730db2-4303-4719-aef8-2a3c339c672b_queries_total": 13, + "server_b7730db2-4303-4719-aef8-2a3c339c672b_read_docs_total": 1, + "server_b7730db2-4303-4719-aef8-2a3c339c672b_stats_request_status_success": 1, + "server_b7730db2-4303-4719-aef8-2a3c339c672b_stats_request_status_timeout": 0, + "server_b7730db2-4303-4719-aef8-2a3c339c672b_written_docs_total": 1, + "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_client_connections": 2, + "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_clients_active": 2, + "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_queries_total": 14, + "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_read_docs_total": 2, + "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_stats_request_status_success": 1, + "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_stats_request_status_timeout": 0, + "server_f325e3c3-22d9-4005-b4b2-1f561d384edc_written_docs_total": 2, + }, + }, + "fails if error on stats": { + wantCharts: len(clusterCharts), + prepare: prepareCaseErrOnStats, + }, + "fails if error on connect": { + wantCharts: len(clusterCharts), + prepare: prepareCaseErrOnStats, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + rdb := test.prepare() + + require.NoError(t, rdb.Init()) + + mx := rdb.Collect() + + require.Equal(t, test.wantMetrics, mx) + + assert.Equal(t, test.wantCharts, len(*rdb.Charts())) + + if len(test.wantMetrics) > 0 { + module.TestMetricsHasAllChartsDimsSkip(t, rdb.Charts(), mx, test.skipChart) + } + + if m, ok := rdb.rdb.(*mockRethinkdbConn); ok { + assert.False(t, m.disconnectCalled, "rdb close before cleanup") + rdb.Cleanup() + assert.True(t, m.disconnectCalled, "rdb close after cleanup") + } + }) + } +} + +func prepareCaseOk() *Rethinkdb { + rdb := New() + rdb.newConn = func(cfg Config) (rdbConn, error) { + return &mockRethinkdbConn{dataStats: dataStats}, nil + } + return rdb +} + +func prepareCaseErrOnStats() *Rethinkdb { + rdb := New() + rdb.newConn = func(cfg Config) (rdbConn, error) { + return &mockRethinkdbConn{errOnStats: true}, nil + } + return rdb +} + +func prepareCaseErrOnConnect() *Rethinkdb { + rdb := New() + rdb.newConn = func(cfg Config) (rdbConn, error) { + return nil, errors.New("mock failed to connect") + } + return rdb +} + +type mockRethinkdbConn struct { + dataStats []byte + errOnStats bool + disconnectCalled bool +} + +func (m *mockRethinkdbConn) stats() ([][]byte, error) { + if m.errOnStats { + return nil, fmt.Errorf("mock.stats() error") + } + return bytes.Split(bytes.TrimSpace(m.dataStats), []byte("\n")), nil +} + +func (m *mockRethinkdbConn) close() error { + m.disconnectCalled = true + return nil +} diff --git a/src/go/plugin/go.d/modules/rethinkdb/testdata/config.json b/src/go/plugin/go.d/modules/rethinkdb/testdata/config.json new file mode 100644 index 00000000..47f755ea --- /dev/null +++ b/src/go/plugin/go.d/modules/rethinkdb/testdata/config.json @@ -0,0 +1,7 @@ +{ + "update_every": 123, + "address": "ok", + "timeout": 123.123, + "username": "ok", + "password": "ok" +} diff --git a/src/go/plugin/go.d/modules/rethinkdb/testdata/config.yaml b/src/go/plugin/go.d/modules/rethinkdb/testdata/config.yaml new file mode 100644 index 00000000..6857aae7 --- /dev/null +++ b/src/go/plugin/go.d/modules/rethinkdb/testdata/config.yaml @@ -0,0 +1,5 @@ +update_every: 123 +address: "ok" +timeout: 123.123 +username: "ok" +password: "ok" diff --git a/src/go/plugin/go.d/modules/rethinkdb/testdata/v2.4.4/stats.txt b/src/go/plugin/go.d/modules/rethinkdb/testdata/v2.4.4/stats.txt new file mode 100644 index 00000000..0d3ab6a6 --- /dev/null +++ b/src/go/plugin/go.d/modules/rethinkdb/testdata/v2.4.4/stats.txt @@ -0,0 +1,4 @@ +{"id":["cluster"],"query_engine":{"client_connections":1,"clients_active":1,"queries_per_sec":1,"read_docs_per_sec":0,"written_docs_per_sec":0}} +{"id":["server","b7730db2-4303-4719-aef8-2a3c339c672b"],"query_engine":{"client_connections":1,"clients_active":1,"queries_per_sec":1,"queries_total":13,"read_docs_per_sec":0,"read_docs_total":1,"written_docs_per_sec":0,"written_docs_total":1},"server":"some_hostname_182"} +{"id":["server","f325e3c3-22d9-4005-b4b2-1f561d384edc"],"query_engine":{"client_connections":2,"clients_active":2,"queries_per_sec":1,"queries_total":14,"read_docs_per_sec":0,"read_docs_total":2,"written_docs_per_sec":0,"written_docs_total":2},"server":"pve_deb_work_183"} +{"id":["server","0f74c641-af5f-48d6-a005-35b8983c576a"],"server":"pve_deb_work_184","error":"Timed out. Unable to retrieve stats."} diff --git a/src/go/plugin/go.d/modules/riakkv/README.md b/src/go/plugin/go.d/modules/riakkv/README.md new file mode 120000 index 00000000..96384375 --- /dev/null +++ b/src/go/plugin/go.d/modules/riakkv/README.md @@ -0,0 +1 @@ +integrations/riak_kv.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/riakkv/charts.go b/src/go/plugin/go.d/modules/riakkv/charts.go new file mode 100644 index 00000000..345f01d6 --- /dev/null +++ b/src/go/plugin/go.d/modules/riakkv/charts.go @@ -0,0 +1,461 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package riakkv + +import ( + "slices" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioKvNodeOperations = module.Priority + iota + prioDtVnodeUpdates + prioSearchQueries + prioSearchDocuments + prioConsistentOperations + + prioKvLatencyGet + prioKvLatencyPut + prioDtLatencyCounter + prioDtLatencySet + prioDtLatencyMap + prioSearchLatencyQuery + prioSearchLatencyIndex + prioConsistentLatencyGet + prioConsistentLatencyPut + + prioVmProcessesCount + prioVmProcessesMemory + + prioKvSiblingsEncounteredGet + prioKvObjSizeGet + prioSearchVnodeqSize + prioSearchIndexErrors + prioCorePbc + prioCoreRepairs + prioCoreFsmActive + prioCoreFsmREjected +) + +var charts = module.Charts{ + kvNodeOperationsChart.Copy(), + dtVnodeUpdatesChart.Copy(), + searchQueriesChart.Copy(), + searchDocumentsChart.Copy(), + consistentOperationsChart.Copy(), + + kvLatencyGetChart.Copy(), + kvLatencyPutChart.Copy(), + dtLatencyCounterChart.Copy(), + dtLatencySetChart.Copy(), + dtLatencyMapChart.Copy(), + searchLatencyQueryChart.Copy(), + searchLatencyIndexChart.Copy(), + consistentLatencyGetChart.Copy(), + consistentLatencyPutChart.Copy(), + + vmProcessesCountChart.Copy(), + vmProcessesMemoryChart.Copy(), + + kvSiblingsEncounteredGetChart.Copy(), + kvObjectSizeGetChart.Copy(), + searchVnodeqSizeChart.Copy(), + searchIndexErrorsChart.Copy(), + corePbsChart.Copy(), + coreRepairsChart.Copy(), + coreFsmActiveChart.Copy(), + coreFsmRejectedChart.Copy(), +} + +/* +Throughput metrics +https://docs.riak.com/riak/kv/latest/using/reference/statistics-monitoring/index.html#throughput-metrics + +Collected in totals +*/ +var ( + kvNodeOperationsChart = module.Chart{ + ID: "kv_node_operations", + Title: "Reads & writes coordinated by this node", + Units: "operations/s", + Fam: "throughput", + Ctx: "riak.kv.throughput", + Priority: prioKvNodeOperations, + Dims: module.Dims{ + {ID: "node_gets_total", Name: "gets", Algo: module.Incremental}, + {ID: "node_puts_total", Name: "puts", Algo: module.Incremental}, + }, + } + dtVnodeUpdatesChart = module.Chart{ + ID: "dt_vnode_updates", + Title: "Update operations coordinated by local vnodes by data type", + Units: "operations/s", + Fam: "throughput", + Ctx: "riak.dt.vnode_updates", + Priority: prioDtVnodeUpdates, + Dims: module.Dims{ + {ID: "vnode_counter_update_total", Name: "counters", Algo: module.Incremental}, + {ID: "vnode_set_update_total", Name: "sets", Algo: module.Incremental}, + {ID: "vnode_map_update_total", Name: "maps", Algo: module.Incremental}, + }, + } + searchQueriesChart = module.Chart{ + ID: "dt_vnode_updates", + Title: "Search queries on the node", + Units: "queries/s", + Fam: "throughput", + Ctx: "riak.search", + Priority: prioSearchQueries, + Dims: module.Dims{ + {ID: "search_query_throughput_count", Name: "queries", Algo: module.Incremental}, + }, + } + searchDocumentsChart = module.Chart{ + ID: "search_documents", + Title: "Documents indexed by search", + Units: "documents/s", + Fam: "throughput", + Ctx: "riak.search.documents", + Priority: prioSearchDocuments, + Dims: module.Dims{ + {ID: "search_index_throughput_count", Name: "indexed", Algo: module.Incremental}, + }, + } + consistentOperationsChart = module.Chart{ + ID: "consistent_operations", + Title: "Consistent node operations", + Units: "operations/s", + Fam: "throughput", + Ctx: "riak.consistent.operations", + Priority: prioConsistentOperations, + Dims: module.Dims{ + {ID: "consistent_gets_total", Name: "gets", Algo: module.Incremental}, + {ID: "consistent_puts_total", Name: "puts", Algo: module.Incremental}, + }, + } +) + +/* +Latency metrics +https://docs.riak.com/riak/kv/latest/using/reference/statistics-monitoring/index.html#throughput-metrics + +Collected for the past minute in milliseconds and +returned from Riak in microseconds. +*/ +var ( + kvLatencyGetChart = module.Chart{ + ID: "kv_latency_get", + Title: "Time between reception of a client GET request and subsequent response to client", + Units: "ms", + Fam: "latency", + Ctx: "riak.kv.latency.get", + Priority: prioKvLatencyGet, + Dims: module.Dims{ + {ID: "node_get_fsm_time_mean", Name: "mean", Div: 1000}, + {ID: "node_get_fsm_time_median", Name: "median", Div: 1000}, + {ID: "node_get_fsm_time_95", Name: "95", Div: 1000}, + {ID: "node_get_fsm_time_99", Name: "99", Div: 1000}, + {ID: "node_get_fsm_time_100", Name: "100", Div: 1000}, + }, + } + kvLatencyPutChart = module.Chart{ + ID: "kv_latency_put", + Title: "Time between reception of a client PUT request and subsequent response to client", + Units: "ms", + Fam: "latency", + Ctx: "riak.kv.latency.put", + Priority: prioKvLatencyPut, + Dims: module.Dims{ + {ID: "node_put_fsm_time_mean", Name: "mean", Div: 1000}, + {ID: "node_put_fsm_time_median", Name: "median", Div: 1000}, + {ID: "node_put_fsm_time_95", Name: "95", Div: 1000}, + {ID: "node_put_fsm_time_99", Name: "99", Div: 1000}, + {ID: "node_put_fsm_time_100", Name: "100", Div: 1000}, + }, + } + dtLatencyCounterChart = module.Chart{ + ID: "dt_latency_counter", + Title: "Time it takes to perform an Update Counter operation", + Units: "ms", + Fam: "latency", + Ctx: "riak.dt.latency.counter_merge", + Priority: prioDtLatencyCounter, + Dims: module.Dims{ + {ID: "object_counter_merge_time_mean", Name: "mean", Div: 1000}, + {ID: "object_counter_merge_time_median", Name: "median", Div: 1000}, + {ID: "object_counter_merge_time_95", Name: "95", Div: 1000}, + {ID: "object_counter_merge_time_99", Name: "99", Div: 1000}, + {ID: "object_counter_merge_time_100", Name: "100", Div: 1000}, + }, + } + dtLatencySetChart = module.Chart{ + ID: "dt_latency_counter", + Title: "Time it takes to perform an Update Set operation", + Units: "ms", + Fam: "latency", + Ctx: "riak.dt.latency.set_merge", + Priority: prioDtLatencySet, + Dims: module.Dims{ + {ID: "object_set_merge_time_mean", Name: "mean", Div: 1000}, + {ID: "object_set_merge_time_median", Name: "median", Div: 1000}, + {ID: "object_set_merge_time_95", Name: "95", Div: 1000}, + {ID: "object_set_merge_time_99", Name: "99", Div: 1000}, + {ID: "object_set_merge_time_100", Name: "100", Div: 1000}, + }, + } + dtLatencyMapChart = module.Chart{ + ID: "dt_latency_map", + Title: "Time it takes to perform an Update Map operation", + Units: "ms", + Fam: "latency", + Ctx: "riak.dt.latency.map_merge", + Priority: prioDtLatencyMap, + Dims: module.Dims{ + {ID: "object_map_merge_time_mean", Name: "mean", Div: 1000}, + {ID: "object_map_merge_time_median", Name: "median", Div: 1000}, + {ID: "object_map_merge_time_95", Name: "95", Div: 1000}, + {ID: "object_map_merge_time_99", Name: "99", Div: 1000}, + {ID: "object_map_merge_time_100", Name: "100", Div: 1000}, + }, + } + searchLatencyQueryChart = module.Chart{ + ID: "search_latency_query", + Title: "Search query latency", + Units: "ms", + Fam: "latency", + Ctx: "riak.search.latency.query", + Priority: prioSearchLatencyQuery, + Dims: module.Dims{ + {ID: "search_query_latency_median", Name: "median", Div: 1000}, + {ID: "search_query_latency_min", Name: "min", Div: 1000}, + {ID: "search_query_latency_95", Name: "95", Div: 1000}, + {ID: "search_query_latency_99", Name: "99", Div: 1000}, + {ID: "search_query_latency_999", Name: "999", Div: 1000}, + {ID: "search_query_latency_max", Name: "max", Div: 1000}, + }, + } + searchLatencyIndexChart = module.Chart{ + ID: "search_latency_index", + Title: "Time it takes Search to index a new document", + Units: "ms", + Fam: "latency", + Ctx: "riak.search.latency.index", + Priority: prioSearchLatencyIndex, + Dims: module.Dims{ + {ID: "search_index_latency_median", Name: "median", Div: 1000}, + {ID: "search_index_latency_min", Name: "min", Div: 1000}, + {ID: "search_index_latency_95", Name: "95", Div: 1000}, + {ID: "search_index_latency_99", Name: "99", Div: 1000}, + {ID: "search_index_latency_999", Name: "999", Div: 1000}, + {ID: "search_index_latency_max", Name: "max", Div: 1000}, + }, + } + consistentLatencyGetChart = module.Chart{ + ID: "consistent_latency_get", + Title: "Strongly consistent read latency", + Units: "ms", + Fam: "latency", + Ctx: "riak.consistent.latency.get", + Priority: prioConsistentLatencyGet, + Dims: module.Dims{ + {ID: "consistent_get_time_mean", Name: "mean", Div: 1000}, + {ID: "consistent_get_time_median", Name: "median", Div: 1000}, + {ID: "consistent_get_time_95", Name: "95", Div: 1000}, + {ID: "consistent_get_time_99", Name: "99", Div: 1000}, + {ID: "consistent_get_time_100", Name: "100", Div: 1000}, + }, + } + consistentLatencyPutChart = module.Chart{ + ID: "consistent_latency_put", + Title: "Strongly consistent write latency", + Units: "ms", + Fam: "latency", + Ctx: "riak.consistent.latency.put", + Priority: prioConsistentLatencyPut, + Dims: module.Dims{ + {ID: "consistent_put_time_mean", Name: "mean", Div: 1000}, + {ID: "consistent_put_time_median", Name: "median", Div: 1000}, + {ID: "consistent_put_time_95", Name: "95", Div: 1000}, + {ID: "consistent_put_time_99", Name: "99", Div: 1000}, + {ID: "consistent_put_time_100", Name: "100", Div: 1000}, + }, + } +) + +/* +Erlang's resource usage metrics +https://docs.riak.com/riak/kv/latest/using/reference/statistics-monitoring/index.html#erlang-resource-usage-metrics + +Processes collected as a gauge. +Memory collected as Megabytes, returned as bytes from Riak. +*/ +var ( + vmProcessesCountChart = module.Chart{ + ID: "vm_processes", + Title: "Total processes running in the Erlang VM", + Units: "processes", + Fam: "vm", + Ctx: "riak.vm.processes.count", + Priority: prioVmProcessesCount, + Dims: module.Dims{ + {ID: "sys_processes", Name: "processes"}, + }, + } + vmProcessesMemoryChart = module.Chart{ + ID: "vm_processes", + Title: "Memory allocated & used by Erlang processes", + Units: "bytes", + Fam: "vm", + Ctx: "riak.vm.processes.memory", + Priority: prioVmProcessesMemory, + Dims: module.Dims{ + {ID: "memory_processes", Name: "allocated"}, + {ID: "memory_processes_used", Name: "used"}, + }, + } +) + +/* +General Riak Load / Health metrics +https://docs.riak.com/riak/kv/latest/using/reference/statistics-monitoring/index.html#general-riak-load-health-metrics +*/ +var ( + // General Riak Load / Health metrics + // https://docs.riak.com/riak/kv/latest/using/reference/statistics-monitoring/index.html#general-riak-load-health-metrics + // Collected by Riak over the past minute + + kvSiblingsEncounteredGetChart = module.Chart{ + ID: "kv_siblings_encountered_get", + Title: "Siblings encountered during GET operations by this node during the past minute", + Units: "siblings", + Fam: "load", + Ctx: "riak.kv.siblings_encountered.get", + Priority: prioKvSiblingsEncounteredGet, + Dims: module.Dims{ + {ID: "node_get_fsm_siblings_mean", Name: "mean"}, + {ID: "node_get_fsm_siblings_median", Name: "median"}, + {ID: "node_get_fsm_siblings_95", Name: "95"}, + {ID: "node_get_fsm_siblings_99", Name: "99"}, + {ID: "node_get_fsm_siblings_100", Name: "100"}, + }, + } + kvObjectSizeGetChart = module.Chart{ + ID: "kv_siblings_encountered_get", + Title: "Object size encountered by this node during the past minute", + Units: "bytes", + Fam: "load", + Ctx: "riak.kv.objsize.get", + Priority: prioKvObjSizeGet, + Dims: module.Dims{ + {ID: "node_get_fsm_objsize_mean", Name: "mean"}, + {ID: "node_get_fsm_objsize_median", Name: "median"}, + {ID: "node_get_fsm_objsize_95", Name: "95"}, + {ID: "node_get_fsm_objsize_99", Name: "99"}, + {ID: "node_get_fsm_objsize_100", Name: "100"}, + }, + } + searchVnodeqSizeChart = module.Chart{ + ID: "kv_siblings_encountered_get", + Title: "Unprocessed messages in the vnode message queues of Search in the past minute", + Units: "messages", + Fam: "load", + Ctx: "riak.search.vnodeq_size", + Priority: prioSearchVnodeqSize, + Dims: module.Dims{ + {ID: "riak_search_vnodeq_mean", Name: "mean"}, + {ID: "riak_search_vnodeq_median", Name: "median"}, + {ID: "riak_search_vnodeq_95", Name: "95"}, + {ID: "riak_search_vnodeq_99", Name: "99"}, + {ID: "riak_search_vnodeq_100", Name: "100"}, + }, + } + + // General Riak Search Load / Health metrics + // https://docs.riak.com/riak/kv/latest/using/reference/statistics-monitoring/index.html#general-riak-search-load-health-metrics + // https://docs.riak.com/riak/kv/latest/using/reference/statistics-monitoring/index.html#general-riak-search-load-health-metrics + // Reported as counters. + + searchIndexErrorsChart = module.Chart{ + ID: "search_index_errors", + Title: "Errors encountered by Search", + Units: "errors", + Fam: "load", + Ctx: "riak.search.index.errors", + Priority: prioSearchIndexErrors, + Dims: module.Dims{ + {ID: "search_index_fail_count", Name: "index_fail"}, + {ID: "search_index_bad_entry_count", Name: "bad_entry"}, + {ID: "search_index_extract_fail_count", Name: "extract_fail"}, + }, + } + corePbsChart = module.Chart{ + ID: "core_pbc", + Title: "Protocol buffer connections by status", + Units: "connections", + Fam: "load", + Ctx: "riak.core.protobuf_connections", + Priority: prioCorePbc, + Dims: module.Dims{ + {ID: "pbc_active", Name: "active"}, + }, + } + coreRepairsChart = module.Chart{ + ID: "core_repairs", + Title: "Number of repair operations this node has coordinated", + Units: "repairs", + Fam: "load", + Ctx: "riak.core.protobuf_connections", + Priority: prioCoreRepairs, + Dims: module.Dims{ + {ID: "read_repairs", Name: "read"}, + }, + } + coreFsmActiveChart = module.Chart{ + ID: "core_fsm_active", + Title: "Active finite state machines by kind", + Units: "fsms", + Fam: "load", + Ctx: "riak.core.fsm_active", + Priority: prioCoreFsmActive, + Dims: module.Dims{ + {ID: "node_get_fsm_active", Name: "get"}, + {ID: "node_put_fsm_active", Name: "put"}, + {ID: "index_fsm_active", Name: "secondary_index"}, + {ID: "list_fsm_active", Name: "list_keys"}, + }, + } + coreFsmRejectedChart = module.Chart{ + ID: "core_fsm_rejected", + Title: "Finite state machines being rejected by Sidejobs overload protection", + Units: "fsms", + Fam: "load", + Ctx: "riak.core.fsm_rejected", + Priority: prioCoreFsmREjected, + Dims: module.Dims{ + {ID: "node_get_fsm_rejected", Name: "get"}, + {ID: "node_put_fsm_rejected", Name: "put"}, + }, + } +) + +func (r *RiakKv) adjustCharts(mx map[string]int64) { + var i int + for _, chart := range *r.Charts() { + chart.Dims = slices.DeleteFunc(chart.Dims, func(dim *module.Dim) bool { + _, ok := mx[dim.ID] + if !ok { + r.Debugf("removing dimension '%s' from chart '%s': metric not found", dim.ID, chart.ID) + } + return !ok + }) + + if len(chart.Dims) == 0 { + r.Debugf("removing chart '%s': no metrics found", chart.ID) + continue + } + + (*r.Charts())[i] = chart + i++ + } +} diff --git a/src/go/plugin/go.d/modules/riakkv/collect.go b/src/go/plugin/go.d/modules/riakkv/collect.go new file mode 100644 index 00000000..0b3be943 --- /dev/null +++ b/src/go/plugin/go.d/modules/riakkv/collect.go @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package riakkv + +import ( + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +func (r *RiakKv) collect() (map[string]int64, error) { + stats, err := r.getStats() + if err != nil { + return nil, err + } + + mx := stm.ToMap(stats) + + if len(mx) == 0 { + return nil, errors.New("no stats") + } + + r.once.Do(func() { r.adjustCharts(mx) }) + + return mx, nil +} + +func (r *RiakKv) getStats() (*riakStats, error) { + req, err := web.NewHTTPRequest(r.Request) + if err != nil { + return nil, err + } + + var stats riakStats + if err := r.doOKDecode(req, &stats); err != nil { + return nil, err + } + + return &stats, nil +} + +func (r *RiakKv) doOKDecode(req *http.Request, in interface{}) error { + resp, err := r.httpClient.Do(req) + if err != nil { + return fmt.Errorf("error on HTTP request '%s': %v", req.URL, err) + } + defer closeBody(resp) + + if resp.StatusCode != http.StatusOK { + msg := fmt.Sprintf("'%s' returned HTTP status code: %d", req.URL, resp.StatusCode) + if resp.StatusCode == http.StatusNotFound { + msg = fmt.Sprintf("%s (riak_kv_stat is not enabled)", msg) + } + return errors.New(msg) + } + + if err := json.NewDecoder(resp.Body).Decode(in); err != nil { + return fmt.Errorf("error on decoding response from '%s': %v", req.URL, err) + } + + return nil +} + +func closeBody(resp *http.Response) { + if resp != nil && resp.Body != nil { + _, _ = io.Copy(io.Discard, resp.Body) + _ = resp.Body.Close() + } +} diff --git a/src/go/plugin/go.d/modules/riakkv/config_schema.json b/src/go/plugin/go.d/modules/riakkv/config_schema.json new file mode 100644 index 00000000..402c2c10 --- /dev/null +++ b/src/go/plugin/go.d/modules/riakkv/config_schema.json @@ -0,0 +1,186 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RiakKV collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 2 + }, + "url": { + "title": "URL", + "description": "The URL of the RiakKV [Stat](https://docs.riak.com/riak/kv/2.2.3/developing/api/http/status.1.html) endpoint.", + "type": "string", + "default": "http://127.0.0.1:8098/stats", + "format": "uri" + }, + "timeout": { + "title": "Timeout", + "description": "The timeout in seconds for the HTTP request.", + "type": "number", + "minimum": 0.5, + "default": 1 + }, + "not_follow_redirects": { + "title": "Not follow redirects", + "description": "If set, the client will not follow HTTP redirects automatically.", + "type": "boolean" + }, + "username": { + "title": "Username", + "description": "The username for basic authentication.", + "type": "string", + "sensitive": true + }, + "password": { + "title": "Password", + "description": "The password for basic authentication.", + "type": "string", + "sensitive": true + }, + "proxy_url": { + "title": "Proxy URL", + "description": "The URL of the proxy server.", + "type": "string" + }, + "proxy_username": { + "title": "Proxy username", + "description": "The username for proxy authentication.", + "type": "string", + "sensitive": true + }, + "proxy_password": { + "title": "Proxy password", + "description": "The password for proxy authentication.", + "type": "string", + "sensitive": true + }, + "headers": { + "title": "Headers", + "description": "Additional HTTP headers to include in the request.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "tls_skip_verify": { + "title": "Skip TLS verification", + "description": "If set, TLS certificate verification will be skipped.", + "type": "boolean" + }, + "tls_ca": { + "title": "TLS CA", + "description": "The path to the CA certificate file for TLS verification.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_cert": { + "title": "TLS certificate", + "description": "The path to the client certificate file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_key": { + "title": "TLS key", + "description": "The path to the client key file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "body": { + "title": "Body", + "type": "string" + }, + "method": { + "title": "Method", + "type": "string" + } + }, + "required": [ + "url" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "body": { + "ui:widget": "hidden" + }, + "method": { + "ui:widget": "hidden" + }, + "update_every": { + "ui:help": "Riak updates metrics on the `/stats` endpoint every second. To ensure accurate data representation, a polling interval of 2 seconds or more is suggested." + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, + "password": { + "ui:widget": "password" + }, + "proxy_password": { + "ui:widget": "password" + }, + "ui:flavour": "tabs", + "ui:options": { + "tabs": [ + { + "title": "Base", + "fields": [ + "update_every", + "url", + "timeout", + "not_follow_redirects" + ] + }, + { + "title": "Auth", + "fields": [ + "username", + "password" + ] + }, + { + "title": "TLS", + "fields": [ + "tls_skip_verify", + "tls_ca", + "tls_cert", + "tls_key" + ] + }, + { + "title": "Proxy", + "fields": [ + "proxy_url", + "proxy_username", + "proxy_password" + ] + }, + { + "title": "Headers", + "fields": [ + "headers" + ] + } + ] + } + } +} diff --git a/src/go/plugin/go.d/modules/riakkv/integrations/riak_kv.md b/src/go/plugin/go.d/modules/riakkv/integrations/riak_kv.md new file mode 100644 index 00000000..87273627 --- /dev/null +++ b/src/go/plugin/go.d/modules/riakkv/integrations/riak_kv.md @@ -0,0 +1,283 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/riakkv/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/riakkv/metadata.yaml" +sidebar_label: "Riak KV" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Databases" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Riak KV + + +<img src="https://netdata.cloud/img/riak.svg" width="150"/> + + +Plugin: go.d.plugin +Module: riakkv + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +This collector monitors RiakKV metrics about throughput, latency, resources and more. + + +It sends HTTP requests to the Riak [/stats](https://docs.riak.com/riak/kv/2.2.3/developing/api/http/status.1.html) endpoint. + + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +By default, it detects Riak instances running on localhost that are listening on port 8098. +On startup, it tries to collect metrics from: + +- http://127.0.0.1:8098/stats + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per Riak KV instance + +These metrics refer to the entire monitored application. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| riak.kv.throughput | gets, puts | operations/s | +| riak.dt.vnode_updates | counters, sets, maps | operations/s | +| riak.search | queries | queries/s | +| riak.search.documents | indexed | documents/s | +| riak.consistent.operations | gets, puts | operations/s | +| riak.kv.latency.get | mean, median, 95, 99, 100 | ms | +| riak.kv.latency.put | mean, median, 95, 99, 100 | ms | +| riak.dt.latency.counter_merge | mean, median, 95, 99, 100 | ms | +| riak.dt.latency.set_merge | mean, median, 95, 99, 100 | ms | +| riak.dt.latency.map_merge | mean, median, 95, 99, 100 | ms | +| riak.search.latency.query | median, min, 95, 99, 999, max | ms | +| riak.search.latency.index | median, min, 95, 99, 999, max | ms | +| riak.consistent.latency.get | mean, median, 95, 99, 100 | ms | +| riak.consistent.latency.put | mean, median, 95, 99, 100 | ms | +| riak.vm | processes | total | +| riak.vm.memory.processes | allocated, used | MB | +| riak.kv.siblings_encountered.get | mean, median, 95, 99, 100 | siblings | +| riak.kv.objsize.get | mean, median, 95, 99, 100 | KB | +| riak.search.vnodeq_size | mean, median, 95, 99, 100 | messages | +| riak.search.index | index_fail, bad_entry, extract_fail | errors | +| riak.core.protobuf_connections | active | connections | +| riak.core.repairs | read | repairs | +| riak.core.fsm_active | get, put, secondary index, list keys | fsms | +| riak.core.fsm_rejected | get, put | fsms | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +#### Enable /stats endpoint + +See the RiakKV [configuration reference](https://docs.riak.com/riak/kv/2.2.3/developing/api/http/status.1.html). + + + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/riakkv.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/riakkv.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| url | Server URL. | http://127.0.0.1:8098/stats | yes | +| timeout | HTTP request timeout. | 1 | no | +| username | Username for basic HTTP authentication. | | no | +| password | Password for basic HTTP authentication. | | no | +| proxy_url | Proxy URL. | | no | +| proxy_username | Username for proxy basic HTTP authentication. | | no | +| proxy_password | Password for proxy basic HTTP authentication. | | no | +| method | HTTP request method. | GET | no | +| body | HTTP request body. | | no | +| headers | HTTP request headers. | | no | +| not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no | +| tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no | +| tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no | +| tls_cert | Client TLS certificate. | | no | +| tls_key | Client TLS key. | | no | + +</details> + +#### Examples + +##### Basic + +A basic example configuration. + +```yaml +jobs: + - name: local + url: http://127.0.0.1:8098/stats + +``` +##### HTTP authentication + +Basic HTTP authentication. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + url: http://127.0.0.1:8098/stats + username: username + password: password + +``` +</details> + +##### HTTPS with self-signed certificate + +With enabled HTTPS and self-signed certificate. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + url: http://127.0.0.1:8098/stats + tls_skip_verify: yes + +``` +</details> + +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + url: http://127.0.0.1:8098/stats + + - name: remote + url: http://192.0.2.1:8098/stats + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `riakkv` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m riakkv + ``` + +### Getting Logs + +If you're encountering problems with the `riakkv` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep riakkv +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep riakkv /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep riakkv +``` + + diff --git a/src/go/plugin/go.d/modules/riakkv/metadata.yaml b/src/go/plugin/go.d/modules/riakkv/metadata.yaml new file mode 100644 index 00000000..435cc4f9 --- /dev/null +++ b/src/go/plugin/go.d/modules/riakkv/metadata.yaml @@ -0,0 +1,390 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-riakkv + plugin_name: go.d.plugin + module_name: riakkv + monitored_instance: + name: Riak KV + link: https://riak.com/products/riak-kv/index.html + categories: + - data-collection.database-servers + icon_filename: "riak.svg" + related_resources: + integrations: + list: [] + alternative_monitored_instances: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - database + - nosql + - big data + most_popular: false + overview: + data_collection: + metrics_description: | + This collector monitors RiakKV metrics about throughput, latency, resources and more. + method_description: | + It sends HTTP requests to the Riak [/stats](https://docs.riak.com/riak/kv/2.2.3/developing/api/http/status.1.html) endpoint. + default_behavior: + auto_detection: + description: | + By default, it detects Riak instances running on localhost that are listening on port 8098. + On startup, it tries to collect metrics from: + + - http://127.0.0.1:8098/stats + limits: + description: "" + performance_impact: + description: "" + additional_permissions: + description: "" + multi_instance: true + supported_platforms: + include: [] + exclude: [] + setup: + prerequisites: + list: + - title: Enable /stats endpoint + description: | + See the RiakKV [configuration reference](https://docs.riak.com/riak/kv/2.2.3/developing/api/http/status.1.html). + configuration: + file: + name: go.d/riakkv.conf + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: url + description: Server URL. + default_value: http://127.0.0.1:8098/stats + required: true + - name: timeout + description: HTTP request timeout. + default_value: 1 + required: false + - name: username + description: Username for basic HTTP authentication. + default_value: "" + required: false + - name: password + description: Password for basic HTTP authentication. + default_value: "" + required: false + - name: proxy_url + description: Proxy URL. + default_value: "" + required: false + - name: proxy_username + description: Username for proxy basic HTTP authentication. + default_value: "" + required: false + - name: proxy_password + description: Password for proxy basic HTTP authentication. + default_value: "" + required: false + - name: method + description: HTTP request method. + default_value: GET + required: false + - name: body + description: HTTP request body. + default_value: "" + required: false + - name: headers + description: HTTP request headers. + default_value: "" + required: false + - name: not_follow_redirects + description: Redirect handling policy. Controls whether the client follows redirects. + default_value: false + required: false + - name: tls_skip_verify + description: Server certificate chain and hostname validation policy. Controls whether the client performs this check. + default_value: false + required: false + - name: tls_ca + description: Certification authority that the client uses when verifying the server's certificates. + default_value: "" + required: false + - name: tls_cert + description: Client TLS certificate. + default_value: "" + required: false + - name: tls_key + description: Client TLS key. + default_value: "" + required: false + examples: + folding: + title: Config + enabled: true + list: + - name: Basic + description: A basic example configuration. + folding: + enabled: false + config: | + jobs: + - name: local + url: http://127.0.0.1:8098/stats + - name: HTTP authentication + description: Basic HTTP authentication. + config: | + jobs: + - name: local + url: http://127.0.0.1:8098/stats + username: username + password: password + - name: HTTPS with self-signed certificate + description: With enabled HTTPS and self-signed certificate. + config: | + jobs: + - name: local + url: http://127.0.0.1:8098/stats + tls_skip_verify: yes + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + url: http://127.0.0.1:8098/stats + + - name: remote + url: http://192.0.2.1:8098/stats + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: These metrics refer to the entire monitored application. + labels: [] + metrics: + - name: riak.kv.throughput + description: Reads & writes coordinated by this node + unit: "operations/s" + chart_type: line + dimensions: + - name: gets + - name: puts + - name: riak.dt.vnode_updates + description: Update operations coordinated by local vnodes by data type + unit: "operations/s" + chart_type: line + dimensions: + - name: counters + - name: sets + - name: maps + - name: riak.search + description: Search queries on the node + unit: "queries/s" + chart_type: line + dimensions: + - name: queries + - name: riak.search.documents + description: Documents indexed by search + unit: "documents/s" + chart_type: line + dimensions: + - name: indexed + - name: riak.consistent.operations + description: Consistent node operations + unit: "operations/s" + chart_type: line + dimensions: + - name: gets + - name: puts + - name: riak.kv.latency.get + description: Time between reception of a client GET request and subsequent response to client + unit: "ms" + chart_type: line + dimensions: + - name: mean + - name: median + - name: "95" + - name: "99" + - name: "100" + - name: riak.kv.latency.put + description: Time between reception of a client PUT request and subsequent response to client + unit: "ms" + chart_type: line + dimensions: + - name: mean + - name: median + - name: "95" + - name: "99" + - name: "100" + - name: riak.dt.latency.counter_merge + description: Time it takes to perform an Update Counter operation + unit: "ms" + chart_type: line + dimensions: + - name: mean + - name: median + - name: "95" + - name: "99" + - name: "100" + - name: riak.dt.latency.set_merge + description: Time it takes to perform an Update Set operation + unit: "ms" + chart_type: line + dimensions: + - name: mean + - name: median + - name: "95" + - name: "99" + - name: "100" + - name: riak.dt.latency.map_merge + description: Time it takes to perform an Update Map operation + unit: "ms" + chart_type: line + dimensions: + - name: mean + - name: median + - name: "95" + - name: "99" + - name: "100" + - name: riak.search.latency.query + description: Search query latency + unit: "ms" + chart_type: line + dimensions: + - name: median + - name: min + - name: "95" + - name: "99" + - name: "999" + - name: max + - name: riak.search.latency.index + description: Time it takes Search to index a new document + unit: "ms" + chart_type: line + dimensions: + - name: median + - name: min + - name: "95" + - name: "99" + - name: "999" + - name: max + - name: riak.consistent.latency.get + description: Strongly consistent read latency + unit: "ms" + chart_type: line + dimensions: + - name: mean + - name: median + - name: "95" + - name: "99" + - name: "100" + - name: riak.consistent.latency.put + description: Strongly consistent write latency + unit: "ms" + chart_type: line + dimensions: + - name: mean + - name: median + - name: "95" + - name: "99" + - name: "100" + - name: riak.vm + description: Total processes running in the Erlang VM + unit: "total" + chart_type: line + dimensions: + - name: processes + - name: riak.vm.memory.processes + description: Memory allocated & used by Erlang processes + unit: "MB" + chart_type: line + dimensions: + - name: allocated + - name: used + - name: riak.kv.siblings_encountered.get + description: Number of siblings encountered during GET operations by this node during the past minute + unit: "siblings" + chart_type: line + dimensions: + - name: mean + - name: median + - name: "95" + - name: "99" + - name: "100" + - name: riak.kv.objsize.get + description: Object size encountered by this node during the past minute + unit: "KB" + chart_type: line + dimensions: + - name: mean + - name: median + - name: "95" + - name: "99" + - name: "100" + - name: riak.search.vnodeq_size + description: Number of unprocessed messages in the vnode message queues of Search on this node in the past minute + unit: "messages" + chart_type: line + dimensions: + - name: mean + - name: median + - name: "95" + - name: "99" + - name: "100" + - name: riak.search.index + description: Errors encountered by Search + unit: "errors" + chart_type: line + dimensions: + - name: index_fail + - name: bad_entry + - name: extract_fail + - name: riak.core.protobuf_connections + description: Protocol buffer connections by status + unit: "connections" + chart_type: line + dimensions: + - name: active + - name: riak.core.repairs + description: Number of repair operations this node has coordinated + unit: "repairs" + chart_type: line + dimensions: + - name: read + - name: riak.core.fsm_active + description: Active finite state machines by kind + unit: "fsms" + chart_type: line + dimensions: + - name: get + - name: put + - name: secondary index + - name: list keys + - name: riak.core.fsm_rejected + description: Finite state machines being rejected by Sidejobs overload protection + unit: "fsms" + chart_type: line + dimensions: + - name: get + - name: put diff --git a/src/go/plugin/go.d/modules/riakkv/riakkv.go b/src/go/plugin/go.d/modules/riakkv/riakkv.go new file mode 100644 index 00000000..64aeda1c --- /dev/null +++ b/src/go/plugin/go.d/modules/riakkv/riakkv.go @@ -0,0 +1,122 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package riakkv + +import ( + _ "embed" + "errors" + "net/http" + "sync" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("riakkv", module.Creator{ + Create: func() module.Module { return New() }, + // Riak updates the metrics on the /stats endpoint every 1 second. + // If we use 1 here, it means we might get weird jitter in the graph, + // so the default is set to 2 seconds to prevent that. + Defaults: module.Defaults{ + UpdateEvery: 2, + }, + JobConfigSchema: configSchema, + Config: func() any { return &Config{} }, + }) +} + +func New() *RiakKv { + return &RiakKv{ + Config: Config{ + HTTP: web.HTTP{ + Request: web.Request{ + // https://docs.riak.com/riak/kv/2.2.3/developing/api/http/status.1.html + URL: "http://127.0.0.1:8098/stats", + }, + Client: web.Client{ + Timeout: web.Duration(time.Second), + }, + }, + }, + once: &sync.Once{}, + charts: charts.Copy(), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + web.HTTP `yaml:",inline" json:""` +} + +type RiakKv struct { + module.Base + Config `yaml:",inline" json:""` + + once *sync.Once + charts *module.Charts + + httpClient *http.Client +} + +func (r *RiakKv) Configuration() any { + return r.Config +} + +func (r *RiakKv) Init() error { + if r.URL == "" { + r.Errorf("url required but not set") + return errors.New("url not set") + } + + httpClient, err := web.NewHTTPClient(r.Client) + if err != nil { + r.Errorf("init HTTP client: %v", err) + return err + } + r.httpClient = httpClient + + r.Debugf("using URL %s", r.URL) + r.Debugf("using timeout: %s", r.Timeout) + + return nil +} + +func (r *RiakKv) Check() error { + mx, err := r.collect() + if err != nil { + r.Error(err) + return err + } + if len(mx) == 0 { + return errors.New("no metrics collected") + + } + return nil +} + +func (r *RiakKv) Charts() *module.Charts { + return r.charts +} + +func (r *RiakKv) Collect() map[string]int64 { + mx, err := r.collect() + if err != nil { + r.Error(err) + } + + if len(mx) == 0 { + return nil + } + return mx +} + +func (r *RiakKv) Cleanup() { + if r.httpClient != nil { + r.httpClient.CloseIdleConnections() + } +} diff --git a/src/go/plugin/go.d/modules/riakkv/riakkv_test.go b/src/go/plugin/go.d/modules/riakkv/riakkv_test.go new file mode 100644 index 00000000..de4e2409 --- /dev/null +++ b/src/go/plugin/go.d/modules/riakkv/riakkv_test.go @@ -0,0 +1,265 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package riakkv + +import ( + "net/http" + "net/http/httptest" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataStats, _ = os.ReadFile("testdata/stats.json") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + "dataStats": dataStats, + } { + require.NotNil(t, data, name) + + } +} + +func TestRiakKv_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &RiakKv{}, dataConfigJSON, dataConfigYAML) +} + +func TestRiakKv_Init(t *testing.T) { + tests := map[string]struct { + wantFail bool + config Config + }{ + "success with default": { + wantFail: false, + config: New().Config, + }, + "fail when URL not set": { + wantFail: true, + config: Config{ + HTTP: web.HTTP{ + Request: web.Request{URL: ""}, + }, + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + riak := New() + riak.Config = test.config + + if test.wantFail { + assert.Error(t, riak.Init()) + } else { + assert.NoError(t, riak.Init()) + } + }) + } +} + +func TestRiakKv_Check(t *testing.T) { + tests := map[string]struct { + wantFail bool + prepare func(t *testing.T) (riak *RiakKv, cleanup func()) + }{ + "success on valid response": { + wantFail: false, + prepare: caseOkResponse, + }, + "fail on invalid data response": { + wantFail: true, + prepare: caseInvalidDataResponse, + }, + "fail on connection refused": { + wantFail: true, + prepare: caseConnectionRefused, + }, + "fail on 404 response": { + wantFail: true, + prepare: case404, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + riak, cleanup := test.prepare(t) + defer cleanup() + + if test.wantFail { + assert.Error(t, riak.Check()) + } else { + assert.NoError(t, riak.Check()) + } + }) + } +} + +func TestRiakKv_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestRiakKv_Collect(t *testing.T) { + tests := map[string]struct { + prepare func(t *testing.T) (riak *RiakKv, cleanup func()) + wantMetrics map[string]int64 + }{ + "success on valid response": { + prepare: caseOkResponse, + wantMetrics: map[string]int64{ + "consistent_get_time_100": 1, + "consistent_get_time_95": 1, + "consistent_get_time_99": 1, + "consistent_get_time_mean": 1, + "consistent_get_time_median": 1, + "consistent_gets_total": 1, + "consistent_put_time_100": 1, + "consistent_put_time_95": 1, + "consistent_put_time_99": 1, + "consistent_put_time_mean": 1, + "consistent_put_time_median": 1, + "consistent_puts_total": 1, + "index_fsm_active": 1, + "list_fsm_active": 1, + "memory_processes": 274468041, + "memory_processes_used": 274337336, + "node_get_fsm_active": 1, + "node_get_fsm_objsize_100": 1037, + "node_get_fsm_objsize_95": 1, + "node_get_fsm_objsize_99": 1025, + "node_get_fsm_objsize_mean": 791, + "node_get_fsm_objsize_median": 669, + "node_get_fsm_rejected": 1, + "node_get_fsm_siblings_100": 1, + "node_get_fsm_siblings_95": 1, + "node_get_fsm_siblings_99": 1, + "node_get_fsm_siblings_mean": 1, + "node_get_fsm_siblings_median": 1, + "node_get_fsm_time_100": 678351, + "node_get_fsm_time_95": 1, + "node_get_fsm_time_99": 10148, + "node_get_fsm_time_mean": 2161, + "node_get_fsm_time_median": 1022, + "node_gets_total": 422626, + "node_put_fsm_active": 1, + "node_put_fsm_rejected": 1, + "node_put_fsm_time_100": 1049568, + "node_put_fsm_time_95": 19609, + "node_put_fsm_time_99": 37735, + "node_put_fsm_time_mean": 11828, + "node_put_fsm_time_median": 5017, + "node_puts_total": 490965, + "object_counter_merge_time_100": 1, + "object_counter_merge_time_95": 1, + "object_counter_merge_time_99": 1, + "object_counter_merge_time_mean": 1, + "object_counter_merge_time_median": 1, + "object_map_merge_time_100": 1, + "object_map_merge_time_95": 1, + "object_map_merge_time_99": 1, + "object_map_merge_time_mean": 1, + "object_map_merge_time_median": 1, + "object_set_merge_time_100": 1, + "object_set_merge_time_95": 1, + "object_set_merge_time_99": 1, + "object_set_merge_time_mean": 1, + "object_set_merge_time_median": 1, + "pbc_active": 46, + "read_repairs": 1, + "vnode_counter_update_total": 1, + "vnode_map_update_total": 1, + "vnode_set_update_total": 1, + }, + }, + "fail on invalid data response": { + prepare: caseInvalidDataResponse, + wantMetrics: nil, + }, + "fail on connection refused": { + prepare: caseConnectionRefused, + wantMetrics: nil, + }, + "fail on 404 response": { + prepare: case404, + wantMetrics: nil, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + riak, cleanup := test.prepare(t) + defer cleanup() + + _ = riak.Check() + + mx := riak.Collect() + + require.Equal(t, test.wantMetrics, mx) + + if len(test.wantMetrics) > 0 { + require.True(t, len(*riak.Charts()) > 0, "charts > 0") + module.TestMetricsHasAllChartsDims(t, riak.Charts(), mx) + } + }) + } +} + +func caseOkResponse(t *testing.T) (*RiakKv, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write(dataStats) + })) + riak := New() + riak.URL = srv.URL + require.NoError(t, riak.Init()) + + return riak, srv.Close +} + +func caseInvalidDataResponse(t *testing.T) (*RiakKv, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte("hello and\n goodbye")) + })) + riak := New() + riak.URL = srv.URL + require.NoError(t, riak.Init()) + + return riak, srv.Close +} + +func caseConnectionRefused(t *testing.T) (*RiakKv, func()) { + t.Helper() + rk := New() + rk.URL = "http://127.0.0.1:65001" + require.NoError(t, rk.Init()) + + return rk, func() {} +} + +func case404(t *testing.T) (*RiakKv, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotFound) + })) + riak := New() + riak.URL = srv.URL + require.NoError(t, riak.Init()) + + return riak, srv.Close +} diff --git a/src/go/plugin/go.d/modules/riakkv/stats.go b/src/go/plugin/go.d/modules/riakkv/stats.go new file mode 100644 index 00000000..ed292758 --- /dev/null +++ b/src/go/plugin/go.d/modules/riakkv/stats.go @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package riakkv + +// FIXME: old data (likely wrong) from https://github.com/netdata/netdata/issues/2413#issuecomment-500867044 +type riakStats struct { + NodeGetsTotal *int64 `json:"node_gets_total" stm:"node_gets_total"` + NodePutsTotal *int64 `json:"node_puts_total" stm:"node_puts_total"` + + VnodeCounterUpdateTotal *int64 `json:"vnode_counter_update_total" stm:"vnode_counter_update_total"` + VnodeSetUpdateTotal *int64 `json:"vnode_set_update_total" stm:"vnode_set_update_total"` + VnodeMapUpdateTotal *int64 `json:"vnode_map_update_total" stm:"vnode_map_update_total"` + + SearchQueryThroughputCount *int64 `json:"search_query_throughput_count" stm:"search_query_throughput_count"` + SearchIndexThroughputCount *int64 `json:"search_index_throughput_count" stm:"search_index_throughput_count"` + + ConsistentGetsTotal *int64 `json:"consistent_gets_total" stm:"consistent_gets_total"` + ConsistentPutsTotal *int64 `json:"consistent_puts_total" stm:"consistent_puts_total"` + + NodeGetFsmTimeMean *int64 `json:"node_get_fsm_time_mean" stm:"node_get_fsm_time_mean"` + NodeGetFsmTimeMedian *int64 `json:"node_get_fsm_time_median" stm:"node_get_fsm_time_median"` + NodeGetFsmTime95 *int64 `json:"node_get_fsm_time_95" stm:"node_get_fsm_time_95"` + NodeGetFsmTime99 *int64 `json:"node_get_fsm_time_99" stm:"node_get_fsm_time_99"` + NodeGetFsmTime100 *int64 `json:"node_get_fsm_time_100" stm:"node_get_fsm_time_100"` + + NodePutFsmTimeMean *int64 `json:"node_put_fsm_time_mean" stm:"node_put_fsm_time_mean"` + NodePutFsmTimeMedian *int64 `json:"node_put_fsm_time_median" stm:"node_put_fsm_time_median"` + NodePutFsmTime95 *int64 `json:"node_put_fsm_time_95" stm:"node_put_fsm_time_95"` + NodePutFsmTime99 *int64 `json:"node_put_fsm_time_99" stm:"node_put_fsm_time_99"` + NodePutFsmTime100 *int64 `json:"node_put_fsm_time_100" stm:"node_put_fsm_time_100"` + + ObjectCounterMergeTimeMean *int64 `json:"object_counter_merge_time_mean" stm:"object_counter_merge_time_mean"` + ObjectCounterMergeTimeMedian *int64 `json:"object_counter_merge_time_median" stm:"object_counter_merge_time_median"` + ObjectCounterMergeTime95 *int64 `json:"object_counter_merge_time_95" stm:"object_counter_merge_time_95"` + ObjectCounterMergeTime99 *int64 `json:"object_counter_merge_time_99" stm:"object_counter_merge_time_99"` + ObjectCounterMergeTime100 *int64 `json:"object_counter_merge_time_100" stm:"object_counter_merge_time_100"` + + ObjectSetMergeTimeMean *int64 `json:"object_set_merge_time_mean" stm:"object_set_merge_time_mean"` + ObjectSetMergeTimeMedian *int64 `json:"object_set_merge_time_median" stm:"object_set_merge_time_median"` + ObjectSetMergeTime95 *int64 `json:"object_set_merge_time_95" stm:"object_set_merge_time_95"` + ObjectSetMergeTime99 *int64 `json:"object_set_merge_time_99" stm:"object_set_merge_time_99"` + ObjectSetMergeTime100 *int64 `json:"object_set_merge_time_100" stm:"object_set_merge_time_100"` + + ObjectMapMergeTimeMean *int64 `json:"object_map_merge_time_mean" stm:"object_map_merge_time_mean"` + ObjectMapMergeTimeMedian *int64 `json:"object_map_merge_time_median" stm:"object_map_merge_time_median"` + ObjectMapMergeTime95 *int64 `json:"object_map_merge_time_95" stm:"object_map_merge_time_95"` + ObjectMapMergeTime99 *int64 `json:"object_map_merge_time_99" stm:"object_map_merge_time_99"` + ObjectMapMergeTime100 *int64 `json:"object_map_merge_time_100" stm:"object_map_merge_time_100"` + + SearchQueryLatencyMin *int64 `json:"search_query_latency_min" stm:"search_query_latency_min"` + SearchQueryLatencyMedian *int64 `json:"search_query_latency_median" stm:"search_query_latency_median"` + SearchQueryLatency95 *int64 `json:"search_query_latency_95" stm:"search_query_latency_95"` + SearchQueryLatency99 *int64 `json:"search_query_latency_99" stm:"search_query_latency_99"` + SearchQueryLatency999 *int64 `json:"search_query_latency_999" stm:"search_query_latency_999"` + SearchQueryLatencyMax *int64 `json:"search_query_latency_max" stm:"search_query_latency_max"` + + SearchIndexLatencyMin *int64 `json:"search_index_latency_min" stm:"search_index_latency_min"` + SearchIndexLatencyMedian *int64 `json:"search_index_latency_median" stm:"search_index_latency_median"` + SearchIndexLatency95 *int64 `json:"search_index_latency_95" stm:"search_index_latency_95"` + SearchIndexLatency99 *int64 `json:"search_index_latency_99" stm:"search_index_latency_99"` + SearchIndexLatency999 *int64 `json:"search_index_latency_999" stm:"search_index_latency_999"` + SearchIndexLatencyMax *int64 `json:"search_index_latency_max" stm:"search_index_latency_max"` + + ConsistentGetTimeMean *int64 `json:"consistent_get_time_mean" stm:"consistent_get_time_mean"` + ConsistentGetTimeMedian *int64 `json:"consistent_get_time_median" stm:"consistent_get_time_median"` + ConsistentGetTime95 *int64 `json:"consistent_get_time_95" stm:"consistent_get_time_95"` + ConsistentGetTime99 *int64 `json:"consistent_get_time_99" stm:"consistent_get_time_99"` + ConsistentGetTime100 *int64 `json:"consistent_get_time_100" stm:"consistent_get_time_100"` + + ConsistentPutTimeMean *int64 `json:"consistent_put_time_mean" stm:"consistent_put_time_mean"` + ConsistentPutTimeMedian *int64 `json:"consistent_put_time_median" stm:"consistent_put_time_median"` + ConsistentPutTime95 *int64 `json:"consistent_put_time_95" stm:"consistent_put_time_95"` + ConsistentPutTime99 *int64 `json:"consistent_put_time_99" stm:"consistent_put_time_99"` + ConsistentPutTime100 *int64 `json:"consistent_put_time_100" stm:"consistent_put_time_100"` + + SysProcesses *int64 `json:"sys_processes" stm:"sys_processes"` + MemoryProcesses *int64 `json:"memory_processes" stm:"memory_processes"` + MemoryProcessesUsed *int64 `json:"memory_processes_used" stm:"memory_processes_used"` + + NodeGetFsmSiblingsMean *int64 `json:"node_get_fsm_siblings_mean" stm:"node_get_fsm_siblings_mean"` + NodeGetFsmSiblingsMedian *int64 `json:"node_get_fsm_siblings_median" stm:"node_get_fsm_siblings_median"` + NodeGetFsmSiblings99 *int64 `json:"node_get_fsm_siblings_99" stm:"node_get_fsm_siblings_99"` + NodeGetFsmSiblings95 *int64 `json:"node_get_fsm_siblings_95" stm:"node_get_fsm_siblings_95"` + NodeGetFsmSiblings100 *int64 `json:"node_get_fsm_siblings_100" stm:"node_get_fsm_siblings_100"` + + NodeGetFsmObjsizeMean *int64 `json:"node_get_fsm_objsize_mean" stm:"node_get_fsm_objsize_mean"` + NodeGetFsmObjsizeMedian *int64 `json:"node_get_fsm_objsize_median" stm:"node_get_fsm_objsize_median"` + NodeGetFsmObjsize95 *int64 `json:"node_get_fsm_objsize_95" stm:"node_get_fsm_objsize_95"` + NodeGetFsmObjsize99 *int64 `json:"node_get_fsm_objsize_99" stm:"node_get_fsm_objsize_99"` + NodeGetFsmObjsize100 *int64 `json:"node_get_fsm_objsize_100" stm:"node_get_fsm_objsize_100"` + + RiakSearchVnodeqMean *int64 `json:"riak_search_vnodeq_mean" stm:"riak_search_vnodeq_mean"` + RiakSearchVnodeqMedian *int64 `json:"riak_search_vnodeq_median" stm:"riak_search_vnodeq_median"` + RiakSearchVnodeq95 *int64 `json:"riak_search_vnodeq_95" stm:"riak_search_vnodeq_95"` + RiakSearchVnodeq99 *int64 `json:"riak_search_vnodeq_99" stm:"riak_search_vnodeq_99"` + RiakSearchVnodeq100 *int64 `json:"riak_search_vnodeq_100" stm:"riak_search_vnodeq_100"` + + SearchIndexFailCount *int64 `json:"search_index_fail_count" stm:"search_index_fail_count"` + PbcActive *int64 `json:"pbc_active" stm:"pbc_active"` + ReadRepairs *int64 `json:"read_repairs" stm:"read_repairs"` + + NodeGetFsmActive *int64 `json:"node_get_fsm_active" stm:"node_get_fsm_active"` + NodePutFsmActive *int64 `json:"node_put_fsm_active" stm:"node_put_fsm_active"` + IndexFsmActive *int64 `json:"index_fsm_active" stm:"index_fsm_active"` + ListFsmActive *int64 `json:"list_fsm_active" stm:"list_fsm_active"` + + NodeGetFsmRejected *int64 `json:"node_get_fsm_rejected" stm:"node_get_fsm_rejected"` + NodePutFsmRejected *int64 `json:"node_put_fsm_rejected" stm:"node_put_fsm_rejected"` + + SearchIndexBadEntryCount *int64 `json:"search_index_bad_entry_count" stm:"search_index_bad_entry_count"` + SearchIndexExtractFailCount *int64 `json:"search_index_extract_fail_count" stm:"search_index_extract_fail_count"` +} diff --git a/src/go/collectors/go.d.plugin/modules/traefik/testdata/config.json b/src/go/plugin/go.d/modules/riakkv/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/traefik/testdata/config.json +++ b/src/go/plugin/go.d/modules/riakkv/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/traefik/testdata/config.yaml b/src/go/plugin/go.d/modules/riakkv/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/traefik/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/riakkv/testdata/config.yaml diff --git a/src/go/plugin/go.d/modules/riakkv/testdata/stats.json b/src/go/plugin/go.d/modules/riakkv/testdata/stats.json new file mode 100644 index 00000000..8dd836f2 --- /dev/null +++ b/src/go/plugin/go.d/modules/riakkv/testdata/stats.json @@ -0,0 +1,478 @@ +{ + "connected_nodes": [], + "consistent_get_objsize_100": 1, + "consistent_get_objsize_95": 1, + "consistent_get_objsize_99": 1, + "consistent_get_objsize_mean": 1, + "consistent_get_objsize_median": 1, + "consistent_get_time_100": 1, + "consistent_get_time_95": 1, + "consistent_get_time_99": 1, + "consistent_get_time_mean": 1, + "consistent_get_time_median": 1, + "consistent_gets": 1, + "consistent_gets_total": 1, + "consistent_put_objsize_100": 1, + "consistent_put_objsize_95": 1, + "consistent_put_objsize_99": 1, + "consistent_put_objsize_mean": 1, + "consistent_put_objsize_median": 1, + "consistent_put_time_100": 1, + "consistent_put_time_95": 1, + "consistent_put_time_99": 1, + "consistent_put_time_mean": 1, + "consistent_put_time_median": 1, + "consistent_puts": 1, + "consistent_puts_total": 1, + "converge_delay_last": 1, + "converge_delay_max": 1, + "converge_delay_mean": 1, + "converge_delay_min": 1, + "coord_redirs_total": 1, + "counter_actor_counts_100": 1, + "counter_actor_counts_95": 1, + "counter_actor_counts_99": 1, + "counter_actor_counts_mean": 1, + "counter_actor_counts_median": 1, + "cpu_avg1": 2276, + "cpu_avg15": 661, + "cpu_avg5": 1267, + "cpu_nprocs": 1443, + "dropped_vnode_requests_total": 1, + "executing_mappers": 1, + "gossip_received": 1, + "handoff_timeouts": 1, + "hll_bytes": 1, + "hll_bytes_100": 1, + "hll_bytes_95": 1, + "hll_bytes_99": 1, + "hll_bytes_mean": 1, + "hll_bytes_median": 1, + "hll_bytes_total": 1, + "ignored_gossip_total": 1, + "index_fsm_active": 1, + "index_fsm_create": 1, + "index_fsm_create_error": 1, + "late_put_fsm_coordinator_ack": 1, + "leveldb_read_block_error": "undefined", + "list_fsm_active": 1, + "list_fsm_create": 1, + "list_fsm_create_error": 1, + "list_fsm_create_error_total": 1, + "list_fsm_create_total": 1, + "map_actor_counts_100": 1, + "map_actor_counts_95": 1, + "map_actor_counts_99": 1, + "map_actor_counts_mean": 1, + "map_actor_counts_median": 1, + "mem_allocated": 14529916928, + "mem_total": 16728453121, + "memory_atom": 695185, + "memory_atom_used": 670675, + "memory_binary": 15413608, + "memory_code": 15375111, + "memory_ets": 7728584, + "memory_processes": 274468041, + "memory_processes_used": 274337336, + "memory_system": 126058328, + "memory_total": 400526368, + "node_get_fsm_active": 1, + "node_get_fsm_active_60s": 20079, + "node_get_fsm_counter_objsize_100": 1, + "node_get_fsm_counter_objsize_95": 1, + "node_get_fsm_counter_objsize_99": 1, + "node_get_fsm_counter_objsize_mean": 1, + "node_get_fsm_counter_objsize_median": 1, + "node_get_fsm_counter_siblings_100": 1, + "node_get_fsm_counter_siblings_95": 1, + "node_get_fsm_counter_siblings_99": 1, + "node_get_fsm_counter_siblings_mean": 1, + "node_get_fsm_counter_siblings_median": 1, + "node_get_fsm_counter_time_100": 1, + "node_get_fsm_counter_time_95": 1, + "node_get_fsm_counter_time_99": 1, + "node_get_fsm_counter_time_mean": 1, + "node_get_fsm_counter_time_median": 1, + "node_get_fsm_errors": 1, + "node_get_fsm_errors_total": 1, + "node_get_fsm_hll_objsize_100": 1, + "node_get_fsm_hll_objsize_95": 1, + "node_get_fsm_hll_objsize_99": 1, + "node_get_fsm_hll_objsize_mean": 1, + "node_get_fsm_hll_objsize_median": 1, + "node_get_fsm_hll_siblings_100": 1, + "node_get_fsm_hll_siblings_95": 1, + "node_get_fsm_hll_siblings_99": 1, + "node_get_fsm_hll_siblings_mean": 1, + "node_get_fsm_hll_siblings_median": 1, + "node_get_fsm_hll_time_100": 1, + "node_get_fsm_hll_time_95": 1, + "node_get_fsm_hll_time_99": 1, + "node_get_fsm_hll_time_mean": 1, + "node_get_fsm_hll_time_median": 1, + "node_get_fsm_in_rate": 181, + "node_get_fsm_map_objsize_100": 1, + "node_get_fsm_map_objsize_95": 1, + "node_get_fsm_map_objsize_99": 1, + "node_get_fsm_map_objsize_mean": 1, + "node_get_fsm_map_objsize_median": 1, + "node_get_fsm_map_siblings_100": 1, + "node_get_fsm_map_siblings_95": 1, + "node_get_fsm_map_siblings_99": 1, + "node_get_fsm_map_siblings_mean": 1, + "node_get_fsm_map_siblings_median": 1, + "node_get_fsm_map_time_100": 1, + "node_get_fsm_map_time_95": 1, + "node_get_fsm_map_time_99": 1, + "node_get_fsm_map_time_mean": 1, + "node_get_fsm_map_time_median": 1, + "node_get_fsm_objsize_100": 1037, + "node_get_fsm_objsize_95": 1, + "node_get_fsm_objsize_99": 1025, + "node_get_fsm_objsize_mean": 791, + "node_get_fsm_objsize_median": 669, + "node_get_fsm_out_rate": 191, + "node_get_fsm_rejected": 1, + "node_get_fsm_rejected_60s": 1, + "node_get_fsm_rejected_total": 1, + "node_get_fsm_set_objsize_100": 1, + "node_get_fsm_set_objsize_95": 1, + "node_get_fsm_set_objsize_99": 1, + "node_get_fsm_set_objsize_mean": 1, + "node_get_fsm_set_objsize_median": 1, + "node_get_fsm_set_siblings_100": 1, + "node_get_fsm_set_siblings_95": 1, + "node_get_fsm_set_siblings_99": 1, + "node_get_fsm_set_siblings_mean": 1, + "node_get_fsm_set_siblings_median": 1, + "node_get_fsm_set_time_100": 1, + "node_get_fsm_set_time_95": 1, + "node_get_fsm_set_time_99": 1, + "node_get_fsm_set_time_mean": 1, + "node_get_fsm_set_time_median": 1, + "node_get_fsm_siblings_100": 1, + "node_get_fsm_siblings_95": 1, + "node_get_fsm_siblings_99": 1, + "node_get_fsm_siblings_mean": 1, + "node_get_fsm_siblings_median": 1, + "node_get_fsm_time_100": 678351, + "node_get_fsm_time_95": 1, + "node_get_fsm_time_99": 10148, + "node_get_fsm_time_mean": 2161, + "node_get_fsm_time_median": 1022, + "node_gets": 19875, + "node_gets_counter": 1, + "node_gets_counter_total": 1, + "node_gets_hll": 1, + "node_gets_hll_total": 1, + "node_gets_map": 1, + "node_gets_map_total": 1, + "node_gets_set": 1, + "node_gets_set_total": 1, + "node_gets_total": 422626, + "node_put_fsm_active": 1, + "node_put_fsm_active_60s": 10498, + "node_put_fsm_counter_time_100": 1, + "node_put_fsm_counter_time_95": 1, + "node_put_fsm_counter_time_99": 1, + "node_put_fsm_counter_time_mean": 1, + "node_put_fsm_counter_time_median": 1, + "node_put_fsm_hll_time_100": 1, + "node_put_fsm_hll_time_95": 1, + "node_put_fsm_hll_time_99": 1, + "node_put_fsm_hll_time_mean": 1, + "node_put_fsm_hll_time_median": 1, + "node_put_fsm_in_rate": 116, + "node_put_fsm_map_time_100": 1, + "node_put_fsm_map_time_95": 1, + "node_put_fsm_map_time_99": 1, + "node_put_fsm_map_time_mean": 1, + "node_put_fsm_map_time_median": 1, + "node_put_fsm_out_rate": 127, + "node_put_fsm_rejected": 1, + "node_put_fsm_rejected_60s": 1, + "node_put_fsm_rejected_total": 1, + "node_put_fsm_set_time_100": 1, + "node_put_fsm_set_time_95": 1, + "node_put_fsm_set_time_99": 1, + "node_put_fsm_set_time_mean": 1, + "node_put_fsm_set_time_median": 1, + "node_put_fsm_time_100": 1049568, + "node_put_fsm_time_95": 19609, + "node_put_fsm_time_99": 37735, + "node_put_fsm_time_mean": 11828, + "node_put_fsm_time_median": 5017, + "node_puts": 10283, + "node_puts_counter": 1, + "node_puts_counter_total": 1, + "node_puts_hll": 1, + "node_puts_hll_total": 1, + "node_puts_map": 1, + "node_puts_map_total": 1, + "node_puts_set": 1, + "node_puts_set_total": 1, + "node_puts_total": 490965, + "nodename": "riak@127.0.0.1", + "object_counter_merge": 1, + "object_counter_merge_time_100": 1, + "object_counter_merge_time_95": 1, + "object_counter_merge_time_99": 1, + "object_counter_merge_time_mean": 1, + "object_counter_merge_time_median": 1, + "object_counter_merge_total": 1, + "object_hll_merge": 1, + "object_hll_merge_time_100": 1, + "object_hll_merge_time_95": 1, + "object_hll_merge_time_99": 1, + "object_hll_merge_time_mean": 1, + "object_hll_merge_time_median": 1, + "object_hll_merge_total": 1, + "object_map_merge": 1, + "object_map_merge_time_100": 1, + "object_map_merge_time_95": 1, + "object_map_merge_time_99": 1, + "object_map_merge_time_mean": 1, + "object_map_merge_time_median": 1, + "object_map_merge_total": 1, + "object_merge": 1, + "object_merge_time_100": 1, + "object_merge_time_95": 1, + "object_merge_time_99": 1, + "object_merge_time_mean": 1, + "object_merge_time_median": 1, + "object_merge_total": 7167, + "object_set_merge": 1, + "object_set_merge_time_100": 1, + "object_set_merge_time_95": 1, + "object_set_merge_time_99": 1, + "object_set_merge_time_mean": 1, + "object_set_merge_time_median": 1, + "object_set_merge_total": 1, + "pbc_active": 46, + "pbc_connects": 1, + "pbc_connects_total": 48, + "pipeline_active": 1, + "pipeline_create_count": 1, + "pipeline_create_error_count": 1, + "pipeline_create_error_one": 1, + "pipeline_create_one": 1, + "postcommit_fail": 1, + "precommit_fail": 1, + "read_repairs": 1, + "read_repairs_counter": 1, + "read_repairs_counter_total": 1, + "read_repairs_fallback_notfound_count": "undefined", + "read_repairs_fallback_notfound_one": "undefined", + "read_repairs_fallback_outofdate_count": "undefined", + "read_repairs_fallback_outofdate_one": "undefined", + "read_repairs_hll": 1, + "read_repairs_hll_total": 1, + "read_repairs_map": 1, + "read_repairs_map_total": 1, + "read_repairs_primary_notfound_count": 186, + "read_repairs_primary_notfound_one": 1, + "read_repairs_primary_outofdate_count": 24, + "read_repairs_primary_outofdate_one": 1, + "read_repairs_set": 1, + "read_repairs_set_total": 1, + "read_repairs_total": 105, + "rebalance_delay_last": 1, + "rebalance_delay_max": 1, + "rebalance_delay_mean": 1, + "rebalance_delay_min": 1, + "rejected_handoffs": 1, + "riak_kv_vnodeq_max": 3, + "riak_kv_vnodeq_mean": 0.078125, + "riak_kv_vnodeq_median": 1, + "riak_kv_vnodeq_min": 1, + "riak_kv_vnodeq_total": 5, + "riak_kv_vnodes_running": 64, + "riak_pipe_vnodeq_max": 1, + "riak_pipe_vnodeq_mean": 1, + "riak_pipe_vnodeq_median": 1, + "riak_pipe_vnodeq_min": 1, + "riak_pipe_vnodeq_total": 1, + "riak_pipe_vnodes_running": 64, + "ring_creation_size": 64, + "ring_members": [ + "riak@127.0.0.1" + ], + "ring_num_partitions": 64, + "ring_ownership": "[{'riak@127.0.0.1',64}]", + "rings_reconciled": 1, + "rings_reconciled_total": 1, + "set_actor_counts_100": 1, + "set_actor_counts_95": 1, + "set_actor_counts_99": 1, + "set_actor_counts_mean": 1, + "set_actor_counts_median": 1, + "skipped_read_repairs": 1, + "skipped_read_repairs_total": 1, + "storage_backend": "riak_kv_bitcask_backend", + "sys_driver_version": "2.2", + "sys_global_heaps_size": "deprecated", + "sys_heap_type": "private", + "sys_logical_processors": 4, + "sys_monitor_count": 966, + "sys_otp_release": "R16B02_basho10", + "sys_port_count": 336, + "sys_process_count": 2169, + "sys_smp_support": true, + "sys_system_architecture": "x86_64-unknown-linux-gnu", + "sys_system_version": "Erlang R16B02_basho10 (erts-5.10.3) [source] [64-bit] [smp:4:4] [async-threads:64] [hipe] [kernel-poll:true] [frame-pointer]", + "sys_thread_pool_size": 64, + "sys_threads_enabled": true, + "sys_wordsize": 8, + "vnode_counter_update": 1, + "vnode_counter_update_time_100": 1, + "vnode_counter_update_time_95": 1, + "vnode_counter_update_time_99": 1, + "vnode_counter_update_time_mean": 1, + "vnode_counter_update_time_median": 1, + "vnode_counter_update_total": 1, + "vnode_get_fsm_time_100": 836988, + "vnode_get_fsm_time_95": 3415, + "vnode_get_fsm_time_99": 7394, + "vnode_get_fsm_time_mean": 1159, + "vnode_get_fsm_time_median": 461, + "vnode_gets": 59641, + "vnode_gets_total": 1267893, + "vnode_hll_update": 1, + "vnode_hll_update_time_100": 1, + "vnode_hll_update_time_95": 1, + "vnode_hll_update_time_99": 1, + "vnode_hll_update_time_mean": 1, + "vnode_hll_update_time_median": 1, + "vnode_hll_update_total": 1, + "vnode_index_deletes": 1, + "vnode_index_deletes_postings": 1, + "vnode_index_deletes_postings_total": 1, + "vnode_index_deletes_total": 1, + "vnode_index_reads": 1, + "vnode_index_reads_total": 1, + "vnode_index_refreshes": 1, + "vnode_index_refreshes_total": 1, + "vnode_index_writes": 1, + "vnode_index_writes_postings": 1, + "vnode_index_writes_postings_total": 1, + "vnode_index_writes_total": 1, + "vnode_map_update": 1, + "vnode_map_update_time_100": 1, + "vnode_map_update_time_95": 1, + "vnode_map_update_time_99": 1, + "vnode_map_update_time_mean": 1, + "vnode_map_update_time_median": 1, + "vnode_map_update_total": 1, + "vnode_put_fsm_time_100": 1034955, + "vnode_put_fsm_time_95": 10302, + "vnode_put_fsm_time_99": 16813, + "vnode_put_fsm_time_mean": 4511, + "vnode_put_fsm_time_median": 1927, + "vnode_puts": 30852, + "vnode_puts_total": 1473108, + "vnode_set_update": 1, + "vnode_set_update_time_100": 1, + "vnode_set_update_time_95": 1, + "vnode_set_update_time_99": 1, + "vnode_set_update_time_mean": 1, + "vnode_set_update_time_median": 1, + "vnode_set_update_total": 1, + "write_once_merge": 1, + "write_once_put_objsize_100": 1, + "write_once_put_objsize_95": 1, + "write_once_put_objsize_99": 1, + "write_once_put_objsize_mean": 1, + "write_once_put_objsize_median": 1, + "write_once_put_time_100": 1, + "write_once_put_time_95": 1, + "write_once_put_time_99": 1, + "write_once_put_time_mean": 1, + "write_once_put_time_median": 1, + "write_once_puts": 1, + "write_once_puts_total": 1, + "disk": [ + { + "id": "/", + "size": 488386584, + "used": 11 + }, + { + "id": "/dev", + "size": 65536, + "used": 0 + }, + { + "id": "/sys/fs/cgroup", + "size": 8168188, + "used": 0 + }, + { + "id": "/etc/hosts", + "size": 488386584, + "used": 11 + }, + { + "id": "/dev/shm", + "size": 65536, + "used": 0 + }, + { + "id": "/proc/asound", + "size": 8168188, + "used": 0 + }, + { + "id": "/proc/acpi", + "size": 8168188, + "used": 0 + }, + { + "id": "/sys/firmware", + "size": 8168188, + "used": 0 + } + ], + "riak_auth_mods_version": "2.1.0-0-g31b8b30", + "erlydtl_version": "0.7.0", + "riak_control_version": "2.1.6-0-gcbf605a", + "cluster_info_version": "2.0.5-0-gd61d055", + "yokozuna_version": "2.1.10-0-gb53d999", + "fuse_version": "2.1.0", + "ibrowse_version": "4.0.2", + "riak_search_version": "2.1.6-0-g0d398f2", + "merge_index_version": "2.0.4-0-gc5efac6", + "riak_kv_version": "2.1.7-0-gbd8e312", + "riak_api_version": "2.1.6-0-ga678e25", + "riak_pb_version": "2.2.0.0-0-gf5af9ff", + "protobuffs_version": "0.9.0-0-g0dde9d3", + "riak_dt_version": "2.1.3-0-g9450044", + "sidejob_version": "2.0.1-0-g8ac6803", + "riak_pipe_version": "2.1.5-0-g8b2c842", + "riak_core_version": "2.1.9-0-gb8a11b4", + "exometer_core_version": "1.0.0-basho9-0-gfcc8662", + "poolboy_version": "0.8.1p3-0-g8bb45fb", + "pbkdf2_version": "2.0.0-0-g7076584", + "eleveldb_version": "2.0.34-0-g55abc57", + "clique_version": "0.3.9-0-ge7114e9", + "bitcask_version": "2.0.3", + "basho_stats_version": "1.0.3", + "webmachine_version": "1.10.8-basho1-0-g494d14f", + "mochiweb_version": "2.9.0", + "inets_version": "5.9.6", + "xmerl_version": "1.3.4", + "erlang_js_version": "1.3.0-0-g07467d8", + "runtime_tools_version": "1.8.12", + "os_mon_version": "2.2.13", + "riak_sysmon_version": "2.1.5-0-g0ab94b3", + "ssl_version": "5.3.1", + "public_key_version": "0.20", + "crypto_version": "3.1", + "asn1_version": "2.0.3", + "sasl_version": "2.3.3", + "lager_version": "3.2.2", + "goldrush_version": "0.1.9", + "compiler_version": "4.9.3", + "syntax_tools_version": "1.6.11", + "stdlib_version": "1.19.3", + "kernel_version": "2.16.3" +} diff --git a/src/go/collectors/go.d.plugin/modules/rspamd/README.md b/src/go/plugin/go.d/modules/rspamd/README.md index b18fa059..b18fa059 120000 --- a/src/go/collectors/go.d.plugin/modules/rspamd/README.md +++ b/src/go/plugin/go.d/modules/rspamd/README.md diff --git a/src/go/collectors/go.d.plugin/modules/rspamd/charts.go b/src/go/plugin/go.d/modules/rspamd/charts.go index fcf21fb4..3d28ab21 100644 --- a/src/go/collectors/go.d.plugin/modules/rspamd/charts.go +++ b/src/go/plugin/go.d/modules/rspamd/charts.go @@ -2,7 +2,7 @@ package rspamd -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" const ( prioClassifications = module.Priority + iota diff --git a/src/go/collectors/go.d.plugin/modules/rspamd/collect.go b/src/go/plugin/go.d/modules/rspamd/collect.go index bb7f5710..ecbe4a03 100644 --- a/src/go/collectors/go.d.plugin/modules/rspamd/collect.go +++ b/src/go/plugin/go.d/modules/rspamd/collect.go @@ -8,8 +8,8 @@ import ( "io" "net/http" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) type rspamdStats struct { @@ -50,13 +50,11 @@ func (r *Rspamd) collect() (map[string]int64, error) { } func (r *Rspamd) queryRspamdStats() (*rspamdStats, error) { - req, err := web.NewHTTPRequest(r.Request) + req, err := web.NewHTTPRequestWithPath(r.Request, "/stat") if err != nil { return nil, err } - req.URL.Path = "/stat" - var stats rspamdStats if err := r.doOKDecode(req, &stats); err != nil { return nil, err diff --git a/src/go/collectors/go.d.plugin/modules/rspamd/config_schema.json b/src/go/plugin/go.d/modules/rspamd/config_schema.json index 8ed49475..c7b866d8 100644 --- a/src/go/collectors/go.d.plugin/modules/rspamd/config_schema.json +++ b/src/go/plugin/go.d/modules/rspamd/config_schema.json @@ -123,6 +123,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/rspamd/integrations/rspamd.md b/src/go/plugin/go.d/modules/rspamd/integrations/rspamd.md index e72c12dd..fe094942 100644 --- a/src/go/collectors/go.d.plugin/modules/rspamd/integrations/rspamd.md +++ b/src/go/plugin/go.d/modules/rspamd/integrations/rspamd.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/rspamd/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/rspamd/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/rspamd/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/rspamd/metadata.yaml" sidebar_label: "Rspamd" learn_status: "Published" learn_rel_path: "Collecting Metrics/Security Systems" @@ -183,6 +183,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `rspamd` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -205,4 +207,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m rspamd ``` +### Getting Logs + +If you're encountering problems with the `rspamd` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep rspamd +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep rspamd /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep rspamd +``` + diff --git a/src/go/collectors/go.d.plugin/modules/rspamd/metadata.yaml b/src/go/plugin/go.d/modules/rspamd/metadata.yaml index a8ab16b4..a8ab16b4 100644 --- a/src/go/collectors/go.d.plugin/modules/rspamd/metadata.yaml +++ b/src/go/plugin/go.d/modules/rspamd/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/rspamd/rspamd.go b/src/go/plugin/go.d/modules/rspamd/rspamd.go index 6972c9e9..0a5c4ffe 100644 --- a/src/go/collectors/go.d.plugin/modules/rspamd/rspamd.go +++ b/src/go/plugin/go.d/modules/rspamd/rspamd.go @@ -8,8 +8,8 @@ import ( "net/http" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/rspamd/rspamd_test.go b/src/go/plugin/go.d/modules/rspamd/rspamd_test.go index c5db42ce..0c8cc8e5 100644 --- a/src/go/collectors/go.d.plugin/modules/rspamd/rspamd_test.go +++ b/src/go/plugin/go.d/modules/rspamd/rspamd_test.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/vcsa/testdata/config.json b/src/go/plugin/go.d/modules/rspamd/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/vcsa/testdata/config.json +++ b/src/go/plugin/go.d/modules/rspamd/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/vcsa/testdata/config.yaml b/src/go/plugin/go.d/modules/rspamd/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/vcsa/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/rspamd/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/rspamd/testdata/v3.4-stat.json b/src/go/plugin/go.d/modules/rspamd/testdata/v3.4-stat.json index 38145477..38145477 100644 --- a/src/go/collectors/go.d.plugin/modules/rspamd/testdata/v3.4-stat.json +++ b/src/go/plugin/go.d/modules/rspamd/testdata/v3.4-stat.json diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/README.md b/src/go/plugin/go.d/modules/scaleio/README.md index 1836d280..1836d280 120000 --- a/src/go/collectors/go.d.plugin/modules/scaleio/README.md +++ b/src/go/plugin/go.d/modules/scaleio/README.md diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/charts.go b/src/go/plugin/go.d/modules/scaleio/charts.go index a6ac24bd..9efd52c7 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/charts.go +++ b/src/go/plugin/go.d/modules/scaleio/charts.go @@ -5,9 +5,9 @@ package scaleio import ( "fmt" - "github.com/netdata/netdata/go/go.d.plugin/modules/scaleio/client" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/scaleio/client" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) type ( diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/client/client.go b/src/go/plugin/go.d/modules/scaleio/client/client.go index e60dfbf6..698b2d17 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/client/client.go +++ b/src/go/plugin/go.d/modules/scaleio/client/client.go @@ -13,7 +13,7 @@ import ( "strings" "sync" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) /* diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/client/client_test.go b/src/go/plugin/go.d/modules/scaleio/client/client_test.go index ea82814c..02e1988b 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/client/client_test.go +++ b/src/go/plugin/go.d/modules/scaleio/client/client_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/client/server.go b/src/go/plugin/go.d/modules/scaleio/client/server.go index b7269d33..b7269d33 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/client/server.go +++ b/src/go/plugin/go.d/modules/scaleio/client/server.go diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/client/types.go b/src/go/plugin/go.d/modules/scaleio/client/types.go index c85bddf8..c85bddf8 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/client/types.go +++ b/src/go/plugin/go.d/modules/scaleio/client/types.go diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/collect.go b/src/go/plugin/go.d/modules/scaleio/collect.go index 93a0a609..a7782a7d 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/collect.go +++ b/src/go/plugin/go.d/modules/scaleio/collect.go @@ -5,8 +5,8 @@ package scaleio import ( "time" - "github.com/netdata/netdata/go/go.d.plugin/modules/scaleio/client" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/scaleio/client" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) const discoveryEvery = 5 diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/collect_sdc.go b/src/go/plugin/go.d/modules/scaleio/collect_sdc.go index e840b781..f6262670 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/collect_sdc.go +++ b/src/go/plugin/go.d/modules/scaleio/collect_sdc.go @@ -2,7 +2,7 @@ package scaleio -import "github.com/netdata/netdata/go/go.d.plugin/modules/scaleio/client" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/scaleio/client" func (s *ScaleIO) collectSdc(ss map[string]client.SdcStatistics) map[string]sdcMetrics { ms := make(map[string]sdcMetrics, len(ss)) diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/collect_storage_pool.go b/src/go/plugin/go.d/modules/scaleio/collect_storage_pool.go index 409be0bd..4a347a64 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/collect_storage_pool.go +++ b/src/go/plugin/go.d/modules/scaleio/collect_storage_pool.go @@ -2,7 +2,7 @@ package scaleio -import "github.com/netdata/netdata/go/go.d.plugin/modules/scaleio/client" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/scaleio/client" func (s *ScaleIO) collectStoragePool(ss map[string]client.StoragePoolStatistics) map[string]storagePoolMetrics { ms := make(map[string]storagePoolMetrics, len(ss)) diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/collect_system.go b/src/go/plugin/go.d/modules/scaleio/collect_system.go index b2c02db1..ae6e89aa 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/collect_system.go +++ b/src/go/plugin/go.d/modules/scaleio/collect_system.go @@ -2,7 +2,7 @@ package scaleio -import "github.com/netdata/netdata/go/go.d.plugin/modules/scaleio/client" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/scaleio/client" func (s *ScaleIO) collectSystem(ss client.SystemStatistics) systemMetrics { var sm systemMetrics diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/config_schema.json b/src/go/plugin/go.d/modules/scaleio/config_schema.json index ba106732..97aea7fa 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/config_schema.json +++ b/src/go/plugin/go.d/modules/scaleio/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/integrations/dell_emc_scaleio.md b/src/go/plugin/go.d/modules/scaleio/integrations/dell_emc_scaleio.md index c5a97760..36d02252 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/integrations/dell_emc_scaleio.md +++ b/src/go/plugin/go.d/modules/scaleio/integrations/dell_emc_scaleio.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/scaleio/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/scaleio/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/scaleio/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/scaleio/metadata.yaml" sidebar_label: "Dell EMC ScaleIO" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -230,6 +230,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `scaleio` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -252,4 +254,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m scaleio ``` +### Getting Logs + +If you're encountering problems with the `scaleio` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep scaleio +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep scaleio /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep scaleio +``` + diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/metadata.yaml b/src/go/plugin/go.d/modules/scaleio/metadata.yaml index edee6fc8..edee6fc8 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/metadata.yaml +++ b/src/go/plugin/go.d/modules/scaleio/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/metrics.go b/src/go/plugin/go.d/modules/scaleio/metrics.go index a5a9b981..a5a9b981 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/metrics.go +++ b/src/go/plugin/go.d/modules/scaleio/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/queries.go b/src/go/plugin/go.d/modules/scaleio/queries.go index 265c3b87..4f38f997 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/queries.go +++ b/src/go/plugin/go.d/modules/scaleio/queries.go @@ -2,7 +2,7 @@ package scaleio -import "github.com/netdata/netdata/go/go.d.plugin/modules/scaleio/client" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/scaleio/client" /* Starting from version 3 of ScaleIO/VxFlex API numOfScsiInitiators property is removed from the system selectedStatisticsQuery. diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/scaleio.go b/src/go/plugin/go.d/modules/scaleio/scaleio.go index 4cc8e69a..d32ccbff 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/scaleio.go +++ b/src/go/plugin/go.d/modules/scaleio/scaleio.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/modules/scaleio/client" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/scaleio/client" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/scaleio_test.go b/src/go/plugin/go.d/modules/scaleio/scaleio_test.go index 970ee263..bb906333 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/scaleio_test.go +++ b/src/go/plugin/go.d/modules/scaleio/scaleio_test.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/modules/scaleio/client" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/scaleio/client" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/testdata/config.json b/src/go/plugin/go.d/modules/scaleio/testdata/config.json index 984c3ed6..984c3ed6 100644 --- a/src/go/collectors/go.d.plugin/modules/vernemq/testdata/config.json +++ b/src/go/plugin/go.d/modules/scaleio/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/testdata/config.yaml b/src/go/plugin/go.d/modules/scaleio/testdata/config.yaml index 8558b61c..8558b61c 100644 --- a/src/go/collectors/go.d.plugin/modules/vernemq/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/scaleio/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/testdata/instances.json b/src/go/plugin/go.d/modules/scaleio/testdata/instances.json index bc8c6e8a..bc8c6e8a 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/testdata/instances.json +++ b/src/go/plugin/go.d/modules/scaleio/testdata/instances.json diff --git a/src/go/collectors/go.d.plugin/modules/scaleio/testdata/selected_statistics.json b/src/go/plugin/go.d/modules/scaleio/testdata/selected_statistics.json index 0b141bbe..0b141bbe 100644 --- a/src/go/collectors/go.d.plugin/modules/scaleio/testdata/selected_statistics.json +++ b/src/go/plugin/go.d/modules/scaleio/testdata/selected_statistics.json diff --git a/src/go/collectors/go.d.plugin/modules/sensors/README.md b/src/go/plugin/go.d/modules/sensors/README.md index 4e92b088..4e92b088 120000 --- a/src/go/collectors/go.d.plugin/modules/sensors/README.md +++ b/src/go/plugin/go.d/modules/sensors/README.md diff --git a/src/go/collectors/go.d.plugin/modules/sensors/charts.go b/src/go/plugin/go.d/modules/sensors/charts.go index 20df057c..05081e1a 100644 --- a/src/go/collectors/go.d.plugin/modules/sensors/charts.go +++ b/src/go/plugin/go.d/modules/sensors/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/sensors/collect.go b/src/go/plugin/go.d/modules/sensors/collect.go index 46e900ad..46e900ad 100644 --- a/src/go/collectors/go.d.plugin/modules/sensors/collect.go +++ b/src/go/plugin/go.d/modules/sensors/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/sensors/config_schema.json b/src/go/plugin/go.d/modules/sensors/config_schema.json index 6c12ca9b..6c12ca9b 100644 --- a/src/go/collectors/go.d.plugin/modules/sensors/config_schema.json +++ b/src/go/plugin/go.d/modules/sensors/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/sensors/exec.go b/src/go/plugin/go.d/modules/sensors/exec.go index b920da66..c386ddd7 100644 --- a/src/go/collectors/go.d.plugin/modules/sensors/exec.go +++ b/src/go/plugin/go.d/modules/sensors/exec.go @@ -8,7 +8,7 @@ import ( "os/exec" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" ) func newSensorsCliExec(binPath string, timeout time.Duration) *sensorsCliExec { diff --git a/src/go/collectors/go.d.plugin/modules/sensors/init.go b/src/go/plugin/go.d/modules/sensors/init.go index 6753693d..6753693d 100644 --- a/src/go/collectors/go.d.plugin/modules/sensors/init.go +++ b/src/go/plugin/go.d/modules/sensors/init.go diff --git a/src/go/collectors/go.d.plugin/modules/sensors/integrations/linux_sensors_lm-sensors.md b/src/go/plugin/go.d/modules/sensors/integrations/linux_sensors_lm-sensors.md index 6a50fafb..d5e948c4 100644 --- a/src/go/collectors/go.d.plugin/modules/sensors/integrations/linux_sensors_lm-sensors.md +++ b/src/go/plugin/go.d/modules/sensors/integrations/linux_sensors_lm-sensors.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/sensors/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/sensors/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/sensors/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/sensors/metadata.yaml" sidebar_label: "Linux Sensors (lm-sensors)" learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -155,6 +155,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `sensors` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -177,4 +179,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m sensors ``` +### Getting Logs + +If you're encountering problems with the `sensors` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep sensors +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep sensors /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep sensors +``` + diff --git a/src/go/collectors/go.d.plugin/modules/sensors/metadata.yaml b/src/go/plugin/go.d/modules/sensors/metadata.yaml index 5ea94f39..5ea94f39 100644 --- a/src/go/collectors/go.d.plugin/modules/sensors/metadata.yaml +++ b/src/go/plugin/go.d/modules/sensors/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/sensors/sensors.go b/src/go/plugin/go.d/modules/sensors/sensors.go index 69f0c4db..379d44de 100644 --- a/src/go/collectors/go.d.plugin/modules/sensors/sensors.go +++ b/src/go/plugin/go.d/modules/sensors/sensors.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/sensors/sensors_test.go b/src/go/plugin/go.d/modules/sensors/sensors_test.go index d9b4242e..a370d750 100644 --- a/src/go/collectors/go.d.plugin/modules/sensors/sensors_test.go +++ b/src/go/plugin/go.d/modules/sensors/sensors_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/zfspool/testdata/config.json b/src/go/plugin/go.d/modules/sensors/testdata/config.json index 09571319..09571319 100644 --- a/src/go/collectors/go.d.plugin/modules/zfspool/testdata/config.json +++ b/src/go/plugin/go.d/modules/sensors/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/zfspool/testdata/config.yaml b/src/go/plugin/go.d/modules/sensors/testdata/config.yaml index baf3bcd0..baf3bcd0 100644 --- a/src/go/collectors/go.d.plugin/modules/zfspool/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/sensors/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/sensors/testdata/sensors-temp-in-curr-power-fan.txt b/src/go/plugin/go.d/modules/sensors/testdata/sensors-temp-in-curr-power-fan.txt index a38c7ab4..a38c7ab4 100644 --- a/src/go/collectors/go.d.plugin/modules/sensors/testdata/sensors-temp-in-curr-power-fan.txt +++ b/src/go/plugin/go.d/modules/sensors/testdata/sensors-temp-in-curr-power-fan.txt diff --git a/src/go/collectors/go.d.plugin/modules/sensors/testdata/sensors-temp.txt b/src/go/plugin/go.d/modules/sensors/testdata/sensors-temp.txt index decc7ee3..decc7ee3 100644 --- a/src/go/collectors/go.d.plugin/modules/sensors/testdata/sensors-temp.txt +++ b/src/go/plugin/go.d/modules/sensors/testdata/sensors-temp.txt diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/README.md b/src/go/plugin/go.d/modules/smartctl/README.md index 63aad6c8..63aad6c8 120000 --- a/src/go/collectors/go.d.plugin/modules/smartctl/README.md +++ b/src/go/plugin/go.d/modules/smartctl/README.md diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/charts.go b/src/go/plugin/go.d/modules/smartctl/charts.go index 2a5fea02..461f7350 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/charts.go +++ b/src/go/plugin/go.d/modules/smartctl/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( @@ -16,6 +16,10 @@ const ( prioDeviceTemperature prioDevicePowerCycleCount + prioDeviceScsiReadErrors + prioDeviceScsiWriteErrors + prioDeviceScsiVerifyErrors + prioDeviceSmartAttributeDecoded prioDeviceSmartAttributeNormalized ) @@ -92,6 +96,54 @@ var ( } ) +var deviceScsiErrorLogChartsTmpl = module.Charts{ + deviceScsiReadErrorsChartTmpl.Copy(), + deviceScsiWriteErrorsChartTmpl.Copy(), + deviceScsiVerifyErrorsChartTmpl.Copy(), +} + +var ( + deviceScsiReadErrorsChartTmpl = module.Chart{ + ID: "device_%s_type_%s_read_errors_rate", + Title: "Device read errors", + Units: "errors/s", + Fam: "scsi errors", + Ctx: "smartctl.device_read_errors_rate", + Type: module.Line, + Priority: prioDeviceScsiReadErrors, + Dims: module.Dims{ + {ID: "device_%s_type_%s_scsi_error_log_read_total_errors_corrected", Name: "corrected", Algo: module.Incremental}, + {ID: "device_%s_type_%s_scsi_error_log_read_total_uncorrected_errors", Name: "uncorrected", Algo: module.Incremental}, + }, + } + deviceScsiWriteErrorsChartTmpl = module.Chart{ + ID: "device_%s_type_%s_write_errors_rate", + Title: "Device write errors", + Units: "errors/s", + Fam: "scsi errors", + Ctx: "smartctl.device_write_errors_rate", + Type: module.Line, + Priority: prioDeviceScsiWriteErrors, + Dims: module.Dims{ + {ID: "device_%s_type_%s_scsi_error_log_write_total_errors_corrected", Name: "corrected", Algo: module.Incremental}, + {ID: "device_%s_type_%s_scsi_error_log_read_total_uncorrected_errors", Name: "uncorrected", Algo: module.Incremental}, + }, + } + deviceScsiVerifyErrorsChartTmpl = module.Chart{ + ID: "device_%s_type_%s_verify_errors_rate", + Title: "Device verify errors", + Units: "errors/s", + Fam: "scsi errors", + Ctx: "smartctl.device_verify_errors_rate", + Type: module.Line, + Priority: prioDeviceScsiVerifyErrors, + Dims: module.Dims{ + {ID: "device_%s_type_%s_scsi_error_log_verify_total_errors_corrected", Name: "corrected", Algo: module.Incremental}, + {ID: "device_%s_type_%s_scsi_error_log_verify_total_uncorrected_errors", Name: "uncorrected", Algo: module.Incremental}, + }, + } +) + var ( deviceSmartAttributeDecodedChartTmpl = module.Chart{ ID: "device_%s_type_%s_smart_attr_%s", @@ -132,6 +184,11 @@ func (s *Smartctl) addDeviceCharts(dev *smartDevice) { s.Warning(err) } } + if cs := s.newDeviceScsiErrorLogCharts(dev); cs != nil && len(*cs) > 0 { + if err := charts.Add(*cs...); err != nil { + s.Warning(err) + } + } if err := s.Charts().Add(charts...); err != nil { s.Warning(err) @@ -235,6 +292,29 @@ func (s *Smartctl) newDeviceSmartAttrCharts(dev *smartDevice) *module.Charts { return &charts } +func (s *Smartctl) newDeviceScsiErrorLogCharts(dev *smartDevice) *module.Charts { + if dev.deviceType() != "scsi" || !dev.data.Get("scsi_error_counter_log").Exists() { + return nil + } + + charts := deviceScsiErrorLogChartsTmpl.Copy() + + for _, chart := range *charts { + chart.ID = fmt.Sprintf(chart.ID, dev.deviceName(), dev.deviceType()) + chart.Labels = []module.Label{ + {Key: "device_name", Value: dev.deviceName()}, + {Key: "device_type", Value: dev.deviceType()}, + {Key: "model_name", Value: dev.modelName()}, + {Key: "serial_number", Value: dev.serialNumber()}, + } + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf(dim.ID, dev.deviceName(), dev.deviceType()) + } + } + + return charts +} + var attrNameReplacer = strings.NewReplacer(" ", "_", "/", "_") func cleanAttributeName(attrName string) string { diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/collect.go b/src/go/plugin/go.d/modules/smartctl/collect.go index 79cbb13d..35585db6 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/collect.go +++ b/src/go/plugin/go.d/modules/smartctl/collect.go @@ -42,7 +42,8 @@ func (s *Smartctl) collect() (map[string]int64, error) { // TODO: make it concurrent for _, d := range s.scannedDevices { if err := s.collectScannedDevice(mx, d); err != nil { - return nil, err + s.Warning(err) + continue } } @@ -57,7 +58,7 @@ func (s *Smartctl) collect() (map[string]int64, error) { func (s *Smartctl) collectScannedDevice(mx map[string]int64, scanDev *scanDevice) error { resp, err := s.exec.deviceInfo(scanDev.name, scanDev.typ, s.NoCheckPowerMode) if err != nil { - if resp != nil && isDeviceOpenFailedNoSuchDevice(resp) { + if resp != nil && isDeviceOpenFailedNoSuchDevice(resp) && !scanDev.extra { s.Infof("smartctl reported that device '%s' type '%s' no longer exists", scanDev.name, scanDev.typ) s.forceScan = true return nil @@ -136,10 +137,34 @@ func (s *Smartctl) collectSmartDevice(mx map[string]int64, dev *smartDevice) { } } } + + if dev.deviceType() == "scsi" { + sel := dev.data.Get("scsi_error_counter_log") + if !sel.Exists() { + return + } + + for _, v := range []string{"read", "write", "verify"} { + for _, n := range []string{ + //"errors_corrected_by_eccdelayed", + //"errors_corrected_by_eccfast", + //"errors_corrected_by_rereads_rewrites", + "total_errors_corrected", + "total_uncorrected_errors", + } { + key := fmt.Sprintf("%sscsi_error_log_%s_%s", px, v, n) + metric := fmt.Sprintf("%s.%s", v, n) + + if m := sel.Get(metric); m.Exists() { + mx[key] = m.Int() + } + } + } + } } func (s *Smartctl) isTimeToScan(now time.Time) bool { - return now.After(s.lastScanTime.Add(s.ScanEvery.Duration())) + return s.ScanEvery.Duration().Seconds() != 0 && now.After(s.lastScanTime.Add(s.ScanEvery.Duration())) } func (s *Smartctl) isTimeToPollDevices(now time.Time) bool { diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/config_schema.json b/src/go/plugin/go.d/modules/smartctl/config_schema.json index 8093cc5f..afe7ce1a 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/config_schema.json +++ b/src/go/plugin/go.d/modules/smartctl/config_schema.json @@ -20,7 +20,7 @@ }, "scan_every": { "title": "Scan interval", - "description": "Interval for discovering new devices using `smartctl --scan`, measured in seconds.", + "description": "Interval for discovering new devices using `smartctl --scan`, measured in seconds. Set to 0 to scan devices only once on startup.", "type": "number", "minimum": 1, "default": 900 @@ -50,6 +50,36 @@ "type": "string", "minimum": 1, "default": "*" + }, + "extra_devices": { + "title": "Extra devices", + "description": "Allows manual specification of devices not automatically detected by `smartctl --scan`. Each device entry must include both a name and a type.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "title": "Device", + "type": [ + "object", + "null" + ], + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + } + } + } } }, "additionalProperties": false, @@ -75,9 +105,10 @@ ] }, { - "title": "Filtering", + "title": "Devices", "fields": [ - "device_selector" + "device_selector", + "extra_devices" ] } ] @@ -94,6 +125,16 @@ }, "device_selector": { "ui:help": "Leave blank or use `*` to collect data for all devices." + }, + "extra_devices": { + "items": { + "name": { + "ui:placeholder": "/dev/sda" + }, + "type": { + "ui:placeholder": "jmb39x-q,3" + } + } } } } diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/exec.go b/src/go/plugin/go.d/modules/smartctl/exec.go index a90e1b52..94974c0d 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/exec.go +++ b/src/go/plugin/go.d/modules/smartctl/exec.go @@ -9,7 +9,7 @@ import ( "os/exec" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" "github.com/tidwall/gjson" ) @@ -29,7 +29,10 @@ type smartctlCliExec struct { timeout time.Duration } -func (e *smartctlCliExec) scan() (*gjson.Result, error) { +func (e *smartctlCliExec) scan(open bool) (*gjson.Result, error) { + if open { + return e.execute("smartctl-json-scan-open") + } return e.execute("smartctl-json-scan") } diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/init.go b/src/go/plugin/go.d/modules/smartctl/init.go index b5d4ebfe..6d3731a1 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/init.go +++ b/src/go/plugin/go.d/modules/smartctl/init.go @@ -7,8 +7,8 @@ import ( "os" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/pkg/executable" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" ) func (s *Smartctl) validateConfig() error { @@ -17,6 +17,13 @@ func (s *Smartctl) validateConfig() error { default: return fmt.Errorf("invalid power mode '%s'", s.NoCheckPowerMode) } + + for _, v := range s.ExtraDevices { + if v.Name == "" || v.Type == "" { + return fmt.Errorf("invalid extra device: name and type must both be provided, got name='%s' type='%s'", v.Name, v.Type) + } + } + return nil } diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/integrations/s.m.a.r.t..md b/src/go/plugin/go.d/modules/smartctl/integrations/s.m.a.r.t..md index 482fedbd..b9eb9f36 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/integrations/s.m.a.r.t..md +++ b/src/go/plugin/go.d/modules/smartctl/integrations/s.m.a.r.t..md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/smartctl/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/smartctl/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/smartctl/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/smartctl/metadata.yaml" sidebar_label: "S.M.A.R.T." learn_status: "Published" learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors" @@ -83,6 +83,9 @@ Metrics: | smartctl.device_power_on_time | power_on_time | seconds | | smartctl.device_temperature | temperature | Celsius | | smartctl.device_power_cycles_count | power | cycles | +| smartctl.device_read_errors_rate | corrected, uncorrected | errors/s | +| smartctl.device_write_errors_rate | corrected, uncorrected | errors/s | +| smartctl.device_verify_errors_rate | corrected, uncorrected | errors/s | | smartctl.device_smart_attr_{attribute_name} | {attribute_name} | {attribute_unit} | | smartctl.device_smart_attr_{attribute_name}_normalized | {attribute_name} | value | @@ -102,6 +105,40 @@ There are no alerts configured by default for this integration. Install `smartmontools` version 7.0 or later using your distribution's package manager. Version 7.0 introduced the `--json` output mode, which is required for this collector to function properly. +#### For Netdata running in a Docker container + +1. **Install smartmontools**. + + Ensure `smartctl` is available in the container by setting the environment variable `NETDATA_EXTRA_DEB_PACKAGES=smartmontools` when starting the container. + +2. **Provide access to storage devices**. + + Netdata requires the `SYS_RAWIO` capability and access to the storage devices to run the `smartctl` collector inside a Docker container. Here's how you can achieve this: + + - `docker run` + + ```bash + docker run --cap-add SYS_RAWIO --device /dev/sda:/dev/sda ... + ``` + + - `docker-compose.yml` + + ```yaml + services: + netdata: + cap_add: + - SYS_PTRACE + - SYS_ADMIN + - SYS_RAWIO # smartctl + devices: + - "/dev/sda:/dev/sda" + ``` + + > **Multiple Devices**: These examples only show mapping of one device (/dev/sda). You'll need to add additional `--device` options (in docker run) or entries in the `devices` list (in docker-compose.yml) for each storage device you want Netdata's smartctl collector to monitor. + + > **NVMe Devices**: Do not map NVMe devices using this method. Netdata uses a [dedicated collector](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nvme#readme) to monitor NVMe devices. + + ### Configuration @@ -128,9 +165,23 @@ The following options can be defined globally: update_every. |:----|:-----------|:-------|:--------:| | update_every | interval for updating Netdata charts, measured in seconds. Collector might use cached data if less than **Devices poll interval**. | 10 | no | | timeout | smartctl binary execution timeout. | 5 | no | -| scan_every | interval for discovering new devices using `smartctl --scan`, measured in seconds. | 900 | no | +| scan_every | interval for discovering new devices using `smartctl --scan`, measured in seconds. Set to 0 to scan devices only once on startup. | 900 | no | | poll_devices_every | interval for gathering data for every device, measured in seconds. Data is cached for this interval. | 300 | no | | device_selector | Specifies a pattern to match the 'info name' of devices as reported by `smartctl --scan --json`. | * | no | +| extra_devices | Allows manual specification of devices not automatically detected by `smartctl --scan`. Each device entry must include both a name and a type. See "Configuration Examples" for details. | [] | no | +| no_check_power_mode | Skip data collection when the device is in a low-power mode. Prevents unnecessary disk spin-up. | standby | no | + +##### no_check_power_mode + +The valid arguments to this option are: + +| Mode | Description | +|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| never | Check the device always. | +| sleep | Check the device unless it is in SLEEP mode. | +| standby | Check the device unless it is in SLEEP or STANDBY mode. In these modes most disks are not spinning, so if you want to prevent a disk from spinning up, this is probably what you want. | +| idle | Check the device unless it is in SLEEP, STANDBY or IDLE mode. In the IDLE state, most disks are still spinning, so this is probably not what you want. | + </details> @@ -150,12 +201,31 @@ jobs: ``` </details> +##### Extra devices + +This example demonstrates using `extra_devices` to manually add a storage device (`/dev/sdc`) not automatically detected by `smartctl --scan`. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: smartctl + extra_devices: + - name: /dev/sdc + type: jmb39x-q,3 + +``` +</details> + ## Troubleshooting ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `smartctl` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -178,4 +248,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m smartctl ``` +### Getting Logs + +If you're encountering problems with the `smartctl` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep smartctl +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep smartctl /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep smartctl +``` + diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/metadata.yaml b/src/go/plugin/go.d/modules/smartctl/metadata.yaml index 6d409ec5..e748e82a 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/metadata.yaml +++ b/src/go/plugin/go.d/modules/smartctl/metadata.yaml @@ -52,6 +52,38 @@ modules: - title: Install smartmontools (v7.0+) description: | Install `smartmontools` version 7.0 or later using your distribution's package manager. Version 7.0 introduced the `--json` output mode, which is required for this collector to function properly. + - title: For Netdata running in a Docker container + description: | + 1. **Install smartmontools**. + + Ensure `smartctl` is available in the container by setting the environment variable `NETDATA_EXTRA_DEB_PACKAGES=smartmontools` when starting the container. + + 2. **Provide access to storage devices**. + + Netdata requires the `SYS_RAWIO` capability and access to the storage devices to run the `smartctl` collector inside a Docker container. Here's how you can achieve this: + + - `docker run` + + ```bash + docker run --cap-add SYS_RAWIO --device /dev/sda:/dev/sda ... + ``` + + - `docker-compose.yml` + + ```yaml + services: + netdata: + cap_add: + - SYS_PTRACE + - SYS_ADMIN + - SYS_RAWIO # smartctl + devices: + - "/dev/sda:/dev/sda" + ``` + + > **Multiple Devices**: These examples only show mapping of one device (/dev/sda). You'll need to add additional `--device` options (in docker run) or entries in the `devices` list (in docker-compose.yml) for each storage device you want Netdata's smartctl collector to monitor. + + > **NVMe Devices**: Do not map NVMe devices using this method. Netdata uses a [dedicated collector](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/modules/nvme#readme) to monitor NVMe devices. configuration: file: name: go.d/smartctl.conf @@ -71,7 +103,7 @@ modules: default_value: 5 required: false - name: scan_every - description: interval for discovering new devices using `smartctl --scan`, measured in seconds. + description: interval for discovering new devices using `smartctl --scan`, measured in seconds. Set to 0 to scan devices only once on startup. default_value: 900 required: false - name: poll_devices_every @@ -82,6 +114,23 @@ modules: description: "Specifies a pattern to match the 'info name' of devices as reported by `smartctl --scan --json`." default_value: "*" required: false + - name: extra_devices + description: "Allows manual specification of devices not automatically detected by `smartctl --scan`. Each device entry must include both a name and a type. See \"Configuration Examples\" for details." + default_value: "[]" + required: false + - name: no_check_power_mode + description: "Skip data collection when the device is in a low-power mode. Prevents unnecessary disk spin-up." + default_value: standby + required: false + detailed_description: | + The valid arguments to this option are: + + | Mode | Description | + |---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | never | Check the device always. | + | sleep | Check the device unless it is in SLEEP mode. | + | standby | Check the device unless it is in SLEEP or STANDBY mode. In these modes most disks are not spinning, so if you want to prevent a disk from spinning up, this is probably what you want. | + | idle | Check the device unless it is in SLEEP, STANDBY or IDLE mode. In the IDLE state, most disks are still spinning, so this is probably not what you want. | examples: folding: title: Config @@ -93,6 +142,15 @@ modules: jobs: - name: smartctl devices_poll_interval: 60 # Collect S.M.A.R.T statistics every 60 seconds + - name: Extra devices + description: | + This example demonstrates using `extra_devices` to manually add a storage device (`/dev/sdc`) not automatically detected by `smartctl --scan`. + config: | + jobs: + - name: smartctl + extra_devices: + - name: /dev/sdc + type: jmb39x-q,3 troubleshooting: problems: list: [] @@ -147,6 +205,27 @@ modules: chart_type: line dimensions: - name: power + - name: smartctl.device_read_errors_rate + description: Device read errors + unit: errors/s + chart_type: line + dimensions: + - name: corrected + - name: uncorrected + - name: smartctl.device_write_errors_rate + description: Device write errors + unit: errors/s + chart_type: line + dimensions: + - name: corrected + - name: uncorrected + - name: smartctl.device_verify_errors_rate + description: Device verify errors + unit: errors/s + chart_type: line + dimensions: + - name: corrected + - name: uncorrected - name: smartctl.device_smart_attr_{attribute_name} description: Device smart attribute {attribute_name} unit: '{attribute_unit}' diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/scan.go b/src/go/plugin/go.d/modules/smartctl/scan.go index 9310938f..5564897a 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/scan.go +++ b/src/go/plugin/go.d/modules/smartctl/scan.go @@ -12,6 +12,7 @@ type scanDevice struct { name string infoName string typ string + extra bool // added via config "extra_devices" } func (s *scanDevice) key() string { @@ -23,7 +24,15 @@ func (s *scanDevice) shortName() string { } func (s *Smartctl) scanDevices() (map[string]*scanDevice, error) { - resp, err := s.exec.scan() + // Issue on Discord: https://discord.com/channels/847502280503590932/1261747175361347644/1261747175361347644 + // "sat" devices being identified as "scsi" with --scan, and then later + // code attempts to validate the type by calling `smartctl` with the "scsi" type. + // This validation can trigger unintended "Enabling discard_zeroes_data" messages in system logs (dmesg). + // To address this specific issue we use `smartctl --scan-open` as a workaround. + // This method reliably identifies device types. + scanOpen := s.NoCheckPowerMode == "never" + + resp, err := s.exec.scan(scanOpen) if err != nil { return nil, fmt.Errorf("failed to scan devices: %v", err) } @@ -34,7 +43,7 @@ func (s *Smartctl) scanDevices() (map[string]*scanDevice, error) { dev := &scanDevice{ name: d.Get("name").String(), infoName: d.Get("info_name").String(), - typ: d.Get("type").String(), // guessed type (we do '--scan' not '--scan-open') + typ: d.Get("type").String(), } if dev.name == "" || dev.typ == "" { @@ -47,17 +56,13 @@ func (s *Smartctl) scanDevices() (map[string]*scanDevice, error) { continue } - if dev.typ == "scsi" { + if !scanOpen && dev.typ == "scsi" { // `smartctl --scan` attempts to guess the device type based on the path, but this can be unreliable. // Accurate device type information is crucial because we use the `--device` option to gather data. // Using the wrong type can lead to issues. // For example, using 'scsi' for 'sat' devices prevents `smartctl` from issuing the necessary ATA commands. - resp, _ := s.exec.deviceInfo(dev.name, dev.typ, s.NoCheckPowerMode) - if resp != nil && isExitStatusHasBit(resp, 2) { - correctType := "sat" - s.Debugf("changing device '%s' type '%s' -> '%s'", dev.name, dev.typ, correctType) - dev.typ = correctType - } + + s.handleGuessedScsiScannedDevice(dev) } s.Debugf("smartctl scan found device '%s' type '%s' info_name '%s'", dev.name, dev.typ, dev.infoName) @@ -65,11 +70,50 @@ func (s *Smartctl) scanDevices() (map[string]*scanDevice, error) { devices[dev.key()] = dev } + s.Debugf("smartctl scan found %d devices", len(devices)) + + for _, v := range s.ExtraDevices { + dev := &scanDevice{name: v.Name, typ: v.Type, extra: true} + + if _, ok := devices[dev.key()]; !ok { + devices[dev.key()] = dev + } + } + if len(devices) == 0 { return nil, errors.New("no devices found during scan") } - s.Debugf("smartctl scan found %d devices", len(devices)) - return devices, nil } + +func (s *Smartctl) handleGuessedScsiScannedDevice(dev *scanDevice) { + if dev.typ != "scsi" || s.hasScannedDevice(dev) { + return + } + + d := &scanDevice{name: dev.name, typ: "sat"} + + if s.hasScannedDevice(d) { + dev.typ = d.typ + return + } + + resp, _ := s.exec.deviceInfo(dev.name, "sat", s.NoCheckPowerMode) + if resp == nil || resp.Get("smartctl.exit_status").Int() != 0 { + return + } + + atts, ok := newSmartDevice(resp).ataSmartAttributeTable() + if !ok || len(atts) == 0 { + return + } + + s.Debugf("changing device '%s' type 'scsi' -> 'sat'", dev.name) + dev.typ = "sat" +} + +func (s *Smartctl) hasScannedDevice(d *scanDevice) bool { + _, ok := s.scannedDevices[d.key()] + return ok +} diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/smart_device.go b/src/go/plugin/go.d/modules/smartctl/smart_device.go index 87306bab..280281aa 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/smart_device.go +++ b/src/go/plugin/go.d/modules/smartctl/smart_device.go @@ -27,10 +27,6 @@ func (d *smartDevice) deviceType() string { return d.data.Get("device.type").String() } -func (d *smartDevice) deviceProtocol() string { - return d.data.Get("device.protocol").String() -} - func (d *smartDevice) serialNumber() string { return d.data.Get("serial_number").String() } diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/smartctl.go b/src/go/plugin/go.d/modules/smartctl/smartctl.go index 4fb70666..36f390a3 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/smartctl.go +++ b/src/go/plugin/go.d/modules/smartctl/smartctl.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/tidwall/gjson" ) @@ -38,19 +38,27 @@ func New() *Smartctl { DeviceSelector: "*", }, charts: &module.Charts{}, + forceScan: true, deviceSr: matcher.TRUE(), seenDevices: make(map[string]bool), } } -type Config struct { - UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` - Timeout web.Duration `yaml:"timeout,omitempty" json:"timeout"` - ScanEvery web.Duration `yaml:"scan_every,omitempty" json:"scan_every"` - PollDevicesEvery web.Duration `yaml:"poll_devices_every,omitempty" json:"poll_devices_every"` - NoCheckPowerMode string `yaml:"no_check_power_mode,omitempty" json:"no_check_power_mode"` - DeviceSelector string `yaml:"device_selector,omitempty" json:"device_selector"` -} +type ( + Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Timeout web.Duration `yaml:"timeout,omitempty" json:"timeout"` + ScanEvery web.Duration `yaml:"scan_every,omitempty" json:"scan_every"` + PollDevicesEvery web.Duration `yaml:"poll_devices_every,omitempty" json:"poll_devices_every"` + NoCheckPowerMode string `yaml:"no_check_power_mode,omitempty" json:"no_check_power_mode"` + DeviceSelector string `yaml:"device_selector,omitempty" json:"device_selector"` + ExtraDevices []ConfigExtraDevice `yaml:"extra_devices,omitempty" json:"extra_devices"` + } + ConfigExtraDevice struct { + Name string `yaml:"name" json:"name"` + Type string `yaml:"type" json:"type"` + } +) type ( Smartctl struct { @@ -74,7 +82,7 @@ type ( mx map[string]int64 } smartctlCli interface { - scan() (*gjson.Result, error) + scan(open bool) (*gjson.Result, error) deviceInfo(deviceName, deviceType, powerMode string) (*gjson.Result, error) } ) diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/smartctl_test.go b/src/go/plugin/go.d/modules/smartctl/smartctl_test.go index 9666924b..7c56605f 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/smartctl_test.go +++ b/src/go/plugin/go.d/modules/smartctl/smartctl_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -26,6 +26,10 @@ var ( dataTypeNvmeScan, _ = os.ReadFile("testdata/type-nvme/scan.json") dataTypeNvmeDeviceNvme0, _ = os.ReadFile("testdata/type-nvme/device-nvme0.json") + dataTypeNvmeDeviceNvme1, _ = os.ReadFile("testdata/type-nvme/device-nvme1.json") + + dataTypeScsiScan, _ = os.ReadFile("testdata/type-scsi/scan.json") + dataTypeScsiDeviceSda, _ = os.ReadFile("testdata/type-scsi/device-sda.json") ) func Test_testDataIsValid(t *testing.T) { @@ -39,6 +43,10 @@ func Test_testDataIsValid(t *testing.T) { "dataTypeNvmeScan": dataTypeNvmeScan, "dataTypeNvmeDeviceNvme0": dataTypeNvmeDeviceNvme0, + "dataTypeNvmeDeviceNvme1": dataTypeNvmeDeviceNvme1, + + "dataTypeScsiScan": dataTypeScsiScan, + "dataTypeScsiDeviceSda": dataTypeScsiDeviceSda, } { require.NotNil(t, data, name) } @@ -160,9 +168,10 @@ func TestSmartctl_Check(t *testing.T) { func TestSmartctl_Collect(t *testing.T) { tests := map[string]struct { - prepareMock func() *mockSmartctlCliExec - wantMetrics map[string]int64 - wantCharts int + prepareMock func() *mockSmartctlCliExec + prepareConfig func() Config + wantMetrics map[string]int64 + wantCharts int }{ "success type sata devices": { prepareMock: prepareMockOkTypeSata, @@ -289,6 +298,46 @@ func TestSmartctl_Collect(t *testing.T) { "device_nvme0_type_nvme_temperature": 39, }, }, + "success type nvme devices with extra": { + prepareMock: prepareMockOkTypeNvme, + prepareConfig: func() Config { + cfg := New().Config + cfg.ExtraDevices = []ConfigExtraDevice{ + {Name: "/dev/nvme1", Type: "nvme"}, + } + return cfg + }, + wantCharts: 8, + wantMetrics: map[string]int64{ + "device_nvme0_type_nvme_power_cycle_count": 2, + "device_nvme0_type_nvme_power_on_time": 11206800, + "device_nvme0_type_nvme_smart_status_failed": 0, + "device_nvme0_type_nvme_smart_status_passed": 1, + "device_nvme0_type_nvme_temperature": 39, + "device_nvme1_type_nvme_power_cycle_count": 5, + "device_nvme1_type_nvme_power_on_time": 17038800, + "device_nvme1_type_nvme_smart_status_failed": 0, + "device_nvme1_type_nvme_smart_status_passed": 1, + "device_nvme1_type_nvme_temperature": 36, + }, + }, + "success type scsi devices": { + prepareMock: prepareMockOkTypeScsi, + wantCharts: 7, + wantMetrics: map[string]int64{ + "device_sda_type_scsi_power_cycle_count": 4, + "device_sda_type_scsi_power_on_time": 5908920, + "device_sda_type_scsi_scsi_error_log_read_total_errors_corrected": 647736, + "device_sda_type_scsi_scsi_error_log_read_total_uncorrected_errors": 0, + "device_sda_type_scsi_scsi_error_log_verify_total_errors_corrected": 0, + "device_sda_type_scsi_scsi_error_log_verify_total_uncorrected_errors": 0, + "device_sda_type_scsi_scsi_error_log_write_total_errors_corrected": 0, + "device_sda_type_scsi_scsi_error_log_write_total_uncorrected_errors": 0, + "device_sda_type_scsi_smart_status_failed": 0, + "device_sda_type_scsi_smart_status_passed": 1, + "device_sda_type_scsi_temperature": 34, + }, + }, "error on scan": { prepareMock: prepareMockErrOnScan, }, @@ -303,6 +352,9 @@ func TestSmartctl_Collect(t *testing.T) { for name, test := range tests { t.Run(name, func(t *testing.T) { smart := New() + if test.prepareConfig != nil { + smart.Config = test.prepareConfig() + } mock := test.prepareMock() smart.exec = mock smart.ScanEvery = web.Duration(time.Microsecond * 1) @@ -367,6 +419,26 @@ func prepareMockOkTypeNvme() *mockSmartctlCliExec { switch deviceName { case "/dev/nvme0": return dataTypeNvmeDeviceNvme0, nil + case "/dev/nvme1": + return dataTypeNvmeDeviceNvme1, nil + default: + return nil, fmt.Errorf("unexpected device name %s", deviceName) + } + }, + } +} + +func prepareMockOkTypeScsi() *mockSmartctlCliExec { + return &mockSmartctlCliExec{ + errOnScan: false, + scanData: dataTypeScsiScan, + deviceDataFunc: func(deviceName, deviceType, powerMode string) ([]byte, error) { + if deviceType != "scsi" { + return nil, fmt.Errorf("unexpected device type %s", deviceType) + } + switch deviceName { + case "/dev/sda": + return dataTypeScsiDeviceSda, nil default: return nil, fmt.Errorf("unexpected device name %s", deviceName) } @@ -397,7 +469,7 @@ type mockSmartctlCliExec struct { deviceDataFunc func(deviceName, deviceType, powerMode string) ([]byte, error) } -func (m *mockSmartctlCliExec) scan() (*gjson.Result, error) { +func (m *mockSmartctlCliExec) scan(_ bool) (*gjson.Result, error) { if m.errOnScan { return nil, fmt.Errorf("mock.scan() error") } diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/config.json b/src/go/plugin/go.d/modules/smartctl/testdata/config.json index ed26105e..41c69da5 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/config.json +++ b/src/go/plugin/go.d/modules/smartctl/testdata/config.json @@ -4,5 +4,11 @@ "scan_every": 123.123, "poll_devices_every": 123.123, "no_check_power_mode": "ok", - "device_selector": "ok" + "device_selector": "ok", + "extra_devices": [ + { + "name": "ok", + "type": "ok" + } + ] } diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/config.yaml b/src/go/plugin/go.d/modules/smartctl/testdata/config.yaml index 94c9b0ac..b0b77d53 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/smartctl/testdata/config.yaml @@ -3,4 +3,7 @@ timeout: 123.123 scan_every: 123.123 poll_devices_every: 123.123 no_check_power_mode: "ok" -"device_selector": "ok" +device_selector: "ok" +extra_devices: + - name: "ok" + type: "ok" diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-nvme/device-nvme0.json b/src/go/plugin/go.d/modules/smartctl/testdata/type-nvme/device-nvme0.json index 1b31d322..1b31d322 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-nvme/device-nvme0.json +++ b/src/go/plugin/go.d/modules/smartctl/testdata/type-nvme/device-nvme0.json diff --git a/src/go/plugin/go.d/modules/smartctl/testdata/type-nvme/device-nvme1.json b/src/go/plugin/go.d/modules/smartctl/testdata/type-nvme/device-nvme1.json new file mode 100644 index 00000000..37faf7cf --- /dev/null +++ b/src/go/plugin/go.d/modules/smartctl/testdata/type-nvme/device-nvme1.json @@ -0,0 +1,113 @@ +{ + "json_format_version": [ + 1, + 0 + ], + "smartctl": { + "version": [ + 7, + 3 + ], + "svn_revision": "5338", + "platform_info": "REDACTED", + "build_info": "(local build)", + "argv": [ + "smartctl", + "--json", + "--all", + "/dev/nvme1", + "--device", + "nvme" + ], + "exit_status": 0 + }, + "local_time": { + "time_t": 1720897758, + "asctime": "Sat Jul 13 22:09:18 2024 EEST" + }, + "device": { + "name": "/dev/nvme1", + "info_name": "/dev/nvme1", + "type": "nvme", + "protocol": "NVMe" + }, + "model_name": "Seagate FireCuda 530 ZP4000GM30023", + "serial_number": "REDACTED", + "firmware_version": "REDACTED", + "nvme_pci_vendor": { + "id": 7089, + "subsystem_id": 7089 + }, + "nvme_ieee_oui_identifier": 6584743, + "nvme_total_capacity": 4000787030016, + "nvme_unallocated_capacity": 0, + "nvme_controller_id": 1, + "nvme_version": { + "string": "1.4", + "value": 66560 + }, + "nvme_number_of_namespaces": 1, + "nvme_namespaces": [ + { + "id": 1, + "size": { + "blocks": 7814037168, + "bytes": 4000787030016 + }, + "capacity": { + "blocks": 7814037168, + "bytes": 4000787030016 + }, + "utilization": { + "blocks": 7814037168, + "bytes": 4000787030016 + }, + "formatted_lba_size": 512, + "eui64": { + "oui": 6584743, + "ext_id": 553497146765 + } + } + ], + "user_capacity": { + "blocks": 7814037168, + "bytes": 4000787030016 + }, + "logical_block_size": 512, + "smart_support": { + "available": true, + "enabled": true + }, + "smart_status": { + "passed": true, + "nvme": { + "value": 0 + } + }, + "nvme_smart_health_information_log": { + "critical_warning": 0, + "temperature": 36, + "available_spare": 100, + "available_spare_threshold": 5, + "percentage_used": 0, + "data_units_read": 202, + "data_units_written": 0, + "host_reads": 2509, + "host_writes": 0, + "controller_busy_time": 0, + "power_cycles": 5, + "power_on_hours": 4733, + "unsafe_shutdowns": 2, + "media_errors": 0, + "num_err_log_entries": 20, + "warning_temp_time": 0, + "critical_comp_time": 0 + }, + "temperature": { + "current": 36 + }, + "power_cycle_count": 5, + "power_on_time": { + "hours": 4733 + } +} diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-nvme/scan.json b/src/go/plugin/go.d/modules/smartctl/testdata/type-nvme/scan.json index b9f716cb..b9f716cb 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-nvme/scan.json +++ b/src/go/plugin/go.d/modules/smartctl/testdata/type-nvme/scan.json diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-sat/device-hdd-sda.json b/src/go/plugin/go.d/modules/smartctl/testdata/type-sat/device-hdd-sda.json index 55cfe15f..55cfe15f 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-sat/device-hdd-sda.json +++ b/src/go/plugin/go.d/modules/smartctl/testdata/type-sat/device-hdd-sda.json diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-sat/device-ssd-sdc.json b/src/go/plugin/go.d/modules/smartctl/testdata/type-sat/device-ssd-sdc.json index a2d8f0aa..a2d8f0aa 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-sat/device-ssd-sdc.json +++ b/src/go/plugin/go.d/modules/smartctl/testdata/type-sat/device-ssd-sdc.json diff --git a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-sat/scan.json b/src/go/plugin/go.d/modules/smartctl/testdata/type-sat/scan.json index c7a68ca8..c7a68ca8 100644 --- a/src/go/collectors/go.d.plugin/modules/smartctl/testdata/type-sat/scan.json +++ b/src/go/plugin/go.d/modules/smartctl/testdata/type-sat/scan.json diff --git a/src/go/plugin/go.d/modules/smartctl/testdata/type-scsi/device-sda.json b/src/go/plugin/go.d/modules/smartctl/testdata/type-scsi/device-sda.json new file mode 100644 index 00000000..0ab55d2c --- /dev/null +++ b/src/go/plugin/go.d/modules/smartctl/testdata/type-scsi/device-sda.json @@ -0,0 +1,128 @@ +{ + "json_format_version": [ + 1, + 0 + ], + "smartctl": { + "version": [ + 7, + 3 + ], + "svn_revision": "5338", + "platform_info": "REDACTED", + "build_info": "(local build)", + "argv": [ + "smartctl", + "--json", + "--all", + "/dev/sda", + "--device", + "scsi" + ], + "exit_status": 0 + }, + "local_time": { + "time_t": 1720689199, + "asctime": "Thu Jul 11 09:13:19 2024 UTC" + }, + "device": { + "name": "/dev/sda", + "info_name": "/dev/sda", + "type": "scsi", + "protocol": "SCSI" + }, + "scsi_vendor": "HGST", + "scsi_product": "REDACTED", + "scsi_model_name": "REDACTED", + "scsi_revision": "REDACTED", + "scsi_version": "REDACTED", + "user_capacity": { + "blocks": 7814037168, + "bytes": 4000787030016 + }, + "logical_block_size": 512, + "scsi_lb_provisioning": { + "name": "fully provisioned", + "value": 0, + "management_enabled": { + "name": "LBPME", + "value": 0 + }, + "read_zeros": { + "name": "LBPRZ", + "value": 0 + } + }, + "rotation_rate": 7200, + "form_factor": { + "scsi_value": 2, + "name": "3.5 inches" + }, + "logical_unit_id": "REDACTED", + "serial_number": "REDACTED", + "device_type": { + "scsi_terminology": "Peripheral Device Type [PDT]", + "scsi_value": 0, + "name": "disk" + }, + "scsi_transport_protocol": { + "name": "SAS (SPL-4)", + "value": 6 + }, + "smart_support": { + "available": true, + "enabled": true + }, + "temperature_warning": { + "enabled": true + }, + "smart_status": { + "passed": true + }, + "temperature": { + "current": 34, + "drive_trip": 85 + }, + "power_on_time": { + "hours": 1641, + "minutes": 22 + }, + "scsi_start_stop_cycle_counter": { + "year_of_manufacture": "2013", + "week_of_manufacture": "51", + "specified_cycle_count_over_device_lifetime": 50000, + "accumulated_start_stop_cycles": 4, + "specified_load_unload_count_over_device_lifetime": 600000, + "accumulated_load_unload_cycles": 119 + }, + "scsi_grown_defect_list": 0, + "scsi_error_counter_log": { + "read": { + "errors_corrected_by_eccfast": 647707, + "errors_corrected_by_eccdelayed": 29, + "errors_corrected_by_rereads_rewrites": 0, + "total_errors_corrected": 647736, + "correction_algorithm_invocations": 586730, + "gigabytes_processed": "36537.378", + "total_uncorrected_errors": 0 + }, + "write": { + "errors_corrected_by_eccfast": 0, + "errors_corrected_by_eccdelayed": 0, + "errors_corrected_by_rereads_rewrites": 0, + "total_errors_corrected": 0, + "correction_algorithm_invocations": 13549, + "gigabytes_processed": "2811.293", + "total_uncorrected_errors": 0 + }, + "verify": { + "errors_corrected_by_eccfast": 0, + "errors_corrected_by_eccdelayed": 0, + "errors_corrected_by_rereads_rewrites": 0, + "total_errors_corrected": 0, + "correction_algorithm_invocations": 2146, + "gigabytes_processed": "0.000", + "total_uncorrected_errors": 0 + } + } +} diff --git a/src/go/plugin/go.d/modules/smartctl/testdata/type-scsi/scan.json b/src/go/plugin/go.d/modules/smartctl/testdata/type-scsi/scan.json new file mode 100644 index 00000000..398f5f4a --- /dev/null +++ b/src/go/plugin/go.d/modules/smartctl/testdata/type-scsi/scan.json @@ -0,0 +1,29 @@ +{ + "json_format_version": [ + 1, + 0 + ], + "smartctl": { + "version": [ + 7, + 3 + ], + "svn_revision": "5338", + "platform_info": "REDACTED", + "build_info": "(local build)", + "argv": [ + "smartctl", + "--scan", + "--json" + ], + "exit_status": 0 + }, + "devices": [ + { + "name": "/dev/sda", + "info_name": "/dev/sda", + "type": "scsi", + "protocol": "SCSI" + } + ] +} diff --git a/src/go/collectors/go.d.plugin/modules/snmp/README.md b/src/go/plugin/go.d/modules/snmp/README.md index edf223bf..edf223bf 120000 --- a/src/go/collectors/go.d.plugin/modules/snmp/README.md +++ b/src/go/plugin/go.d/modules/snmp/README.md diff --git a/src/go/plugin/go.d/modules/snmp/charts.go b/src/go/plugin/go.d/modules/snmp/charts.go new file mode 100644 index 00000000..dd31f1cc --- /dev/null +++ b/src/go/plugin/go.d/modules/snmp/charts.go @@ -0,0 +1,309 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package snmp + +import ( + "fmt" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioNetIfaceTraffic = module.Priority + iota + prioNetIfaceUnicast + prioNetIfaceMulticast + prioNetIfaceBroadcast + prioNetIfaceErrors + prioNetIfaceDiscards + prioNetIfaceAdminStatus + prioNetIfaceOperStatus + prioSysUptime +) + +var netIfaceChartsTmpl = module.Charts{ + netIfaceTrafficChartTmpl.Copy(), + netIfacePacketsChartTmpl.Copy(), + netIfaceMulticastChartTmpl.Copy(), + netIfaceBroadcastChartTmpl.Copy(), + netIfaceErrorsChartTmpl.Copy(), + netIfaceDiscardsChartTmpl.Copy(), + netIfaceAdminStatusChartTmpl.Copy(), + netIfaceOperStatusChartTmpl.Copy(), +} + +var ( + netIfaceTrafficChartTmpl = module.Chart{ + ID: "snmp_device_net_iface_%s_traffic", + Title: "SNMP device network interface traffic", + Units: "kilobits/s", + Fam: "traffic", + Ctx: "snmp.device_net_interface_traffic", + Priority: prioNetIfaceTraffic, + Type: module.Area, + Dims: module.Dims{ + {ID: "net_iface_%s_traffic_in", Name: "received", Algo: module.Incremental}, + {ID: "net_iface_%s_traffic_out", Name: "sent", Mul: -1, Algo: module.Incremental}, + }, + } + + netIfacePacketsChartTmpl = module.Chart{ + ID: "snmp_device_net_iface_%s_unicast", + Title: "SNMP device network interface unicast packets", + Units: "packets/s", + Fam: "packets", + Ctx: "snmp.device_net_interface_unicast", + Priority: prioNetIfaceUnicast, + Dims: module.Dims{ + {ID: "net_iface_%s_ucast_in", Name: "received", Algo: module.Incremental}, + {ID: "net_iface_%s_ucast_out", Name: "sent", Mul: -1, Algo: module.Incremental}, + }, + } + netIfaceMulticastChartTmpl = module.Chart{ + ID: "snmp_device_net_iface_%s_multicast", + Title: "SNMP device network interface multicast packets", + Units: "packets/s", + Fam: "packets", + Ctx: "snmp.device_net_interface_multicast", + Priority: prioNetIfaceMulticast, + Dims: module.Dims{ + {ID: "net_iface_%s_mcast_in", Name: "received", Algo: module.Incremental}, + {ID: "net_iface_%s_mcast_out", Name: "sent", Mul: -1, Algo: module.Incremental}, + }, + } + netIfaceBroadcastChartTmpl = module.Chart{ + ID: "snmp_device_net_iface_%s_broadcast", + Title: "SNMP device network interface broadcast packets", + Units: "packets/s", + Fam: "packets", + Ctx: "snmp.device_net_interface_broadcast", + Priority: prioNetIfaceBroadcast, + Dims: module.Dims{ + {ID: "net_iface_%s_bcast_in", Name: "received", Algo: module.Incremental}, + {ID: "net_iface_%s_bcast_out", Name: "sent", Mul: -1, Algo: module.Incremental}, + }, + } + + netIfaceErrorsChartTmpl = module.Chart{ + ID: "snmp_device_net_iface_%s_errors", + Title: "SNMP device network interface errors", + Units: "errors/s", + Fam: "errors", + Ctx: "snmp.device_net_interface_errors", + Priority: prioNetIfaceErrors, + Dims: module.Dims{ + {ID: "net_iface_%s_errors_in", Name: "inbound", Algo: module.Incremental}, + {ID: "net_iface_%s_errors_out", Name: "outbound", Mul: -1, Algo: module.Incremental}, + }, + } + + netIfaceDiscardsChartTmpl = module.Chart{ + ID: "snmp_device_net_iface_%s_discards", + Title: "SNMP device network interface discards", + Units: "discards/s", + Fam: "discards", + Ctx: "snmp.device_net_interface_discards", + Priority: prioNetIfaceDiscards, + Dims: module.Dims{ + {ID: "net_iface_%s_discards_in", Name: "inbound", Algo: module.Incremental}, + {ID: "net_iface_%s_discards_out", Name: "outbound", Mul: -1, Algo: module.Incremental}, + }, + } + + netIfaceAdminStatusChartTmpl = module.Chart{ + ID: "snmp_device_net_iface_%s_admin_status", + Title: "SNMP device network interface administrative status", + Units: "status", + Fam: "status", + Ctx: "snmp.device_net_interface_admin_status", + Priority: prioNetIfaceAdminStatus, + Dims: module.Dims{ + {ID: "net_iface_%s_admin_status_up", Name: "up"}, + {ID: "net_iface_%s_admin_status_down", Name: "down"}, + {ID: "net_iface_%s_admin_status_testing", Name: "testing"}, + }, + } + netIfaceOperStatusChartTmpl = module.Chart{ + ID: "snmp_device_net_iface_%s_oper_status", + Title: "SNMP device network interface operational status", + Units: "status", + Fam: "status", + Ctx: "snmp.device_net_interface_oper_status", + Priority: prioNetIfaceOperStatus, + Dims: module.Dims{ + {ID: "net_iface_%s_oper_status_up", Name: "up"}, + {ID: "net_iface_%s_oper_status_down", Name: "down"}, + {ID: "net_iface_%s_oper_status_testing", Name: "testing"}, + {ID: "net_iface_%s_oper_status_unknown", Name: "unknown"}, + {ID: "net_iface_%s_oper_status_dormant", Name: "dormant"}, + {ID: "net_iface_%s_oper_status_notPresent", Name: "not_present"}, + {ID: "net_iface_%s_oper_status_lowerLayerDown", Name: "lower_layer_down"}, + }, + } +) + +var ( + uptimeChart = module.Chart{ + ID: "snmp_device_uptime", + Title: "SNMP device uptime", + Units: "seconds", + Fam: "uptime", + Ctx: "snmp.device_uptime", + Priority: prioSysUptime, + Dims: module.Dims{ + {ID: "uptime", Name: "uptime"}, + }, + } +) + +func (s *SNMP) addNetIfaceCharts(iface *netInterface) { + charts := netIfaceChartsTmpl.Copy() + + for _, chart := range *charts { + chart.ID = fmt.Sprintf(chart.ID, cleanIfaceName(iface.ifName)) + chart.Labels = []module.Label{ + {Key: "sysName", Value: s.sysName}, + {Key: "ifDescr", Value: iface.ifDescr}, + {Key: "ifName", Value: iface.ifName}, + {Key: "ifType", Value: ifTypeMapping[iface.ifType]}, + } + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf(dim.ID, iface.ifName) + } + } + + if err := s.Charts().Add(*charts...); err != nil { + s.Warning(err) + } +} + +func (s *SNMP) removeNetIfaceCharts(iface *netInterface) { + px := fmt.Sprintf("snmp_device_net_iface_%s_", cleanIfaceName(iface.ifName)) + for _, chart := range *s.Charts() { + if strings.HasPrefix(chart.ID, px) { + chart.MarkRemove() + chart.MarkNotCreated() + } + } +} + +func (s *SNMP) addSysUptimeChart() { + chart := uptimeChart.Copy() + chart.Labels = []module.Label{ + {Key: "sysName", Value: s.sysName}, + } + if err := s.Charts().Add(chart); err != nil { + s.Warning(err) + } +} + +func cleanIfaceName(name string) string { + r := strings.NewReplacer(".", "_", " ", "_") + return r.Replace(name) +} + +func newUserInputCharts(configs []ChartConfig) (*module.Charts, error) { + charts := &module.Charts{} + for _, cfg := range configs { + if len(cfg.IndexRange) == 2 { + cs, err := newUserInputChartsFromIndexRange(cfg) + if err != nil { + return nil, err + } + if err := charts.Add(*cs...); err != nil { + return nil, err + } + } else { + chart, err := newUserInputChart(cfg) + if err != nil { + return nil, err + } + if err = charts.Add(chart); err != nil { + return nil, err + } + } + } + return charts, nil +} + +func newUserInputChartsFromIndexRange(cfg ChartConfig) (*module.Charts, error) { + var addPrio int + charts := &module.Charts{} + for i := cfg.IndexRange[0]; i <= cfg.IndexRange[1]; i++ { + chart, err := newUserInputChartWithOIDIndex(i, cfg) + if err != nil { + return nil, err + } + chart.Priority += addPrio + addPrio += 1 + if err = charts.Add(chart); err != nil { + return nil, err + } + } + return charts, nil +} + +func newUserInputChartWithOIDIndex(oidIndex int, cfg ChartConfig) (*module.Chart, error) { + chart, err := newUserInputChart(cfg) + if err != nil { + return nil, err + } + + chart.ID = fmt.Sprintf("%s_%d", chart.ID, oidIndex) + chart.Title = fmt.Sprintf("%s %d", chart.Title, oidIndex) + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf("%s.%d", dim.ID, oidIndex) + } + + return chart, nil +} + +func newUserInputChart(cfg ChartConfig) (*module.Chart, error) { + chart := &module.Chart{ + ID: cfg.ID, + Title: cfg.Title, + Units: cfg.Units, + Fam: cfg.Family, + Ctx: fmt.Sprintf("snmp.%s", cfg.ID), + Type: module.ChartType(cfg.Type), + Priority: cfg.Priority, + } + + if chart.Title == "" { + chart.Title = "Untitled chart" + } + if chart.Units == "" { + chart.Units = "num" + } + if chart.Priority < module.Priority { + chart.Priority += module.Priority + } + + seen := make(map[string]struct{}) + var a string + for _, cfg := range cfg.Dimensions { + if cfg.Algorithm != "" { + seen[cfg.Algorithm] = struct{}{} + a = cfg.Algorithm + } + dim := &module.Dim{ + ID: strings.TrimPrefix(cfg.OID, "."), + Name: cfg.Name, + Algo: module.DimAlgo(cfg.Algorithm), + Mul: cfg.Multiplier, + Div: cfg.Divisor, + } + if err := chart.AddDim(dim); err != nil { + return nil, err + } + } + if len(seen) == 1 && a != "" && len(chart.Dims) > 1 { + for _, d := range chart.Dims { + if d.Algo == "" { + d.Algo = module.DimAlgo(a) + } + } + } + + return chart, nil +} diff --git a/src/go/plugin/go.d/modules/snmp/collect.go b/src/go/plugin/go.d/modules/snmp/collect.go new file mode 100644 index 00000000..24cc49db --- /dev/null +++ b/src/go/plugin/go.d/modules/snmp/collect.go @@ -0,0 +1,395 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package snmp + +import ( + "errors" + "fmt" + "log/slog" + "sort" + "strings" + + "github.com/netdata/netdata/go/plugins/logger" + + "github.com/gosnmp/gosnmp" +) + +const ( + oidSysUptime = "1.3.6.1.2.1.1.3.0" + oidSysName = "1.3.6.1.2.1.1.5.0" + rootOidIfMibIfTable = "1.3.6.1.2.1.2.2" + rootOidIfMibIfXTable = "1.3.6.1.2.1.31.1.1" +) + +func (s *SNMP) collect() (map[string]int64, error) { + if s.sysName == "" { + sysName, err := s.getSysName() + if err != nil { + return nil, err + } + s.sysName = sysName + s.addSysUptimeChart() + } + + mx := make(map[string]int64) + + if err := s.collectSysUptime(mx); err != nil { + return nil, err + } + + if s.collectIfMib { + if err := s.collectNetworkInterfaces(mx); err != nil { + return nil, err + } + } + + if len(s.oids) > 0 { + if err := s.collectOIDs(mx); err != nil { + return nil, err + } + } + + return mx, nil +} + +func (s *SNMP) getSysName() (string, error) { + resp, err := s.snmpClient.Get([]string{oidSysName}) + if err != nil { + return "", err + } + if len(resp.Variables) == 0 { + return "", errors.New("no system name") + } + return pduToString(resp.Variables[0]) +} + +func (s *SNMP) collectSysUptime(mx map[string]int64) error { + resp, err := s.snmpClient.Get([]string{oidSysUptime}) + if err != nil { + return err + } + if len(resp.Variables) == 0 { + return errors.New("no system uptime") + } + v, err := pduToInt(resp.Variables[0]) + if err != nil { + return err + } + + mx["uptime"] = v / 100 // the time is in hundredths of a second + + return nil +} + +func (s *SNMP) collectNetworkInterfaces(mx map[string]int64) error { + if s.checkMaxReps { + ok, err := s.adjustMaxRepetitions() + if err != nil { + return err + } + + s.checkMaxReps = false + + if !ok { + s.collectIfMib = false + + if len(s.oids) == 0 { + return errors.New("no IF-MIB data returned") + } + + s.Warning("no IF-MIB data returned") + return nil + } + } + + ifMibTable, err := s.walkAll(rootOidIfMibIfTable) + if err != nil { + return err + } + + ifMibXTable, err := s.walkAll(rootOidIfMibIfXTable) + if err != nil { + return err + } + + if len(ifMibTable) == 0 && len(ifMibXTable) == 0 { + s.Warning("no IF-MIB data returned") + s.collectIfMib = false + return nil + } + + for _, i := range s.netInterfaces { + i.updated = false + } + + pdus := make([]gosnmp.SnmpPDU, 0, len(ifMibTable)+len(ifMibXTable)) + pdus = append(pdus, ifMibTable...) + pdus = append(pdus, ifMibXTable...) + + for _, pdu := range pdus { + i := strings.LastIndexByte(pdu.Name, '.') + if i == -1 { + continue + } + + idx := pdu.Name[i+1:] + oid := strings.TrimPrefix(pdu.Name[:i], ".") + + iface, ok := s.netInterfaces[idx] + if !ok { + iface = &netInterface{idx: idx} + } + + switch oid { + case oidIfIndex: + iface.ifIndex, err = pduToInt(pdu) + case oidIfDescr: + iface.ifDescr, err = pduToString(pdu) + case oidIfType: + iface.ifType, err = pduToInt(pdu) + case oidIfMtu: + iface.ifMtu, err = pduToInt(pdu) + case oidIfSpeed: + iface.ifSpeed, err = pduToInt(pdu) + case oidIfAdminStatus: + iface.ifAdminStatus, err = pduToInt(pdu) + case oidIfOperStatus: + iface.ifOperStatus, err = pduToInt(pdu) + case oidIfInOctets: + iface.ifInOctets, err = pduToInt(pdu) + case oidIfInUcastPkts: + iface.ifInUcastPkts, err = pduToInt(pdu) + case oidIfInNUcastPkts: + iface.ifInNUcastPkts, err = pduToInt(pdu) + case oidIfInDiscards: + iface.ifInDiscards, err = pduToInt(pdu) + case oidIfInErrors: + iface.ifInErrors, err = pduToInt(pdu) + case oidIfInUnknownProtos: + iface.ifInUnknownProtos, err = pduToInt(pdu) + case oidIfOutOctets: + iface.ifOutOctets, err = pduToInt(pdu) + case oidIfOutUcastPkts: + iface.ifOutUcastPkts, err = pduToInt(pdu) + case oidIfOutNUcastPkts: + iface.ifOutNUcastPkts, err = pduToInt(pdu) + case oidIfOutDiscards: + iface.ifOutDiscards, err = pduToInt(pdu) + case oidIfOutErrors: + iface.ifOutErrors, err = pduToInt(pdu) + case oidIfName: + iface.ifName, err = pduToString(pdu) + case oidIfInMulticastPkts: + iface.ifInMulticastPkts, err = pduToInt(pdu) + case oidIfInBroadcastPkts: + iface.ifInBroadcastPkts, err = pduToInt(pdu) + case oidIfOutMulticastPkts: + iface.ifOutMulticastPkts, err = pduToInt(pdu) + case oidIfOutBroadcastPkts: + iface.ifOutBroadcastPkts, err = pduToInt(pdu) + case oidIfHCInOctets: + iface.ifHCInOctets, err = pduToInt(pdu) + case oidIfHCInUcastPkts: + iface.ifHCInUcastPkts, err = pduToInt(pdu) + case oidIfHCInMulticastPkts: + iface.ifHCInMulticastPkts, err = pduToInt(pdu) + case oidIfHCInBroadcastPkts: + iface.ifHCInBroadcastPkts, err = pduToInt(pdu) + case oidIfHCOutOctets: + iface.ifHCOutOctets, err = pduToInt(pdu) + case oidIfHCOutUcastPkts: + iface.ifHCOutUcastPkts, err = pduToInt(pdu) + case oidIfHCOutMulticastPkts: + iface.ifHCOutMulticastPkts, err = pduToInt(pdu) + case oidIfHCOutBroadcastPkts: + iface.ifHCOutMulticastPkts, err = pduToInt(pdu) + case oidIfHighSpeed: + iface.ifHighSpeed, err = pduToInt(pdu) + case oidIfAlias: + iface.ifAlias, err = pduToString(pdu) + default: + continue + } + + if err != nil { + return fmt.Errorf("OID '%s': %v", pdu.Name, err) + } + + s.netInterfaces[idx] = iface + iface.updated = true + } + + for _, iface := range s.netInterfaces { + if iface.ifName == "" { + continue + } + + typeStr := ifTypeMapping[iface.ifType] + if s.netIfaceFilterByName.MatchString(iface.ifName) || s.netIfaceFilterByType.MatchString(typeStr) { + continue + } + + if !iface.updated { + delete(s.netInterfaces, iface.idx) + if iface.hasCharts { + s.removeNetIfaceCharts(iface) + } + continue + } + if !iface.hasCharts { + iface.hasCharts = true + s.addNetIfaceCharts(iface) + } + + px := fmt.Sprintf("net_iface_%s_", iface.ifName) + mx[px+"traffic_in"] = iface.ifHCInOctets * 8 / 1000 // kilobits + mx[px+"traffic_out"] = iface.ifHCOutOctets * 8 / 1000 // kilobits + mx[px+"ucast_in"] = iface.ifHCInUcastPkts + mx[px+"ucast_out"] = iface.ifHCOutUcastPkts + mx[px+"mcast_in"] = iface.ifHCInMulticastPkts + mx[px+"mcast_out"] = iface.ifHCOutMulticastPkts + mx[px+"bcast_in"] = iface.ifHCInBroadcastPkts + mx[px+"bcast_out"] = iface.ifHCOutBroadcastPkts + mx[px+"errors_in"] = iface.ifInErrors + mx[px+"errors_out"] = iface.ifOutErrors + mx[px+"discards_in"] = iface.ifInDiscards + mx[px+"discards_out"] = iface.ifOutDiscards + + for _, v := range ifAdminStatusMapping { + mx[px+"admin_status_"+v] = 0 + } + mx[px+"admin_status_"+ifAdminStatusMapping[iface.ifAdminStatus]] = 1 + + for _, v := range ifOperStatusMapping { + mx[px+"oper_status_"+v] = 0 + } + mx[px+"oper_status_"+ifOperStatusMapping[iface.ifOperStatus]] = 1 + } + + if logger.Level.Enabled(slog.LevelDebug) { + ifaces := make([]*netInterface, 0, len(s.netInterfaces)) + for _, nif := range s.netInterfaces { + ifaces = append(ifaces, nif) + } + sort.Slice(ifaces, func(i, j int) bool { return ifaces[i].ifIndex < ifaces[j].ifIndex }) + for _, iface := range ifaces { + s.Debugf("found %s", iface) + } + } + + return nil +} + +func (s *SNMP) adjustMaxRepetitions() (bool, error) { + orig := s.Config.Options.MaxRepetitions + maxReps := s.Config.Options.MaxRepetitions + + for { + v, err := s.walkAll(oidIfIndex) + if err != nil { + return false, err + } + + if len(v) > 0 { + if orig != maxReps { + s.Infof("changed 'max_repetitions' %d => %d", orig, maxReps) + } + return true, nil + } + + if maxReps > 5 { + maxReps = max(5, maxReps-5) + } else { + maxReps-- + } + + if maxReps <= 0 { + return false, nil + } + + s.Debugf("no IF-MIB data returned, trying to decrese 'max_repetitions' to %d", maxReps) + s.snmpClient.SetMaxRepetitions(uint32(maxReps)) + } +} + +func (s *SNMP) walkAll(rootOid string) ([]gosnmp.SnmpPDU, error) { + if s.snmpClient.Version() == gosnmp.Version1 { + return s.snmpClient.WalkAll(rootOid) + } + return s.snmpClient.BulkWalkAll(rootOid) +} + +func pduToString(pdu gosnmp.SnmpPDU) (string, error) { + switch pdu.Type { + case gosnmp.OctetString: + // TODO: this isn't reliable (e.g. physAddress we need hex.EncodeToString()) + bs, ok := pdu.Value.([]byte) + if !ok { + return "", fmt.Errorf("OctetString is not a []byte but %T", pdu.Value) + } + return strings.ToValidUTF8(string(bs), "�"), nil + case gosnmp.Counter32, gosnmp.Counter64, gosnmp.Integer, gosnmp.Gauge32: + return gosnmp.ToBigInt(pdu.Value).String(), nil + default: + return "", fmt.Errorf("unussported type: '%v'", pdu.Type) + } +} + +func pduToInt(pdu gosnmp.SnmpPDU) (int64, error) { + switch pdu.Type { + case gosnmp.Counter32, gosnmp.Counter64, gosnmp.Integer, gosnmp.Gauge32, gosnmp.TimeTicks: + return gosnmp.ToBigInt(pdu.Value).Int64(), nil + default: + return 0, fmt.Errorf("unussported type: '%v'", pdu.Type) + } +} + +//func physAddressToString(pdu gosnmp.SnmpPDU) (string, error) { +// address, ok := pdu.Value.([]uint8) +// if !ok { +// return "", errors.New("physAddress is not a []uint8") +// } +// parts := make([]string, 0, 6) +// for _, v := range address { +// parts = append(parts, fmt.Sprintf("%02X", v)) +// } +// return strings.Join(parts, ":"), nil +//} + +func (s *SNMP) collectOIDs(mx map[string]int64) error { + for i, end := 0, 0; i < len(s.oids); i += s.Options.MaxOIDs { + if end = i + s.Options.MaxOIDs; end > len(s.oids) { + end = len(s.oids) + } + + oids := s.oids[i:end] + resp, err := s.snmpClient.Get(oids) + if err != nil { + s.Errorf("cannot get SNMP data: %v", err) + return err + } + + for i, oid := range oids { + if i >= len(resp.Variables) { + continue + } + + switch v := resp.Variables[i]; v.Type { + case gosnmp.Boolean, + gosnmp.Counter32, + gosnmp.Counter64, + gosnmp.Gauge32, + gosnmp.TimeTicks, + gosnmp.Uinteger32, + gosnmp.OpaqueFloat, + gosnmp.OpaqueDouble, + gosnmp.Integer: + mx[oid] = gosnmp.ToBigInt(v.Value).Int64() + default: + s.Debugf("skipping OID '%s' (unsupported type '%s')", oid, v.Type) + } + } + } + + return nil +} diff --git a/src/go/plugin/go.d/modules/snmp/config.go b/src/go/plugin/go.d/modules/snmp/config.go new file mode 100644 index 00000000..631c47d3 --- /dev/null +++ b/src/go/plugin/go.d/modules/snmp/config.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package snmp + +type ( + Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Hostname string `yaml:"hostname" json:"hostname"` + Community string `yaml:"community,omitempty" json:"community"` + User User `yaml:"user,omitempty" json:"user"` + Options Options `yaml:"options,omitempty" json:"options"` + ChartsInput []ChartConfig `yaml:"charts,omitempty" json:"charts"` + NetworkInterfaceFilter NetworkInterfaceFilter `yaml:"network_interface_filter,omitempty" json:"network_interface_filter"` + } + NetworkInterfaceFilter struct { + ByName string `yaml:"by_name,omitempty" json:"by_name"` + ByType string `yaml:"by_type,omitempty" json:"by_type"` + } + User struct { + Name string `yaml:"name,omitempty" json:"name"` + SecurityLevel string `yaml:"level,omitempty" json:"level"` + AuthProto string `yaml:"auth_proto,omitempty" json:"auth_proto"` + AuthKey string `yaml:"auth_key,omitempty" json:"auth_key"` + PrivProto string `yaml:"priv_proto,omitempty" json:"priv_proto"` + PrivKey string `yaml:"priv_key,omitempty" json:"priv_key"` + } + Options struct { + Port int `yaml:"port,omitempty" json:"port"` + Retries int `yaml:"retries,omitempty" json:"retries"` + Timeout int `yaml:"timeout,omitempty" json:"timeout"` + Version string `yaml:"version,omitempty" json:"version"` + MaxOIDs int `yaml:"max_request_size,omitempty" json:"max_request_size"` + MaxRepetitions int `yaml:"max_repetitions,omitempty" json:"max_repetitions"` + } + ChartConfig struct { + ID string `yaml:"id" json:"id"` + Title string `yaml:"title" json:"title"` + Units string `yaml:"units" json:"units"` + Family string `yaml:"family" json:"family"` + Type string `yaml:"type" json:"type"` + Priority int `yaml:"priority" json:"priority"` + IndexRange []int `yaml:"multiply_range,omitempty" json:"multiply_range"` + Dimensions []DimensionConfig `yaml:"dimensions" json:"dimensions"` + } + DimensionConfig struct { + OID string `yaml:"oid" json:"oid"` + Name string `yaml:"name" json:"name"` + Algorithm string `yaml:"algorithm" json:"algorithm"` + Multiplier int `yaml:"multiplier" json:"multiplier"` + Divisor int `yaml:"divisor" json:"divisor"` + } +) diff --git a/src/go/collectors/go.d.plugin/modules/snmp/config_schema.json b/src/go/plugin/go.d/modules/snmp/config_schema.json index a83a2da3..8deb4f6c 100644 --- a/src/go/collectors/go.d.plugin/modules/snmp/config_schema.json +++ b/src/go/plugin/go.d/modules/snmp/config_schema.json @@ -8,7 +8,7 @@ "description": "Data collection interval, measured in seconds.", "type": "integer", "minimum": 1, - "default": 1 + "default": 10 }, "hostname": { "title": "Hostname", @@ -21,6 +21,26 @@ "type": "string", "default": "public" }, + "network_interface_filter": { + "title": "Network interface filter", + "description": "Configuration for filtering specific network interfaces. If left empty, no interfaces will be filtered. You can filter interfaces by name or type using [simple patterns](/src/libnetdata/simple_pattern/README.md#simple-patterns).", + "type": [ + "object", + "null" + ], + "properties": { + "by_name": { + "title": "By Name", + "description": "Specify the interface name or a pattern to match against the [ifName](https://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?oid=1.3.6.1.2.1.31.1.1.1.1) label.", + "type": "string" + }, + "by_type": { + "title": "By Type", + "description": "Specify the interface type or a pattern to match against the [ifType](https://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?oid=1.3.6.1.2.1.2.2.1.3) label.", + "type": "string" + } + } + }, "options": { "title": "Options", "description": "Configuration options for SNMP monitoring.", @@ -46,23 +66,30 @@ "exclusiveMinimum": 0, "default": 161 }, + "timeout": { + "title": "Timeout", + "description": "The timeout duration in seconds for SNMP requests.", + "type": "integer", + "minimum": 1, + "default": 5 + }, "retries": { "title": "Retries", "description": "The number of retries to attempt for SNMP requests.", "type": "integer", "minimum": 0, - "default": 161 + "default": 1 }, - "timeout": { - "title": "Timeout", - "description": "The timeout duration in seconds for SNMP requests.", + "max_repetitions": { + "title": "Max repetitions", + "description": "Controls how many SNMP variables to retrieve in a single GETBULK request.", "type": "integer", "minimum": 1, - "default": 1 + "default": 25 }, "max_request_size": { - "title": "Max OIDs in request", - "description": "The maximum number of OIDs allowed in a single SNMP request.", + "title": "Max OIDs", + "description": "The maximum number of OIDs allowed in a single GET request.", "type": "integer", "minimum": 1, "default": 60 @@ -144,7 +171,6 @@ "null" ], "uniqueItems": true, - "minItems": 1, "items": { "title": "Chart", "type": [ @@ -284,8 +310,7 @@ "required": [ "hostname", "community", - "options", - "charts" + "options" ], "additionalProperties": false, "patternProperties": { @@ -296,15 +321,27 @@ "uiOptions": { "fullPage": true }, + "network_interface_filter": { + "ui:collapsible": true + }, + "community": { + "ui:widget": "password" + }, "options": { "version": { "ui:widget": "radio", "ui:options": { "inline": true } + }, + "max_repetitions": { + "ui:help": "A higher value retrieves more data in fewer round trips, potentially improving efficiency. This reduces network overhead compared to sending multiple individual requests. **Important**: Setting a value too high might cause the target device to return no data." } }, "user": { + "name": { + "ui:widget": "password" + }, "level": { "ui:widget": "radio", "ui:options": { @@ -357,7 +394,13 @@ "fields": [ "update_every", "hostname", - "community", + "community" + ] + }, + { + "title": "Options", + "fields": [ + "network_interface_filter", "options" ] }, diff --git a/src/go/plugin/go.d/modules/snmp/init.go b/src/go/plugin/go.d/modules/snmp/init.go new file mode 100644 index 00000000..acde4b9b --- /dev/null +++ b/src/go/plugin/go.d/modules/snmp/init.go @@ -0,0 +1,175 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package snmp + +import ( + "errors" + "fmt" + "strings" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + + "github.com/gosnmp/gosnmp" +) + +func (s *SNMP) validateConfig() error { + if s.Hostname == "" { + return errors.New("SNMP hostname is required") + } + return nil +} + +func (s *SNMP) initSNMPClient() (gosnmp.Handler, error) { + client := s.newSnmpClient() + + client.SetTarget(s.Hostname) + client.SetPort(uint16(s.Options.Port)) + client.SetRetries(s.Options.Retries) + client.SetTimeout(time.Duration(s.Options.Timeout) * time.Second) + client.SetMaxOids(s.Options.MaxOIDs) + client.SetMaxRepetitions(uint32(s.Options.MaxRepetitions)) + + ver := parseSNMPVersion(s.Options.Version) + comm := s.Community + + switch ver { + case gosnmp.Version1: + client.SetCommunity(comm) + client.SetVersion(gosnmp.Version1) + case gosnmp.Version2c: + client.SetCommunity(comm) + client.SetVersion(gosnmp.Version2c) + case gosnmp.Version3: + if s.User.Name == "" { + return nil, errors.New("username is required for SNMPv3") + } + client.SetVersion(gosnmp.Version3) + client.SetSecurityModel(gosnmp.UserSecurityModel) + client.SetMsgFlags(parseSNMPv3SecurityLevel(s.User.SecurityLevel)) + client.SetSecurityParameters(&gosnmp.UsmSecurityParameters{ + UserName: s.User.Name, + AuthenticationProtocol: parseSNMPv3AuthProtocol(s.User.AuthProto), + AuthenticationPassphrase: s.User.AuthKey, + PrivacyProtocol: parseSNMPv3PrivProtocol(s.User.PrivProto), + PrivacyPassphrase: s.User.PrivKey, + }) + default: + return nil, fmt.Errorf("invalid SNMP version: %s", s.Options.Version) + } + + s.Info(snmpClientConnInfo(client)) + + return client, nil +} + +func (s *SNMP) initNetIfaceFilters() (matcher.Matcher, matcher.Matcher, error) { + byName, byType := matcher.FALSE(), matcher.FALSE() + + if v := s.NetworkInterfaceFilter.ByName; v != "" { + m, err := matcher.NewSimplePatternsMatcher(v) + if err != nil { + return nil, nil, err + } + byName = m + } + + if v := s.NetworkInterfaceFilter.ByType; v != "" { + m, err := matcher.NewSimplePatternsMatcher(v) + if err != nil { + return nil, nil, err + } + byType = m + } + + return byName, byType, nil +} + +func (s *SNMP) initOIDs() (oids []string) { + for _, c := range *s.charts { + for _, d := range c.Dims { + oids = append(oids, d.ID) + } + } + return oids +} + +func parseSNMPVersion(version string) gosnmp.SnmpVersion { + switch version { + case "0", "1": + return gosnmp.Version1 + case "2", "2c", "": + return gosnmp.Version2c + case "3": + return gosnmp.Version3 + default: + return gosnmp.Version2c + } +} + +func parseSNMPv3SecurityLevel(level string) gosnmp.SnmpV3MsgFlags { + switch level { + case "1", "none", "noAuthNoPriv", "": + return gosnmp.NoAuthNoPriv + case "2", "authNoPriv": + return gosnmp.AuthNoPriv + case "3", "authPriv": + return gosnmp.AuthPriv + default: + return gosnmp.NoAuthNoPriv + } +} + +func parseSNMPv3AuthProtocol(protocol string) gosnmp.SnmpV3AuthProtocol { + switch protocol { + case "1", "none", "noAuth", "": + return gosnmp.NoAuth + case "2", "md5": + return gosnmp.MD5 + case "3", "sha": + return gosnmp.SHA + case "4", "sha224": + return gosnmp.SHA224 + case "5", "sha256": + return gosnmp.SHA256 + case "6", "sha384": + return gosnmp.SHA384 + case "7", "sha512": + return gosnmp.SHA512 + default: + return gosnmp.NoAuth + } +} + +func parseSNMPv3PrivProtocol(protocol string) gosnmp.SnmpV3PrivProtocol { + switch protocol { + case "1", "none", "noPriv", "": + return gosnmp.NoPriv + case "2", "des": + return gosnmp.DES + case "3", "aes": + return gosnmp.AES + case "4", "aes192": + return gosnmp.AES192 + case "5", "aes256": + return gosnmp.AES256 + case "6", "aes192c": + return gosnmp.AES192C + case "7", "aes256c": + return gosnmp.AES256C + default: + return gosnmp.NoPriv + } +} + +func snmpClientConnInfo(c gosnmp.Handler) string { + var info strings.Builder + info.WriteString(fmt.Sprintf("hostname='%s',port='%d',snmp_version='%s'", c.Target(), c.Port(), c.Version())) + switch c.Version() { + case gosnmp.Version1, gosnmp.Version2c: + info.WriteString(fmt.Sprintf(",community='%s'", c.Community())) + case gosnmp.Version3: + info.WriteString(fmt.Sprintf(",security_level='%d,%s'", c.MsgFlags(), c.SecurityParameters().Description())) + } + return info.String() +} diff --git a/src/go/collectors/go.d.plugin/modules/snmp/integrations/snmp_devices.md b/src/go/plugin/go.d/modules/snmp/integrations/snmp_devices.md index cc15a696..a2431b00 100644 --- a/src/go/collectors/go.d.plugin/modules/snmp/integrations/snmp_devices.md +++ b/src/go/plugin/go.d/modules/snmp/integrations/snmp_devices.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/snmp/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/snmp/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/snmp/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/snmp/metadata.yaml" sidebar_label: "SNMP devices" learn_status: "Published" learn_rel_path: "Collecting Metrics/Generic Collecting Metrics" @@ -21,22 +21,22 @@ Module: snmp ## Overview -This collector monitors any SNMP devices and uses the [gosnmp](https://github.com/gosnmp/gosnmp) package. +This SNMP collector discovers and gathers statistics for network interfaces on SNMP-enabled devices: -It supports: +- Traffic +- Packets (unicast, multicast, broadcast) +- Errors +- Discards +- Administrative and operational status -- all SNMP versions: SNMPv1, SNMPv2c and SNMPv3. -- any number of SNMP devices. -- each SNMP device can be used to collect data for any number of charts. -- each chart may have any number of dimensions. -- each SNMP device may have a different update frequency. -- each SNMP device will accept one or more batches to report values (you can set `max_request_size` per SNMP server, to control the size of batches). +Additionally, it collects overall device uptime. -Keep in mind that many SNMP switches and routers are very slow. They may not be able to report values per second. -`go.d.plugin` reports the time it took for the SNMP device to respond when executed in the debug mode. +It is compatible with all SNMP versions (v1, v2c, and v3) and uses the [gosnmp](https://github.com/gosnmp/gosnmp) package. -Also, if many SNMP clients are used on the same SNMP device at the same time, values may be skipped. -This is a problem of the SNMP device, not this collector. In this case, consider reducing the frequency of data collection (increasing `update_every`). +**For advanced users**: + +- You can manually specify custom OIDs (Object Identifiers) to retrieve specific data points beyond the default metrics. +- However, defining custom charts with dimensions for these OIDs requires manual configuration. @@ -58,39 +58,75 @@ The default configuration for this integration does not impose any limits on dat #### Performance Impact -The default configuration for this integration is not expected to impose a significant performance impact on the system. +**Device limitations**: Many SNMP switches and routers have limited processing power. They might not be able to report data as frequently as desired. You can monitor response times using go.d.plugin in debug mode to identify potential bottlenecks. + +**Concurrent access**: If multiple collectors or tools access the same SNMP device simultaneously, data points might be skipped. This is a limitation of the device itself, not this collector. To mitigate this, consider increasing the collection interval (update_every) to reduce the frequency of requests. + ## Metrics +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + The metrics that will be collected are defined in the configuration file. +### Per snmp device -## Alerts +These metrics refer to the SNMP device. -There are no alerts configured by default for this integration. +Labels: +| Label | Description | +|:-----------|:----------------| +| sysName | SNMP device's system name (OID: [1.3.6.1.2.1.1.5](https://oidref.com/1.3.6.1.2.1.1.5)). | -## Setup +Metrics: -### Prerequisites +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| snmp.device_uptime | uptime | seconds | -#### Find OIDs +### Per network interface -Use `snmpwalk`, like this: +Network interfaces of the SNMP device being monitored. These metrics refer to each interface. -```sh -snmpwalk -t 20 -O fn -v 2c -c public 192.0.2.1 -``` +Labels: + +| Label | Description | +|:-----------|:----------------| +| sysName | SNMP device's system name (OID: [1.3.6.1.2.1.1.5](https://oidref.com/1.3.6.1.2.1.1.5)). | +| ifDescr | Network interface description (OID: [1.3.6.1.2.1.2.2.1.2](https://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?oid=1.3.6.1.2.1.2.2.1.2)). | +| ifName | Network interface name (OID: [1.3.6.1.2.1.2.2.1.2](https://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?oid=1.3.6.1.2.1.31.1.1.1.1)). | +| ifType | Network interface type (OID: [1.3.6.1.2.1.2.2.1.2](https://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?oid=1.3.6.1.2.1.2.2.1.3)). | + +Metrics: -- `-t 20` is the timeout in seconds. -- `-O fn` will display full OIDs in numeric format. -- `-v 2c` is the SNMP version. -- `-c public` is the SNMP community. -- `192.0.2.1` is the SNMP device. +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| snmp.device_net_interface_traffic | received, sent | kilobits/s | +| snmp.device_net_interface_unicast | received, sent | packets/s | +| snmp.device_net_interface_multicast | received, sent | packets/s | +| snmp.device_net_interface_broadcast | received, sent | packets/s | +| snmp.device_net_interface_errors | inbound, outbound | errors/s | +| snmp.device_net_interface_discards | inbound, outbound | discards/s | +| snmp.device_net_interface_admin_status | up, down, testing | status | +| snmp.device_net_interface_oper_status | up, down, testing, unknown, dormant, not_present, lower_layer_down | status | +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +No action required. + ### Configuration #### File @@ -114,15 +150,18 @@ The following options can be defined globally: update_every, autodetection_retry | Name | Description | Default | Required | |:----|:-----------|:-------|:--------:| -| update_every | Data collection frequency. | 1 | no | +| update_every | Data collection frequency. | 10 | no | | autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | -| hostname | Target ipv4 address. | 127.0.0.1 | yes | +| hostname | Target ipv4 address. | | yes | | community | SNMPv1/2 community string. | public | no | | options.version | SNMP version. Available versions: 1, 2, 3. | 2 | no | | options.port | Target port. | 161 | no | | options.retries | Retries to attempt. | 1 | no | -| options.timeout | SNMP request/response timeout. | 10 | no | -| options.max_request_size | Maximum number of OIDs allowed in one one SNMP request. | 60 | no | +| options.timeout | SNMP request/response timeout. | 5 | no | +| options.max_repetitions | Controls how many SNMP variables to retrieve in a single GETBULK request. | 25 | no | +| options.max_request_size | Maximum number of OIDs allowed in a single GET request. | 60 | no | +| network_interface_filter.by_name | Filter interfaces by their names using [simple patterns](/src/libnetdata/simple_pattern/README.md#simple-patterns). | | no | +| network_interface_filter.by_type | Filter interfaces by their types using [simple patterns](/src/libnetdata/simple_pattern/README.md#simple-patterns). | | no | | user.name | SNMPv3 user name. | | no | | user.name | Security level of SNMPv3 messages. | | no | | user.auth_proto | Security level of SNMPv3 messages. | | no | @@ -198,10 +237,58 @@ In this example: - the SNMP version is `2`. - the SNMP community is `public`. - we will update the values every 10 seconds. -- we define 2 charts `bandwidth_port1` and `bandwidth_port2`, each having 2 dimensions: `in` and `out`. -> **SNMPv1**: just set `options.version` to 1. -> **Note**: the algorithm chosen is `incremental`, because the collected values show the total number of bytes transferred, which we need to transform into kbps. To chart gauges (e.g. temperature), use `absolute` instead. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: switch + update_every: 10 + hostname: 192.0.2.1 + community: public + options: + version: 2 + +``` +</details> + +##### SNMPv3 + +To use SNMPv3: + +- use `user` instead of `community`. +- set `options.version` to 3. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: switch + update_every: 10 + hostname: 192.0.2.1 + options: + version: 3 + user: + name: username + level: authPriv + auth_proto: sha256 + auth_key: auth_protocol_passphrase + priv_proto: aes256 + priv_key: priv_protocol_passphrase + +``` +</details> + +##### Custom OIDs + +In this example: + +- the SNMP device is `192.0.2.1`. +- the SNMP version is `2`. +- the SNMP community is `public`. +- we will update the values every 10 seconds. <details open><summary>Config</summary> @@ -249,37 +336,7 @@ jobs: ``` </details> -##### SNMPv3 - -To use SNMPv3: - -- use `user` instead of `community`. -- set `options.version` to 3. - -The rest of the configuration is the same as in the SNMPv1/2 example. - - -<details open><summary>Config</summary> - -```yaml -jobs: - - name: switch - update_every: 10 - hostname: 192.0.2.1 - options: - version: 3 - user: - name: username - level: authPriv - auth_proto: sha256 - auth_key: auth_protocol_passphrase - priv_proto: aes256 - priv_key: priv_protocol_passphrase - -``` -</details> - -##### Multiply range +##### Custom OIDs with multiply range If you need to define many charts using incremental OIDs, you can use the `charts.multiply_range` option. @@ -379,6 +436,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `snmp` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -401,4 +460,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m snmp ``` +### Getting Logs + +If you're encountering problems with the `snmp` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep snmp +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep snmp /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep snmp +``` + diff --git a/src/go/collectors/go.d.plugin/modules/snmp/metadata.yaml b/src/go/plugin/go.d/modules/snmp/metadata.yaml index a35b3190..0475a2f2 100644 --- a/src/go/collectors/go.d.plugin/modules/snmp/metadata.yaml +++ b/src/go/plugin/go.d/modules/snmp/metadata.yaml @@ -21,22 +21,22 @@ modules: overview: data_collection: metrics_description: | - This collector monitors any SNMP devices and uses the [gosnmp](https://github.com/gosnmp/gosnmp) package. - - It supports: + This SNMP collector discovers and gathers statistics for network interfaces on SNMP-enabled devices: + + - Traffic + - Packets (unicast, multicast, broadcast) + - Errors + - Discards + - Administrative and operational status - - all SNMP versions: SNMPv1, SNMPv2c and SNMPv3. - - any number of SNMP devices. - - each SNMP device can be used to collect data for any number of charts. - - each chart may have any number of dimensions. - - each SNMP device may have a different update frequency. - - each SNMP device will accept one or more batches to report values (you can set `max_request_size` per SNMP server, to control the size of batches). + Additionally, it collects overall device uptime. - Keep in mind that many SNMP switches and routers are very slow. They may not be able to report values per second. - `go.d.plugin` reports the time it took for the SNMP device to respond when executed in the debug mode. + It is compatible with all SNMP versions (v1, v2c, and v3) and uses the [gosnmp](https://github.com/gosnmp/gosnmp) package. - Also, if many SNMP clients are used on the same SNMP device at the same time, values may be skipped. - This is a problem of the SNMP device, not this collector. In this case, consider reducing the frequency of data collection (increasing `update_every`). + **For advanced users**: + + - You can manually specify custom OIDs (Object Identifiers) to retrieve specific data points beyond the default metrics. + - However, defining custom charts with dimensions for these OIDs requires manual configuration. method_description: "" supported_platforms: include: [] @@ -50,23 +50,13 @@ modules: limits: description: "" performance_impact: - description: "" + description: | + **Device limitations**: Many SNMP switches and routers have limited processing power. They might not be able to report data as frequently as desired. You can monitor response times using go.d.plugin in debug mode to identify potential bottlenecks. + + **Concurrent access**: If multiple collectors or tools access the same SNMP device simultaneously, data points might be skipped. This is a limitation of the device itself, not this collector. To mitigate this, consider increasing the collection interval (update_every) to reduce the frequency of requests. setup: prerequisites: - list: - - title: Find OIDs - description: | - Use `snmpwalk`, like this: - - ```sh - snmpwalk -t 20 -O fn -v 2c -c public 192.0.2.1 - ``` - - - `-t 20` is the timeout in seconds. - - `-O fn` will display full OIDs in numeric format. - - `-v 2c` is the SNMP version. - - `-c public` is the SNMP community. - - `192.0.2.1` is the SNMP device. + list: [] configuration: file: name: go.d/snmp.conf @@ -79,7 +69,7 @@ modules: list: - name: update_every description: Data collection frequency. - default_value: 1 + default_value: 10 required: false - name: autodetection_retry description: Recheck interval in seconds. Zero means no recheck will be scheduled. @@ -87,7 +77,7 @@ modules: required: false - name: hostname description: Target ipv4 address. - default_value: 127.0.0.1 + default_value: "" required: true - name: community description: SNMPv1/2 community string. @@ -107,12 +97,24 @@ modules: required: false - name: options.timeout description: SNMP request/response timeout. - default_value: 10 + default_value: 5 + required: false + - name: options.max_repetitions + description: Controls how many SNMP variables to retrieve in a single GETBULK request. + default_value: 25 required: false - name: options.max_request_size - description: Maximum number of OIDs allowed in one one SNMP request. + description: Maximum number of OIDs allowed in a single GET request. default_value: 60 required: false + - name: network_interface_filter.by_name + description: "Filter interfaces by their names using [simple patterns](/src/libnetdata/simple_pattern/README.md#simple-patterns)." + default_value: "" + required: false + - name: network_interface_filter.by_type + description: "Filter interfaces by their types using [simple patterns](/src/libnetdata/simple_pattern/README.md#simple-patterns)." + default_value: "" + required: false - name: user.name description: SNMPv3 user name. default_value: "" @@ -242,10 +244,42 @@ modules: - the SNMP version is `2`. - the SNMP community is `public`. - we will update the values every 10 seconds. - - we define 2 charts `bandwidth_port1` and `bandwidth_port2`, each having 2 dimensions: `in` and `out`. + config: | + jobs: + - name: switch + update_every: 10 + hostname: 192.0.2.1 + community: public + options: + version: 2 + - name: SNMPv3 + description: | + To use SNMPv3: - > **SNMPv1**: just set `options.version` to 1. - > **Note**: the algorithm chosen is `incremental`, because the collected values show the total number of bytes transferred, which we need to transform into kbps. To chart gauges (e.g. temperature), use `absolute` instead. + - use `user` instead of `community`. + - set `options.version` to 3. + config: | + jobs: + - name: switch + update_every: 10 + hostname: 192.0.2.1 + options: + version: 3 + user: + name: username + level: authPriv + auth_proto: sha256 + auth_key: auth_protocol_passphrase + priv_proto: aes256 + priv_key: priv_protocol_passphrase + - name: Custom OIDs + description: | + In this example: + + - the SNMP device is `192.0.2.1`. + - the SNMP version is `2`. + - the SNMP community is `public`. + - we will update the values every 10 seconds. config: | jobs: - name: switch @@ -285,29 +319,7 @@ modules: oid: "1.3.6.1.2.1.2.2.1.16.2" multiplier: -8 divisor: 1000 - - name: SNMPv3 - description: | - To use SNMPv3: - - - use `user` instead of `community`. - - set `options.version` to 3. - - The rest of the configuration is the same as in the SNMPv1/2 example. - config: | - jobs: - - name: switch - update_every: 10 - hostname: 192.0.2.1 - options: - version: 3 - user: - name: username - level: authPriv - auth_proto: sha256 - auth_key: auth_protocol_passphrase - priv_proto: aes256 - priv_key: priv_protocol_passphrase - - name: Multiply range + - name: Custom OIDs with multiply range description: | If you need to define many charts using incremental OIDs, you can use the `charts.multiply_range` option. @@ -395,4 +407,90 @@ modules: enabled: false description: The metrics that will be collected are defined in the configuration file. availability: [] - scopes: [] + scopes: + - name: snmp device + description: These metrics refer to the SNMP device. + labels: + - name: sysName + description: "SNMP device's system name (OID: [1.3.6.1.2.1.1.5](https://oidref.com/1.3.6.1.2.1.1.5))." + metrics: + - name: snmp.device_uptime + description: SNMP device uptime + unit: seconds + chart_type: line + dimensions: + - name: uptime + - name: network interface + description: Network interfaces of the SNMP device being monitored. These metrics refer to each interface. + labels: + - name: sysName + description: "SNMP device's system name (OID: [1.3.6.1.2.1.1.5](https://oidref.com/1.3.6.1.2.1.1.5))." + - name: ifDescr + description: "Network interface description (OID: [1.3.6.1.2.1.2.2.1.2](https://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?oid=1.3.6.1.2.1.2.2.1.2))." + - name: ifName + description: "Network interface name (OID: [1.3.6.1.2.1.2.2.1.2](https://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?oid=1.3.6.1.2.1.31.1.1.1.1))." + - name: ifType + description: "Network interface type (OID: [1.3.6.1.2.1.2.2.1.2](https://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?oid=1.3.6.1.2.1.2.2.1.3))." + metrics: + - name: snmp.device_net_interface_traffic + description: SNMP device network interface traffic + unit: kilobits/s + chart_type: area + dimensions: + - name: received + - name: sent + - name: snmp.device_net_interface_unicast + description: SNMP device network interface unicast packets + unit: packets/s + chart_type: line + dimensions: + - name: received + - name: sent + - name: snmp.device_net_interface_multicast + description: SNMP device network interface multicast packets + unit: packets/s + chart_type: line + dimensions: + - name: received + - name: sent + - name: snmp.device_net_interface_broadcast + description: SNMP device network interface broadcast packets + unit: packets/s + chart_type: line + dimensions: + - name: received + - name: sent + - name: snmp.device_net_interface_errors + description: SNMP device network interface errors + unit: errors/s + chart_type: line + dimensions: + - name: inbound + - name: outbound + - name: snmp.device_net_interface_discards + description: SNMP device network interface discards + unit: discards/s + chart_type: line + dimensions: + - name: inbound + - name: outbound + - name: snmp.device_net_interface_admin_status + description: SNMP device network interface administrative status + unit: status + chart_type: line + dimensions: + - name: up + - name: down + - name: testing + - name: snmp.device_net_interface_oper_status + description: SNMP device network interface operational status + unit: status + chart_type: line + dimensions: + - name: up + - name: down + - name: testing + - name: unknown + - name: dormant + - name: not_present + - name: lower_layer_down diff --git a/src/go/plugin/go.d/modules/snmp/netif.go b/src/go/plugin/go.d/modules/snmp/netif.go new file mode 100644 index 00000000..1345e5ee --- /dev/null +++ b/src/go/plugin/go.d/modules/snmp/netif.go @@ -0,0 +1,412 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package snmp + +import ( + "fmt" + "strings" +) + +const ( + oidIfIndex = "1.3.6.1.2.1.2.2.1.1" + oidIfDescr = "1.3.6.1.2.1.2.2.1.2" + oidIfType = "1.3.6.1.2.1.2.2.1.3" + oidIfMtu = "1.3.6.1.2.1.2.2.1.4" + oidIfSpeed = "1.3.6.1.2.1.2.2.1.5" + oidIfPhysAddress = "1.3.6.1.2.1.2.2.1.6" + oidIfAdminStatus = "1.3.6.1.2.1.2.2.1.7" + oidIfOperStatus = "1.3.6.1.2.1.2.2.1.8" + oidIfLastChange = "1.3.6.1.2.1.2.2.1.9" + oidIfInOctets = "1.3.6.1.2.1.2.2.1.10" + oidIfInUcastPkts = "1.3.6.1.2.1.2.2.1.11" + oidIfInNUcastPkts = "1.3.6.1.2.1.2.2.1.12" + oidIfInDiscards = "1.3.6.1.2.1.2.2.1.13" + oidIfInErrors = "1.3.6.1.2.1.2.2.1.14" + oidIfInUnknownProtos = "1.3.6.1.2.1.2.2.1.15" + oidIfOutOctets = "1.3.6.1.2.1.2.2.1.16" + oidIfOutUcastPkts = "1.3.6.1.2.1.2.2.1.17" + oidIfOutNUcastPkts = "1.3.6.1.2.1.2.2.1.18" + oidIfOutDiscards = "1.3.6.1.2.1.2.2.1.19" + oidIfOutErrors = "1.3.6.1.2.1.2.2.1.20" + + oidIfName = "1.3.6.1.2.1.31.1.1.1.1" + oidIfInMulticastPkts = "1.3.6.1.2.1.31.1.1.1.2" + oidIfInBroadcastPkts = "1.3.6.1.2.1.31.1.1.1.3" + oidIfOutMulticastPkts = "1.3.6.1.2.1.31.1.1.1.4" + oidIfOutBroadcastPkts = "1.3.6.1.2.1.31.1.1.1.5" + oidIfHCInOctets = "1.3.6.1.2.1.31.1.1.1.6" + oidIfHCInUcastPkts = "1.3.6.1.2.1.31.1.1.1.7" + oidIfHCInMulticastPkts = "1.3.6.1.2.1.31.1.1.1.8" + oidIfHCInBroadcastPkts = "1.3.6.1.2.1.31.1.1.1.9" + oidIfHCOutOctets = "1.3.6.1.2.1.31.1.1.1.10" + oidIfHCOutUcastPkts = "1.3.6.1.2.1.31.1.1.1.11" + oidIfHCOutMulticastPkts = "1.3.6.1.2.1.31.1.1.1.12" + oidIfHCOutBroadcastPkts = "1.3.6.1.2.1.31.1.1.1.13" + oidIfHighSpeed = "1.3.6.1.2.1.31.1.1.1.15" + oidIfAlias = "1.3.6.1.2.1.31.1.1.1.18" +) + +type netInterface struct { + updated bool + hasCharts bool + idx string + + ifIndex int64 + ifDescr string + ifType int64 + ifMtu int64 + ifSpeed int64 + //ifPhysAddress string + ifAdminStatus int64 + ifOperStatus int64 + //ifLastChange string + ifInOctets int64 + ifInUcastPkts int64 + ifInNUcastPkts int64 + ifInDiscards int64 + ifInErrors int64 + ifInUnknownProtos int64 + ifOutOctets int64 + ifOutUcastPkts int64 + ifOutNUcastPkts int64 + ifOutDiscards int64 + ifOutErrors int64 + ifName string + ifInMulticastPkts int64 + ifInBroadcastPkts int64 + ifOutMulticastPkts int64 + ifOutBroadcastPkts int64 + ifHCInOctets int64 + ifHCInUcastPkts int64 + ifHCInMulticastPkts int64 + ifHCInBroadcastPkts int64 + ifHCOutOctets int64 + ifHCOutUcastPkts int64 + ifHCOutMulticastPkts int64 + ifHCOutBroadcastPkts int64 + ifHighSpeed int64 + ifAlias string +} + +func (n *netInterface) String() string { + return fmt.Sprintf("iface index='%d',type='%s',name='%s',descr='%s',alias='%s'", + n.ifIndex, ifTypeMapping[n.ifType], n.ifName, n.ifDescr, strings.ReplaceAll(n.ifAlias, "\n", "\\n")) +} + +var ifAdminStatusMapping = map[int64]string{ + 1: "up", + 2: "down", + 3: "testing", +} + +var ifOperStatusMapping = map[int64]string{ + 1: "up", + 2: "down", + 3: "testing", + 4: "unknown", + 5: "dormant", + 6: "notPresent", + 7: "lowerLayerDown", +} + +var ifTypeMapping = map[int64]string{ + 1: "other", + 2: "regular1822", + 3: "hdh1822", + 4: "ddnX25", + 5: "rfc877x25", + 6: "ethernetCsmacd", + 7: "iso88023Csmacd", + 8: "iso88024TokenBus", + 9: "iso88025TokenRing", + 10: "iso88026Man", + 11: "starLan", + 12: "proteon10Mbit", + 13: "proteon80Mbit", + 14: "hyperchannel", + 15: "fddi", + 16: "lapb", + 17: "sdlc", + 18: "ds1", + 19: "e1", + 20: "basicISDN", + 21: "primaryISDN", + 22: "propPointToPointSerial", + 23: "ppp", + 24: "softwareLoopback", + 25: "eon", + 26: "ethernet3Mbit", + 27: "nsip", + 28: "slip", + 29: "ultra", + 30: "ds3", + 31: "sip", + 32: "frameRelay", + 33: "rs232", + 34: "para", + 35: "arcnet", + 36: "arcnetPlus", + 37: "atm", + 38: "miox25", + 39: "sonet", + 40: "x25ple", + 41: "iso88022llc", + 42: "localTalk", + 43: "smdsDxi", + 44: "frameRelayService", + 45: "v35", + 46: "hssi", + 47: "hippi", + 48: "modem", + 49: "aal5", + 50: "sonetPath", + 51: "sonetVT", + 52: "smdsIcip", + 53: "propVirtual", + 54: "propMultiplexor", + 55: "ieee80212", + 56: "fibreChannel", + 57: "hippiInterface", + 58: "frameRelayInterconnect", + 59: "aflane8023", + 60: "aflane8025", + 61: "cctEmul", + 62: "fastEther", + 63: "isdn", + 64: "v11", + 65: "v36", + 66: "g703at64k", + 67: "g703at2mb", + 68: "qllc", + 69: "fastEtherFX", + 70: "channel", + 71: "ieee80211", + 72: "ibm370parChan", + 73: "escon", + 74: "dlsw", + 75: "isdns", + 76: "isdnu", + 77: "lapd", + 78: "ipSwitch", + 79: "rsrb", + 80: "atmLogical", + 81: "ds0", + 82: "ds0Bundle", + 83: "bsc", + 84: "async", + 85: "cnr", + 86: "iso88025Dtr", + 87: "eplrs", + 88: "arap", + 89: "propCnls", + 90: "hostPad", + 91: "termPad", + 92: "frameRelayMPI", + 93: "x213", + 94: "adsl", + 95: "radsl", + 96: "sdsl", + 97: "vdsl", + 98: "iso88025CRFPInt", + 99: "myrinet", + 100: "voiceEM", + 101: "voiceFXO", + 102: "voiceFXS", + 103: "voiceEncap", + 104: "voiceOverIp", + 105: "atmDxi", + 106: "atmFuni", + 107: "atmIma", + 108: "pppMultilinkBundle", + 109: "ipOverCdlc", + 110: "ipOverClaw", + 111: "stackToStack", + 112: "virtualIpAddress", + 113: "mpc", + 114: "ipOverAtm", + 115: "iso88025Fiber", + 116: "tdlc", + 117: "gigabitEthernet", + 118: "hdlc", + 119: "lapf", + 120: "v37", + 121: "x25mlp", + 122: "x25huntGroup", + 123: "transpHdlc", + 124: "interleave", + 125: "fast", + 126: "ip", + 127: "docsCableMaclayer", + 128: "docsCableDownstream", + 129: "docsCableUpstream", + 130: "a12MppSwitch", + 131: "tunnel", + 132: "coffee", + 133: "ces", + 134: "atmSubInterface", + 135: "l2vlan", + 136: "l3ipvlan", + 137: "l3ipxvlan", + 138: "digitalPowerline", + 139: "mediaMailOverIp", + 140: "dtm", + 141: "dcn", + 142: "ipForward", + 143: "msdsl", + 144: "ieee1394", + 145: "if-gsn", + 146: "dvbRccMacLayer", + 147: "dvbRccDownstream", + 148: "dvbRccUpstream", + 149: "atmVirtual", + 150: "mplsTunnel", + 151: "srp", + 152: "voiceOverAtm", + 153: "voiceOverFrameRelay", + 154: "idsl", + 155: "compositeLink", + 156: "ss7SigLink", + 157: "propWirelessP2P", + 158: "frForward", + 159: "rfc1483", + 160: "usb", + 161: "ieee8023adLag", + 162: "bgppolicyaccounting", + 163: "frf16MfrBundle", + 164: "h323Gatekeeper", + 165: "h323Proxy", + 166: "mpls", + 167: "mfSigLink", + 168: "hdsl2", + 169: "shdsl", + 170: "ds1FDL", + 171: "pos", + 172: "dvbAsiIn", + 173: "dvbAsiOut", + 174: "plc", + 175: "nfas", + 176: "tr008", + 177: "gr303RDT", + 178: "gr303IDT", + 179: "isup", + 180: "propDocsWirelessMaclayer", + 181: "propDocsWirelessDownstream", + 182: "propDocsWirelessUpstream", + 183: "hiperlan2", + 184: "propBWAp2Mp", + 185: "sonetOverheadChannel", + 186: "digitalWrapperOverheadChannel", + 187: "aal2", + 188: "radioMAC", + 189: "atmRadio", + 190: "imt", + 191: "mvl", + 192: "reachDSL", + 193: "frDlciEndPt", + 194: "atmVciEndPt", + 195: "opticalChannel", + 196: "opticalTransport", + 197: "propAtm", + 198: "voiceOverCable", + 199: "infiniband", + 200: "teLink", + 201: "q2931", + 202: "virtualTg", + 203: "sipTg", + 204: "sipSig", + 205: "docsCableUpstreamChannel", + 206: "econet", + 207: "pon155", + 208: "pon622", + 209: "bridge", + 210: "linegroup", + 211: "voiceEMFGD", + 212: "voiceFGDEANA", + 213: "voiceDID", + 214: "mpegTransport", + 215: "sixToFour", + 216: "gtp", + 217: "pdnEtherLoop1", + 218: "pdnEtherLoop2", + 219: "opticalChannelGroup", + 220: "homepna", + 221: "gfp", + 222: "ciscoISLvlan", + 223: "actelisMetaLOOP", + 224: "fcipLink", + 225: "rpr", + 226: "qam", + 227: "lmp", + 228: "cblVectaStar", + 229: "docsCableMCmtsDownstream", + 230: "adsl2", + 231: "macSecControlledIF", + 232: "macSecUncontrolledIF", + 233: "aviciOpticalEther", + 234: "atmbond", + 235: "voiceFGDOS", + 236: "mocaVersion1", + 237: "ieee80216WMAN", + 238: "adsl2plus", + 239: "dvbRcsMacLayer", + 240: "dvbTdm", + 241: "dvbRcsTdma", + 242: "x86Laps", + 243: "wwanPP", + 244: "wwanPP2", + 245: "voiceEBS", + 246: "ifPwType", + 247: "ilan", + 248: "pip", + 249: "aluELP", + 250: "gpon", + 251: "vdsl2", + 252: "capwapDot11Profile", + 253: "capwapDot11Bss", + 254: "capwapWtpVirtualRadio", + 255: "bits", + 256: "docsCableUpstreamRfPort", + 257: "cableDownstreamRfPort", + 258: "vmwareVirtualNic", + 259: "ieee802154", + 260: "otnOdu", + 261: "otnOtu", + 262: "ifVfiType", + 263: "g9981", + 264: "g9982", + 265: "g9983", + 266: "aluEpon", + 267: "aluEponOnu", + 268: "aluEponPhysicalUni", + 269: "aluEponLogicalLink", + 270: "aluGponOnu", + 271: "aluGponPhysicalUni", + 272: "vmwareNicTeam", + 277: "docsOfdmDownstream", + 278: "docsOfdmaUpstream", + 279: "gfast", + 280: "sdci", + 281: "xboxWireless", + 282: "fastdsl", + 283: "docsCableScte55d1FwdOob", + 284: "docsCableScte55d1RetOob", + 285: "docsCableScte55d2DsOob", + 286: "docsCableScte55d2UsOob", + 287: "docsCableNdf", + 288: "docsCableNdr", + 289: "ptm", + 290: "ghn", + 291: "otnOtsi", + 292: "otnOtuc", + 293: "otnOduc", + 294: "otnOtsig", + 295: "microwaveCarrierTermination", + 296: "microwaveRadioLinkTerminal", + 297: "ieee8021axDrni", + 298: "ax25", + 299: "ieee19061nanocom", + 300: "cpri", + 301: "omni", + 302: "roe", + 303: "p2pOverLan", +} diff --git a/src/go/plugin/go.d/modules/snmp/snmp.go b/src/go/plugin/go.d/modules/snmp/snmp.go new file mode 100644 index 00000000..253d9f50 --- /dev/null +++ b/src/go/plugin/go.d/modules/snmp/snmp.go @@ -0,0 +1,155 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package snmp + +import ( + _ "embed" + "errors" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + + "github.com/gosnmp/gosnmp" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("snmp", module.Creator{ + JobConfigSchema: configSchema, + Defaults: module.Defaults{ + UpdateEvery: 10, + }, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *SNMP { + return &SNMP{ + Config: Config{ + Community: "public", + Options: Options{ + Port: 161, + Retries: 1, + Timeout: 5, + Version: gosnmp.Version2c.String(), + MaxOIDs: 60, + MaxRepetitions: 25, + }, + User: User{ + SecurityLevel: "authPriv", + AuthProto: "sha512", + PrivProto: "aes192c", + }, + }, + + newSnmpClient: gosnmp.NewHandler, + + checkMaxReps: true, + collectIfMib: true, + netInterfaces: make(map[string]*netInterface), + } +} + +type SNMP struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + newSnmpClient func() gosnmp.Handler + snmpClient gosnmp.Handler + + netIfaceFilterByName matcher.Matcher + netIfaceFilterByType matcher.Matcher + + checkMaxReps bool + collectIfMib bool + netInterfaces map[string]*netInterface + sysName string + + oids []string +} + +func (s *SNMP) Configuration() any { + return s.Config +} + +func (s *SNMP) Init() error { + err := s.validateConfig() + if err != nil { + s.Errorf("config validation failed: %v", err) + return err + } + + snmpClient, err := s.initSNMPClient() + if err != nil { + s.Errorf("failed to initialize SNMP client: %v", err) + return err + } + + err = snmpClient.Connect() + if err != nil { + s.Errorf("SNMP client connection failed: %v", err) + return err + } + s.snmpClient = snmpClient + + byName, byType, err := s.initNetIfaceFilters() + if err != nil { + s.Errorf("failed to initialize network interface filters: %v", err) + return err + } + s.netIfaceFilterByName = byName + s.netIfaceFilterByType = byType + + charts, err := newUserInputCharts(s.ChartsInput) + if err != nil { + s.Errorf("failed to create user charts: %v", err) + return err + } + s.charts = charts + + s.oids = s.initOIDs() + + return nil +} + +func (s *SNMP) Check() error { + mx, err := s.collect() + if err != nil { + s.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (s *SNMP) Charts() *module.Charts { + return s.charts +} + +func (s *SNMP) Collect() map[string]int64 { + mx, err := s.collect() + if err != nil { + s.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (s *SNMP) Cleanup() { + if s.snmpClient != nil { + _ = s.snmpClient.Close() + } +} diff --git a/src/go/plugin/go.d/modules/snmp/snmp_test.go b/src/go/plugin/go.d/modules/snmp/snmp_test.go new file mode 100644 index 00000000..1841235f --- /dev/null +++ b/src/go/plugin/go.d/modules/snmp/snmp_test.go @@ -0,0 +1,754 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package snmp + +import ( + "encoding/hex" + "errors" + "fmt" + "os" + "strings" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + + "github.com/golang/mock/gomock" + "github.com/gosnmp/gosnmp" + snmpmock "github.com/gosnmp/gosnmp/mocks" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + } { + require.NotNil(t, data, name) + } +} + +func TestSNMP_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &SNMP{}, dataConfigJSON, dataConfigYAML) +} + +func TestSNMP_Init(t *testing.T) { + tests := map[string]struct { + prepareSNMP func() *SNMP + wantFail bool + }{ + "fail with default config": { + wantFail: true, + prepareSNMP: func() *SNMP { + return New() + }, + }, + "fail when using SNMPv3 but 'user.name' not set": { + wantFail: true, + prepareSNMP: func() *SNMP { + snmp := New() + snmp.Config = prepareV3Config() + snmp.User.Name = "" + return snmp + }, + }, + "success when using SNMPv1 with valid config": { + wantFail: false, + prepareSNMP: func() *SNMP { + snmp := New() + snmp.Config = prepareV1Config() + return snmp + }, + }, + "success when using SNMPv2 with valid config": { + wantFail: false, + prepareSNMP: func() *SNMP { + snmp := New() + snmp.Config = prepareV2Config() + return snmp + }, + }, + "success when using SNMPv3 with valid config": { + wantFail: false, + prepareSNMP: func() *SNMP { + snmp := New() + snmp.Config = prepareV3Config() + return snmp + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + snmp := test.prepareSNMP() + + if test.wantFail { + assert.Error(t, snmp.Init()) + } else { + assert.NoError(t, snmp.Init()) + } + }) + } +} + +func TestSNMP_Cleanup(t *testing.T) { + tests := map[string]struct { + prepareSNMP func(t *testing.T, m *snmpmock.MockHandler) *SNMP + }{ + "cleanup call if snmpClient initialized": { + prepareSNMP: func(t *testing.T, m *snmpmock.MockHandler) *SNMP { + snmp := New() + snmp.Config = prepareV2Config() + snmp.newSnmpClient = func() gosnmp.Handler { return m } + setMockClientInitExpect(m) + + require.NoError(t, snmp.Init()) + + m.EXPECT().Close().Times(1) + + return snmp + }, + }, + "cleanup call does not panic if snmpClient not initialized": { + prepareSNMP: func(t *testing.T, m *snmpmock.MockHandler) *SNMP { + snmp := New() + snmp.Config = prepareV2Config() + snmp.newSnmpClient = func() gosnmp.Handler { return m } + setMockClientInitExpect(m) + + require.NoError(t, snmp.Init()) + + snmp.snmpClient = nil + + return snmp + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + mockSNMP, cleanup := mockInit(t) + defer cleanup() + + snmp := test.prepareSNMP(t, mockSNMP) + + assert.NotPanics(t, snmp.Cleanup) + }) + } +} + +func TestSNMP_Charts(t *testing.T) { + tests := map[string]struct { + prepareSNMP func(t *testing.T, m *snmpmock.MockHandler) *SNMP + wantNumCharts int + doCollect bool + }{ + "if-mib, no custom": { + doCollect: true, + wantNumCharts: len(netIfaceChartsTmpl)*4 + 1, + prepareSNMP: func(t *testing.T, m *snmpmock.MockHandler) *SNMP { + snmp := New() + snmp.Config = prepareV2Config() + setMockClientSysExpect(m) + setMockClientIfMibExpect(m) + + return snmp + }, + }, + "custom, no if-mib": { + wantNumCharts: 10, + prepareSNMP: func(t *testing.T, m *snmpmock.MockHandler) *SNMP { + snmp := New() + snmp.Config = prepareConfigWithUserCharts(prepareV2Config(), 0, 9) + snmp.collectIfMib = false + + return snmp + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + mockSNMP, cleanup := mockInit(t) + defer cleanup() + + setMockClientInitExpect(mockSNMP) + + snmp := test.prepareSNMP(t, mockSNMP) + snmp.newSnmpClient = func() gosnmp.Handler { return mockSNMP } + + require.NoError(t, snmp.Init()) + + if test.doCollect { + _ = snmp.Collect() + } + + assert.Equal(t, test.wantNumCharts, len(*snmp.Charts())) + }) + } +} + +func TestSNMP_Check(t *testing.T) { + tests := map[string]struct { + wantFail bool + prepareSNMP func(m *snmpmock.MockHandler) *SNMP + }{ + "success when collecting IF-MIB": { + wantFail: false, + prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { + snmp := New() + snmp.Config = prepareV2Config() + setMockClientIfMibExpect(m) + + return snmp + }, + }, + "success only custom OIDs supported type": { + wantFail: false, + prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { + snmp := New() + snmp.Config = prepareConfigWithUserCharts(prepareV2Config(), 0, 3) + snmp.collectIfMib = false + + m.EXPECT().Get(gomock.Any()).Return(&gosnmp.SnmpPacket{ + Variables: []gosnmp.SnmpPDU{ + {Value: 10, Type: gosnmp.Counter32}, + {Value: 20, Type: gosnmp.Counter64}, + {Value: 30, Type: gosnmp.Gauge32}, + {Value: 1, Type: gosnmp.Boolean}, + {Value: 40, Type: gosnmp.Gauge32}, + {Value: 50, Type: gosnmp.TimeTicks}, + {Value: 60, Type: gosnmp.Uinteger32}, + {Value: 70, Type: gosnmp.Integer}, + }, + }, nil).Times(1) + + return snmp + }, + }, + "fail when snmp client Get fails": { + wantFail: true, + prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { + snmp := New() + snmp.Config = prepareConfigWithUserCharts(prepareV2Config(), 0, 3) + snmp.collectIfMib = false + + m.EXPECT().Get(gomock.Any()).Return(nil, errors.New("mock Get() error")).Times(1) + + return snmp + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + mockSNMP, cleanup := mockInit(t) + defer cleanup() + + setMockClientInitExpect(mockSNMP) + setMockClientSysExpect(mockSNMP) + + snmp := test.prepareSNMP(mockSNMP) + snmp.newSnmpClient = func() gosnmp.Handler { return mockSNMP } + + require.NoError(t, snmp.Init()) + + if test.wantFail { + assert.Error(t, snmp.Check()) + } else { + assert.NoError(t, snmp.Check()) + } + }) + } +} + +func TestSNMP_Collect(t *testing.T) { + tests := map[string]struct { + prepareSNMP func(m *snmpmock.MockHandler) *SNMP + wantCollected map[string]int64 + }{ + "success only IF-MIB": { + prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { + snmp := New() + snmp.Config = prepareV2Config() + + setMockClientIfMibExpect(m) + + return snmp + }, + wantCollected: map[string]int64{ + "net_iface_ether1_admin_status_down": 0, + "net_iface_ether1_admin_status_testing": 0, + "net_iface_ether1_admin_status_up": 1, + "net_iface_ether1_bcast_in": 0, + "net_iface_ether1_bcast_out": 0, + "net_iface_ether1_discards_in": 0, + "net_iface_ether1_discards_out": 0, + "net_iface_ether1_errors_in": 0, + "net_iface_ether1_errors_out": 0, + "net_iface_ether1_mcast_in": 0, + "net_iface_ether1_mcast_out": 0, + "net_iface_ether1_oper_status_dormant": 0, + "net_iface_ether1_oper_status_down": 1, + "net_iface_ether1_oper_status_lowerLayerDown": 0, + "net_iface_ether1_oper_status_notPresent": 0, + "net_iface_ether1_oper_status_testing": 0, + "net_iface_ether1_oper_status_unknown": 0, + "net_iface_ether1_oper_status_up": 0, + "net_iface_ether1_traffic_in": 0, + "net_iface_ether1_traffic_out": 0, + "net_iface_ether1_ucast_in": 0, + "net_iface_ether1_ucast_out": 0, + "net_iface_ether2_admin_status_down": 0, + "net_iface_ether2_admin_status_testing": 0, + "net_iface_ether2_admin_status_up": 1, + "net_iface_ether2_bcast_in": 0, + "net_iface_ether2_bcast_out": 0, + "net_iface_ether2_discards_in": 0, + "net_iface_ether2_discards_out": 0, + "net_iface_ether2_errors_in": 0, + "net_iface_ether2_errors_out": 0, + "net_iface_ether2_mcast_in": 1891, + "net_iface_ether2_mcast_out": 7386, + "net_iface_ether2_oper_status_dormant": 0, + "net_iface_ether2_oper_status_down": 0, + "net_iface_ether2_oper_status_lowerLayerDown": 0, + "net_iface_ether2_oper_status_notPresent": 0, + "net_iface_ether2_oper_status_testing": 0, + "net_iface_ether2_oper_status_unknown": 0, + "net_iface_ether2_oper_status_up": 1, + "net_iface_ether2_traffic_in": 615057509, + "net_iface_ether2_traffic_out": 159677206, + "net_iface_ether2_ucast_in": 71080332, + "net_iface_ether2_ucast_out": 39509661, + "net_iface_sfp-sfpplus1_admin_status_down": 0, + "net_iface_sfp-sfpplus1_admin_status_testing": 0, + "net_iface_sfp-sfpplus1_admin_status_up": 1, + "net_iface_sfp-sfpplus1_bcast_in": 0, + "net_iface_sfp-sfpplus1_bcast_out": 0, + "net_iface_sfp-sfpplus1_discards_in": 0, + "net_iface_sfp-sfpplus1_discards_out": 0, + "net_iface_sfp-sfpplus1_errors_in": 0, + "net_iface_sfp-sfpplus1_errors_out": 0, + "net_iface_sfp-sfpplus1_mcast_in": 0, + "net_iface_sfp-sfpplus1_mcast_out": 0, + "net_iface_sfp-sfpplus1_oper_status_dormant": 0, + "net_iface_sfp-sfpplus1_oper_status_down": 0, + "net_iface_sfp-sfpplus1_oper_status_lowerLayerDown": 0, + "net_iface_sfp-sfpplus1_oper_status_notPresent": 1, + "net_iface_sfp-sfpplus1_oper_status_testing": 0, + "net_iface_sfp-sfpplus1_oper_status_unknown": 0, + "net_iface_sfp-sfpplus1_oper_status_up": 0, + "net_iface_sfp-sfpplus1_traffic_in": 0, + "net_iface_sfp-sfpplus1_traffic_out": 0, + "net_iface_sfp-sfpplus1_ucast_in": 0, + "net_iface_sfp-sfpplus1_ucast_out": 0, + "net_iface_sfp-sfpplus2_admin_status_down": 0, + "net_iface_sfp-sfpplus2_admin_status_testing": 0, + "net_iface_sfp-sfpplus2_admin_status_up": 1, + "net_iface_sfp-sfpplus2_bcast_in": 0, + "net_iface_sfp-sfpplus2_bcast_out": 0, + "net_iface_sfp-sfpplus2_discards_in": 0, + "net_iface_sfp-sfpplus2_discards_out": 0, + "net_iface_sfp-sfpplus2_errors_in": 0, + "net_iface_sfp-sfpplus2_errors_out": 0, + "net_iface_sfp-sfpplus2_mcast_in": 0, + "net_iface_sfp-sfpplus2_mcast_out": 0, + "net_iface_sfp-sfpplus2_oper_status_dormant": 0, + "net_iface_sfp-sfpplus2_oper_status_down": 0, + "net_iface_sfp-sfpplus2_oper_status_lowerLayerDown": 0, + "net_iface_sfp-sfpplus2_oper_status_notPresent": 1, + "net_iface_sfp-sfpplus2_oper_status_testing": 0, + "net_iface_sfp-sfpplus2_oper_status_unknown": 0, + "net_iface_sfp-sfpplus2_oper_status_up": 0, + "net_iface_sfp-sfpplus2_traffic_in": 0, + "net_iface_sfp-sfpplus2_traffic_out": 0, + "net_iface_sfp-sfpplus2_ucast_in": 0, + "net_iface_sfp-sfpplus2_ucast_out": 0, + "uptime": 60, + }, + }, + "success only custom OIDs supported type": { + prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { + snmp := New() + snmp.Config = prepareConfigWithUserCharts(prepareV2Config(), 0, 3) + snmp.collectIfMib = false + + m.EXPECT().Get(gomock.Any()).Return(&gosnmp.SnmpPacket{ + Variables: []gosnmp.SnmpPDU{ + {Value: 10, Type: gosnmp.Counter32}, + {Value: 20, Type: gosnmp.Counter64}, + {Value: 30, Type: gosnmp.Gauge32}, + {Value: 1, Type: gosnmp.Boolean}, + {Value: 40, Type: gosnmp.Gauge32}, + {Value: 50, Type: gosnmp.TimeTicks}, + {Value: 60, Type: gosnmp.Uinteger32}, + {Value: 70, Type: gosnmp.Integer}, + }, + }, nil).Times(1) + + return snmp + }, + wantCollected: map[string]int64{ + "1.3.6.1.2.1.2.2.1.10.0": 10, + "1.3.6.1.2.1.2.2.1.16.0": 20, + "1.3.6.1.2.1.2.2.1.10.1": 30, + "1.3.6.1.2.1.2.2.1.16.1": 1, + "1.3.6.1.2.1.2.2.1.10.2": 40, + "1.3.6.1.2.1.2.2.1.16.2": 50, + "1.3.6.1.2.1.2.2.1.10.3": 60, + "1.3.6.1.2.1.2.2.1.16.3": 70, + "uptime": 60, + }, + }, + "success only custom OIDs supported and unsupported type": { + prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { + snmp := New() + snmp.Config = prepareConfigWithUserCharts(prepareV2Config(), 0, 2) + snmp.collectIfMib = false + + m.EXPECT().Get(gomock.Any()).Return(&gosnmp.SnmpPacket{ + Variables: []gosnmp.SnmpPDU{ + {Value: 10, Type: gosnmp.Counter32}, + {Value: 20, Type: gosnmp.Counter64}, + {Value: 30, Type: gosnmp.Gauge32}, + {Value: nil, Type: gosnmp.NoSuchInstance}, + {Value: nil, Type: gosnmp.NoSuchInstance}, + {Value: nil, Type: gosnmp.NoSuchInstance}, + }, + }, nil).Times(1) + + return snmp + }, + wantCollected: map[string]int64{ + "1.3.6.1.2.1.2.2.1.10.0": 10, + "1.3.6.1.2.1.2.2.1.16.0": 20, + "1.3.6.1.2.1.2.2.1.10.1": 30, + "uptime": 60, + }, + }, + "success only custom OIDs unsupported type": { + prepareSNMP: func(m *snmpmock.MockHandler) *SNMP { + snmp := New() + snmp.Config = prepareConfigWithUserCharts(prepareV2Config(), 0, 2) + snmp.collectIfMib = false + + m.EXPECT().Get(gomock.Any()).Return(&gosnmp.SnmpPacket{ + Variables: []gosnmp.SnmpPDU{ + {Value: nil, Type: gosnmp.NoSuchInstance}, + {Value: nil, Type: gosnmp.NoSuchInstance}, + {Value: nil, Type: gosnmp.NoSuchObject}, + {Value: "192.0.2.0", Type: gosnmp.NsapAddress}, + {Value: []uint8{118, 101, 116}, Type: gosnmp.OctetString}, + {Value: ".1.3.6.1.2.1.4.32.1.5.2.1.4.10.19.0.0.16", Type: gosnmp.ObjectIdentifier}, + }, + }, nil).Times(1) + + return snmp + }, + wantCollected: map[string]int64{ + "uptime": 60, + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + mockSNMP, cleanup := mockInit(t) + defer cleanup() + + setMockClientInitExpect(mockSNMP) + setMockClientSysExpect(mockSNMP) + + snmp := test.prepareSNMP(mockSNMP) + snmp.newSnmpClient = func() gosnmp.Handler { return mockSNMP } + + require.NoError(t, snmp.Init()) + + mx := snmp.Collect() + + assert.Equal(t, test.wantCollected, mx) + }) + } +} + +func mockInit(t *testing.T) (*snmpmock.MockHandler, func()) { + mockCtl := gomock.NewController(t) + cleanup := func() { mockCtl.Finish() } + mockSNMP := snmpmock.NewMockHandler(mockCtl) + + return mockSNMP, cleanup +} + +func prepareV3Config() Config { + cfg := prepareV2Config() + cfg.Options.Version = gosnmp.Version3.String() + cfg.User = User{ + Name: "name", + SecurityLevel: "authPriv", + AuthProto: strings.ToLower(gosnmp.MD5.String()), + AuthKey: "auth_key", + PrivProto: strings.ToLower(gosnmp.AES.String()), + PrivKey: "priv_key", + } + return cfg +} + +func prepareV2Config() Config { + cfg := prepareV1Config() + cfg.Options.Version = gosnmp.Version2c.String() + return cfg +} + +func prepareV1Config() Config { + return Config{ + UpdateEvery: 1, + Hostname: "192.0.2.1", + Community: "public", + Options: Options{ + Port: 161, + Retries: 1, + Timeout: 5, + Version: gosnmp.Version1.String(), + MaxOIDs: 60, + MaxRepetitions: 25, + }, + } +} + +func prepareConfigWithUserCharts(cfg Config, start, end int) Config { + if start > end || start < 0 || end < 1 { + panic(fmt.Sprintf("invalid index range ('%d'-'%d')", start, end)) + } + cfg.ChartsInput = []ChartConfig{ + { + ID: "test_chart1", + Title: "This is Test Chart1", + Units: "kilobits/s", + Family: "family", + Type: module.Area.String(), + Priority: module.Priority, + Dimensions: []DimensionConfig{ + { + OID: "1.3.6.1.2.1.2.2.1.10", + Name: "in", + Algorithm: module.Incremental.String(), + Multiplier: 8, + Divisor: 1000, + }, + { + OID: "1.3.6.1.2.1.2.2.1.16", + Name: "out", + Algorithm: module.Incremental.String(), + Multiplier: 8, + Divisor: 1000, + }, + }, + }, + } + + for i := range cfg.ChartsInput { + cfg.ChartsInput[i].IndexRange = []int{start, end} + } + + return cfg +} + +func setMockClientInitExpect(m *snmpmock.MockHandler) { + m.EXPECT().Target().AnyTimes() + m.EXPECT().Port().AnyTimes() + m.EXPECT().Version().AnyTimes() + m.EXPECT().Community().AnyTimes() + m.EXPECT().SetTarget(gomock.Any()).AnyTimes() + m.EXPECT().SetPort(gomock.Any()).AnyTimes() + m.EXPECT().SetRetries(gomock.Any()).AnyTimes() + m.EXPECT().SetMaxRepetitions(gomock.Any()).AnyTimes() + m.EXPECT().SetMaxOids(gomock.Any()).AnyTimes() + m.EXPECT().SetLogger(gomock.Any()).AnyTimes() + m.EXPECT().SetTimeout(gomock.Any()).AnyTimes() + m.EXPECT().SetCommunity(gomock.Any()).AnyTimes() + m.EXPECT().SetVersion(gomock.Any()).AnyTimes() + m.EXPECT().SetSecurityModel(gomock.Any()).AnyTimes() + m.EXPECT().SetMsgFlags(gomock.Any()).AnyTimes() + m.EXPECT().SetSecurityParameters(gomock.Any()).AnyTimes() + m.EXPECT().Connect().Return(nil).AnyTimes() +} + +func setMockClientSysExpect(m *snmpmock.MockHandler) { + m.EXPECT().Get([]string{oidSysName}).Return(&gosnmp.SnmpPacket{ + Variables: []gosnmp.SnmpPDU{ + {Value: []uint8("mock-host"), Type: gosnmp.OctetString}, + }, + }, nil).MinTimes(1) + + m.EXPECT().Get([]string{oidSysUptime}).Return(&gosnmp.SnmpPacket{ + Variables: []gosnmp.SnmpPDU{ + {Value: uint32(6048), Type: gosnmp.TimeTicks}, + }, + }, nil).MinTimes(1) +} + +func setMockClientIfMibExpect(m *snmpmock.MockHandler) { + m.EXPECT().WalkAll(oidIfIndex).Return([]gosnmp.SnmpPDU{ + {Name: oidIfIndex + ".1", Value: 1, Type: gosnmp.Integer}, + {Name: oidIfIndex + ".2", Value: 2, Type: gosnmp.Integer}, + {Name: oidIfIndex + ".17", Value: 17, Type: gosnmp.Integer}, + {Name: oidIfIndex + ".18", Value: 18, Type: gosnmp.Integer}, + }, nil).MinTimes(1) + m.EXPECT().WalkAll(rootOidIfMibIfTable).Return([]gosnmp.SnmpPDU{ + {Name: oidIfIndex + ".1", Value: 1, Type: gosnmp.Integer}, + {Name: oidIfIndex + ".2", Value: 2, Type: gosnmp.Integer}, + {Name: oidIfIndex + ".17", Value: 17, Type: gosnmp.Integer}, + {Name: oidIfIndex + ".18", Value: 18, Type: gosnmp.Integer}, + {Name: oidIfDescr + ".1", Value: []uint8("ether1"), Type: gosnmp.OctetString}, + {Name: oidIfDescr + ".2", Value: []uint8("ether2"), Type: gosnmp.OctetString}, + {Name: oidIfDescr + ".17", Value: []uint8("sfp-sfpplus2"), Type: gosnmp.OctetString}, + {Name: oidIfDescr + ".18", Value: []uint8("sfp-sfpplus1"), Type: gosnmp.OctetString}, + {Name: oidIfType + ".1", Value: 6, Type: gosnmp.Integer}, + {Name: oidIfType + ".2", Value: 6, Type: gosnmp.Integer}, + {Name: oidIfType + ".17", Value: 6, Type: gosnmp.Integer}, + {Name: oidIfType + ".18", Value: 6, Type: gosnmp.Integer}, + {Name: oidIfMtu + ".1", Value: 1500, Type: gosnmp.Integer}, + {Name: oidIfMtu + ".2", Value: 1500, Type: gosnmp.Integer}, + {Name: oidIfMtu + ".17", Value: 1500, Type: gosnmp.Integer}, + {Name: oidIfMtu + ".18", Value: 1500, Type: gosnmp.Integer}, + {Name: oidIfSpeed + ".1", Value: 0, Type: gosnmp.Gauge32}, + {Name: oidIfSpeed + ".2", Value: 1000000000, Type: gosnmp.Gauge32}, + {Name: oidIfSpeed + ".17", Value: 0, Type: gosnmp.Gauge32}, + {Name: oidIfSpeed + ".18", Value: 0, Type: gosnmp.Gauge32}, + {Name: oidIfPhysAddress + ".1", Value: decodePhysAddr("18:fd:74:7e:c5:80"), Type: gosnmp.OctetString}, + {Name: oidIfPhysAddress + ".2", Value: decodePhysAddr("18:fd:74:7e:c5:81"), Type: gosnmp.OctetString}, + {Name: oidIfPhysAddress + ".17", Value: decodePhysAddr("18:fd:74:7e:c5:90"), Type: gosnmp.OctetString}, + {Name: oidIfPhysAddress + ".18", Value: decodePhysAddr("18:fd:74:7e:c5:91"), Type: gosnmp.OctetString}, + {Name: oidIfAdminStatus + ".1", Value: 1, Type: gosnmp.Integer}, + {Name: oidIfAdminStatus + ".2", Value: 1, Type: gosnmp.Integer}, + {Name: oidIfAdminStatus + ".17", Value: 1, Type: gosnmp.Integer}, + {Name: oidIfAdminStatus + ".18", Value: 1, Type: gosnmp.Integer}, + {Name: oidIfOperStatus + ".1", Value: 2, Type: gosnmp.Integer}, + {Name: oidIfOperStatus + ".2", Value: 1, Type: gosnmp.Integer}, + {Name: oidIfOperStatus + ".17", Value: 6, Type: gosnmp.Integer}, + {Name: oidIfOperStatus + ".18", Value: 6, Type: gosnmp.Integer}, + {Name: oidIfLastChange + ".1", Value: 0, Type: gosnmp.TimeTicks}, + {Name: oidIfLastChange + ".2", Value: 3243, Type: gosnmp.TimeTicks}, + {Name: oidIfLastChange + ".17", Value: 0, Type: gosnmp.TimeTicks}, + {Name: oidIfLastChange + ".18", Value: 0, Type: gosnmp.TimeTicks}, + {Name: oidIfInOctets + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInOctets + ".2", Value: 3827243723, Type: gosnmp.Counter32}, + {Name: oidIfInOctets + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInOctets + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInUcastPkts + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInUcastPkts + ".2", Value: 71035992, Type: gosnmp.Counter32}, + {Name: oidIfInUcastPkts + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInUcastPkts + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInNUcastPkts + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInNUcastPkts + ".2", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInNUcastPkts + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInNUcastPkts + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInDiscards + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInDiscards + ".2", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInDiscards + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInDiscards + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInErrors + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInErrors + ".2", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInErrors + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInErrors + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInUnknownProtos + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInUnknownProtos + ".2", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInUnknownProtos + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInUnknownProtos + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutOctets + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutOctets + ".2", Value: 2769838772, Type: gosnmp.Counter32}, + {Name: oidIfOutOctets + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutOctets + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutUcastPkts + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutUcastPkts + ".2", Value: 39482929, Type: gosnmp.Counter32}, + {Name: oidIfOutUcastPkts + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutUcastPkts + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutNUcastPkts + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutNUcastPkts + ".2", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutNUcastPkts + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutNUcastPkts + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutDiscards + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutDiscards + ".2", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutDiscards + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutDiscards + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutErrors + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutErrors + ".2", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutErrors + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutErrors + ".18", Value: 0, Type: gosnmp.Counter32}, + }, nil).MinTimes(1) + + m.EXPECT().WalkAll(rootOidIfMibIfXTable).Return([]gosnmp.SnmpPDU{ + {Name: oidIfName + ".1", Value: []uint8("ether1"), Type: gosnmp.OctetString}, + {Name: oidIfName + ".2", Value: []uint8("ether2"), Type: gosnmp.OctetString}, + {Name: oidIfName + ".17", Value: []uint8("sfp-sfpplus2"), Type: gosnmp.OctetString}, + {Name: oidIfName + ".18", Value: []uint8("sfp-sfpplus1"), Type: gosnmp.OctetString}, + {Name: oidIfInMulticastPkts + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInMulticastPkts + ".2", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInMulticastPkts + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInMulticastPkts + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInBroadcastPkts + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInBroadcastPkts + ".2", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInBroadcastPkts + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfInBroadcastPkts + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutMulticastPkts + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutMulticastPkts + ".2", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutMulticastPkts + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutMulticastPkts + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutBroadcastPkts + ".1", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutBroadcastPkts + ".2", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutBroadcastPkts + ".17", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfOutBroadcastPkts + ".18", Value: 0, Type: gosnmp.Counter32}, + {Name: oidIfHCInOctets + ".1", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCInOctets + ".2", Value: 76882188712, Type: gosnmp.Counter64}, + {Name: oidIfHCInOctets + ".17", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCInOctets + ".18", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCInUcastPkts + ".1", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCInUcastPkts + ".2", Value: 71080332, Type: gosnmp.Counter64}, + {Name: oidIfHCInUcastPkts + ".17", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCInUcastPkts + ".18", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCInMulticastPkts + ".1", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCInMulticastPkts + ".2", Value: 1891, Type: gosnmp.Counter64}, + {Name: oidIfHCInMulticastPkts + ".17", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCInMulticastPkts + ".18", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCInBroadcastPkts + ".1", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCInBroadcastPkts + ".2", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCInBroadcastPkts + ".17", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCInBroadcastPkts + ".18", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCOutOctets + ".1", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCOutOctets + ".2", Value: 19959650810, Type: gosnmp.Counter64}, + {Name: oidIfHCOutOctets + ".17", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCOutOctets + ".18", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCOutUcastPkts + ".1", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCOutUcastPkts + ".2", Value: 39509661, Type: gosnmp.Counter64}, + {Name: oidIfHCOutUcastPkts + ".17", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCOutUcastPkts + ".18", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCOutMulticastPkts + ".1", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCOutMulticastPkts + ".2", Value: 28844, Type: gosnmp.Counter64}, + {Name: oidIfHCOutMulticastPkts + ".17", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCOutMulticastPkts + ".18", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCOutBroadcastPkts + ".1", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCOutBroadcastPkts + ".2", Value: 7386, Type: gosnmp.Counter64}, + {Name: oidIfHCOutBroadcastPkts + ".17", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHCOutBroadcastPkts + ".18", Value: 0, Type: gosnmp.Counter64}, + {Name: oidIfHighSpeed + ".1", Value: 0, Type: gosnmp.Gauge32}, + {Name: oidIfHighSpeed + ".2", Value: 1000, Type: gosnmp.Gauge32}, + {Name: oidIfHighSpeed + ".17", Value: 0, Type: gosnmp.Gauge32}, + {Name: oidIfHighSpeed + ".18", Value: 0, Type: gosnmp.Gauge32}, + {Name: oidIfAlias + ".1", Value: []uint8(""), Type: gosnmp.OctetString}, + {Name: oidIfAlias + ".2", Value: []uint8("UPLINK2 (2.1)"), Type: gosnmp.OctetString}, + {Name: oidIfAlias + ".17", Value: []uint8(""), Type: gosnmp.OctetString}, + {Name: oidIfAlias + ".18", Value: []uint8(""), Type: gosnmp.OctetString}, + }, nil).MinTimes(1) +} + +func decodePhysAddr(s string) []uint8 { + s = strings.ReplaceAll(s, ":", "") + v, _ := hex.DecodeString(s) + return v +} diff --git a/src/go/collectors/go.d.plugin/modules/snmp/testdata/config.json b/src/go/plugin/go.d/modules/snmp/testdata/config.json index c0fff486..b88ac1c2 100644 --- a/src/go/collectors/go.d.plugin/modules/snmp/testdata/config.json +++ b/src/go/plugin/go.d/modules/snmp/testdata/config.json @@ -2,6 +2,10 @@ "update_every": 123, "hostname": "ok", "community": "ok", + "network_interface_filter": { + "by_name": "ok", + "by_type": "ok" + }, "user": { "name": "ok", "level": "ok", @@ -15,7 +19,8 @@ "retries": 123, "timeout": 123, "version": "ok", - "max_request_size": 123 + "max_request_size": 123, + "max_repetitions": 123 }, "charts": [ { diff --git a/src/go/collectors/go.d.plugin/modules/snmp/testdata/config.yaml b/src/go/plugin/go.d/modules/snmp/testdata/config.yaml index 98620fb9..f4ddbf91 100644 --- a/src/go/collectors/go.d.plugin/modules/snmp/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/snmp/testdata/config.yaml @@ -1,6 +1,9 @@ update_every: 123 hostname: "ok" community: "ok" +network_interface_filter: + by_name: "ok" + by_type: "ok" user: name: "ok" level: "ok" @@ -14,6 +17,7 @@ options: timeout: 123 version: "ok" max_request_size: 123 + max_repetitions: 123 charts: - id: "ok" title: "ok" diff --git a/src/go/plugin/go.d/modules/squid/README.md b/src/go/plugin/go.d/modules/squid/README.md new file mode 120000 index 00000000..c4e5a03d --- /dev/null +++ b/src/go/plugin/go.d/modules/squid/README.md @@ -0,0 +1 @@ +integrations/squid.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/squid/charts.go b/src/go/plugin/go.d/modules/squid/charts.go new file mode 100644 index 00000000..47bab60f --- /dev/null +++ b/src/go/plugin/go.d/modules/squid/charts.go @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package squid + +import ( + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioClientsNet = module.Priority + iota + prioClientsRequests + prioServersNet + prioServersRequests +) + +var charts = module.Charts{ + clientsNetChart.Copy(), + clientsRequestsChart.Copy(), + serversNetChart.Copy(), + serversRequestsChart.Copy(), +} + +var ( + clientsNetChart = module.Chart{ + ID: "clients_net", + Title: "Squid Client Bandwidth", + Units: "kilobits/s", + Fam: "clients", + Ctx: "squid.clients_net", + Type: module.Area, + Priority: prioClientsNet, + Dims: module.Dims{ + {ID: "client_http.kbytes_in", Name: "in", Algo: module.Incremental, Mul: 8}, + {ID: "client_http.kbytes_out", Name: "out", Algo: module.Incremental, Mul: -8}, + {ID: "client_http.hit_kbytes_out", Name: "hits", Algo: module.Incremental, Mul: -8}, + }, + } + + clientsRequestsChart = module.Chart{ + ID: "clients_requests", + Title: "Squid Client Requests", + Units: "requests/s", + Fam: "clients", + Ctx: "squid.clients_requests", + Type: module.Line, + Priority: prioClientsRequests, + Dims: module.Dims{ + {ID: "client_http.requests", Name: "requests", Algo: module.Incremental}, + {ID: "client_http.hits", Name: "hits", Algo: module.Incremental}, + {ID: "client_http.errors", Name: "errors", Algo: module.Incremental, Mul: -1}, + }, + } + + serversNetChart = module.Chart{ + ID: "servers_net", + Title: "Squid Server Bandwidth", + Units: "kilobits/s", + Fam: "servers", + Ctx: "squid.servers_net", + Type: module.Area, + Priority: prioServersNet, + Dims: module.Dims{ + {ID: "server.all.kbytes_in", Name: "in", Algo: module.Incremental, Mul: 8}, + {ID: "server.all.kbytes_out", Name: "out", Algo: module.Incremental, Mul: -8}, + }, + } + + serversRequestsChart = module.Chart{ + ID: "servers_requests", + Title: "Squid Server Requests", + Units: "requests/s", + Fam: "servers", + Ctx: "squid.servers_requests", + Type: module.Line, + Priority: prioServersRequests, + Dims: module.Dims{ + {ID: "server.all.requests", Name: "requests", Algo: module.Incremental}, + {ID: "server.all.errors", Name: "errors", Algo: module.Incremental, Mul: -1}, + }, + } +) diff --git a/src/go/plugin/go.d/modules/squid/collect.go b/src/go/plugin/go.d/modules/squid/collect.go new file mode 100644 index 00000000..bb0cf1ab --- /dev/null +++ b/src/go/plugin/go.d/modules/squid/collect.go @@ -0,0 +1,105 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package squid + +import ( + "bufio" + "fmt" + "io" + "net/http" + "strconv" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +const ( + // https://wiki.squid-cache.org/Features/CacheManager/Index#controlling-access-to-the-cache-manager + urlPathServerStats = "/squid-internal-mgr/counters" +) + +var statsCounters = map[string]bool{ + "client_http.kbytes_in": true, + "client_http.kbytes_out": true, + "server.all.errors": true, + "server.all.requests": true, + "server.all.kbytes_out": true, + "server.all.kbytes_in": true, + "client_http.errors": true, + "client_http.hits": true, + "client_http.requests": true, + "client_http.hit_kbytes_out": true, +} + +func (s *Squid) collect() (map[string]int64, error) { + mx := make(map[string]int64) + + if err := s.collectCounters(mx); err != nil { + return nil, err + } + + return mx, nil +} + +func (s *Squid) collectCounters(mx map[string]int64) error { + req, err := web.NewHTTPRequestWithPath(s.Request, urlPathServerStats) + if err != nil { + return err + } + + if err := s.doOK(req, func(body io.Reader) error { + sc := bufio.NewScanner(body) + + for sc.Scan() { + key, value, ok := strings.Cut(sc.Text(), "=") + if !ok { + continue + } + + key, value = strings.TrimSpace(key), strings.TrimSpace(value) + + if !statsCounters[key] { + continue + } + + v, err := strconv.ParseInt(value, 10, 64) + if err != nil { + s.Debugf("failed to parse key %s value %s: %v", key, value, err) + continue + } + + mx[key] = v + } + return nil + }); err != nil { + return err + } + + if len(mx) == 0 { + return fmt.Errorf("unexpected response from '%s': no metrics found", req.URL) + } + + return nil +} + +func (s *Squid) doOK(req *http.Request, parse func(body io.Reader) error) error { + resp, err := s.httpClient.Do(req) + if err != nil { + return fmt.Errorf("error on HTTP request '%s': %v", req.URL, err) + } + + defer closeBody(resp) + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("'%s' returned HTTP status code: %d", req.URL, resp.StatusCode) + } + + return parse(resp.Body) +} + +func closeBody(resp *http.Response) { + if resp != nil && resp.Body != nil { + _, _ = io.Copy(io.Discard, resp.Body) + _ = resp.Body.Close() + } +} diff --git a/src/go/plugin/go.d/modules/squid/config_schema.json b/src/go/plugin/go.d/modules/squid/config_schema.json new file mode 100644 index 00000000..b1264b2b --- /dev/null +++ b/src/go/plugin/go.d/modules/squid/config_schema.json @@ -0,0 +1,177 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Squid collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "url": { + "title": "URL", + "description": "The base URL where the Squid endpoint can be accessed.", + "type": "string", + "default": "http://127.0.0.1:1328", + "format": "uri" + }, + "timeout": { + "title": "Timeout", + "description": "The timeout in seconds for the HTTP request.", + "type": "number", + "minimum": 0.5, + "default": 1 + }, + "not_follow_redirects": { + "title": "Not follow redirects", + "description": "If set, the client will not follow HTTP redirects automatically.", + "type": "boolean" + }, + "username": { + "title": "Username", + "description": "The username for basic authentication.", + "type": "string", + "sensitive": true + }, + "password": { + "title": "Password", + "description": "The password for basic authentication.", + "type": "string", + "sensitive": true + }, + "proxy_url": { + "title": "Proxy URL", + "description": "The URL of the proxy server.", + "type": "string" + }, + "proxy_username": { + "title": "Proxy username", + "description": "The username for proxy authentication.", + "type": "string", + "sensitive": true + }, + "proxy_password": { + "title": "Proxy password", + "description": "The password for proxy authentication.", + "type": "string", + "sensitive": true + }, + "headers": { + "title": "Headers", + "description": "Additional HTTP headers to include in the request.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "tls_skip_verify": { + "title": "Skip TLS verification", + "description": "If set, TLS certificate verification will be skipped.", + "type": "boolean" + }, + "tls_ca": { + "title": "TLS CA", + "description": "The path to the CA certificate file for TLS verification.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_cert": { + "title": "TLS certificate", + "description": "The path to the client certificate file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_key": { + "title": "TLS key", + "description": "The path to the client key file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "body": { + "title": "Body", + "type": "string" + }, + "method": { + "title": "Method", + "type": "string" + } + }, + "required": [ + "url" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "body": { + "ui:widget": "hidden" + }, + "method": { + "ui:widget": "hidden" + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + }, + "password": { + "ui:widget": "password" + }, + "proxy_password": { + "ui:widget": "password" + }, + "ui:flavour": "tabs", + "ui:options": { + "tabs": [ + { + "title": "Base", + "fields": [ + "update_every", + "url", + "timeout", + "not_follow_redirects" + ] + }, + { + "title": "Auth", + "fields": [ + "username", + "password" + ] + }, + { + "title": "TLS", + "fields": [ + "tls_skip_verify", + "tls_ca", + "tls_cert", + "tls_key" + ] + }, + { + "title": "Proxy", + "fields": [ + "proxy_url", + "proxy_username", + "proxy_password" + ] + }, + { + "title": "Headers", + "fields": [ + "headers" + ] + } + ] + } + } +} diff --git a/src/go/plugin/go.d/modules/squid/integrations/squid.md b/src/go/plugin/go.d/modules/squid/integrations/squid.md new file mode 100644 index 00000000..1a448de3 --- /dev/null +++ b/src/go/plugin/go.d/modules/squid/integrations/squid.md @@ -0,0 +1,227 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/squid/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/squid/metadata.yaml" +sidebar_label: "Squid" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Squid + + +<img src="https://netdata.cloud/img/squid.png" width="150"/> + + +Plugin: go.d.plugin +Module: squid + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +This collector monitors statistics about the Squid Clients and Servers, like bandwidth and requests. + + +It collects metrics from the `squid-internal-mgr/counters` endpoint. + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +By default, it detects Squid instances running on localhost that are listening on port 3128. +On startup, it tries to collect metrics from: + +- https://127.0.0.1:3128 + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per Squid instance + +These metrics refer to each monitored Squid instance. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| squid.clients_net | in, out, hits | kilobits/s | +| squid.clients_requests | requests, hits, errors | requests/s | +| squid.servers_net | in, out | kilobits/s | +| squid.servers_requests | requests, errors | requests/s | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +No action required. + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/squid.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/squid.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| url | Server URL. | http://127.0.0.1:3128 | yes | +| timeout | HTTP request timeout. | 1 | no | +| username | Username for basic HTTP authentication. | | no | +| password | Password for basic HTTP authentication. | | no | +| proxy_url | Proxy URL. | | no | +| proxy_username | Username for proxy basic HTTP authentication. | | no | +| proxy_password | Password for proxy basic HTTP authentication. | | no | +| method | HTTP request method. | POST | no | +| body | HTTP request body. | | no | +| headers | HTTP request headers. | | no | +| not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no | +| tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no | +| tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no | +| tls_cert | Client TLS certificate. | | no | +| tls_key | Client TLS key. | | no | + +</details> + +#### Examples + +##### Basic + +A basic example configuration. + +```yaml +jobs: + - name: local + url: http://127.0.0.1:3128 + +``` +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + url: http://127.0.0.1:3128 + + - name: remote + url: http://192.0.2.1:3128 + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `squid` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m squid + ``` + +### Getting Logs + +If you're encountering problems with the `squid` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep squid +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep squid /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep squid +``` + + diff --git a/src/go/plugin/go.d/modules/squid/metadata.yaml b/src/go/plugin/go.d/modules/squid/metadata.yaml new file mode 100644 index 00000000..fbe0202e --- /dev/null +++ b/src/go/plugin/go.d/modules/squid/metadata.yaml @@ -0,0 +1,195 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-squid + plugin_name: go.d.plugin + module_name: squid + monitored_instance: + name: Squid + link: "https://www.squid-cache.org/" + categories: + - data-collection.web-servers-and-web-proxies + icon_filename: "squid.png" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - squid + - web delivery + - squid caching proxy + most_popular: false + overview: + data_collection: + metrics_description: | + This collector monitors statistics about the Squid Clients and Servers, like bandwidth and requests. + method_description: "It collects metrics from the `squid-internal-mgr/counters` endpoint." + supported_platforms: + include: [] + exclude: [] + multi_instance: true + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: | + By default, it detects Squid instances running on localhost that are listening on port 3128. + On startup, it tries to collect metrics from: + + - https://127.0.0.1:3128 + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: [] + configuration: + file: + name: "go.d/squid.conf" + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: "Config options" + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: url + description: Server URL. + default_value: http://127.0.0.1:3128 + required: true + - name: timeout + description: HTTP request timeout. + default_value: 1 + required: false + - name: username + description: Username for basic HTTP authentication. + default_value: "" + required: false + - name: password + description: Password for basic HTTP authentication. + default_value: "" + required: false + - name: proxy_url + description: Proxy URL. + default_value: "" + required: false + - name: proxy_username + description: Username for proxy basic HTTP authentication. + default_value: "" + required: false + - name: proxy_password + description: Password for proxy basic HTTP authentication. + default_value: "" + required: false + - name: method + description: HTTP request method. + default_value: POST + required: false + - name: body + description: HTTP request body. + default_value: "" + required: false + - name: headers + description: HTTP request headers. + default_value: "" + required: false + - name: not_follow_redirects + description: Redirect handling policy. Controls whether the client follows redirects. + default_value: false + required: false + - name: tls_skip_verify + description: Server certificate chain and hostname validation policy. Controls whether the client performs this check. + default_value: false + required: false + - name: tls_ca + description: Certification authority that the client uses when verifying the server's certificates. + default_value: "" + required: false + - name: tls_cert + description: Client TLS certificate. + default_value: "" + required: false + - name: tls_key + description: Client TLS key. + default_value: "" + required: false + examples: + folding: + enabled: true + title: Config + list: + - name: Basic + description: A basic example configuration. + folding: + enabled: false + config: | + jobs: + - name: local + url: http://127.0.0.1:3128 + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + url: http://127.0.0.1:3128 + + - name: remote + url: http://192.0.2.1:3128 + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: Squid instance + description: "These metrics refer to each monitored Squid instance." + labels: [] + metrics: + - name: squid.clients_net + description: Squid Client Bandwidth + unit: "kilobits/s" + chart_type: area + dimensions: + - name: in + - name: out + - name: hits + - name: squid.clients_requests + description: Squid Client Requests + unit: "requests/s" + chart_type: line + dimensions: + - name: requests + - name: hits + - name: errors + - name: squid.servers_net + description: Squid Server Bandwidth + unit: "kilobits/s" + chart_type: area + dimensions: + - name: in + - name: out + - name: squid.servers_requests + description: Squid Server Requests + unit: "requests/s" + chart_type: line + dimensions: + - name: requests + - name: errors diff --git a/src/go/plugin/go.d/modules/squid/squid.go b/src/go/plugin/go.d/modules/squid/squid.go new file mode 100644 index 00000000..fe9c15ec --- /dev/null +++ b/src/go/plugin/go.d/modules/squid/squid.go @@ -0,0 +1,114 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package squid + +import ( + _ "embed" + "errors" + "net/http" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("squid", module.Creator{ + JobConfigSchema: configSchema, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Squid { + return &Squid{ + Config: Config{ + HTTP: web.HTTP{ + Request: web.Request{ + URL: "http://127.0.0.1:3128", + }, + Client: web.Client{ + Timeout: web.Duration(time.Second * 1), + }, + }, + }, + charts: charts.Copy(), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + web.HTTP `yaml:",inline" json:""` +} + +type Squid struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + httpClient *http.Client +} + +func (s *Squid) Configuration() any { + return s.Config +} + +func (s *Squid) Init() error { + if s.URL == "" { + s.Error("URL not set") + return errors.New("url not set") + } + + client, err := web.NewHTTPClient(s.Client) + if err != nil { + s.Error(err) + return err + } + s.httpClient = client + + s.Debugf("using URL %s", s.URL) + s.Debugf("using timeout: %s", s.Timeout) + + return nil +} + +func (s *Squid) Check() error { + mx, err := s.collect() + if err != nil { + s.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (s *Squid) Charts() *module.Charts { + return s.charts +} + +func (s *Squid) Collect() map[string]int64 { + mx, err := s.collect() + if err != nil { + s.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (s *Squid) Cleanup() { + if s.httpClient != nil { + s.httpClient.CloseIdleConnections() + } +} diff --git a/src/go/plugin/go.d/modules/squid/squid_test.go b/src/go/plugin/go.d/modules/squid/squid_test.go new file mode 100644 index 00000000..c0856f89 --- /dev/null +++ b/src/go/plugin/go.d/modules/squid/squid_test.go @@ -0,0 +1,223 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package squid + +import ( + "net/http" + "net/http/httptest" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + dataCounters, _ = os.ReadFile("testdata/counters.txt") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + "dataCounters": dataCounters, + } { + require.NotNil(t, data, name) + } +} + +func TestSquid_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &Squid{}, dataConfigJSON, dataConfigYAML) +} + +func TestSquid_Init(t *testing.T) { + tests := map[string]struct { + wantFail bool + config Config + }{ + "success with default": { + wantFail: false, + config: New().Config, + }, + "fail when URL not set": { + wantFail: true, + config: Config{ + HTTP: web.HTTP{ + Request: web.Request{URL: ""}, + }, + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + squid := New() + squid.Config = test.config + + if test.wantFail { + assert.Error(t, squid.Init()) + } else { + assert.NoError(t, squid.Init()) + } + }) + } +} + +func TestSquid_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestSquid_Check(t *testing.T) { + tests := map[string]struct { + wantFail bool + prepare func(t *testing.T) (*Squid, func()) + }{ + "success case": { + wantFail: false, + prepare: prepareCaseSuccess, + }, + "fails on unexpected response": { + wantFail: true, + prepare: prepareCaseUnexpectedResponse, + }, + "fails on empty response": { + wantFail: true, + prepare: prepareCaseEmptyResponse, + }, + "fails on connection refused": { + wantFail: true, + prepare: prepareCaseConnectionRefused, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + squid, cleanup := test.prepare(t) + defer cleanup() + + if test.wantFail { + assert.Error(t, squid.Check()) + } else { + assert.NoError(t, squid.Check()) + } + }) + } +} + +func TestSquid_Collect(t *testing.T) { + tests := map[string]struct { + prepare func(t *testing.T) (*Squid, func()) + wantMetrics map[string]int64 + wantCharts int + }{ + "success case": { + prepare: prepareCaseSuccess, + wantCharts: len(charts), + wantMetrics: map[string]int64{ + "client_http.errors": 5, + "client_http.hit_kbytes_out": 11, + "client_http.hits": 1, + "client_http.kbytes_in": 566, + "client_http.kbytes_out": 16081, + "client_http.requests": 9019, + "server.all.errors": 0, + "server.all.kbytes_in": 0, + "server.all.kbytes_out": 0, + "server.all.requests": 0, + }, + }, + "fails on unexpected response": { + prepare: prepareCaseUnexpectedResponse, + }, + "fails on empty response": { + prepare: prepareCaseEmptyResponse, + }, + "fails on connection refused": { + prepare: prepareCaseConnectionRefused, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + squid, cleanup := test.prepare(t) + defer cleanup() + + mx := squid.Collect() + + require.Equal(t, test.wantMetrics, mx) + + if len(test.wantMetrics) > 0 { + assert.Equal(t, test.wantCharts, len(*squid.Charts())) + module.TestMetricsHasAllChartsDims(t, squid.Charts(), mx) + } + }) + } +} + +func prepareCaseSuccess(t *testing.T) (*Squid, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case urlPathServerStats: + _, _ = w.Write(dataCounters) + default: + w.WriteHeader(http.StatusNotFound) + } + })) + + squid := New() + squid.URL = srv.URL + require.NoError(t, squid.Init()) + + return squid, srv.Close +} + +func prepareCaseUnexpectedResponse(t *testing.T) (*Squid, func()) { + t.Helper() + resp := []byte(` +Lorem ipsum dolor sit amet, consectetur adipiscing elit. +Nulla malesuada erat id magna mattis, eu viverra tellus rhoncus. +Fusce et felis pulvinar, posuere sem non, porttitor eros.`) + + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte(resp)) + })) + + squid := New() + squid.URL = srv.URL + require.NoError(t, squid.Init()) + + return squid, srv.Close +} + +func prepareCaseEmptyResponse(t *testing.T) (*Squid, func()) { + t.Helper() + resp := []byte(``) + + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte(resp)) + })) + + squid := New() + squid.URL = srv.URL + require.NoError(t, squid.Init()) + + return squid, srv.Close +} + +func prepareCaseConnectionRefused(t *testing.T) (*Squid, func()) { + t.Helper() + squid := New() + squid.URL = "http://127.0.0.1:65001" + require.NoError(t, squid.Init()) + + return squid, func() {} +} diff --git a/src/go/plugin/go.d/modules/squid/testdata/config.json b/src/go/plugin/go.d/modules/squid/testdata/config.json new file mode 100644 index 00000000..984c3ed6 --- /dev/null +++ b/src/go/plugin/go.d/modules/squid/testdata/config.json @@ -0,0 +1,20 @@ +{ + "update_every": 123, + "url": "ok", + "body": "ok", + "method": "ok", + "headers": { + "ok": "ok" + }, + "username": "ok", + "password": "ok", + "proxy_url": "ok", + "proxy_username": "ok", + "proxy_password": "ok", + "timeout": 123.123, + "not_follow_redirects": true, + "tls_ca": "ok", + "tls_cert": "ok", + "tls_key": "ok", + "tls_skip_verify": true +} diff --git a/src/go/plugin/go.d/modules/squid/testdata/config.yaml b/src/go/plugin/go.d/modules/squid/testdata/config.yaml new file mode 100644 index 00000000..8558b61c --- /dev/null +++ b/src/go/plugin/go.d/modules/squid/testdata/config.yaml @@ -0,0 +1,17 @@ +update_every: 123 +url: "ok" +body: "ok" +method: "ok" +headers: + ok: "ok" +username: "ok" +password: "ok" +proxy_url: "ok" +proxy_username: "ok" +proxy_password: "ok" +timeout: 123.123 +not_follow_redirects: yes +tls_ca: "ok" +tls_cert: "ok" +tls_key: "ok" +tls_skip_verify: yes diff --git a/src/go/plugin/go.d/modules/squid/testdata/counters.txt b/src/go/plugin/go.d/modules/squid/testdata/counters.txt new file mode 100644 index 00000000..250a003d --- /dev/null +++ b/src/go/plugin/go.d/modules/squid/testdata/counters.txt @@ -0,0 +1,59 @@ +sample_time = 1723030944.784818 (Wed, 07 Aug 2024 11:42:24 GMT) +client_http.requests = 9019 +client_http.hits = 1 +client_http.errors = 5 +client_http.kbytes_in = 566 +client_http.kbytes_out = 16081 +client_http.hit_kbytes_out = 11 +server.all.requests = 0 +server.all.errors = 0 +server.all.kbytes_in = 0 +server.all.kbytes_out = 0 +server.http.requests = 0 +server.http.errors = 0 +server.http.kbytes_in = 0 +server.http.kbytes_out = 0 +server.ftp.requests = 0 +server.ftp.errors = 0 +server.ftp.kbytes_in = 0 +server.ftp.kbytes_out = 0 +server.other.requests = 0 +server.other.errors = 0 +server.other.kbytes_in = 0 +server.other.kbytes_out = 0 +icp.pkts_sent = 0 +icp.pkts_recv = 0 +icp.queries_sent = 0 +icp.replies_sent = 0 +icp.queries_recv = 0 +icp.replies_recv = 0 +icp.query_timeouts = 0 +icp.replies_queued = 0 +icp.kbytes_sent = 0 +icp.kbytes_recv = 0 +icp.q_kbytes_sent = 0 +icp.r_kbytes_sent = 0 +icp.q_kbytes_recv = 0 +icp.r_kbytes_recv = 0 +icp.times_used = 0 +cd.times_used = 0 +cd.msgs_sent = 0 +cd.msgs_recv = 0 +cd.memory = 0 +cd.local_memory = 0 +cd.kbytes_sent = 0 +cd.kbytes_recv = 0 +unlink.requests = 0 +page_faults = 874 +select_loops = 91146 +cpu_time = 8.501572 +wall_time = 13.524214 +swap.outs = 0 +swap.ins = 0 +swap.files_cleaned = 0 +aborted_requests = 0 +hit_validation.attempts = 0 +hit_validation.refusals.due_to_locking = 0 +hit_validation.refusals.due_to_zeroSize = 0 +hit_validation.refusals.due_to_timeLimit = 0 +hit_validation.failures = 0 diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/README.md b/src/go/plugin/go.d/modules/squidlog/README.md index 876d4b47..876d4b47 120000 --- a/src/go/collectors/go.d.plugin/modules/squidlog/README.md +++ b/src/go/plugin/go.d/modules/squidlog/README.md diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/charts.go b/src/go/plugin/go.d/modules/squidlog/charts.go index dfac2249..92875eaf 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/charts.go +++ b/src/go/plugin/go.d/modules/squidlog/charts.go @@ -5,7 +5,7 @@ package squidlog import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) type ( diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/collect.go b/src/go/plugin/go.d/modules/squidlog/collect.go index e0ebb6eb..ee548b5b 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/collect.go +++ b/src/go/plugin/go.d/modules/squidlog/collect.go @@ -8,10 +8,10 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/logs" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/logs" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func (s *SquidLog) logPanicStackIfAny() { diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/config_schema.json b/src/go/plugin/go.d/modules/squidlog/config_schema.json index 47e55b09..47e55b09 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/config_schema.json +++ b/src/go/plugin/go.d/modules/squidlog/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/init.go b/src/go/plugin/go.d/modules/squidlog/init.go index b995b3e6..fd3a76c9 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/init.go +++ b/src/go/plugin/go.d/modules/squidlog/init.go @@ -3,11 +3,10 @@ package squidlog import ( - "bytes" "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/logs" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/logs" ) func (s *SquidLog) createLogReader() error { @@ -26,28 +25,48 @@ func (s *SquidLog) createLogReader() error { func (s *SquidLog) createParser() error { s.Debug("starting parser creating") - lastLine, err := logs.ReadLastLine(s.file.CurrentFilename(), 0) - if err != nil { - return fmt.Errorf("read last line: %v", err) - } - lastLine = bytes.TrimRight(lastLine, "\n") - s.Debugf("last line: '%s'", string(lastLine)) + const readLastLinesNum = 100 - s.parser, err = logs.NewParser(s.ParserConfig, s.file) + lines, err := logs.ReadLastLines(s.file.CurrentFilename(), readLastLinesNum) if err != nil { - return fmt.Errorf("create parser: %v", err) + return fmt.Errorf("failed to read last lines: %v", err) } - s.Debugf("created parser: %s", s.parser.Info()) - err = s.parser.Parse(lastLine, s.line) - if err != nil { - return fmt.Errorf("parse last line: %v (%s)", err, string(lastLine)) + var found bool + for _, line := range lines { + if line = strings.TrimSpace(line); line == "" { + continue + } + + s.Debugf("last line: '%s'", line) + + s.parser, err = logs.NewParser(s.ParserConfig, s.file) + if err != nil { + s.Debugf("failed to create parser from line: %v", err) + continue + } + + s.line.reset() + + if err = s.parser.Parse([]byte(line), s.line); err != nil { + s.Debugf("failed to parse line: %v", err) + continue + } + + if err = s.line.verify(); err != nil { + s.Debugf("failed to verify line: %v", err) + continue + } + + found = true + break } - if err = s.line.verify(); err != nil { - return fmt.Errorf("verify last line: %v (%s)", err, string(lastLine)) + if !found { + return fmt.Errorf("failed to create log parser (file '%s')", s.file.CurrentFilename()) } + return nil } diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/integrations/squid_log_files.md b/src/go/plugin/go.d/modules/squidlog/integrations/squid_log_files.md index 0cf064b2..7d1e4799 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/integrations/squid_log_files.md +++ b/src/go/plugin/go.d/modules/squidlog/integrations/squid_log_files.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/squidlog/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/squidlog/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/squidlog/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/squidlog/metadata.yaml" sidebar_label: "Squid log files" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -224,6 +224,8 @@ There are no configuration examples. ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `squidlog` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -246,4 +248,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m squidlog ``` +### Getting Logs + +If you're encountering problems with the `squidlog` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep squidlog +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep squidlog /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep squidlog +``` + diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/logline.go b/src/go/plugin/go.d/modules/squidlog/logline.go index e3d200ea..47a8bf8f 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/logline.go +++ b/src/go/plugin/go.d/modules/squidlog/logline.go @@ -245,10 +245,16 @@ func (l *logLine) assignMimeType(mime string) error { } // format: type/subtype, type/subtype;parameter=value i := strings.IndexByte(mime, '/') - if i <= 0 || !isMimeTypeValid(mime[:i]) { + if i <= 0 { return fmt.Errorf("assign '%s': %w", mime, errBadMimeType) } + + if !isMimeTypeValid(mime[:i]) { + return nil + } + l.mimeType = mime[:i] // drop subtype + return nil } @@ -345,7 +351,7 @@ func isRespTimeValid(time int) bool { // isCacheCodeValid does not guarantee cache result code is valid, but it is very likely. func isCacheCodeValid(code string) bool { // https://wiki.squid-cache.org/SquidFaq/SquidLogs#Squid_result_codes - if code == "NONE" { + if code == "NONE" || code == "NONE_NONE" { return true } return len(code) > 5 && (code[:4] == "TCP_" || code[:4] == "UDP_") diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/logline_test.go b/src/go/plugin/go.d/modules/squidlog/logline_test.go index 4a9069e3..cb3f399f 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/logline_test.go +++ b/src/go/plugin/go.d/modules/squidlog/logline_test.go @@ -60,6 +60,7 @@ func TestLogLine_Assign(t *testing.T) { {input: "UDP_MISS_NOFETCH", wantLine: logLine{cacheCode: "UDP_MISS_NOFETCH"}}, {input: "UDP_INVALID", wantLine: logLine{cacheCode: "UDP_INVALID"}}, {input: "NONE", wantLine: logLine{cacheCode: "NONE"}}, + {input: "NONE_NONE", wantLine: logLine{cacheCode: "NONE_NONE"}}, {input: emptyStr, wantLine: emptyLogLine}, {input: hyphen, wantLine: emptyLogLine, wantErr: errBadCacheCode}, {input: "TCP", wantLine: emptyLogLine, wantErr: errBadCacheCode}, @@ -173,8 +174,8 @@ func TestLogLine_Assign(t *testing.T) { {input: "video/3gpp", wantLine: logLine{mimeType: "video"}}, {input: emptyStr, wantLine: emptyLogLine}, {input: hyphen, wantLine: emptyLogLine}, - {input: "example/example", wantLine: emptyLogLine, wantErr: errBadMimeType}, - {input: "unknown/example", wantLine: emptyLogLine, wantErr: errBadMimeType}, + {input: "example/example", wantLine: emptyLogLine}, + {input: "unknown/example", wantLine: emptyLogLine}, {input: "audio", wantLine: emptyLogLine, wantErr: errBadMimeType}, {input: "/", wantLine: emptyLogLine, wantErr: errBadMimeType}, }, @@ -274,6 +275,7 @@ func TestLogLine_verify(t *testing.T) { {input: "UDP_MISS_NOFETCH"}, {input: "UDP_INVALID"}, {input: "NONE"}, + {input: "NONE_NONE"}, {input: emptyStr}, {input: "TCP", wantErr: errBadCacheCode}, {input: "UDP", wantErr: errBadCacheCode}, diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/metadata.yaml b/src/go/plugin/go.d/modules/squidlog/metadata.yaml index 82712f9e..82712f9e 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/metadata.yaml +++ b/src/go/plugin/go.d/modules/squidlog/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/metrics.go b/src/go/plugin/go.d/modules/squidlog/metrics.go index 3754e022..031f832a 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/metrics.go +++ b/src/go/plugin/go.d/modules/squidlog/metrics.go @@ -2,7 +2,7 @@ package squidlog -import "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" func newSummary() metrics.Summary { return &summary{metrics.NewSummary()} diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/squidlog.go b/src/go/plugin/go.d/modules/squidlog/squidlog.go index 6b5d3626..e2e743c6 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/squidlog.go +++ b/src/go/plugin/go.d/modules/squidlog/squidlog.go @@ -5,8 +5,8 @@ package squidlog import ( _ "embed" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/logs" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/logs" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/squidlog_test.go b/src/go/plugin/go.d/modules/squidlog/squidlog_test.go index 5cc8a728..eb5ce635 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/squidlog_test.go +++ b/src/go/plugin/go.d/modules/squidlog/squidlog_test.go @@ -7,10 +7,10 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/pkg/logs" - "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/logs" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/testdata/access.log b/src/go/plugin/go.d/modules/squidlog/testdata/access.log index 64a23d35..64a23d35 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/testdata/access.log +++ b/src/go/plugin/go.d/modules/squidlog/testdata/access.log diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/testdata/config.json b/src/go/plugin/go.d/modules/squidlog/testdata/config.json index 5d563cc7..5d563cc7 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/testdata/config.json +++ b/src/go/plugin/go.d/modules/squidlog/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/testdata/config.yaml b/src/go/plugin/go.d/modules/squidlog/testdata/config.yaml index 701205e2..701205e2 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/squidlog/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/squidlog/testdata/unknown.log b/src/go/plugin/go.d/modules/squidlog/testdata/unknown.log index 0478a5c1..0478a5c1 100644 --- a/src/go/collectors/go.d.plugin/modules/squidlog/testdata/unknown.log +++ b/src/go/plugin/go.d/modules/squidlog/testdata/unknown.log diff --git a/src/go/collectors/go.d.plugin/modules/storcli/README.md b/src/go/plugin/go.d/modules/storcli/README.md index 482049b1..482049b1 120000 --- a/src/go/collectors/go.d.plugin/modules/storcli/README.md +++ b/src/go/plugin/go.d/modules/storcli/README.md diff --git a/src/go/collectors/go.d.plugin/modules/storcli/charts.go b/src/go/plugin/go.d/modules/storcli/charts.go index 9730c14e..3e0c07c1 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/charts.go +++ b/src/go/plugin/go.d/modules/storcli/charts.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/storcli/collect.go b/src/go/plugin/go.d/modules/storcli/collect.go index df2b09d8..df2b09d8 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/collect.go +++ b/src/go/plugin/go.d/modules/storcli/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/storcli/collect_controllers.go b/src/go/plugin/go.d/modules/storcli/collect_controllers.go index 64d61594..64d61594 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/collect_controllers.go +++ b/src/go/plugin/go.d/modules/storcli/collect_controllers.go diff --git a/src/go/collectors/go.d.plugin/modules/storcli/collect_drives.go b/src/go/plugin/go.d/modules/storcli/collect_drives.go index 5c2ecb38..5c2ecb38 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/collect_drives.go +++ b/src/go/plugin/go.d/modules/storcli/collect_drives.go diff --git a/src/go/collectors/go.d.plugin/modules/storcli/config_schema.json b/src/go/plugin/go.d/modules/storcli/config_schema.json index 226a370f..226a370f 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/config_schema.json +++ b/src/go/plugin/go.d/modules/storcli/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/storcli/exec.go b/src/go/plugin/go.d/modules/storcli/exec.go index 3375ddbe..5be88a89 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/exec.go +++ b/src/go/plugin/go.d/modules/storcli/exec.go @@ -8,7 +8,7 @@ import ( "os/exec" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" ) func newStorCliExec(ndsudoPath string, timeout time.Duration, log *logger.Logger) *storCliExec { diff --git a/src/go/collectors/go.d.plugin/modules/storcli/init.go b/src/go/plugin/go.d/modules/storcli/init.go index 297f7c8c..d35ad07d 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/init.go +++ b/src/go/plugin/go.d/modules/storcli/init.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" + "github.com/netdata/netdata/go/plugins/pkg/executable" ) func (s *StorCli) initStorCliExec() (storCli, error) { diff --git a/src/go/collectors/go.d.plugin/modules/storcli/integrations/storecli_raid.md b/src/go/plugin/go.d/modules/storcli/integrations/storecli_raid.md index f6197b4e..9b8b2848 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/integrations/storecli_raid.md +++ b/src/go/plugin/go.d/modules/storcli/integrations/storecli_raid.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/storcli/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/storcli/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/storcli/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/storcli/metadata.yaml" sidebar_label: "StoreCLI RAID" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -192,6 +192,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `storcli` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -214,4 +216,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m storcli ``` +### Getting Logs + +If you're encountering problems with the `storcli` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep storcli +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep storcli /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep storcli +``` + diff --git a/src/go/collectors/go.d.plugin/modules/storcli/metadata.yaml b/src/go/plugin/go.d/modules/storcli/metadata.yaml index 7e807f05..7e807f05 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/metadata.yaml +++ b/src/go/plugin/go.d/modules/storcli/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/storcli/storcli.go b/src/go/plugin/go.d/modules/storcli/storcli.go index 7dd650d6..0133c470 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/storcli.go +++ b/src/go/plugin/go.d/modules/storcli/storcli.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/storcli/storcli_test.go b/src/go/plugin/go.d/modules/storcli/storcli_test.go index ad1b43f0..63ee54b5 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/storcli_test.go +++ b/src/go/plugin/go.d/modules/storcli/storcli_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/plugin/go.d/modules/storcli/testdata/config.json b/src/go/plugin/go.d/modules/storcli/testdata/config.json new file mode 100644 index 00000000..291ecee3 --- /dev/null +++ b/src/go/plugin/go.d/modules/storcli/testdata/config.json @@ -0,0 +1,4 @@ +{ + "update_every": 123, + "timeout": 123.123 +} diff --git a/src/go/plugin/go.d/modules/storcli/testdata/config.yaml b/src/go/plugin/go.d/modules/storcli/testdata/config.yaml new file mode 100644 index 00000000..25b0b4c7 --- /dev/null +++ b/src/go/plugin/go.d/modules/storcli/testdata/config.yaml @@ -0,0 +1,2 @@ +update_every: 123 +timeout: 123.123 diff --git a/src/go/collectors/go.d.plugin/modules/storcli/testdata/megaraid-controllers-info.json b/src/go/plugin/go.d/modules/storcli/testdata/megaraid-controllers-info.json index e4e988d1..e4e988d1 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/testdata/megaraid-controllers-info.json +++ b/src/go/plugin/go.d/modules/storcli/testdata/megaraid-controllers-info.json diff --git a/src/go/collectors/go.d.plugin/modules/storcli/testdata/megaraid-drives-info.json b/src/go/plugin/go.d/modules/storcli/testdata/megaraid-drives-info.json index b8735d6a..b8735d6a 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/testdata/megaraid-drives-info.json +++ b/src/go/plugin/go.d/modules/storcli/testdata/megaraid-drives-info.json diff --git a/src/go/collectors/go.d.plugin/modules/storcli/testdata/mpt3sas-controllers-info.json b/src/go/plugin/go.d/modules/storcli/testdata/mpt3sas-controllers-info.json index 02eefd71..02eefd71 100644 --- a/src/go/collectors/go.d.plugin/modules/storcli/testdata/mpt3sas-controllers-info.json +++ b/src/go/plugin/go.d/modules/storcli/testdata/mpt3sas-controllers-info.json diff --git a/src/go/collectors/go.d.plugin/modules/supervisord/README.md b/src/go/plugin/go.d/modules/supervisord/README.md index a8b74348..a8b74348 120000 --- a/src/go/collectors/go.d.plugin/modules/supervisord/README.md +++ b/src/go/plugin/go.d/modules/supervisord/README.md diff --git a/src/go/collectors/go.d.plugin/modules/supervisord/charts.go b/src/go/plugin/go.d/modules/supervisord/charts.go index 2c7f08f0..c0f7c901 100644 --- a/src/go/collectors/go.d.plugin/modules/supervisord/charts.go +++ b/src/go/plugin/go.d/modules/supervisord/charts.go @@ -5,7 +5,7 @@ package supervisord import ( "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/supervisord/client.go b/src/go/plugin/go.d/modules/supervisord/client.go index da62ca21..da62ca21 100644 --- a/src/go/collectors/go.d.plugin/modules/supervisord/client.go +++ b/src/go/plugin/go.d/modules/supervisord/client.go diff --git a/src/go/collectors/go.d.plugin/modules/supervisord/collect.go b/src/go/plugin/go.d/modules/supervisord/collect.go index e04e3213..31a0d394 100644 --- a/src/go/collectors/go.d.plugin/modules/supervisord/collect.go +++ b/src/go/plugin/go.d/modules/supervisord/collect.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func (s *Supervisord) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/supervisord/config_schema.json b/src/go/plugin/go.d/modules/supervisord/config_schema.json index 8d3c4e94..8d3c4e94 100644 --- a/src/go/collectors/go.d.plugin/modules/supervisord/config_schema.json +++ b/src/go/plugin/go.d/modules/supervisord/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/supervisord/init.go b/src/go/plugin/go.d/modules/supervisord/init.go index b4cc3638..c7ccc06b 100644 --- a/src/go/collectors/go.d.plugin/modules/supervisord/init.go +++ b/src/go/plugin/go.d/modules/supervisord/init.go @@ -7,7 +7,7 @@ import ( "fmt" "net/url" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (s *Supervisord) verifyConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/supervisord/integrations/supervisor.md b/src/go/plugin/go.d/modules/supervisord/integrations/supervisor.md index 0cbb1324..ba302e4a 100644 --- a/src/go/collectors/go.d.plugin/modules/supervisord/integrations/supervisor.md +++ b/src/go/plugin/go.d/modules/supervisord/integrations/supervisor.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/supervisord/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/supervisord/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/supervisord/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/supervisord/metadata.yaml" sidebar_label: "Supervisor" learn_status: "Published" learn_rel_path: "Collecting Metrics/Processes and System Services" @@ -189,6 +189,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `supervisord` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -211,4 +213,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m supervisord ``` +### Getting Logs + +If you're encountering problems with the `supervisord` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep supervisord +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep supervisord /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep supervisord +``` + diff --git a/src/go/collectors/go.d.plugin/modules/supervisord/metadata.yaml b/src/go/plugin/go.d/modules/supervisord/metadata.yaml index b5c81dd0..b5c81dd0 100644 --- a/src/go/collectors/go.d.plugin/modules/supervisord/metadata.yaml +++ b/src/go/plugin/go.d/modules/supervisord/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/supervisord/supervisord.go b/src/go/plugin/go.d/modules/supervisord/supervisord.go index 4c1bc8e8..0988cfc8 100644 --- a/src/go/collectors/go.d.plugin/modules/supervisord/supervisord.go +++ b/src/go/plugin/go.d/modules/supervisord/supervisord.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/supervisord/supervisord_test.go b/src/go/plugin/go.d/modules/supervisord/supervisord_test.go index 521811b1..7eb5df53 100644 --- a/src/go/collectors/go.d.plugin/modules/supervisord/supervisord_test.go +++ b/src/go/plugin/go.d/modules/supervisord/supervisord_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/supervisord/testdata/config.json b/src/go/plugin/go.d/modules/supervisord/testdata/config.json index 825b0c39..825b0c39 100644 --- a/src/go/collectors/go.d.plugin/modules/supervisord/testdata/config.json +++ b/src/go/plugin/go.d/modules/supervisord/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/supervisord/testdata/config.yaml b/src/go/plugin/go.d/modules/supervisord/testdata/config.yaml index e1a01abd..e1a01abd 100644 --- a/src/go/collectors/go.d.plugin/modules/supervisord/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/supervisord/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/README.md b/src/go/plugin/go.d/modules/systemdunits/README.md index 68dd433b..68dd433b 120000 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/README.md +++ b/src/go/plugin/go.d/modules/systemdunits/README.md diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/charts.go b/src/go/plugin/go.d/modules/systemdunits/charts.go index 18d8838f..9f1f56b7 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/charts.go +++ b/src/go/plugin/go.d/modules/systemdunits/charts.go @@ -10,7 +10,7 @@ import ( "path/filepath" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "golang.org/x/text/cases" "golang.org/x/text/language" diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/client.go b/src/go/plugin/go.d/modules/systemdunits/client.go index e6363d13..e6363d13 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/client.go +++ b/src/go/plugin/go.d/modules/systemdunits/client.go diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/collect.go b/src/go/plugin/go.d/modules/systemdunits/collect.go index 0d61c999..0d61c999 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/collect.go +++ b/src/go/plugin/go.d/modules/systemdunits/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/collect_unit_files.go b/src/go/plugin/go.d/modules/systemdunits/collect_unit_files.go index eff2d6ec..eff2d6ec 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/collect_unit_files.go +++ b/src/go/plugin/go.d/modules/systemdunits/collect_unit_files.go diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/collect_units.go b/src/go/plugin/go.d/modules/systemdunits/collect_units.go index 0cf97af0..0cf97af0 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/collect_units.go +++ b/src/go/plugin/go.d/modules/systemdunits/collect_units.go diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/config_schema.json b/src/go/plugin/go.d/modules/systemdunits/config_schema.json index 016e984c..016e984c 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/config_schema.json +++ b/src/go/plugin/go.d/modules/systemdunits/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/doc.go b/src/go/plugin/go.d/modules/systemdunits/doc.go index 8bb45fab..8bb45fab 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/doc.go +++ b/src/go/plugin/go.d/modules/systemdunits/doc.go diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/init.go b/src/go/plugin/go.d/modules/systemdunits/init.go index ea3d21d3..8a1b579c 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/init.go +++ b/src/go/plugin/go.d/modules/systemdunits/init.go @@ -9,7 +9,7 @@ import ( "errors" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" ) func (s *SystemdUnits) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/integrations/systemd_units.md b/src/go/plugin/go.d/modules/systemdunits/integrations/systemd_units.md index 431f084b..a2ff90b0 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/integrations/systemd_units.md +++ b/src/go/plugin/go.d/modules/systemdunits/integrations/systemd_units.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/systemdunits/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/systemdunits/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/systemdunits/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/systemdunits/metadata.yaml" sidebar_label: "Systemd Units" learn_status: "Published" learn_rel_path: "Collecting Metrics/Systemd" @@ -264,6 +264,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `systemdunits` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -286,4 +288,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m systemdunits ``` +### Getting Logs + +If you're encountering problems with the `systemdunits` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep systemdunits +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep systemdunits /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep systemdunits +``` + diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/metadata.yaml b/src/go/plugin/go.d/modules/systemdunits/metadata.yaml index 791e5840..791e5840 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/metadata.yaml +++ b/src/go/plugin/go.d/modules/systemdunits/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/systemdunits.go b/src/go/plugin/go.d/modules/systemdunits/systemdunits.go index 367fa2a4..9a347876 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/systemdunits.go +++ b/src/go/plugin/go.d/modules/systemdunits/systemdunits.go @@ -10,9 +10,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/coreos/go-systemd/v22/dbus" ) diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/systemdunits_test.go b/src/go/plugin/go.d/modules/systemdunits/systemdunits_test.go index 89c0a92d..7074e186 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/systemdunits_test.go +++ b/src/go/plugin/go.d/modules/systemdunits/systemdunits_test.go @@ -15,7 +15,7 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/coreos/go-systemd/v22/dbus" "github.com/stretchr/testify/assert" diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/testdata/config.json b/src/go/plugin/go.d/modules/systemdunits/testdata/config.json index 1ab5b47e..1ab5b47e 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/testdata/config.json +++ b/src/go/plugin/go.d/modules/systemdunits/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/systemdunits/testdata/config.yaml b/src/go/plugin/go.d/modules/systemdunits/testdata/config.yaml index d1894aea..d1894aea 100644 --- a/src/go/collectors/go.d.plugin/modules/systemdunits/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/systemdunits/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/tengine/README.md b/src/go/plugin/go.d/modules/tengine/README.md index e016ea0c..e016ea0c 120000 --- a/src/go/collectors/go.d.plugin/modules/tengine/README.md +++ b/src/go/plugin/go.d/modules/tengine/README.md diff --git a/src/go/collectors/go.d.plugin/modules/tengine/apiclient.go b/src/go/plugin/go.d/modules/tengine/apiclient.go index 4f025105..e91b9976 100644 --- a/src/go/collectors/go.d.plugin/modules/tengine/apiclient.go +++ b/src/go/plugin/go.d/modules/tengine/apiclient.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/tengine/charts.go b/src/go/plugin/go.d/modules/tengine/charts.go index 59b191dd..bd0564aa 100644 --- a/src/go/collectors/go.d.plugin/modules/tengine/charts.go +++ b/src/go/plugin/go.d/modules/tengine/charts.go @@ -2,7 +2,7 @@ package tengine -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( // Charts is an alias for module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/tengine/collect.go b/src/go/plugin/go.d/modules/tengine/collect.go index 83dcba17..ffa39019 100644 --- a/src/go/collectors/go.d.plugin/modules/tengine/collect.go +++ b/src/go/plugin/go.d/modules/tengine/collect.go @@ -3,7 +3,7 @@ package tengine import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) func (t *Tengine) collect() (map[string]int64, error) { diff --git a/src/go/collectors/go.d.plugin/modules/tengine/config_schema.json b/src/go/plugin/go.d/modules/tengine/config_schema.json index 5493997a..44f6968e 100644 --- a/src/go/collectors/go.d.plugin/modules/tengine/config_schema.json +++ b/src/go/plugin/go.d/modules/tengine/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/tengine/integrations/tengine.md b/src/go/plugin/go.d/modules/tengine/integrations/tengine.md index a4e6c5f9..44bec575 100644 --- a/src/go/collectors/go.d.plugin/modules/tengine/integrations/tengine.md +++ b/src/go/plugin/go.d/modules/tengine/integrations/tengine.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/tengine/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/tengine/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/tengine/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/tengine/metadata.yaml" sidebar_label: "Tengine" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -207,6 +207,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `tengine` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -229,4 +231,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m tengine ``` +### Getting Logs + +If you're encountering problems with the `tengine` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep tengine +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep tengine /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep tengine +``` + diff --git a/src/go/collectors/go.d.plugin/modules/tengine/metadata.yaml b/src/go/plugin/go.d/modules/tengine/metadata.yaml index b0778c9f..b0778c9f 100644 --- a/src/go/collectors/go.d.plugin/modules/tengine/metadata.yaml +++ b/src/go/plugin/go.d/modules/tengine/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/tengine/metrics.go b/src/go/plugin/go.d/modules/tengine/metrics.go index 42555947..42555947 100644 --- a/src/go/collectors/go.d.plugin/modules/tengine/metrics.go +++ b/src/go/plugin/go.d/modules/tengine/metrics.go diff --git a/src/go/collectors/go.d.plugin/modules/tengine/tengine.go b/src/go/plugin/go.d/modules/tengine/tengine.go index f70e4ede..8f67fae4 100644 --- a/src/go/collectors/go.d.plugin/modules/tengine/tengine.go +++ b/src/go/plugin/go.d/modules/tengine/tengine.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/tengine/tengine_test.go b/src/go/plugin/go.d/modules/tengine/tengine_test.go index d8b8ec99..e87e62b0 100644 --- a/src/go/collectors/go.d.plugin/modules/tengine/tengine_test.go +++ b/src/go/plugin/go.d/modules/tengine/tengine_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/plugin/go.d/modules/tengine/testdata/config.json b/src/go/plugin/go.d/modules/tengine/testdata/config.json new file mode 100644 index 00000000..984c3ed6 --- /dev/null +++ b/src/go/plugin/go.d/modules/tengine/testdata/config.json @@ -0,0 +1,20 @@ +{ + "update_every": 123, + "url": "ok", + "body": "ok", + "method": "ok", + "headers": { + "ok": "ok" + }, + "username": "ok", + "password": "ok", + "proxy_url": "ok", + "proxy_username": "ok", + "proxy_password": "ok", + "timeout": 123.123, + "not_follow_redirects": true, + "tls_ca": "ok", + "tls_cert": "ok", + "tls_key": "ok", + "tls_skip_verify": true +} diff --git a/src/go/plugin/go.d/modules/tengine/testdata/config.yaml b/src/go/plugin/go.d/modules/tengine/testdata/config.yaml new file mode 100644 index 00000000..8558b61c --- /dev/null +++ b/src/go/plugin/go.d/modules/tengine/testdata/config.yaml @@ -0,0 +1,17 @@ +update_every: 123 +url: "ok" +body: "ok" +method: "ok" +headers: + ok: "ok" +username: "ok" +password: "ok" +proxy_url: "ok" +proxy_username: "ok" +proxy_password: "ok" +timeout: 123.123 +not_follow_redirects: yes +tls_ca: "ok" +tls_cert: "ok" +tls_key: "ok" +tls_skip_verify: yes diff --git a/src/go/collectors/go.d.plugin/modules/tengine/testdata/status.txt b/src/go/plugin/go.d/modules/tengine/testdata/status.txt index dff2ec2d..dff2ec2d 100644 --- a/src/go/collectors/go.d.plugin/modules/tengine/testdata/status.txt +++ b/src/go/plugin/go.d/modules/tengine/testdata/status.txt diff --git a/src/go/plugin/go.d/modules/tomcat/README.md b/src/go/plugin/go.d/modules/tomcat/README.md new file mode 120000 index 00000000..997090c3 --- /dev/null +++ b/src/go/plugin/go.d/modules/tomcat/README.md @@ -0,0 +1 @@ +integrations/tomcat.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/tomcat/charts.go b/src/go/plugin/go.d/modules/tomcat/charts.go new file mode 100644 index 00000000..137f700b --- /dev/null +++ b/src/go/plugin/go.d/modules/tomcat/charts.go @@ -0,0 +1,196 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package tomcat + +import ( + "fmt" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioConnectorRequestsCount = module.Priority + iota + prioConnectorRequestsBandwidth + prioConnectorRequestsProcessingTime + prioConnectorRequestsErrors + + prioConnectorRequestThreads + + prioJvmMemoryUsage + + prioJvmMemoryPoolMemoryUsage +) + +var ( + defaultCharts = module.Charts{ + jvmMemoryUsageChart.Copy(), + } + + jvmMemoryUsageChart = module.Chart{ + ID: "jvm_memory_usage", + Title: "JVM Memory Usage", + Units: "bytes", + Fam: "memory", + Ctx: "tomcat.jvm_memory_usage", + Type: module.Stacked, + Priority: prioJvmMemoryUsage, + Dims: module.Dims{ + {ID: "jvm_memory_free", Name: "free"}, + {ID: "jvm_memory_used", Name: "used"}, + }, + } +) + +var ( + connectorChartsTmpl = module.Charts{ + connectorRequestsCountChartTmpl.Copy(), + connectorRequestsBandwidthChartTmpl.Copy(), + connectorRequestsProcessingTimeChartTmpl.Copy(), + connectorRequestsErrorsChartTmpl.Copy(), + connectorRequestThreadsChartTmpl.Copy(), + } + + connectorRequestsCountChartTmpl = module.Chart{ + ID: "connector_%_requests", + Title: "Connector Requests", + Units: "requests/s", + Fam: "requests", + Ctx: "tomcat.connector_requests", + Type: module.Line, + Priority: prioConnectorRequestsCount, + Dims: module.Dims{ + {ID: "connector_%s_request_info_request_count", Name: "requests", Algo: module.Incremental}, + }, + } + connectorRequestsBandwidthChartTmpl = module.Chart{ + ID: "connector_%s_requests_bandwidth", + Title: "Connector Requests Bandwidth", + Units: "bytes/s", + Fam: "requests", + Ctx: "tomcat.connector_bandwidth", + Type: module.Area, + Priority: prioConnectorRequestsBandwidth, + Dims: module.Dims{ + {ID: "connector_%s_request_info_bytes_received", Name: "received", Algo: module.Incremental}, + {ID: "connector_%s_request_info_bytes_sent", Name: "sent", Mul: -1, Algo: module.Incremental}, + }, + } + connectorRequestsProcessingTimeChartTmpl = module.Chart{ + ID: "connector_%_requests_processing_time", + Title: "Connector Requests Processing Time", + Units: "milliseconds", + Fam: "requests", + Ctx: "tomcat.connector_requests_processing_time", + Type: module.Line, + Priority: prioConnectorRequestsProcessingTime, + Dims: module.Dims{ + {ID: "connector_%s_request_info_processing_time", Name: "processing_time", Algo: module.Incremental}, + }, + } + connectorRequestsErrorsChartTmpl = module.Chart{ + ID: "connector_%_errors", + Title: "Connector Errors", + Units: "errors/s", + Fam: "requests", + Ctx: "tomcat.connector_errors", + Type: module.Line, + Priority: prioConnectorRequestsErrors, + Dims: module.Dims{ + {ID: "connector_%s_request_info_error_count", Name: "errors", Algo: module.Incremental}, + }, + } + + connectorRequestThreadsChartTmpl = module.Chart{ + ID: "connector_%s_request_threads", + Title: "Connector Request Threads", + Units: "threads", + Fam: "threads", + Ctx: "tomcat.connector_request_threads", + Type: module.Stacked, + Priority: prioConnectorRequestThreads, + Dims: module.Dims{ + {ID: "connector_%s_thread_info_idle", Name: "idle"}, + {ID: "connector_%s_thread_info_busy", Name: "busy"}, + }, + } +) + +var ( + jvmMemoryPoolChartsTmpl = module.Charts{ + jvmMemoryPoolMemoryUsageChartTmpl.Copy(), + } + + jvmMemoryPoolMemoryUsageChartTmpl = module.Chart{ + ID: "jvm_mem_pool_%s_memory_usage", + Title: "JVM Mem Pool Memory Usage", + Units: "bytes", + Fam: "memory", + Ctx: "tomcat.jvm_mem_pool_memory_usage", + Type: module.Area, + Priority: prioJvmMemoryPoolMemoryUsage, + Dims: module.Dims{ + {ID: "jvm_memorypool_%s_commited", Name: "commited"}, + {ID: "jvm_memorypool_%s_used", Name: "used"}, + {ID: "jvm_memorypool_%s_max", Name: "max"}, + }, + } +) + +func (t *Tomcat) addConnectorCharts(name string) { + charts := connectorChartsTmpl.Copy() + + for _, chart := range *charts { + chart.ID = fmt.Sprintf(chart.ID, cleanName(name)) + chart.Labels = []module.Label{ + {Key: "connector_name", Value: strings.Trim(name, "\"")}, + } + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf(dim.ID, cleanName(name)) + } + } + + if err := t.Charts().Add(*charts...); err != nil { + t.Warning(err) + } +} + +func (t *Tomcat) addMemPoolCharts(name, typ string) { + name = strings.ReplaceAll(name, "'", "") + + charts := jvmMemoryPoolChartsTmpl.Copy() + + for _, chart := range *charts { + chart.ID = fmt.Sprintf(chart.ID, cleanName(name)) + chart.Labels = []module.Label{ + {Key: "mempool_name", Value: name}, + {Key: "mempool_type", Value: typ}, + } + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf(dim.ID, cleanName(name)) + } + } + + if err := t.Charts().Add(*charts...); err != nil { + t.Warning(err) + } +} + +func (t *Tomcat) removeConnectorCharts(name string) { + px := fmt.Sprintf("connector_%s_", cleanName(name)) + t.removeCharts(px) +} + +func (t *Tomcat) removeMemoryPoolCharts(name string) { + px := fmt.Sprintf("jvm_mem_pool_%s_", cleanName(name)) + t.removeCharts(px) +} + +func (t *Tomcat) removeCharts(prefix string) { + for _, chart := range *t.Charts() { + if strings.HasPrefix(chart.ID, prefix) { + chart.MarkRemove() + chart.MarkNotCreated() + } + } +} diff --git a/src/go/plugin/go.d/modules/tomcat/collect.go b/src/go/plugin/go.d/modules/tomcat/collect.go new file mode 100644 index 00000000..c6e2a74b --- /dev/null +++ b/src/go/plugin/go.d/modules/tomcat/collect.go @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package tomcat + +import ( + "encoding/xml" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +var ( + urlPathServerStatus = "/manager/status" + urlQueryServerStatus = url.Values{"XML": {"true"}}.Encode() +) + +func (t *Tomcat) collect() (map[string]int64, error) { + mx, err := t.collectServerStatus() + if err != nil { + return nil, err + } + + return mx, nil +} + +func (t *Tomcat) collectServerStatus() (map[string]int64, error) { + resp, err := t.queryServerStatus() + if err != nil { + return nil, err + } + + if len(resp.Connectors) == 0 { + return nil, errors.New("unexpected response: not tomcat server status data") + } + + seenConns, seenPools := make(map[string]bool), make(map[string]bool) + + for i, v := range resp.Connectors { + resp.Connectors[i].STMKey = cleanName(v.Name) + ti := &resp.Connectors[i].ThreadInfo + ti.CurrentThreadsIdle = ti.CurrentThreadCount - ti.CurrentThreadsBusy + + seenConns[v.Name] = true + if !t.seenConnectors[v.Name] { + t.seenConnectors[v.Name] = true + t.addConnectorCharts(v.Name) + } + } + + for i, v := range resp.JVM.MemoryPools { + resp.JVM.MemoryPools[i].STMKey = cleanName(v.Name) + + seenPools[v.Name] = true + if !t.seenMemPools[v.Name] { + t.seenMemPools[v.Name] = true + t.addMemPoolCharts(v.Name, v.Type) + } + } + + for name := range t.seenConnectors { + if !seenConns[name] { + delete(t.seenConnectors, name) + t.removeConnectorCharts(name) + } + } + + for name := range t.seenMemPools { + if !seenPools[name] { + delete(t.seenMemPools, name) + t.removeMemoryPoolCharts(name) + } + } + + resp.JVM.Memory.Used = resp.JVM.Memory.Total - resp.JVM.Memory.Free + + return stm.ToMap(resp), nil +} + +func cleanName(name string) string { + r := strings.NewReplacer(" ", "_", ".", "_", "\"", "", "'", "") + return strings.ToLower(r.Replace(name)) +} + +func (t *Tomcat) queryServerStatus() (*serverStatusResponse, error) { + req, err := web.NewHTTPRequestWithPath(t.Request, urlPathServerStatus) + if err != nil { + return nil, err + } + + req.URL.RawQuery = urlQueryServerStatus + + var status serverStatusResponse + + if err := t.doOKDecode(req, &status); err != nil { + return nil, err + } + + return &status, nil +} + +func (t *Tomcat) doOKDecode(req *http.Request, in interface{}) error { + resp, err := t.httpClient.Do(req) + if err != nil { + return fmt.Errorf("error on HTTP request '%s': %v", req.URL, err) + } + defer closeBody(resp) + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("'%s' returned HTTP status code: %d", req.URL, resp.StatusCode) + } + + if err := xml.NewDecoder(resp.Body).Decode(in); err != nil { + return fmt.Errorf("error decoding XML response from '%s': %v", req.URL, err) + } + + return nil +} + +func closeBody(resp *http.Response) { + if resp != nil && resp.Body != nil { + _, _ = io.Copy(io.Discard, resp.Body) + _ = resp.Body.Close() + } +} diff --git a/src/go/plugin/go.d/modules/tomcat/config_schema.json b/src/go/plugin/go.d/modules/tomcat/config_schema.json new file mode 100644 index 00000000..91d7096e --- /dev/null +++ b/src/go/plugin/go.d/modules/tomcat/config_schema.json @@ -0,0 +1,183 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Tomcat collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "url": { + "title": "URL", + "description": "The base URL of the Tomcat server.", + "type": "string", + "default": "http://127.0.0.1:8080", + "format": "uri" + }, + "timeout": { + "title": "Timeout", + "description": "The timeout in seconds for the HTTP request.", + "type": "number", + "minimum": 0.5, + "default": 1 + }, + "not_follow_redirects": { + "title": "Not follow redirects", + "description": "If set, the client will not follow HTTP redirects automatically.", + "type": "boolean" + }, + "username": { + "title": "Username", + "description": "The username for basic authentication.", + "type": "string", + "sensitive": true + }, + "password": { + "title": "Password", + "description": "The password for basic authentication.", + "type": "string", + "sensitive": true + }, + "proxy_url": { + "title": "Proxy URL", + "description": "The URL of the proxy server.", + "type": "string" + }, + "proxy_username": { + "title": "Proxy username", + "description": "The username for proxy authentication.", + "type": "string", + "sensitive": true + }, + "proxy_password": { + "title": "Proxy password", + "description": "The password for proxy authentication.", + "type": "string", + "sensitive": true + }, + "headers": { + "title": "Headers", + "description": "Additional HTTP headers to include in the request.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "tls_skip_verify": { + "title": "Skip TLS verification", + "description": "If set, TLS certificate verification will be skipped.", + "type": "boolean" + }, + "tls_ca": { + "title": "TLS CA", + "description": "The path to the CA certificate file for TLS verification.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_cert": { + "title": "TLS certificate", + "description": "The path to the client certificate file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "tls_key": { + "title": "TLS key", + "description": "The path to the client key file for TLS authentication.", + "type": "string", + "pattern": "^$|^/" + }, + "body": { + "title": "Body", + "type": "string" + }, + "method": { + "title": "Method", + "type": "string" + } + }, + "required": [ + "url" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "body": { + "ui:widget": "hidden" + }, + "method": { + "ui:widget": "hidden" + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, + "password": { + "ui:widget": "password" + }, + "proxy_password": { + "ui:widget": "password" + }, + "ui:flavour": "tabs", + "ui:options": { + "tabs": [ + { + "title": "Base", + "fields": [ + "update_every", + "url", + "timeout", + "not_follow_redirects" + ] + }, + { + "title": "Auth", + "fields": [ + "username", + "password" + ] + }, + { + "title": "TLS", + "fields": [ + "tls_skip_verify", + "tls_ca", + "tls_cert", + "tls_key" + ] + }, + { + "title": "Proxy", + "fields": [ + "proxy_url", + "proxy_username", + "proxy_password" + ] + }, + { + "title": "Headers", + "fields": [ + "headers" + ] + } + ] + } + } +} diff --git a/src/go/plugin/go.d/modules/tomcat/init.go b/src/go/plugin/go.d/modules/tomcat/init.go new file mode 100644 index 00000000..2c2ee29e --- /dev/null +++ b/src/go/plugin/go.d/modules/tomcat/init.go @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package tomcat + +import ( + "fmt" + "net/http" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +func (t *Tomcat) validateConfig() error { + if t.URL == "" { + return fmt.Errorf("url not set") + } + return nil +} + +func (t *Tomcat) initHTTPClient() (*http.Client, error) { + return web.NewHTTPClient(t.Client) +} diff --git a/src/go/plugin/go.d/modules/tomcat/integrations/tomcat.md b/src/go/plugin/go.d/modules/tomcat/integrations/tomcat.md new file mode 100644 index 00000000..b404e66e --- /dev/null +++ b/src/go/plugin/go.d/modules/tomcat/integrations/tomcat.md @@ -0,0 +1,275 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/tomcat/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/tomcat/metadata.yaml" +sidebar_label: "Tomcat" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Tomcat + + +<img src="https://netdata.cloud/img/tomcat.svg" width="150"/> + + +Plugin: go.d.plugin +Module: tomcat + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +This collector monitors Tomcat metrics about bandwidth, processing time, threads and more. + + +It parses the information provided by the [Server Status](https://tomcat.apache.org/tomcat-10.0-doc/manager-howto.html#Server_Status) HTTP endpoint. + + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + +By default, this Tomcat collector cannot access the server's status page. To enable data collection, you will need to configure access credentials with appropriate permissions. + + +### Default Behavior + +#### Auto-Detection + +If the Netdata agent and Tomcat are on the same host, the collector will attempt to connect to the Tomcat server's status page at `http://localhost:8080/manager/status?XML=true`. + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per Tomcat instance + +These metrics refer to the entire monitored application. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| tomcat.jvm_memory_usage | free, used | bytes | + +### Per jvm memory pool + +These metrics refer to the JVM memory pool. + +Labels: + +| Label | Description | +|:-----------|:----------------| +| mempool_name | Memory Pool name. | +| mempool_type | Memory Pool type. | + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| tomcat.jvm_mem_pool_memory_usage | commited, used, max | bytes | + +### Per connector + +These metrics refer to the connector. + +Labels: + +| Label | Description | +|:-----------|:----------------| +| connector_name | Connector name. | + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| tomcat.connector_requests | requests | requests/s | +| tomcat.connector_bandwidth | received, sent | bytes/s | +| tomcat.connector_requests_processing_time | processing_time | milliseconds | +| tomcat.connector_errors | errors | errors/s | +| tomcat.connector_request_threads | idle, busy | threads | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +#### Access to Tomcat Status Endpoint + +The Netdata agent needs read-only access to its status endpoint to collect data from the Tomcat server. + +You can achieve this by creating a dedicated user named `netdata` with read-only permissions specifically for accessing the [Server Status](https://tomcat.apache.org/tomcat-10.0-doc/manager-howto.html#Server_Status) endpoint. + +Once you've created the `netdata` user, you'll need to configure the username and password in the collector configuration file. + + + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/tomcat.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/tomcat.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| url | Server URL. | http://127.0.0.1:8080 | yes | +| timeout | HTTP request timeout. | 1 | no | +| username | Username for basic HTTP authentication. | | no | +| password | Password for basic HTTP authentication. | | no | +| proxy_url | Proxy URL. | | no | +| proxy_username | Username for proxy basic HTTP authentication. | | no | +| proxy_password | Password for proxy basic HTTP authentication. | | no | +| method | HTTP request method. | POST | no | +| body | HTTP request body. | | no | +| headers | HTTP request headers. | | no | +| not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no | +| tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no | +| tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no | +| tls_cert | Client TLS certificate. | | no | +| tls_key | Client TLS key. | | no | + +</details> + +#### Examples + +##### Basic + +A basic example configuration. + +```yaml +jobs: + - name: local + url: http://127.0.0.1:8080 + username: John + password: Doe + +``` +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + url: http://127.0.0.1:8080 + username: admin1 + password: hackme1 + + - name: remote + url: http://192.0.2.1:8080 + username: admin2 + password: hackme2 + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `tomcat` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m tomcat + ``` + +### Getting Logs + +If you're encountering problems with the `tomcat` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep tomcat +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep tomcat /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep tomcat +``` + + diff --git a/src/go/plugin/go.d/modules/tomcat/metadata.yaml b/src/go/plugin/go.d/modules/tomcat/metadata.yaml new file mode 100644 index 00000000..d5815cf7 --- /dev/null +++ b/src/go/plugin/go.d/modules/tomcat/metadata.yaml @@ -0,0 +1,241 @@ +plugin_name: go.d.plugin +modules: + - meta: + plugin_name: go.d.plugin + module_name: tomcat + monitored_instance: + name: Tomcat + link: "https://tomcat.apache.org/" + categories: + - data-collection.web-servers-and-web-proxies + icon_filename: "tomcat.svg" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - apache + - tomcat + - webserver + - websocket + - jakarta + - javaEE + most_popular: false + overview: + data_collection: + metrics_description: | + This collector monitors Tomcat metrics about bandwidth, processing time, threads and more. + method_description: | + It parses the information provided by the [Server Status](https://tomcat.apache.org/tomcat-10.0-doc/manager-howto.html#Server_Status) HTTP endpoint. + supported_platforms: + include: [] + exclude: [] + multi_instance: true + additional_permissions: + description: > + By default, this Tomcat collector cannot access the server's status page. + To enable data collection, you will need to configure access credentials with appropriate permissions. + default_behavior: + auto_detection: + description: > + If the Netdata agent and Tomcat are on the same host, the collector will attempt to connect to the Tomcat server's status page at `http://localhost:8080/manager/status?XML=true`. + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: + - title: Access to Tomcat Status Endpoint + description: | + The Netdata agent needs read-only access to its status endpoint to collect data from the Tomcat server. + + You can achieve this by creating a dedicated user named `netdata` with read-only permissions specifically for accessing the [Server Status](https://tomcat.apache.org/tomcat-10.0-doc/manager-howto.html#Server_Status) endpoint. + + Once you've created the `netdata` user, you'll need to configure the username and password in the collector configuration file. + configuration: + file: + name: "go.d/tomcat.conf" + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: "Config options" + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: url + description: Server URL. + default_value: http://127.0.0.1:8080 + required: true + - name: timeout + description: HTTP request timeout. + default_value: 1 + required: false + - name: username + description: Username for basic HTTP authentication. + default_value: "" + required: false + - name: password + description: Password for basic HTTP authentication. + default_value: "" + required: false + - name: proxy_url + description: Proxy URL. + default_value: "" + required: false + - name: proxy_username + description: Username for proxy basic HTTP authentication. + default_value: "" + required: false + - name: proxy_password + description: Password for proxy basic HTTP authentication. + default_value: "" + required: false + - name: method + description: HTTP request method. + default_value: POST + required: false + - name: body + description: HTTP request body. + default_value: "" + required: false + - name: headers + description: HTTP request headers. + default_value: "" + required: false + - name: not_follow_redirects + description: Redirect handling policy. Controls whether the client follows redirects. + default_value: false + required: false + - name: tls_skip_verify + description: Server certificate chain and hostname validation policy. Controls whether the client performs this check. + default_value: false + required: false + - name: tls_ca + description: Certification authority that the client uses when verifying the server's certificates. + default_value: "" + required: false + - name: tls_cert + description: Client TLS certificate. + default_value: "" + required: false + - name: tls_key + description: Client TLS key. + default_value: "" + required: false + examples: + folding: + enabled: true + title: "Config" + list: + - name: Basic + description: A basic example configuration. + folding: + enabled: false + config: | + jobs: + - name: local + url: http://127.0.0.1:8080 + username: John + password: Doe + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + url: http://127.0.0.1:8080 + username: admin1 + password: hackme1 + + - name: remote + url: http://192.0.2.1:8080 + username: admin2 + password: hackme2 + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: "These metrics refer to the entire monitored application." + labels: [] + metrics: + - name: tomcat.jvm_memory_usage + description: Requests + unit: bytes + chart_type: stacked + dimensions: + - name: free + - name: used + - name: jvm memory pool + description: "These metrics refer to the JVM memory pool." + labels: + - name: mempool_name + description: Memory Pool name. + - name: mempool_type + description: Memory Pool type. + metrics: + - name: tomcat.jvm_mem_pool_memory_usage + description: JVM Mem Pool Memory Usage + unit: bytes + chart_type: area + dimensions: + - name: commited + - name: used + - name: max + - name: connector + description: "These metrics refer to the connector." + labels: + - name: connector_name + description: Connector name. + metrics: + - name: tomcat.connector_requests + description: Connector Requests + unit: requests/s + chart_type: line + dimensions: + - name: requests + - name: tomcat.connector_bandwidth + description: Connector Bandwidth + unit: bytes/s + chart_type: area + dimensions: + - name: received + - name: sent + - name: tomcat.connector_requests_processing_time + description: Connector Requests Processing Time + unit: milliseconds + chart_type: line + dimensions: + - name: processing_time + - name: tomcat.connector_errors + description: Connector Errors + unit: errors/s + chart_type: line + dimensions: + - name: errors + - name: tomcat.connector_request_threads + description: Connector Request Threads + unit: threads + chart_type: stacked + dimensions: + - name: idle + - name: busy diff --git a/src/go/plugin/go.d/modules/tomcat/status_response.go b/src/go/plugin/go.d/modules/tomcat/status_response.go new file mode 100644 index 00000000..1459bd56 --- /dev/null +++ b/src/go/plugin/go.d/modules/tomcat/status_response.go @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package tomcat + +import "encoding/xml" + +type serverStatusResponse struct { + XMLName xml.Name `xml:"status"` + + JVM struct { + Memory struct { + Used int64 `stm:"used"` // calculated manually + Free int64 `xml:"free,attr" stm:"free"` + Total int64 `xml:"total,attr" stm:"total"` + Max int64 `xml:"max,attr"` + } `xml:"memory" stm:"memory"` + + MemoryPools []struct { + STMKey string + + Name string `xml:"name,attr"` + Type string `xml:"type,attr"` + UsageInit int64 `xml:"usageInit,attr"` + UsageCommitted int64 `xml:"usageCommitted,attr" stm:"commited"` + UsageMax int64 `xml:"usageMax,attr" stm:"max"` + UsageUsed int64 `xml:"usageUsed,attr" stm:"used"` + } `xml:"memorypool" stm:"memorypool"` + } `xml:"jvm" stm:"jvm"` + + Connectors []struct { + STMKey string + + Name string `xml:"name,attr"` + + ThreadInfo struct { + MaxThreads int64 `xml:"maxThreads,attr"` + CurrentThreadCount int64 `xml:"currentThreadCount,attr" stm:"count"` + CurrentThreadsBusy int64 `xml:"currentThreadsBusy,attr" stm:"busy"` + CurrentThreadsIdle int64 `stm:"idle"` // calculated manually + } `xml:"threadInfo" stm:"thread_info"` + + RequestInfo struct { + MaxTime int64 `xml:"maxTime,attr"` + ProcessingTime int64 `xml:"processingTime,attr" stm:"processing_time"` + RequestCount int64 `xml:"requestCount,attr" stm:"request_count"` + ErrorCount int64 `xml:"errorCount,attr" stm:"error_count"` + BytesReceived int64 `xml:"bytesReceived,attr" stm:"bytes_received"` + BytesSent int64 `xml:"bytesSent,attr" stm:"bytes_sent"` + } `xml:"requestInfo" stm:"request_info"` + } `xml:"connector" stm:"connector"` +} diff --git a/src/go/plugin/go.d/modules/tomcat/testdata/config.json b/src/go/plugin/go.d/modules/tomcat/testdata/config.json new file mode 100644 index 00000000..984c3ed6 --- /dev/null +++ b/src/go/plugin/go.d/modules/tomcat/testdata/config.json @@ -0,0 +1,20 @@ +{ + "update_every": 123, + "url": "ok", + "body": "ok", + "method": "ok", + "headers": { + "ok": "ok" + }, + "username": "ok", + "password": "ok", + "proxy_url": "ok", + "proxy_username": "ok", + "proxy_password": "ok", + "timeout": 123.123, + "not_follow_redirects": true, + "tls_ca": "ok", + "tls_cert": "ok", + "tls_key": "ok", + "tls_skip_verify": true +} diff --git a/src/go/plugin/go.d/modules/tomcat/testdata/config.yaml b/src/go/plugin/go.d/modules/tomcat/testdata/config.yaml new file mode 100644 index 00000000..8558b61c --- /dev/null +++ b/src/go/plugin/go.d/modules/tomcat/testdata/config.yaml @@ -0,0 +1,17 @@ +update_every: 123 +url: "ok" +body: "ok" +method: "ok" +headers: + ok: "ok" +username: "ok" +password: "ok" +proxy_url: "ok" +proxy_username: "ok" +proxy_password: "ok" +timeout: 123.123 +not_follow_redirects: yes +tls_ca: "ok" +tls_cert: "ok" +tls_key: "ok" +tls_skip_verify: yes diff --git a/src/go/plugin/go.d/modules/tomcat/testdata/server_status.xml b/src/go/plugin/go.d/modules/tomcat/testdata/server_status.xml new file mode 100644 index 00000000..e4d54f4e --- /dev/null +++ b/src/go/plugin/go.d/modules/tomcat/testdata/server_status.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="/manager/xform.xsl" ?> +<status> + <jvm> + <memory free='144529816' total='179306496' max='1914699776'/> + <memorypool name='G1 Eden Space' type='Heap memory' usageInit='24117248' usageCommitted='108003328' + usageMax='-1' usageUsed='23068672'/> + <memorypool name='G1 Old Gen' type='Heap memory' usageInit='97517568' usageCommitted='66060288' + usageMax='1914699776' usageUsed='6175120'/> + <memorypool name='G1 Survivor Space' type='Heap memory' usageInit='0' usageCommitted='5242880' usageMax='-1' + usageUsed='5040192'/> + <memorypool name='CodeHeap 'non-nmethods'' type='Non-heap memory' usageInit='2555904' + usageCommitted='2555904' usageMax='5840896' usageUsed='1477888'/> + <memorypool name='CodeHeap 'non-profiled nmethods'' type='Non-heap memory' usageInit='2555904' + usageCommitted='4587520' usageMax='122908672' usageUsed='4536704'/> + <memorypool name='CodeHeap 'profiled nmethods'' type='Non-heap memory' usageInit='2555904' + usageCommitted='13172736' usageMax='122908672' usageUsed='13132032'/> + <memorypool name='Compressed Class Space' type='Non-heap memory' usageInit='0' usageCommitted='1900544' + usageMax='1073741824' usageUsed='1712872'/> + <memorypool name='Metaspace' type='Non-heap memory' usageInit='0' usageCommitted='18939904' usageMax='-1' + usageUsed='18537336'/> + </jvm> + <connector name='"http-nio-8080"'> + <threadInfo maxThreads="200" currentThreadCount="10" currentThreadsBusy="1"/> + <requestInfo maxTime="247" processingTime="28326" requestCount="4838" errorCount="24" bytesReceived="0" + bytesSent="12174519"/> + <workers> + <worker stage="R" requestProcessingTime="0" requestBytesSent="0" requestBytesReceived="0" remoteAddr="?" + virtualHost="?" method="?" currentUri="?" currentQueryString="?" protocol="?"/> + <worker stage="R" requestProcessingTime="0" requestBytesSent="0" requestBytesReceived="0" remoteAddr="?" + virtualHost="?" method="?" currentUri="?" currentQueryString="?" protocol="?"/> + <worker stage="R" requestProcessingTime="0" requestBytesSent="0" requestBytesReceived="0" remoteAddr="?" + virtualHost="?" method="?" currentUri="?" currentQueryString="?" protocol="?"/> + <worker stage="S" requestProcessingTime="30" requestBytesSent="0" requestBytesReceived="0" + remoteAddr="127.0.0.1" virtualHost="127.0.0.1" method="GET" currentUri="/manager/status" + currentQueryString="XML=true" protocol="HTTP/1.1"/> + </workers> + </connector> + <connector name='"http-nio-8081"'> + <threadInfo maxThreads="200" currentThreadCount="10" currentThreadsBusy="1"/> + <requestInfo maxTime="247" processingTime="28326" requestCount="4838" errorCount="24" bytesReceived="0" + bytesSent="12174519"/> + <workers> + <worker stage="R" requestProcessingTime="0" requestBytesSent="0" requestBytesReceived="0" remoteAddr="?" + virtualHost="?" method="?" currentUri="?" currentQueryString="?" protocol="?"/> + <worker stage="R" requestProcessingTime="0" requestBytesSent="0" requestBytesReceived="0" remoteAddr="?" + virtualHost="?" method="?" currentUri="?" currentQueryString="?" protocol="?"/> + <worker stage="R" requestProcessingTime="0" requestBytesSent="0" requestBytesReceived="0" remoteAddr="?" + virtualHost="?" method="?" currentUri="?" currentQueryString="?" protocol="?"/> + <worker stage="S" requestProcessingTime="30" requestBytesSent="0" requestBytesReceived="0" + remoteAddr="127.0.0.1" virtualHost="127.0.0.1" method="GET" currentUri="/manager/status" + currentQueryString="XML=true" protocol="HTTP/1.1"/> + </workers> + </connector> +</status> diff --git a/src/go/plugin/go.d/modules/tomcat/tomcat.go b/src/go/plugin/go.d/modules/tomcat/tomcat.go new file mode 100644 index 00000000..54024706 --- /dev/null +++ b/src/go/plugin/go.d/modules/tomcat/tomcat.go @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package tomcat + +import ( + _ "embed" + "errors" + "net/http" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("tomcat", module.Creator{ + JobConfigSchema: configSchema, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Tomcat { + return &Tomcat{ + Config: Config{ + HTTP: web.HTTP{ + Request: web.Request{ + URL: "http://127.0.0.1:8080", + }, + Client: web.Client{ + Timeout: web.Duration(time.Second * 1), + }, + }, + }, + charts: defaultCharts.Copy(), + seenConnectors: make(map[string]bool), + seenMemPools: make(map[string]bool), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + web.HTTP `yaml:",inline" json:""` +} + +type Tomcat struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + httpClient *http.Client + + seenConnectors map[string]bool + seenMemPools map[string]bool +} + +func (t *Tomcat) Configuration() any { + return t.Config +} + +func (t *Tomcat) Init() error { + if err := t.validateConfig(); err != nil { + t.Errorf("config validation: %v", err) + return err + } + + httpClient, err := t.initHTTPClient() + if err != nil { + t.Errorf("init HTTP client: %v", err) + return err + } + + t.httpClient = httpClient + + t.Debugf("using URL %s", t.URL) + t.Debugf("using timeout: %s", t.Timeout) + + return nil +} + +func (t *Tomcat) Check() error { + mx, err := t.collect() + if err != nil { + t.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (t *Tomcat) Charts() *module.Charts { + return t.charts +} + +func (t *Tomcat) Collect() map[string]int64 { + mx, err := t.collect() + if err != nil { + t.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (t *Tomcat) Cleanup() { + if t.httpClient != nil { + t.httpClient.CloseIdleConnections() + } +} diff --git a/src/go/plugin/go.d/modules/tomcat/tomcat_test.go b/src/go/plugin/go.d/modules/tomcat/tomcat_test.go new file mode 100644 index 00000000..7dfb6ff1 --- /dev/null +++ b/src/go/plugin/go.d/modules/tomcat/tomcat_test.go @@ -0,0 +1,272 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package tomcat + +import ( + "net/http" + "net/http/httptest" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataServerStatus, _ = os.ReadFile("testdata/server_status.xml") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + "dataServerStatus": dataServerStatus, + } { + require.NotNil(t, data, name) + } +} + +func TestTomcat_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &Tomcat{}, dataConfigJSON, dataConfigYAML) +} + +func TestTomcat_Init(t *testing.T) { + tests := map[string]struct { + wantFail bool + config Config + }{ + "success with default": { + wantFail: false, + config: New().Config, + }, + "fail when URL not set": { + wantFail: true, + config: Config{ + HTTP: web.HTTP{ + Request: web.Request{URL: ""}, + }, + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + tomcat := New() + tomcat.Config = test.config + + if test.wantFail { + assert.Error(t, tomcat.Init()) + } else { + assert.NoError(t, tomcat.Init()) + } + }) + } +} + +func TestTomcat_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestTomcat_Check(t *testing.T) { + tests := map[string]struct { + wantFail bool + prepare func(t *testing.T) (*Tomcat, func()) + }{ + "success case": { + wantFail: false, + prepare: prepareCaseSuccess, + }, + "fails on unexpected xml response": { + wantFail: true, + prepare: prepareCaseUnexpectedXMLResponse, + }, + "fails on invalid format response": { + wantFail: true, + prepare: prepareCaseInvalidFormatResponse, + }, + "fails on connection refused": { + wantFail: true, + prepare: prepareCaseConnectionRefused, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + tomcat, cleanup := test.prepare(t) + defer cleanup() + + if test.wantFail { + assert.Error(t, tomcat.Check()) + } else { + assert.NoError(t, tomcat.Check()) + } + }) + } +} + +func TestTomcat_Collect(t *testing.T) { + tests := map[string]struct { + prepare func(t *testing.T) (tomcat *Tomcat, cleanup func()) + wantMetrics map[string]int64 + wantCharts int + }{ + "success case": { + prepare: prepareCaseSuccess, + wantCharts: len(defaultCharts) + len(jvmMemoryPoolChartsTmpl)*8 + len(connectorChartsTmpl)*2, + wantMetrics: map[string]int64{ + "connector_http-nio-8080_request_info_bytes_received": 0, + "connector_http-nio-8080_request_info_bytes_sent": 12174519, + "connector_http-nio-8080_request_info_error_count": 24, + "connector_http-nio-8080_request_info_processing_time": 28326, + "connector_http-nio-8080_request_info_request_count": 4838, + "connector_http-nio-8080_thread_info_busy": 1, + "connector_http-nio-8080_thread_info_count": 10, + "connector_http-nio-8080_thread_info_idle": 9, + "connector_http-nio-8081_request_info_bytes_received": 0, + "connector_http-nio-8081_request_info_bytes_sent": 12174519, + "connector_http-nio-8081_request_info_error_count": 24, + "connector_http-nio-8081_request_info_processing_time": 28326, + "connector_http-nio-8081_request_info_request_count": 4838, + "connector_http-nio-8081_thread_info_busy": 1, + "connector_http-nio-8081_thread_info_count": 10, + "connector_http-nio-8081_thread_info_idle": 9, + "jvm_memory_free": 144529816, + "jvm_memory_total": 179306496, + "jvm_memory_used": 34776680, + "jvm_memorypool_codeheap_non-nmethods_commited": 2555904, + "jvm_memorypool_codeheap_non-nmethods_max": 5840896, + "jvm_memorypool_codeheap_non-nmethods_used": 1477888, + "jvm_memorypool_codeheap_non-profiled_nmethods_commited": 4587520, + "jvm_memorypool_codeheap_non-profiled_nmethods_max": 122908672, + "jvm_memorypool_codeheap_non-profiled_nmethods_used": 4536704, + "jvm_memorypool_codeheap_profiled_nmethods_commited": 13172736, + "jvm_memorypool_codeheap_profiled_nmethods_max": 122908672, + "jvm_memorypool_codeheap_profiled_nmethods_used": 13132032, + "jvm_memorypool_compressed_class_space_commited": 1900544, + "jvm_memorypool_compressed_class_space_max": 1073741824, + "jvm_memorypool_compressed_class_space_used": 1712872, + "jvm_memorypool_g1_eden_space_commited": 108003328, + "jvm_memorypool_g1_eden_space_max": -1, + "jvm_memorypool_g1_eden_space_used": 23068672, + "jvm_memorypool_g1_old_gen_commited": 66060288, + "jvm_memorypool_g1_old_gen_max": 1914699776, + "jvm_memorypool_g1_old_gen_used": 6175120, + "jvm_memorypool_g1_survivor_space_commited": 5242880, + "jvm_memorypool_g1_survivor_space_max": -1, + "jvm_memorypool_g1_survivor_space_used": 5040192, + "jvm_memorypool_metaspace_commited": 18939904, + "jvm_memorypool_metaspace_max": -1, + "jvm_memorypool_metaspace_used": 18537336, + }, + }, + "fails on unexpected xml response": { + prepare: prepareCaseUnexpectedXMLResponse, + }, + "fails on invalid format response": { + prepare: prepareCaseInvalidFormatResponse, + }, + "fails on connection refused": { + prepare: prepareCaseConnectionRefused, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + tomcat, cleanup := test.prepare(t) + defer cleanup() + + mx := tomcat.Collect() + + require.Equal(t, test.wantMetrics, mx) + + if len(test.wantMetrics) > 0 { + assert.Equal(t, test.wantCharts, len(*tomcat.Charts())) + module.TestMetricsHasAllChartsDims(t, tomcat.Charts(), mx) + } + }) + } +} + +func prepareCaseSuccess(t *testing.T) (*Tomcat, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case urlPathServerStatus: + if r.URL.RawQuery != urlQueryServerStatus { + w.WriteHeader(http.StatusNotFound) + } else { + _, _ = w.Write(dataServerStatus) + } + default: + w.WriteHeader(http.StatusNotFound) + } + })) + tomcat := New() + tomcat.URL = srv.URL + require.NoError(t, tomcat.Init()) + + return tomcat, srv.Close +} + +func prepareCaseConnectionRefused(t *testing.T) (*Tomcat, func()) { + t.Helper() + tomcat := New() + tomcat.URL = "http://127.0.0.1:65001" + require.NoError(t, tomcat.Init()) + + return tomcat, func() {} +} + +func prepareCaseUnexpectedXMLResponse(t *testing.T) (*Tomcat, func()) { + t.Helper() + resp := ` +<?xml version="1.0" encoding="UTF-8" ?> + <root> + <elephant> + <burn>false</burn> + <mountain>true</mountain> + <fog>false</fog> + <skin>-1561907625</skin> + <burst>anyway</burst> + <shadow>1558616893</shadow> + </elephant> + <start>ever</start> + <base>2093056027</base> + <mission>-2007590351</mission> + <victory>999053756</victory> + <die>false</die> + </root> + +` + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte(resp)) + })) + + tomcat := New() + tomcat.URL = srv.URL + require.NoError(t, tomcat.Init()) + + return tomcat, srv.Close +} + +func prepareCaseInvalidFormatResponse(t *testing.T) (*Tomcat, func()) { + t.Helper() + srv := httptest.NewServer(http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte("hello and\n goodbye")) + })) + + tomcat := New() + tomcat.URL = srv.URL + require.NoError(t, tomcat.Init()) + + return tomcat, srv.Close +} diff --git a/src/go/plugin/go.d/modules/tor/README.md b/src/go/plugin/go.d/modules/tor/README.md new file mode 120000 index 00000000..7c20cd40 --- /dev/null +++ b/src/go/plugin/go.d/modules/tor/README.md @@ -0,0 +1 @@ +integrations/tor.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/tor/charts.go b/src/go/plugin/go.d/modules/tor/charts.go new file mode 100644 index 00000000..1e2a1ef9 --- /dev/null +++ b/src/go/plugin/go.d/modules/tor/charts.go @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package tor + +import ( + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioTraffic = module.Priority + iota + prioUptime +) + +var charts = module.Charts{ + trafficChart.Copy(), + uptimeChart.Copy(), +} + +var trafficChart = module.Chart{ + ID: "traffic", + Title: "Tor Traffic", + Units: "KiB/s", + Fam: "traffic", + Ctx: "tor.traffic", + Type: module.Area, + Priority: prioTraffic, + Dims: module.Dims{ + {ID: "traffic/read", Name: "read", Algo: module.Incremental, Div: 1024}, + {ID: "traffic/written", Name: "write", Algo: module.Incremental, Mul: -1, Div: 1024}, + }, +} + +var uptimeChart = module.Chart{ + ID: "uptime", + Title: "Tor Uptime", + Units: "seconds", + Fam: "uptime", + Ctx: "tor.uptime", + Priority: prioUptime, + Dims: module.Dims{ + {ID: "uptime"}, + }, +} diff --git a/src/go/plugin/go.d/modules/tor/client.go b/src/go/plugin/go.d/modules/tor/client.go new file mode 100644 index 00000000..e4a8045a --- /dev/null +++ b/src/go/plugin/go.d/modules/tor/client.go @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package tor + +import ( + "bytes" + "errors" + "fmt" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" +) + +// https://spec.torproject.org/control-spec/index.html +// https://github.com/torproject/stem/blob/master/stem/control.py + +const ( + cmdAuthenticate = "AUTHENTICATE" + cmdQuit = "QUIT" + cmdGetInfo = "GETINFO" +) + +type controlConn interface { + connect() error + disconnect() + + getInfo(...string) ([]byte, error) +} + +func newControlConn(conf Config) controlConn { + return &torControlClient{ + password: conf.Password, + conn: socket.New(socket.Config{ + Address: conf.Address, + ConnectTimeout: conf.Timeout.Duration(), + ReadTimeout: conf.Timeout.Duration(), + WriteTimeout: conf.Timeout.Duration(), + })} +} + +type torControlClient struct { + password string + conn socket.Client +} + +func (c *torControlClient) connect() error { + if err := c.conn.Connect(); err != nil { + return err + } + + return c.authenticate() +} + +func (c *torControlClient) authenticate() error { + // https://spec.torproject.org/control-spec/commands.html#authenticate + + cmd := cmdAuthenticate + if c.password != "" { + cmd = fmt.Sprintf("%s \"%s\"", cmdAuthenticate, c.password) + } + + var s string + err := c.conn.Command(cmd+"\n", func(bs []byte) bool { + s = string(bs) + return false + }) + if err != nil { + return fmt.Errorf("authentication failed: %v", err) + } + if !strings.HasPrefix(s, "250") { + return fmt.Errorf("authentication failed: %s", s) + } + return nil +} + +func (c *torControlClient) disconnect() { + // https://spec.torproject.org/control-spec/commands.html#quit + + _ = c.conn.Command(cmdQuit+"\n", func(bs []byte) bool { return false }) + _ = c.conn.Disconnect() +} + +func (c *torControlClient) getInfo(keywords ...string) ([]byte, error) { + // https://spec.torproject.org/control-spec/commands.html#getinfo + + if len(keywords) == 0 { + return nil, errors.New("no keywords specified") + } + cmd := fmt.Sprintf("%s %s", cmdGetInfo, strings.Join(keywords, " ")) + + var buf bytes.Buffer + var err error + + clientErr := c.conn.Command(cmd+"\n", func(bs []byte) bool { + s := string(bs) + + switch { + case strings.HasPrefix(s, "250-"): + buf.WriteString(strings.TrimPrefix(s, "250-")) + buf.WriteByte('\n') + return true + case strings.HasPrefix(s, "250 "): + return false + default: + err = errors.New(s) + return false + } + }) + if clientErr != nil { + return nil, fmt.Errorf("command '%s' failed: %v", cmd, clientErr) + } + if err != nil { + return nil, fmt.Errorf("command '%s' failed: %v", cmd, err) + } + + return buf.Bytes(), nil +} diff --git a/src/go/plugin/go.d/modules/tor/collect.go b/src/go/plugin/go.d/modules/tor/collect.go new file mode 100644 index 00000000..6e6078df --- /dev/null +++ b/src/go/plugin/go.d/modules/tor/collect.go @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package tor + +import ( + "bufio" + "bytes" + "fmt" + "strconv" + "strings" +) + +func (t *Tor) collect() (map[string]int64, error) { + if t.conn == nil { + conn, err := t.establishConnection() + if err != nil { + return nil, err + } + t.conn = conn + } + + mx := make(map[string]int64) + if err := t.collectServerInfo(mx); err != nil { + t.Cleanup() + return nil, err + } + + return mx, nil +} + +func (t *Tor) collectServerInfo(mx map[string]int64) error { + resp, err := t.conn.getInfo("traffic/read", "traffic/written", "uptime") + if err != nil { + return err + } + + sc := bufio.NewScanner(bytes.NewReader(resp)) + + for sc.Scan() { + line := sc.Text() + + key, value, ok := strings.Cut(line, "=") + if !ok { + return fmt.Errorf("failed to parse metric: %s", line) + } + + v, err := strconv.ParseInt(value, 10, 64) + if err != nil { + return fmt.Errorf("failed to parse metric %s value: %v", line, err) + } + mx[key] = v + } + + return nil +} + +func (t *Tor) establishConnection() (controlConn, error) { + conn := t.newConn(t.Config) + + if err := conn.connect(); err != nil { + return nil, err + } + + return conn, nil +} diff --git a/src/go/plugin/go.d/modules/tor/config_schema.json b/src/go/plugin/go.d/modules/tor/config_schema.json new file mode 100644 index 00000000..abfc40d9 --- /dev/null +++ b/src/go/plugin/go.d/modules/tor/config_schema.json @@ -0,0 +1,53 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Tor collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "address": { + "title": "Address", + "description": "The IP address and port where the Tor's Control Port listens for connections.", + "type": "string", + "default": "127.0.0.1:9051" + }, + "timeout": { + "title": "Timeout", + "description": "Timeout for establishing a connection and communication (reading and writing) in seconds.", + "type": "number", + "minimum": 0.5, + "default": 1 + }, + "password": { + "title": "Password", + "description": "The password for authentication.", + "type": "string", + "sensitive": true + } + }, + "required": [ + "address" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + }, + "password": { + "ui:widget": "password" + } + } +} diff --git a/src/go/plugin/go.d/modules/tor/integrations/tor.md b/src/go/plugin/go.d/modules/tor/integrations/tor.md new file mode 100644 index 00000000..54b5a428 --- /dev/null +++ b/src/go/plugin/go.d/modules/tor/integrations/tor.md @@ -0,0 +1,225 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/tor/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/tor/metadata.yaml" +sidebar_label: "Tor" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/VPNs" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# Tor + + +<img src="https://netdata.cloud/img/tor.svg" width="150"/> + + +Plugin: go.d.plugin +Module: tor + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +Tracks Tor's download and upload traffic, as well as its uptime. + + +It reads the server's response to the [GETINFO](https://spec.torproject.org/control-spec/commands.html#getinfo) command. + + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +By default, it detects Tor instances running on localhost that are listening on port 9051. +On startup, it tries to collect metrics from: + +- 127.0.0.1:9051 + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per Tor instance + +These metrics refer to the entire monitored application. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| tor.traffic | read, write | KiB/s | +| tor.uptime | uptime | seconds | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +#### Enable Control Port + +Enable `ControlPort` in `/etc/tor/torrc`. + + + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/tor.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/tor.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| address | The IP address and port where the Tor's Control Port listens for connections. | 127.0.0.1:9051 | yes | +| timeout | Connection, read, and write timeout duration in seconds. The timeout includes name resolution. | 1 | no | +| password | Password for authentication. | | no | + +</details> + +#### Examples + +##### Basic + +A basic example configuration. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:9051 + password: somePassword + +``` +</details> + +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:9051 + password: somePassword + + - name: remote + address: 203.0.113.0:9051 + password: somePassword + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `tor` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m tor + ``` + +### Getting Logs + +If you're encountering problems with the `tor` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep tor +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep tor /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep tor +``` + + diff --git a/src/go/plugin/go.d/modules/tor/metadata.yaml b/src/go/plugin/go.d/modules/tor/metadata.yaml new file mode 100644 index 00000000..7df58934 --- /dev/null +++ b/src/go/plugin/go.d/modules/tor/metadata.yaml @@ -0,0 +1,135 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-tor + plugin_name: go.d.plugin + module_name: tor + monitored_instance: + name: Tor + link: https://www.torproject.org/ + categories: + - data-collection.vpns + icon_filename: "tor.svg" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - tor + - traffic + - vpn + most_popular: false + overview: + data_collection: + metrics_description: | + Tracks Tor's download and upload traffic, as well as its uptime. + method_description: | + It reads the server's response to the [GETINFO](https://spec.torproject.org/control-spec/commands.html#getinfo) command. + supported_platforms: + include: [] + exclude: [] + multi_instance: true + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: | + By default, it detects Tor instances running on localhost that are listening on port 9051. + On startup, it tries to collect metrics from: + + - 127.0.0.1:9051 + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: + - title: Enable Control Port + description: | + Enable `ControlPort` in `/etc/tor/torrc`. + configuration: + file: + name: go.d/tor.conf + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: address + description: The IP address and port where the Tor's Control Port listens for connections. + default_value: 127.0.0.1:9051 + required: true + - name: timeout + description: Connection, read, and write timeout duration in seconds. The timeout includes name resolution. + default_value: 1 + required: false + - name: password + description: Password for authentication. + default_value: "" + required: false + examples: + folding: + title: Config + enabled: true + list: + - name: Basic + description: A basic example configuration. + config: | + jobs: + - name: local + address: 127.0.0.1:9051 + password: somePassword + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + address: 127.0.0.1:9051 + password: somePassword + + - name: remote + address: 203.0.113.0:9051 + password: somePassword + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: "These metrics refer to the entire monitored application." + labels: [] + metrics: + - name: tor.traffic + description: Tor Traffic + unit: "KiB/s" + chart_type: area + dimensions: + - name: read + - name: write + - name: tor.uptime + description: Tor Uptime + unit: "seconds" + chart_type: line + dimensions: + - name: uptime diff --git a/src/go/plugin/go.d/modules/tor/testdata/config.json b/src/go/plugin/go.d/modules/tor/testdata/config.json new file mode 100644 index 00000000..76769305 --- /dev/null +++ b/src/go/plugin/go.d/modules/tor/testdata/config.json @@ -0,0 +1,6 @@ +{ + "update_every": 123, + "address": "ok", + "timeout": 123.123, + "password": "ok" +} diff --git a/src/go/plugin/go.d/modules/tor/testdata/config.yaml b/src/go/plugin/go.d/modules/tor/testdata/config.yaml new file mode 100644 index 00000000..95ba970b --- /dev/null +++ b/src/go/plugin/go.d/modules/tor/testdata/config.yaml @@ -0,0 +1,4 @@ +update_every: 123 +address: "ok" +timeout: 123.123 +password: "ok" diff --git a/src/go/plugin/go.d/modules/tor/tor.go b/src/go/plugin/go.d/modules/tor/tor.go new file mode 100644 index 00000000..bb6cacab --- /dev/null +++ b/src/go/plugin/go.d/modules/tor/tor.go @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package tor + +import ( + _ "embed" + "errors" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("tor", module.Creator{ + JobConfigSchema: configSchema, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Tor { + return &Tor{ + Config: Config{ + Address: "127.0.0.1:9051", + Timeout: web.Duration(time.Second * 1), + }, + newConn: newControlConn, + charts: charts.Copy(), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Address string `yaml:"address" json:"address"` + Timeout web.Duration `yaml:"timeout" json:"timeout"` + Password string `yaml:"password" json:"password"` +} + +type Tor struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + newConn func(Config) controlConn + conn controlConn +} + +func (t *Tor) Configuration() any { + return t.Config +} + +func (t *Tor) Init() error { + if t.Address == "" { + t.Error("config: 'address' not set") + return errors.New("address not set") + } + + return nil +} + +func (t *Tor) Check() error { + mx, err := t.collect() + if err != nil { + t.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (t *Tor) Charts() *module.Charts { + return t.charts +} + +func (t *Tor) Collect() map[string]int64 { + mx, err := t.collect() + if err != nil { + t.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (t *Tor) Cleanup() { + if t.conn != nil { + t.conn.disconnect() + t.conn = nil + } +} diff --git a/src/go/plugin/go.d/modules/tor/tor_test.go b/src/go/plugin/go.d/modules/tor/tor_test.go new file mode 100644 index 00000000..35001c39 --- /dev/null +++ b/src/go/plugin/go.d/modules/tor/tor_test.go @@ -0,0 +1,328 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package tor + +import ( + "bufio" + "errors" + "fmt" + "io" + "net" + "os" + "strings" + "testing" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + } { + require.NotNil(t, data, name) + } +} + +func TestTor_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &Tor{}, dataConfigJSON, dataConfigYAML) +} + +func TestTor_Init(t *testing.T) { + tests := map[string]struct { + config Config + wantFail bool + }{ + "success with default config": { + wantFail: false, + config: New().Config, + }, + "fails if address not set": { + wantFail: true, + config: func() Config { + conf := New().Config + conf.Address = "" + return conf + }(), + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + tor := New() + tor.Config = test.config + + if test.wantFail { + assert.Error(t, tor.Init()) + } else { + assert.NoError(t, tor.Init()) + } + }) + } +} + +func TestTor_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestTor_Check(t *testing.T) { + tests := map[string]struct { + prepare func() (*Tor, *mockTorDaemon) + wantFail bool + }{ + "success on valid response": { + wantFail: false, + prepare: prepareCaseOk, + }, + "fails on connection refused": { + wantFail: true, + prepare: prepareCaseConnectionRefused, + }, + } + for name, test := range tests { + t.Run(name, func(t *testing.T) { + tor, daemon := test.prepare() + + defer func() { + assert.NoError(t, daemon.Close(), "daemon.Close()") + }() + go func() { + assert.NoError(t, daemon.Run(), "daemon.Run()") + }() + + select { + case <-daemon.started: + case <-time.After(time.Second * 3): + t.Errorf("mock tor daemon start timed out") + } + + require.NoError(t, tor.Init()) + + if test.wantFail { + assert.Error(t, tor.Check()) + } else { + assert.NoError(t, tor.Check()) + } + + tor.Cleanup() + + select { + case <-daemon.stopped: + case <-time.After(time.Second * 3): + t.Errorf("mock tor daemon stop timed out") + } + }) + } +} + +func TestTor_Collect(t *testing.T) { + tests := map[string]struct { + prepare func() (*Tor, *mockTorDaemon) + wantMetrics map[string]int64 + wantCharts int + }{ + "success on valid response": { + prepare: prepareCaseOk, + wantCharts: len(charts), + wantMetrics: map[string]int64{ + "traffic/read": 100, + "traffic/written": 100, + "uptime": 100, + }, + }, + "fails on connection refused": { + prepare: prepareCaseConnectionRefused, + wantCharts: len(charts), + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + tor, daemon := test.prepare() + + defer func() { + assert.NoError(t, daemon.Close(), "daemon.Close()") + }() + go func() { + assert.NoError(t, daemon.Run(), "daemon.Run()") + }() + + select { + case <-daemon.started: + case <-time.After(time.Second * 3): + t.Errorf("mock tor daemon start timed out") + } + + require.NoError(t, tor.Init()) + + mx := tor.Collect() + + require.Equal(t, test.wantMetrics, mx) + + assert.Equal(t, test.wantCharts, len(*tor.Charts()), "want charts") + + if len(test.wantMetrics) > 0 { + module.TestMetricsHasAllChartsDims(t, tor.Charts(), mx) + } + + tor.Cleanup() + + select { + case <-daemon.stopped: + case <-time.After(time.Second * 3): + t.Errorf("mock tordaemon stop timed out") + } + }) + } +} + +func prepareCaseOk() (*Tor, *mockTorDaemon) { + daemon := &mockTorDaemon{ + addr: "127.0.0.1:65001", + started: make(chan struct{}), + stopped: make(chan struct{}), + } + + tor := New() + tor.Address = daemon.addr + + return tor, daemon +} + +func prepareCaseConnectionRefused() (*Tor, *mockTorDaemon) { + ch := make(chan struct{}) + close(ch) + + daemon := &mockTorDaemon{ + addr: "127.0.0.1:65001", + dontStart: true, + started: ch, + stopped: ch, + } + + tor := New() + tor.Address = daemon.addr + + return tor, daemon +} + +type mockTorDaemon struct { + addr string + srv net.Listener + started chan struct{} + stopped chan struct{} + dontStart bool + authenticated bool +} + +func (m *mockTorDaemon) Run() error { + if m.dontStart { + return nil + } + + srv, err := net.Listen("tcp", m.addr) + if err != nil { + return err + } + + m.srv = srv + + close(m.started) + defer close(m.stopped) + + return m.handleConnections() +} + +func (m *mockTorDaemon) Close() error { + if m.srv != nil { + err := m.srv.Close() + m.srv = nil + return err + } + return nil +} + +func (m *mockTorDaemon) handleConnections() error { + conn, err := m.srv.Accept() + if err != nil || conn == nil { + return errors.New("could not accept connection") + } + return m.handleConnection(conn) +} + +func (m *mockTorDaemon) handleConnection(conn net.Conn) error { + defer func() { _ = conn.Close() }() + + rw := bufio.NewReadWriter(bufio.NewReader(conn), bufio.NewWriter(conn)) + var line string + var err error + + for { + if line, err = rw.ReadString('\n'); err != nil { + return fmt.Errorf("error reading from connection: %v", err) + } + + line = strings.TrimSpace(line) + + cmd, param, _ := strings.Cut(line, " ") + + switch cmd { + case cmdQuit: + return m.handleQuit(conn) + case cmdAuthenticate: + err = m.handleAuthenticate(conn) + case cmdGetInfo: + err = m.handleGetInfo(conn, param) + default: + s := fmt.Sprintf("510 Unrecognized command \"%s\"\n", cmd) + _, _ = rw.WriteString(s) + return fmt.Errorf("unexpected command: %s", line) + } + + _ = rw.Flush() + + if err != nil { + return err + } + } +} + +func (m *mockTorDaemon) handleQuit(conn io.Writer) error { + _, err := conn.Write([]byte("250 closing connection\n")) + return err +} + +func (m *mockTorDaemon) handleAuthenticate(conn io.Writer) error { + m.authenticated = true + _, err := conn.Write([]byte("250 OK\n")) + return err +} + +func (m *mockTorDaemon) handleGetInfo(conn io.Writer, keywords string) error { + if !m.authenticated { + _, _ = conn.Write([]byte("514 Authentication required\n")) + return errors.New("authentication required") + } + + keywords = strings.Trim(keywords, "\"") + + for _, k := range strings.Fields(keywords) { + s := fmt.Sprintf("250-%s=%d\n", k, 100) + + if _, err := conn.Write([]byte(s)); err != nil { + return err + } + } + + _, err := conn.Write([]byte("250 OK\n")) + return err +} diff --git a/src/go/collectors/go.d.plugin/modules/traefik/README.md b/src/go/plugin/go.d/modules/traefik/README.md index da5abad2..da5abad2 120000 --- a/src/go/collectors/go.d.plugin/modules/traefik/README.md +++ b/src/go/plugin/go.d/modules/traefik/README.md diff --git a/src/go/collectors/go.d.plugin/modules/traefik/charts.go b/src/go/plugin/go.d/modules/traefik/charts.go index e4f50baf..7d67ef68 100644 --- a/src/go/collectors/go.d.plugin/modules/traefik/charts.go +++ b/src/go/plugin/go.d/modules/traefik/charts.go @@ -5,7 +5,7 @@ package traefik import ( "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) var chartTmplEntrypointRequests = module.Chart{ diff --git a/src/go/collectors/go.d.plugin/modules/traefik/collect.go b/src/go/plugin/go.d/modules/traefik/collect.go index 3ceb845e..3f255606 100644 --- a/src/go/collectors/go.d.plugin/modules/traefik/collect.go +++ b/src/go/plugin/go.d/modules/traefik/collect.go @@ -6,8 +6,8 @@ import ( "errors" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/traefik/config_schema.json b/src/go/plugin/go.d/modules/traefik/config_schema.json index f3ddc375..f027f20a 100644 --- a/src/go/collectors/go.d.plugin/modules/traefik/config_schema.json +++ b/src/go/plugin/go.d/modules/traefik/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/traefik/init.go b/src/go/plugin/go.d/modules/traefik/init.go index 99ab731e..02c1dde0 100644 --- a/src/go/collectors/go.d.plugin/modules/traefik/init.go +++ b/src/go/plugin/go.d/modules/traefik/init.go @@ -5,9 +5,9 @@ package traefik import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus/selector" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus/selector" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (t *Traefik) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/traefik/integrations/traefik.md b/src/go/plugin/go.d/modules/traefik/integrations/traefik.md index 411dd9d0..f5dc10eb 100644 --- a/src/go/collectors/go.d.plugin/modules/traefik/integrations/traefik.md +++ b/src/go/plugin/go.d/modules/traefik/integrations/traefik.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/traefik/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/traefik/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/traefik/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/traefik/metadata.yaml" sidebar_label: "Traefik" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -186,6 +186,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `traefik` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -208,4 +210,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m traefik ``` +### Getting Logs + +If you're encountering problems with the `traefik` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep traefik +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep traefik /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep traefik +``` + diff --git a/src/go/collectors/go.d.plugin/modules/traefik/metadata.yaml b/src/go/plugin/go.d/modules/traefik/metadata.yaml index 7fe182ea..7fe182ea 100644 --- a/src/go/collectors/go.d.plugin/modules/traefik/metadata.yaml +++ b/src/go/plugin/go.d/modules/traefik/metadata.yaml diff --git a/src/go/plugin/go.d/modules/traefik/testdata/config.json b/src/go/plugin/go.d/modules/traefik/testdata/config.json new file mode 100644 index 00000000..984c3ed6 --- /dev/null +++ b/src/go/plugin/go.d/modules/traefik/testdata/config.json @@ -0,0 +1,20 @@ +{ + "update_every": 123, + "url": "ok", + "body": "ok", + "method": "ok", + "headers": { + "ok": "ok" + }, + "username": "ok", + "password": "ok", + "proxy_url": "ok", + "proxy_username": "ok", + "proxy_password": "ok", + "timeout": 123.123, + "not_follow_redirects": true, + "tls_ca": "ok", + "tls_cert": "ok", + "tls_key": "ok", + "tls_skip_verify": true +} diff --git a/src/go/plugin/go.d/modules/traefik/testdata/config.yaml b/src/go/plugin/go.d/modules/traefik/testdata/config.yaml new file mode 100644 index 00000000..8558b61c --- /dev/null +++ b/src/go/plugin/go.d/modules/traefik/testdata/config.yaml @@ -0,0 +1,17 @@ +update_every: 123 +url: "ok" +body: "ok" +method: "ok" +headers: + ok: "ok" +username: "ok" +password: "ok" +proxy_url: "ok" +proxy_username: "ok" +proxy_password: "ok" +timeout: 123.123 +not_follow_redirects: yes +tls_ca: "ok" +tls_cert: "ok" +tls_key: "ok" +tls_skip_verify: yes diff --git a/src/go/collectors/go.d.plugin/modules/traefik/testdata/v2.2.1/metrics.txt b/src/go/plugin/go.d/modules/traefik/testdata/v2.2.1/metrics.txt index 947a365c..947a365c 100644 --- a/src/go/collectors/go.d.plugin/modules/traefik/testdata/v2.2.1/metrics.txt +++ b/src/go/plugin/go.d/modules/traefik/testdata/v2.2.1/metrics.txt diff --git a/src/go/collectors/go.d.plugin/modules/traefik/traefik.go b/src/go/plugin/go.d/modules/traefik/traefik.go index 6e20863c..e38ff969 100644 --- a/src/go/collectors/go.d.plugin/modules/traefik/traefik.go +++ b/src/go/plugin/go.d/modules/traefik/traefik.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/traefik/traefik_test.go b/src/go/plugin/go.d/modules/traefik/traefik_test.go index b6b77cfb..f3ef024b 100644 --- a/src/go/collectors/go.d.plugin/modules/traefik/traefik_test.go +++ b/src/go/plugin/go.d/modules/traefik/traefik_test.go @@ -8,9 +8,9 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/unbound/README.md b/src/go/plugin/go.d/modules/unbound/README.md index 5b0f42b0..5b0f42b0 120000 --- a/src/go/collectors/go.d.plugin/modules/unbound/README.md +++ b/src/go/plugin/go.d/modules/unbound/README.md diff --git a/src/go/collectors/go.d.plugin/modules/unbound/charts.go b/src/go/plugin/go.d/modules/unbound/charts.go index 0f060766..f0ac8b08 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/charts.go +++ b/src/go/plugin/go.d/modules/unbound/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "golang.org/x/text/cases" "golang.org/x/text/language" diff --git a/src/go/collectors/go.d.plugin/modules/unbound/collect.go b/src/go/plugin/go.d/modules/unbound/collect.go index 125f206a..125f206a 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/collect.go +++ b/src/go/plugin/go.d/modules/unbound/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/config.go b/src/go/plugin/go.d/modules/unbound/config/config.go index 69dc5c21..69dc5c21 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/config.go +++ b/src/go/plugin/go.d/modules/unbound/config/config.go diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/config_test.go b/src/go/plugin/go.d/modules/unbound/config/config_test.go index 0375c136..0375c136 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/config_test.go +++ b/src/go/plugin/go.d/modules/unbound/config/config_test.go diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/parse.go b/src/go/plugin/go.d/modules/unbound/config/parse.go index 99a632d5..99a632d5 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/parse.go +++ b/src/go/plugin/go.d/modules/unbound/config/parse.go diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/parse_test.go b/src/go/plugin/go.d/modules/unbound/config/parse_test.go index 72542a86..72542a86 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/parse_test.go +++ b/src/go/plugin/go.d/modules/unbound/config/parse_test.go diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/infinite_rec.conf b/src/go/plugin/go.d/modules/unbound/config/testdata/infinite_rec.conf index 904f75b3..904f75b3 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/infinite_rec.conf +++ b/src/go/plugin/go.d/modules/unbound/config/testdata/infinite_rec.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/non_existent_glob_include.conf b/src/go/plugin/go.d/modules/unbound/config/testdata/non_existent_glob_include.conf index 21620f7d..21620f7d 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/non_existent_glob_include.conf +++ b/src/go/plugin/go.d/modules/unbound/config/testdata/non_existent_glob_include.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/non_existent_include.conf b/src/go/plugin/go.d/modules/unbound/config/testdata/non_existent_include.conf index e493e35b..e493e35b 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/non_existent_include.conf +++ b/src/go/plugin/go.d/modules/unbound/config/testdata/non_existent_include.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_glob.conf b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_glob.conf index f020c580..f020c580 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_glob.conf +++ b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_glob.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_glob2.conf b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_glob2.conf index 85bd80e0..85bd80e0 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_glob2.conf +++ b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_glob2.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_glob3.conf b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_glob3.conf index f20eacf1..f20eacf1 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_glob3.conf +++ b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_glob3.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include.conf b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_include.conf index 1974f617..1974f617 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include.conf +++ b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_include.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include2.conf b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_include2.conf index c956d44d..c956d44d 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include2.conf +++ b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_include2.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include3.conf b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_include3.conf index f20eacf1..f20eacf1 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include3.conf +++ b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_include3.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include_toplevel.conf b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_include_toplevel.conf index 9e5675e1..9e5675e1 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include_toplevel.conf +++ b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_include_toplevel.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include_toplevel2.conf b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_include_toplevel2.conf index f3f69470..f3f69470 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include_toplevel2.conf +++ b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_include_toplevel2.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include_toplevel3.conf b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_include_toplevel3.conf index d30778c0..d30778c0 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config/testdata/valid_include_toplevel3.conf +++ b/src/go/plugin/go.d/modules/unbound/config/testdata/valid_include_toplevel3.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/config_schema.json b/src/go/plugin/go.d/modules/unbound/config_schema.json index 500b6016..500b6016 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/config_schema.json +++ b/src/go/plugin/go.d/modules/unbound/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/unbound/init.go b/src/go/plugin/go.d/modules/unbound/init.go index 06631540..88e5e5ab 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/init.go +++ b/src/go/plugin/go.d/modules/unbound/init.go @@ -7,9 +7,9 @@ import ( "errors" "net" - "github.com/netdata/netdata/go/go.d.plugin/modules/unbound/config" - "github.com/netdata/netdata/go/go.d.plugin/pkg/socket" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/unbound/config" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" ) func (u *Unbound) initConfig() (enabled bool) { diff --git a/src/go/collectors/go.d.plugin/modules/unbound/integrations/unbound.md b/src/go/plugin/go.d/modules/unbound/integrations/unbound.md index f934e666..df641227 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/integrations/unbound.md +++ b/src/go/plugin/go.d/modules/unbound/integrations/unbound.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/unbound/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/unbound/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/unbound/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/unbound/metadata.yaml" sidebar_label: "Unbound" learn_status: "Published" learn_rel_path: "Collecting Metrics/DNS and DHCP Servers" @@ -245,6 +245,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `unbound` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -267,4 +269,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m unbound ``` +### Getting Logs + +If you're encountering problems with the `unbound` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep unbound +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep unbound /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep unbound +``` + diff --git a/src/go/collectors/go.d.plugin/modules/unbound/metadata.yaml b/src/go/plugin/go.d/modules/unbound/metadata.yaml index ec6e6538..ec6e6538 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/metadata.yaml +++ b/src/go/plugin/go.d/modules/unbound/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/unbound/testdata/config.json b/src/go/plugin/go.d/modules/unbound/testdata/config.json index 9874de18..9874de18 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/testdata/config.json +++ b/src/go/plugin/go.d/modules/unbound/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/unbound/testdata/config.yaml b/src/go/plugin/go.d/modules/unbound/testdata/config.yaml index 68326cab..68326cab 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/unbound/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/common.txt b/src/go/plugin/go.d/modules/unbound/testdata/stats/common.txt index 7a1f91a3..7a1f91a3 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/common.txt +++ b/src/go/plugin/go.d/modules/unbound/testdata/stats/common.txt diff --git a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/extended.txt b/src/go/plugin/go.d/modules/unbound/testdata/stats/extended.txt index 578794fa..578794fa 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/extended.txt +++ b/src/go/plugin/go.d/modules/unbound/testdata/stats/extended.txt diff --git a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/cumulative/extended1.txt b/src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/cumulative/extended1.txt index 53bd7f95..53bd7f95 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/cumulative/extended1.txt +++ b/src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/cumulative/extended1.txt diff --git a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/cumulative/extended2.txt b/src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/cumulative/extended2.txt index 939ba75d..939ba75d 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/cumulative/extended2.txt +++ b/src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/cumulative/extended2.txt diff --git a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/cumulative/extended3.txt b/src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/cumulative/extended3.txt index e9448f7d..e9448f7d 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/cumulative/extended3.txt +++ b/src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/cumulative/extended3.txt diff --git a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/reset/extended1.txt b/src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/reset/extended1.txt index 8be40ecb..8be40ecb 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/reset/extended1.txt +++ b/src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/reset/extended1.txt diff --git a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/reset/extended2.txt b/src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/reset/extended2.txt index 08ff128b..08ff128b 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/reset/extended2.txt +++ b/src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/reset/extended2.txt diff --git a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/reset/extended3.txt b/src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/reset/extended3.txt index 45324bef..45324bef 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/testdata/stats/lifecycle/reset/extended3.txt +++ b/src/go/plugin/go.d/modules/unbound/testdata/stats/lifecycle/reset/extended3.txt diff --git a/src/go/collectors/go.d.plugin/modules/unbound/testdata/unbound.conf b/src/go/plugin/go.d/modules/unbound/testdata/unbound.conf index a061a347..a061a347 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/testdata/unbound.conf +++ b/src/go/plugin/go.d/modules/unbound/testdata/unbound.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/testdata/unbound_disabled.conf b/src/go/plugin/go.d/modules/unbound/testdata/unbound_disabled.conf index 1cef549f..1cef549f 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/testdata/unbound_disabled.conf +++ b/src/go/plugin/go.d/modules/unbound/testdata/unbound_disabled.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/testdata/unbound_empty.conf b/src/go/plugin/go.d/modules/unbound/testdata/unbound_empty.conf index a2d15837..a2d15837 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/testdata/unbound_empty.conf +++ b/src/go/plugin/go.d/modules/unbound/testdata/unbound_empty.conf diff --git a/src/go/collectors/go.d.plugin/modules/unbound/unbound.go b/src/go/plugin/go.d/modules/unbound/unbound.go index 7536aed3..fa071bb0 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/unbound.go +++ b/src/go/plugin/go.d/modules/unbound/unbound.go @@ -7,10 +7,10 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/socket" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/unbound/unbound_test.go b/src/go/plugin/go.d/modules/unbound/unbound_test.go index 2d24b67b..f9ed73af 100644 --- a/src/go/collectors/go.d.plugin/modules/unbound/unbound_test.go +++ b/src/go/plugin/go.d/modules/unbound/unbound_test.go @@ -11,9 +11,9 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/socket" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/upsd/README.md b/src/go/plugin/go.d/modules/upsd/README.md index 8dcef84d..8dcef84d 120000 --- a/src/go/collectors/go.d.plugin/modules/upsd/README.md +++ b/src/go/plugin/go.d/modules/upsd/README.md diff --git a/src/go/collectors/go.d.plugin/modules/upsd/charts.go b/src/go/plugin/go.d/modules/upsd/charts.go index 72bd69f4..909c111d 100644 --- a/src/go/collectors/go.d.plugin/modules/upsd/charts.go +++ b/src/go/plugin/go.d/modules/upsd/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/upsd/client.go b/src/go/plugin/go.d/modules/upsd/client.go index a1b8f288..a708bdca 100644 --- a/src/go/collectors/go.d.plugin/modules/upsd/client.go +++ b/src/go/plugin/go.d/modules/upsd/client.go @@ -8,7 +8,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/socket" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/upsd/collect.go b/src/go/plugin/go.d/modules/upsd/collect.go index 39e3d1b5..39e3d1b5 100644 --- a/src/go/collectors/go.d.plugin/modules/upsd/collect.go +++ b/src/go/plugin/go.d/modules/upsd/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/upsd/config_schema.json b/src/go/plugin/go.d/modules/upsd/config_schema.json index 564c0179..564c0179 100644 --- a/src/go/collectors/go.d.plugin/modules/upsd/config_schema.json +++ b/src/go/plugin/go.d/modules/upsd/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/upsd/integrations/ups_nut.md b/src/go/plugin/go.d/modules/upsd/integrations/ups_nut.md index c02eafc7..002617bd 100644 --- a/src/go/collectors/go.d.plugin/modules/upsd/integrations/ups_nut.md +++ b/src/go/plugin/go.d/modules/upsd/integrations/ups_nut.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/upsd/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/upsd/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/upsd/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/upsd/metadata.yaml" sidebar_label: "UPS (NUT)" learn_status: "Published" learn_rel_path: "Collecting Metrics/UPS" @@ -186,6 +186,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `upsd` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -208,4 +210,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m upsd ``` +### Getting Logs + +If you're encountering problems with the `upsd` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep upsd +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep upsd /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep upsd +``` + diff --git a/src/go/collectors/go.d.plugin/modules/upsd/metadata.yaml b/src/go/plugin/go.d/modules/upsd/metadata.yaml index 070b3385..070b3385 100644 --- a/src/go/collectors/go.d.plugin/modules/upsd/metadata.yaml +++ b/src/go/plugin/go.d/modules/upsd/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/upsd/testdata/config.json b/src/go/plugin/go.d/modules/upsd/testdata/config.json index ab7a8654..ab7a8654 100644 --- a/src/go/collectors/go.d.plugin/modules/upsd/testdata/config.json +++ b/src/go/plugin/go.d/modules/upsd/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/upsd/testdata/config.yaml b/src/go/plugin/go.d/modules/upsd/testdata/config.yaml index 27637041..27637041 100644 --- a/src/go/collectors/go.d.plugin/modules/upsd/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/upsd/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/upsd/upsd.go b/src/go/plugin/go.d/modules/upsd/upsd.go index be734bc5..752697fa 100644 --- a/src/go/collectors/go.d.plugin/modules/upsd/upsd.go +++ b/src/go/plugin/go.d/modules/upsd/upsd.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/upsd/upsd_test.go b/src/go/plugin/go.d/modules/upsd/upsd_test.go index 1dffdd0f..e654aa90 100644 --- a/src/go/collectors/go.d.plugin/modules/upsd/upsd_test.go +++ b/src/go/plugin/go.d/modules/upsd/upsd_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/upsd/variables.go b/src/go/plugin/go.d/modules/upsd/variables.go index 9792e62b..9792e62b 100644 --- a/src/go/collectors/go.d.plugin/modules/upsd/variables.go +++ b/src/go/plugin/go.d/modules/upsd/variables.go diff --git a/src/go/plugin/go.d/modules/uwsgi/README.md b/src/go/plugin/go.d/modules/uwsgi/README.md new file mode 120000 index 00000000..44b85594 --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/README.md @@ -0,0 +1 @@ +integrations/uwsgi.md
\ No newline at end of file diff --git a/src/go/plugin/go.d/modules/uwsgi/charts.go b/src/go/plugin/go.d/modules/uwsgi/charts.go new file mode 100644 index 00000000..d79b3938 --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/charts.go @@ -0,0 +1,275 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package uwsgi + +import ( + "fmt" + "strconv" + "strings" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" +) + +const ( + prioTransmittedData = module.Priority + iota + prioRequests + prioHarakiris + prioExceptions + prioRespawns + + prioWorkerTransmittedData + prioWorkerRequests + prioWorkerDeltaRequests + prioWorkerAvgRequestTime + prioWorkerHarakiris + prioWorkerExceptions + prioWorkerStatus + prioWorkerRequestHandlingStatus + prioWorkerRespawns + prioWorkerMemoryRss + prioWorkerMemoryVsz +) + +var charts = module.Charts{ + transmittedDataChart.Copy(), + requestsChart.Copy(), + harakirisChart.Copy(), + exceptionsChart.Copy(), + respawnsChart.Copy(), +} + +var ( + transmittedDataChart = module.Chart{ + ID: "transmitted_data", + Title: "UWSGI Transmitted Data", + Units: "bytes/s", + Fam: "workers", + Ctx: "uwsgi.transmitted_data", + Priority: prioTransmittedData, + Type: module.Area, + Dims: module.Dims{ + {ID: "workers_tx", Name: "tx", Algo: module.Incremental}, + }, + } + requestsChart = module.Chart{ + ID: "requests", + Title: "UWSGI Requests", + Units: "requests/s", + Fam: "workers", + Ctx: "uwsgi.requests", + Priority: prioRequests, + Dims: module.Dims{ + {ID: "workers_requests", Name: "requests", Algo: module.Incremental}, + }, + } + harakirisChart = module.Chart{ + ID: "harakiris", + Title: "UWSGI Dropped Requests", + Units: "harakiris/s", + Fam: "workers", + Ctx: "uwsgi.harakiris", + Priority: prioHarakiris, + Dims: module.Dims{ + {ID: "workers_harakiris", Name: "harakiris", Algo: module.Incremental}, + }, + } + exceptionsChart = module.Chart{ + ID: "exceptions", + Title: "UWSGI Raised Exceptions", + Units: "exceptions/s", + Fam: "workers", + Ctx: "uwsgi.exceptions", + Priority: prioExceptions, + Dims: module.Dims{ + {ID: "workers_exceptions", Name: "exceptions", Algo: module.Incremental}, + }, + } + respawnsChart = module.Chart{ + ID: "respawns", + Title: "UWSGI Respawns", + Units: "respawns/s", + Fam: "workers", + Ctx: "uwsgi.respawns", + Priority: prioRespawns, + Dims: module.Dims{ + {ID: "workers_respawns", Name: "respawns", Algo: module.Incremental}, + }, + } +) + +var workerChartsTmpl = module.Charts{ + workerTransmittedDataChartTmpl.Copy(), + workerRequestsChartTmpl.Copy(), + workerDeltaRequestsChartTmpl.Copy(), + workerAvgRequestTimeChartTmpl.Copy(), + workerHarakirisChartTmpl.Copy(), + workerExceptionsChartTmpl.Copy(), + workerStatusChartTmpl.Copy(), + workerRequestHandlingStatusChartTmpl.Copy(), + workerRespawnsChartTmpl.Copy(), + workerMemoryRssChartTmpl.Copy(), + workerMemoryVszChartTmpl.Copy(), +} + +var ( + workerTransmittedDataChartTmpl = module.Chart{ + ID: "worker_%s_transmitted_data", + Title: "UWSGI Worker Transmitted Data", + Units: "bytes/s", + Fam: "wrk transmitted data", + Ctx: "uwsgi.worker_transmitted_data", + Priority: prioWorkerTransmittedData, + Type: module.Area, + Dims: module.Dims{ + {ID: "worker_%s_tx", Name: "tx", Algo: module.Incremental}, + }, + } + workerRequestsChartTmpl = module.Chart{ + ID: "worker_%s_requests", + Title: "UWSGI Worker Requests", + Units: "requests/s", + Fam: "wrk requests", + Ctx: "uwsgi.worker_requests", + Priority: prioWorkerRequests, + Dims: module.Dims{ + {ID: "worker_%s_requests", Name: "requests", Algo: module.Incremental}, + }, + } + workerDeltaRequestsChartTmpl = module.Chart{ + ID: "worker_%s_delta_requests", + Title: "UWSGI Worker Delta Requests", + Units: "requests/s", + Fam: "wrk requests", + Ctx: "uwsgi.worker_delta_requests", + Priority: prioWorkerDeltaRequests, + Dims: module.Dims{ + {ID: "worker_%s_delta_requests", Name: "delta_requests", Algo: module.Incremental}, + }, + } + workerAvgRequestTimeChartTmpl = module.Chart{ + ID: "worker_%s_average_request_time", + Title: "UWSGI Worker Average Request Time", + Units: "milliseconds", + Fam: "wrk request time", + Ctx: "uwsgi.worker_average_request_time", + Priority: prioWorkerAvgRequestTime, + Dims: module.Dims{ + {ID: "worker_%s_average_request_time", Name: "avg"}, + }, + } + workerHarakirisChartTmpl = module.Chart{ + ID: "worker_%s_harakiris", + Title: "UWSGI Worker Dropped Requests", + Units: "harakiris/s", + Fam: "wrk harakiris", + Ctx: "uwsgi.worker_harakiris", + Priority: prioWorkerHarakiris, + Dims: module.Dims{ + {ID: "worker_%s_harakiris", Name: "harakiris", Algo: module.Incremental}, + }, + } + workerExceptionsChartTmpl = module.Chart{ + ID: "worker_%s_exceptions", + Title: "UWSGI Worker Raised Exceptions", + Units: "exceptions/s", + Fam: "wrk exceptions", + Ctx: "uwsgi.worker_exceptions", + Priority: prioWorkerExceptions, + Dims: module.Dims{ + {ID: "worker_%s_exceptions", Name: "exceptions", Algo: module.Incremental}, + }, + } + workerStatusChartTmpl = module.Chart{ + ID: "worker_%s_status", + Title: "UWSGI Worker Status", + Units: "status", + Fam: "wrk status", + Ctx: "uwsgi.status", + Priority: prioWorkerStatus, + Dims: module.Dims{ + {ID: "worker_%s_status_idle", Name: "idle"}, + {ID: "worker_%s_status_busy", Name: "busy"}, + {ID: "worker_%s_status_cheap", Name: "cheap"}, + {ID: "worker_%s_status_pause", Name: "pause"}, + {ID: "worker_%s_status_sig", Name: "sig"}, + }, + } + workerRequestHandlingStatusChartTmpl = module.Chart{ + ID: "worker_%s_request_handling_status", + Title: "UWSGI Worker Request Handling Status", + Units: "status", + Fam: "wrk status", + Ctx: "uwsgi.request_handling_status", + Priority: prioWorkerRequestHandlingStatus, + Dims: module.Dims{ + {ID: "worker_%s_request_handling_status_accepting", Name: "accepting"}, + {ID: "worker_%s_request_handling_status_not_accepting", Name: "not_accepting"}, + }, + } + workerRespawnsChartTmpl = module.Chart{ + ID: "worker_%s_respawns", + Title: "UWSGI Worker Respawns", + Units: "respawns/s", + Fam: "wrk respawns", + Ctx: "uwsgi.worker_respawns", + Priority: prioWorkerRespawns, + Dims: module.Dims{ + {ID: "worker_%s_respawns", Name: "respawns", Algo: module.Incremental}, + }, + } + workerMemoryRssChartTmpl = module.Chart{ + ID: "worker_%s_memory_rss", + Title: "UWSGI Worker Memory RSS (Resident Set Size)", + Units: "bytes", + Fam: "wrk memory", + Ctx: "uwsgi.worker_memory_rss", + Priority: prioWorkerMemoryRss, + Type: module.Area, + Dims: module.Dims{ + {ID: "worker_%s_memory_rss", Name: "rss"}, + }, + } + workerMemoryVszChartTmpl = module.Chart{ + ID: "worker_%s_memory_vsz", + Title: "UWSGI Worker Memory VSZ (Virtual Memory Size)", + Units: "bytes", + Fam: "wrk memory", + Ctx: "uwsgi.worker_memory_vsz", + Priority: prioWorkerMemoryVsz, + Type: module.Area, + Dims: module.Dims{ + {ID: "worker_%s_memory_vsz", Name: "vsz"}, + }, + } +) + +func (u *Uwsgi) addWorkerCharts(workerID int) { + charts := workerChartsTmpl.Copy() + + id := strconv.Itoa(workerID) + + for _, chart := range *charts { + chart.ID = fmt.Sprintf(chart.ID, id) + chart.Labels = []module.Label{ + {Key: "worker_id", Value: id}, + } + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf(dim.ID, id) + } + } + + if err := u.Charts().Add(*charts...); err != nil { + u.Warning(err) + } +} + +func (u *Uwsgi) removeWorkerCharts(workerID int) { + px := fmt.Sprintf("worker_%d_", workerID) + + for _, chart := range *u.Charts() { + if strings.HasPrefix(chart.ID, px) { + chart.MarkRemove() + chart.MarkNotCreated() + } + } +} diff --git a/src/go/plugin/go.d/modules/uwsgi/client.go b/src/go/plugin/go.d/modules/uwsgi/client.go new file mode 100644 index 00000000..40368074 --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/client.go @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package uwsgi + +import ( + "bytes" + "fmt" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" +) + +type uwsgiConn interface { + connect() error + disconnect() + queryStats() ([]byte, error) +} + +func newUwsgiConn(conf Config) uwsgiConn { + return &uwsgiClient{conn: socket.New(socket.Config{ + Address: conf.Address, + ConnectTimeout: conf.Timeout.Duration(), + ReadTimeout: conf.Timeout.Duration(), + WriteTimeout: conf.Timeout.Duration(), + })} +} + +type uwsgiClient struct { + conn socket.Client +} + +func (c *uwsgiClient) connect() error { + return c.conn.Connect() +} + +func (c *uwsgiClient) disconnect() { + _ = c.conn.Disconnect() +} + +func (c *uwsgiClient) queryStats() ([]byte, error) { + var b bytes.Buffer + var n int64 + var err error + const readLineLimit = 1000 * 10 + + clientErr := c.conn.Command("", func(bs []byte) bool { + b.Write(bs) + b.WriteByte('\n') + + if n++; n >= readLineLimit { + err = fmt.Errorf("read line limit exceeded %d", readLineLimit) + return false + } + // The server will close the connection when it has finished sending data. + return true + }) + if clientErr != nil { + return nil, clientErr + } + if err != nil { + return nil, err + } + + return b.Bytes(), nil +} diff --git a/src/go/plugin/go.d/modules/uwsgi/collect.go b/src/go/plugin/go.d/modules/uwsgi/collect.go new file mode 100644 index 00000000..3f440535 --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/collect.go @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package uwsgi + +import ( + "encoding/json" + "fmt" +) + +type statsResponse struct { + Workers []workerStats `json:"workers"` +} + +type workerStats struct { + ID int `json:"id"` + Accepting int64 `json:"accepting"` + Requests int64 `json:"requests"` + DeltaRequests int64 `json:"delta_requests"` + Exceptions int64 `json:"exceptions"` + HarakiriCount int64 `json:"harakiri_count"` + Status string `json:"status"` + RSS int64 `json:"rss"` + VSZ int64 `json:"vsz"` + RespawnCount int64 `json:"respawn_count"` + TX int64 `json:"tx"` + AvgRT int64 `json:"avg_rt"` +} + +func (u *Uwsgi) collect() (map[string]int64, error) { + conn, err := u.establishConn() + if err != nil { + return nil, fmt.Errorf("failed to connect: %v", err) + } + + defer conn.disconnect() + + stats, err := conn.queryStats() + if err != nil { + return nil, fmt.Errorf("failed to query stats: %v", err) + } + + mx := make(map[string]int64) + + if err := u.collectStats(mx, stats); err != nil { + return nil, err + } + + return mx, nil +} + +func (u *Uwsgi) collectStats(mx map[string]int64, stats []byte) error { + var resp statsResponse + if err := json.Unmarshal(stats, &resp); err != nil { + return fmt.Errorf("failed to json decode stats response: %v", err) + } + + // stats server returns an empty array if there are no workers + if resp.Workers == nil { + return fmt.Errorf("unexpected stats response: no workers found") + } + + seen := make(map[int]bool) + + mx["workers_tx"] = 0 + mx["workers_requests"] = 0 + mx["workers_harakiris"] = 0 + mx["workers_exceptions"] = 0 + mx["workers_respawns"] = 0 + + for _, w := range resp.Workers { + mx["workers_tx"] += w.TX + mx["workers_requests"] += w.Requests + mx["workers_harakiris"] += w.HarakiriCount + mx["workers_exceptions"] += w.Exceptions + mx["workers_respawns"] += w.RespawnCount + + seen[w.ID] = true + + if !u.seenWorkers[w.ID] { + u.seenWorkers[w.ID] = true + u.addWorkerCharts(w.ID) + } + + px := fmt.Sprintf("worker_%d_", w.ID) + + mx[px+"tx"] = w.TX + mx[px+"requests"] = w.Requests + mx[px+"delta_requests"] = w.DeltaRequests + mx[px+"average_request_time"] = w.AvgRT + mx[px+"harakiris"] = w.HarakiriCount + mx[px+"exceptions"] = w.Exceptions + mx[px+"respawns"] = w.RespawnCount + mx[px+"memory_rss"] = w.RSS + mx[px+"memory_vsz"] = w.VSZ + + for _, v := range []string{"idle", "busy", "cheap", "pause", "sig"} { + mx[px+"status_"+v] = boolToInt(w.Status == v) + } + mx[px+"request_handling_status_accepting"] = boolToInt(w.Accepting == 1) + mx[px+"request_handling_status_not_accepting"] = boolToInt(w.Accepting == 0) + } + + for id := range u.seenWorkers { + if !seen[id] { + delete(u.seenWorkers, id) + u.removeWorkerCharts(id) + } + } + + return nil +} + +func (u *Uwsgi) establishConn() (uwsgiConn, error) { + conn := u.newConn(u.Config) + + if err := conn.connect(); err != nil { + return nil, err + } + + return conn, nil +} + +func boolToInt(b bool) int64 { + if b { + return 1 + } + return 0 +} diff --git a/src/go/plugin/go.d/modules/uwsgi/config_schema.json b/src/go/plugin/go.d/modules/uwsgi/config_schema.json new file mode 100644 index 00000000..14c75043 --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/config_schema.json @@ -0,0 +1,44 @@ +{ + "jsonSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "UWSGI collector configuration.", + "type": "object", + "properties": { + "update_every": { + "title": "Update every", + "description": "Data collection interval, measured in seconds.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "address": { + "title": "Address", + "description": "The IP address and port where the UWSGI [Stats Server](https://uwsgi-docs.readthedocs.io/en/latest/StatsServer.html) listens for connections.", + "type": "string", + "default": "127.0.0.1:1717" + }, + "timeout": { + "title": "Timeout", + "description": "Timeout for establishing a connection and communication (reading and writing) in seconds.", + "type": "number", + "minimum": 0.5, + "default": 1 + } + }, + "required": [ + "address" + ], + "additionalProperties": false, + "patternProperties": { + "^name$": {} + } + }, + "uiSchema": { + "uiOptions": { + "fullPage": true + }, + "timeout": { + "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." + } + } +} diff --git a/src/go/plugin/go.d/modules/uwsgi/init.go b/src/go/plugin/go.d/modules/uwsgi/init.go new file mode 100644 index 00000000..ab599970 --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/init.go @@ -0,0 +1,3 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package uwsgi diff --git a/src/go/plugin/go.d/modules/uwsgi/integrations/uwsgi.md b/src/go/plugin/go.d/modules/uwsgi/integrations/uwsgi.md new file mode 100644 index 00000000..6fe19263 --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/integrations/uwsgi.md @@ -0,0 +1,248 @@ +<!--startmeta +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/uwsgi/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/uwsgi/metadata.yaml" +sidebar_label: "uWSGI" +learn_status: "Published" +learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" +most_popular: False +message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" +endmeta--> + +# uWSGI + + +<img src="https://netdata.cloud/img/uwsgi.svg" width="150"/> + + +Plugin: go.d.plugin +Module: uwsgi + +<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> + +## Overview + +Monitors UWSGI worker health and performance by collecting metrics like requests, transmitted data, exceptions, and harakiris. + + +It fetches [Stats Server](https://uwsgi-docs.readthedocs.io/en/latest/StatsServer.html) statistics over TCP. + + +This collector is supported on all platforms. + +This collector supports collecting metrics from multiple instances of this integration, including remote instances. + + +### Default Behavior + +#### Auto-Detection + +Automatically discovers and collects UWSGI statistics from the following default locations: + +- localhost:1717 + + +#### Limits + +The default configuration for this integration does not impose any limits on data collection. + +#### Performance Impact + +The default configuration for this integration is not expected to impose a significant performance impact on the system. + + +## Metrics + +Metrics grouped by *scope*. + +The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. + + + +### Per uWSGI instance + +These metrics refer to the entire monitored application. + +This scope has no labels. + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| uwsgi.transmitted_data | tx | bytes/s | +| uwsgi.requests | requests | requests/s | +| uwsgi.harakiris | harakiris | harakiris/s | +| uwsgi.respawns | respawns | respawns/s | + +### Per worker + +These metrics refer to the Worker process. + +Labels: + +| Label | Description | +|:-----------|:----------------| +| worker_id | Worker ID. | + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| uwsgi.worker_transmitted_data | tx | bytes/s | +| uwsgi.worker_requests | requests | requests/s | +| uwsgi.worker_delta_requests | delta_requests | requests/s | +| uwsgi.worker_average_request_time | avg | milliseconds | +| uwsgi.worker_harakiris | harakiris | harakiris/s | +| uwsgi.worker_exceptions | exceptions | exceptions/s | +| uwsgi.worker_status | idle, busy, cheap, pause, sig | status | +| uwsgi.worker_request_handling_status | accepting, not_accepting | status | +| uwsgi.worker_respawns | respawns | respawns/s | +| uwsgi.worker_memory_rss | rss | bytes | +| uwsgi.worker_memory_vsz | vsz | bytes | + + + +## Alerts + +There are no alerts configured by default for this integration. + + +## Setup + +### Prerequisites + +#### Enable the uWSGI Stats Server + +See [Stats Server](https://uwsgi-docs.readthedocs.io/en/latest/StatsServer.html) for details. + + + +### Configuration + +#### File + +The configuration file name for this integration is `go.d/uwsgi.conf`. + + +You can edit the configuration file using the `edit-config` script from the +Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory). + +```bash +cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata +sudo ./edit-config go.d/uwsgi.conf +``` +#### Options + +The following options can be defined globally: update_every, autodetection_retry. + + +<details open><summary>Config options</summary> + +| Name | Description | Default | Required | +|:----|:-----------|:-------|:--------:| +| update_every | Data collection frequency. | 1 | no | +| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no | +| address | The IP address and port where the UWSGI [Stats Server](https://uwsgi-docs.readthedocs.io/en/latest/StatsServer.html) listens for connections. | 127.0.0.1:1717 | yes | +| timeout | Connection, read, and write timeout duration in seconds. The timeout includes name resolution. | 1 | no | + +</details> + +#### Examples + +##### Basic + +A basic example configuration. + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:1717 + +``` +</details> + +##### Multi-instance + +> **Note**: When you define multiple jobs, their names must be unique. + +Collecting metrics from local and remote instances. + + +<details open><summary>Config</summary> + +```yaml +jobs: + - name: local + address: 127.0.0.1:1717 + + - name: remote + address: 203.0.113.0:1717 + +``` +</details> + + + +## Troubleshooting + +### Debug Mode + +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + +To troubleshoot issues with the `uwsgi` collector, run the `go.d.plugin` with the debug option enabled. The output +should give you clues as to why the collector isn't working. + +- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on + your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. + + ```bash + cd /usr/libexec/netdata/plugins.d/ + ``` + +- Switch to the `netdata` user. + + ```bash + sudo -u netdata -s + ``` + +- Run the `go.d.plugin` to debug the collector: + + ```bash + ./go.d.plugin -d -m uwsgi + ``` + +### Getting Logs + +If you're encountering problems with the `uwsgi` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep uwsgi +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep uwsgi /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep uwsgi +``` + + diff --git a/src/go/plugin/go.d/modules/uwsgi/metadata.yaml b/src/go/plugin/go.d/modules/uwsgi/metadata.yaml new file mode 100644 index 00000000..698d6abb --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/metadata.yaml @@ -0,0 +1,215 @@ +plugin_name: go.d.plugin +modules: + - meta: + id: collector-go.d.plugin-uwsgi + plugin_name: go.d.plugin + module_name: uwsgi + monitored_instance: + name: uWSGI + link: https://uwsgi-docs.readthedocs.io/en/latest/ + categories: + - data-collection.web-servers-and-web-proxies + icon_filename: "uwsgi.svg" + related_resources: + integrations: + list: [] + info_provided_to_referring_integrations: + description: "" + keywords: + - application server + - python + - web applications + most_popular: false + overview: + data_collection: + metrics_description: | + Monitors UWSGI worker health and performance by collecting metrics like requests, transmitted data, exceptions, and harakiris. + method_description: | + It fetches [Stats Server](https://uwsgi-docs.readthedocs.io/en/latest/StatsServer.html) statistics over TCP. + supported_platforms: + include: [] + exclude: [] + multi_instance: true + additional_permissions: + description: "" + default_behavior: + auto_detection: + description: | + Automatically discovers and collects UWSGI statistics from the following default locations: + + - localhost:1717 + limits: + description: "" + performance_impact: + description: "" + setup: + prerequisites: + list: + - title: Enable the uWSGI Stats Server + description: | + See [Stats Server](https://uwsgi-docs.readthedocs.io/en/latest/StatsServer.html) for details. + configuration: + file: + name: go.d/uwsgi.conf + options: + description: | + The following options can be defined globally: update_every, autodetection_retry. + folding: + title: Config options + enabled: true + list: + - name: update_every + description: Data collection frequency. + default_value: 1 + required: false + - name: autodetection_retry + description: Recheck interval in seconds. Zero means no recheck will be scheduled. + default_value: 0 + required: false + - name: address + description: "The IP address and port where the UWSGI [Stats Server](https://uwsgi-docs.readthedocs.io/en/latest/StatsServer.html) listens for connections." + default_value: 127.0.0.1:1717 + required: true + - name: timeout + description: Connection, read, and write timeout duration in seconds. The timeout includes name resolution. + default_value: 1 + required: false + examples: + folding: + title: Config + enabled: true + list: + - name: Basic + description: A basic example configuration. + config: | + jobs: + - name: local + address: 127.0.0.1:1717 + - name: Multi-instance + description: | + > **Note**: When you define multiple jobs, their names must be unique. + + Collecting metrics from local and remote instances. + config: | + jobs: + - name: local + address: 127.0.0.1:1717 + + - name: remote + address: 203.0.113.0:1717 + troubleshooting: + problems: + list: [] + alerts: [] + metrics: + folding: + title: Metrics + enabled: false + description: "" + availability: [] + scopes: + - name: global + description: "These metrics refer to the entire monitored application." + labels: [] + metrics: + - name: uwsgi.transmitted_data + description: UWSGI Transmitted Data + unit: "bytes/s" + chart_type: area + dimensions: + - name: tx + - name: uwsgi.requests + description: UWSGI Requests + unit: "requests/s" + chart_type: line + dimensions: + - name: requests + - name: uwsgi.harakiris + description: UWSGI Dropped Requests + unit: "harakiris/s" + chart_type: line + dimensions: + - name: harakiris + - name: uwsgi.respawns + description: UWSGI Respawns + unit: "respawns/s" + chart_type: line + dimensions: + - name: respawns + - name: worker + description: "These metrics refer to the Worker process." + labels: + - name: "worker_id" + description: Worker ID. + metrics: + - name: uwsgi.worker_transmitted_data + description: UWSGI Worker Transmitted Data + unit: "bytes/s" + chart_type: area + dimensions: + - name: tx + - name: uwsgi.worker_requests + description: UWSGI Worker Requests + unit: "requests/s" + chart_type: line + dimensions: + - name: requests + - name: uwsgi.worker_delta_requests + description: UWSGI Worker Delta Requests + unit: "requests/s" + chart_type: line + dimensions: + - name: delta_requests + - name: uwsgi.worker_average_request_time + description: UWSGI Worker Average Request Time + unit: "milliseconds" + chart_type: line + dimensions: + - name: avg + - name: uwsgi.worker_harakiris + description: UWSGI Worker Dropped Requests + unit: "harakiris/s" + chart_type: line + dimensions: + - name: harakiris + - name: uwsgi.worker_exceptions + description: UWSGI Worker Raised Exceptions + unit: "exceptions/s" + chart_type: line + dimensions: + - name: exceptions + - name: uwsgi.worker_status + description: UWSGI Worker Status + unit: "status" + chart_type: line + dimensions: + - name: idle + - name: busy + - name: cheap + - name: pause + - name: sig + - name: uwsgi.worker_request_handling_status + description: UWSGI Worker Request Handling Status + unit: "status" + chart_type: line + dimensions: + - name: accepting + - name: not_accepting + - name: uwsgi.worker_respawns + description: UWSGI Worker Respawns + unit: "respawns/s" + chart_type: line + dimensions: + - name: respawns + - name: uwsgi.worker_memory_rss + description: UWSGI Worker Memory RSS (Resident Set Size) + unit: "bytes" + chart_type: area + dimensions: + - name: rss + - name: uwsgi.worker_memory_vsz + description: UWSGI Worker Memory VSZ (Virtual Memory Size) + unit: "bytes" + chart_type: area + dimensions: + - name: vsz diff --git a/src/go/plugin/go.d/modules/uwsgi/testdata/config.json b/src/go/plugin/go.d/modules/uwsgi/testdata/config.json new file mode 100644 index 00000000..e8683472 --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/testdata/config.json @@ -0,0 +1,5 @@ +{ + "update_every": 123, + "address": "ok", + "timeout": 123.123 +} diff --git a/src/go/plugin/go.d/modules/uwsgi/testdata/config.yaml b/src/go/plugin/go.d/modules/uwsgi/testdata/config.yaml new file mode 100644 index 00000000..1b81d09e --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/testdata/config.yaml @@ -0,0 +1,3 @@ +update_every: 123 +address: "ok" +timeout: 123.123 diff --git a/src/go/plugin/go.d/modules/uwsgi/testdata/stats.json b/src/go/plugin/go.d/modules/uwsgi/testdata/stats.json new file mode 100644 index 00000000..d00a340b --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/testdata/stats.json @@ -0,0 +1,117 @@ +{ + "version": "2.1.21-debian", + "listen_queue": 1, + "listen_queue_errors": 1, + "signal_queue": 1, + "load": 1, + "pid": 859919, + "uid": 1111, + "gid": 1111, + "cwd": "/home/ilyam", + "locks": [ + { + "user 1": 1 + }, + { + "signal": 1 + }, + { + "filemon": 1 + }, + { + "timer": 1 + }, + { + "rbtimer": 1 + }, + { + "cron": 1 + }, + { + "rpc": 1 + }, + { + "snmp": 1 + } + ], + "sockets": [ + { + "name": ":3131", + "proto": "uwsgi", + "queue": 1, + "max_queue": 111, + "shared": 1, + "can_offload": 1 + } + ], + "workers": [ + { + "id": 1, + "pid": 859911, + "accepting": 1, + "requests": 1, + "delta_requests": 1, + "exceptions": 1, + "harakiri_count": 1, + "signals": 1, + "signal_queue": 1, + "status": "idle", + "rss": 1, + "vsz": 1, + "running_time": 1, + "last_spawn": 1723542786, + "respawn_count": 1, + "tx": 1, + "avg_rt": 1, + "apps": [], + "cores": [ + { + "id": 1, + "requests": 1, + "static_requests": 1, + "routed_requests": 1, + "offloaded_requests": 1, + "write_errors": 1, + "read_errors": 1, + "in_request": 1, + "vars": [], + "req_info": {} + } + ] + }, + { + "id": 2, + "pid": 859911, + "accepting": 1, + "requests": 1, + "delta_requests": 1, + "exceptions": 1, + "harakiri_count": 1, + "signals": 1, + "signal_queue": 1, + "status": "idle", + "rss": 1, + "vsz": 1, + "running_time": 1, + "last_spawn": 1723542786, + "respawn_count": 1, + "tx": 1, + "avg_rt": 1, + "apps": [], + "cores": [ + { + "id": 1, + "requests": 1, + "static_requests": 1, + "routed_requests": 1, + "offloaded_requests": 1, + "write_errors": 1, + "read_errors": 1, + "in_request": 1, + "vars": [], + "req_info": {} + } + ] + } + ] +} diff --git a/src/go/plugin/go.d/modules/uwsgi/testdata/stats_no_workers.json b/src/go/plugin/go.d/modules/uwsgi/testdata/stats_no_workers.json new file mode 100644 index 00000000..8b8c782f --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/testdata/stats_no_workers.json @@ -0,0 +1,49 @@ +{ + "version": "2.0.21-debian", + "listen_queue": 0, + "listen_queue_errors": 0, + "signal_queue": 0, + "load": 0, + "pid": 1267323, + "uid": 1001, + "gid": 1001, + "cwd": "/home/ilyam", + "locks": [ + { + "user 0": 0 + }, + { + "signal": 0 + }, + { + "filemon": 0 + }, + { + "timer": 0 + }, + { + "rbtimer": 0 + }, + { + "cron": 0 + }, + { + "rpc": 0 + }, + { + "snmp": 0 + } + ], + "sockets": [ + { + "name": ":3031", + "proto": "uwsgi", + "queue": 0, + "max_queue": 100, + "shared": 0, + "can_offload": 0 + } + ], + "workers": [ + ] +} diff --git a/src/go/plugin/go.d/modules/uwsgi/uwsgi.go b/src/go/plugin/go.d/modules/uwsgi/uwsgi.go new file mode 100644 index 00000000..7fe98503 --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/uwsgi.go @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package uwsgi + +import ( + _ "embed" + "errors" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" +) + +//go:embed "config_schema.json" +var configSchema string + +func init() { + module.Register("uwsgi", module.Creator{ + JobConfigSchema: configSchema, + Create: func() module.Module { return New() }, + Config: func() any { return &Config{} }, + }) +} + +func New() *Uwsgi { + return &Uwsgi{ + Config: Config{ + Address: "127.0.0.1:1717", + Timeout: web.Duration(time.Second * 1), + }, + newConn: newUwsgiConn, + charts: charts.Copy(), + seenWorkers: make(map[int]bool), + } +} + +type Config struct { + UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` + Address string `yaml:"address" json:"address"` + Timeout web.Duration `yaml:"timeout" json:"timeout"` +} + +type Uwsgi struct { + module.Base + Config `yaml:",inline" json:""` + + charts *module.Charts + + newConn func(Config) uwsgiConn + + seenWorkers map[int]bool +} + +func (u *Uwsgi) Configuration() any { + return u.Config +} + +func (u *Uwsgi) Init() error { + if u.Address == "" { + u.Error("config: 'address' not set") + return errors.New("address not set") + } + + return nil +} + +func (u *Uwsgi) Check() error { + mx, err := u.collect() + if err != nil { + u.Error(err) + return err + } + + if len(mx) == 0 { + return errors.New("no metrics collected") + } + + return nil +} + +func (u *Uwsgi) Charts() *module.Charts { + return u.charts +} + +func (u *Uwsgi) Collect() map[string]int64 { + mx, err := u.collect() + if err != nil { + u.Error(err) + } + + if len(mx) == 0 { + return nil + } + + return mx +} + +func (u *Uwsgi) Cleanup() {} diff --git a/src/go/plugin/go.d/modules/uwsgi/uwsgi_test.go b/src/go/plugin/go.d/modules/uwsgi/uwsgi_test.go new file mode 100644 index 00000000..900c4853 --- /dev/null +++ b/src/go/plugin/go.d/modules/uwsgi/uwsgi_test.go @@ -0,0 +1,325 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package uwsgi + +import ( + "errors" + "os" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataStats, _ = os.ReadFile("testdata/stats.json") + dataStatsNoWorkers, _ = os.ReadFile("testdata/stats_no_workers.json") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + "dataStats": dataStats, + "dataStatsNoWorkers": dataStatsNoWorkers, + } { + require.NotNil(t, data, name) + } +} + +func TestUwsgi_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &Uwsgi{}, dataConfigJSON, dataConfigYAML) +} + +func TestUwsgi_Init(t *testing.T) { + tests := map[string]struct { + config Config + wantFail bool + }{ + "success with default config": { + wantFail: false, + config: New().Config, + }, + "fails if address not set": { + wantFail: true, + config: func() Config { + conf := New().Config + conf.Address = "" + return conf + }(), + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + uw := New() + uw.Config = test.config + + if test.wantFail { + assert.Error(t, uw.Init()) + } else { + assert.NoError(t, uw.Init()) + } + }) + } +} + +func TestUwsgi_Cleanup(t *testing.T) { + tests := map[string]struct { + prepare func() *Uwsgi + }{ + "not initialized": { + prepare: func() *Uwsgi { + return New() + }, + }, + "after check": { + prepare: func() *Uwsgi { + uw := New() + uw.newConn = func(config Config) uwsgiConn { return prepareMockOk() } + _ = uw.Check() + return uw + }, + }, + "after collect": { + prepare: func() *Uwsgi { + uw := New() + uw.newConn = func(config Config) uwsgiConn { return prepareMockOk() } + _ = uw.Collect() + return uw + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + uw := test.prepare() + + assert.NotPanics(t, uw.Cleanup) + }) + } +} + +func TestUwsgi_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestUwsgi_Check(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockUwsgiConn + wantFail bool + }{ + "success case": { + wantFail: false, + prepareMock: prepareMockOk, + }, + "success case no workers": { + wantFail: false, + prepareMock: prepareMockOkNoWorkers, + }, + "err on connect": { + wantFail: true, + prepareMock: prepareMockErrOnConnect, + }, + "unexpected response": { + wantFail: true, + prepareMock: prepareMockUnexpectedResponse, + }, + "empty response": { + wantFail: true, + prepareMock: prepareMockEmptyResponse, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + uw := New() + mock := test.prepareMock() + uw.newConn = func(config Config) uwsgiConn { return mock } + + if test.wantFail { + assert.Error(t, uw.Check()) + } else { + assert.NoError(t, uw.Check()) + } + }) + } +} + +func TestUwsgi_Collect(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockUwsgiConn + wantMetrics map[string]int64 + wantCharts int + disconnectBeforeCleanup bool + disconnectAfterCleanup bool + }{ + "success case": { + prepareMock: prepareMockOk, + wantCharts: len(charts) + len(workerChartsTmpl)*2, + disconnectBeforeCleanup: true, + disconnectAfterCleanup: true, + wantMetrics: map[string]int64{ + "worker_1_average_request_time": 1, + "worker_1_delta_requests": 1, + "worker_1_exceptions": 1, + "worker_1_harakiris": 1, + "worker_1_memory_rss": 1, + "worker_1_memory_vsz": 1, + "worker_1_request_handling_status_accepting": 1, + "worker_1_request_handling_status_not_accepting": 0, + "worker_1_requests": 1, + "worker_1_respawns": 1, + "worker_1_status_busy": 0, + "worker_1_status_cheap": 0, + "worker_1_status_idle": 1, + "worker_1_status_pause": 0, + "worker_1_status_sig": 0, + "worker_1_tx": 1, + "worker_2_average_request_time": 1, + "worker_2_delta_requests": 1, + "worker_2_exceptions": 1, + "worker_2_harakiris": 1, + "worker_2_memory_rss": 1, + "worker_2_memory_vsz": 1, + "worker_2_request_handling_status_accepting": 1, + "worker_2_request_handling_status_not_accepting": 0, + "worker_2_requests": 1, + "worker_2_respawns": 1, + "worker_2_status_busy": 0, + "worker_2_status_cheap": 0, + "worker_2_status_idle": 1, + "worker_2_status_pause": 0, + "worker_2_status_sig": 0, + "worker_2_tx": 1, + "workers_exceptions": 2, + "workers_harakiris": 2, + "workers_requests": 2, + "workers_respawns": 2, + "workers_tx": 2, + }, + }, + "success case no workers": { + prepareMock: prepareMockOkNoWorkers, + wantCharts: len(charts), + wantMetrics: map[string]int64{ + "workers_exceptions": 0, + "workers_harakiris": 0, + "workers_requests": 0, + "workers_respawns": 0, + "workers_tx": 0, + }, + disconnectBeforeCleanup: true, + disconnectAfterCleanup: true, + }, + "unexpected response": { + prepareMock: prepareMockUnexpectedResponse, + wantCharts: len(charts), + disconnectBeforeCleanup: true, + disconnectAfterCleanup: true, + }, + "empty response": { + prepareMock: prepareMockEmptyResponse, + wantCharts: len(charts), + disconnectBeforeCleanup: true, + disconnectAfterCleanup: true, + }, + "err on connect": { + prepareMock: prepareMockErrOnConnect, + wantCharts: len(charts), + disconnectBeforeCleanup: false, + disconnectAfterCleanup: false, + }, + "err on query stats": { + prepareMock: prepareMockErrOnQueryStats, + wantCharts: len(charts), + disconnectBeforeCleanup: true, + disconnectAfterCleanup: true, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + uw := New() + mock := test.prepareMock() + uw.newConn = func(config Config) uwsgiConn { return mock } + + mx := uw.Collect() + + require.Equal(t, test.wantMetrics, mx) + + if len(test.wantMetrics) > 0 { + module.TestMetricsHasAllChartsDims(t, uw.Charts(), mx) + } + assert.Equal(t, test.wantCharts, len(*uw.Charts()), "want charts") + + assert.Equal(t, test.disconnectBeforeCleanup, mock.disconnectCalled, "disconnect before cleanup") + uw.Cleanup() + assert.Equal(t, test.disconnectAfterCleanup, mock.disconnectCalled, "disconnect after cleanup") + }) + } +} + +func prepareMockOk() *mockUwsgiConn { + return &mockUwsgiConn{ + statsResponse: dataStats, + } +} + +func prepareMockOkNoWorkers() *mockUwsgiConn { + return &mockUwsgiConn{ + statsResponse: dataStatsNoWorkers, + } +} + +func prepareMockErrOnConnect() *mockUwsgiConn { + return &mockUwsgiConn{ + errOnConnect: true, + } +} + +func prepareMockErrOnQueryStats() *mockUwsgiConn { + return &mockUwsgiConn{ + errOnQueryStats: true, + } +} + +func prepareMockUnexpectedResponse() *mockUwsgiConn { + return &mockUwsgiConn{ + statsResponse: []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit."), + } +} + +func prepareMockEmptyResponse() *mockUwsgiConn { + return &mockUwsgiConn{} +} + +type mockUwsgiConn struct { + errOnConnect bool + errOnQueryStats bool + statsResponse []byte + disconnectCalled bool +} + +func (m *mockUwsgiConn) connect() error { + if m.errOnConnect { + return errors.New("mock.connect() error") + } + return nil +} + +func (m *mockUwsgiConn) disconnect() { + m.disconnectCalled = true +} + +func (m *mockUwsgiConn) queryStats() ([]byte, error) { + if m.errOnQueryStats { + return nil, errors.New("mock.queryStats() error") + } + return m.statsResponse, nil +} diff --git a/src/go/collectors/go.d.plugin/modules/vcsa/README.md b/src/go/plugin/go.d/modules/vcsa/README.md index 0d00f467..0d00f467 120000 --- a/src/go/collectors/go.d.plugin/modules/vcsa/README.md +++ b/src/go/plugin/go.d/modules/vcsa/README.md diff --git a/src/go/collectors/go.d.plugin/modules/vcsa/charts.go b/src/go/plugin/go.d/modules/vcsa/charts.go index 306b6a57..8d4103a1 100644 --- a/src/go/collectors/go.d.plugin/modules/vcsa/charts.go +++ b/src/go/plugin/go.d/modules/vcsa/charts.go @@ -2,7 +2,7 @@ package vcsa -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" var ( vcsaHealthCharts = module.Charts{ diff --git a/src/go/collectors/go.d.plugin/modules/vcsa/client/client.go b/src/go/plugin/go.d/modules/vcsa/client/client.go index 64f53ff4..ea0dd161 100644 --- a/src/go/collectors/go.d.plugin/modules/vcsa/client/client.go +++ b/src/go/plugin/go.d/modules/vcsa/client/client.go @@ -9,7 +9,7 @@ import ( "net/http" "sync" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) // Session: https://vmware.github.io/vsphere-automation-sdk-rest/vsphere/index.html#SVC_com.vmware.cis.session diff --git a/src/go/collectors/go.d.plugin/modules/vcsa/client/client_test.go b/src/go/plugin/go.d/modules/vcsa/client/client_test.go index 379644b8..379644b8 100644 --- a/src/go/collectors/go.d.plugin/modules/vcsa/client/client_test.go +++ b/src/go/plugin/go.d/modules/vcsa/client/client_test.go diff --git a/src/go/collectors/go.d.plugin/modules/vcsa/collect.go b/src/go/plugin/go.d/modules/vcsa/collect.go index 8a734d9e..8a734d9e 100644 --- a/src/go/collectors/go.d.plugin/modules/vcsa/collect.go +++ b/src/go/plugin/go.d/modules/vcsa/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/vcsa/config_schema.json b/src/go/plugin/go.d/modules/vcsa/config_schema.json index 809ab97c..3302794c 100644 --- a/src/go/collectors/go.d.plugin/modules/vcsa/config_schema.json +++ b/src/go/plugin/go.d/modules/vcsa/config_schema.json @@ -170,7 +170,11 @@ "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, "username": { - "ui:placeholder": "admin@vsphere.local" + "ui:placeholder": "admin@vsphere.local", + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" }, "password": { "ui:widget": "password" diff --git a/src/go/collectors/go.d.plugin/modules/vcsa/init.go b/src/go/plugin/go.d/modules/vcsa/init.go index 11223942..20631ab4 100644 --- a/src/go/collectors/go.d.plugin/modules/vcsa/init.go +++ b/src/go/plugin/go.d/modules/vcsa/init.go @@ -5,8 +5,8 @@ package vcsa import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/modules/vcsa/client" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vcsa/client" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (vc *VCSA) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/vcsa/integrations/vcenter_server_appliance.md b/src/go/plugin/go.d/modules/vcsa/integrations/vcenter_server_appliance.md index 2fd72657..99517af3 100644 --- a/src/go/collectors/go.d.plugin/modules/vcsa/integrations/vcenter_server_appliance.md +++ b/src/go/plugin/go.d/modules/vcsa/integrations/vcenter_server_appliance.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/vcsa/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/vcsa/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/vcsa/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/vcsa/metadata.yaml" sidebar_label: "vCenter Server Appliance" learn_status: "Published" learn_rel_path: "Collecting Metrics/Containers and VMs" @@ -232,6 +232,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `vcsa` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -254,4 +256,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m vcsa ``` +### Getting Logs + +If you're encountering problems with the `vcsa` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep vcsa +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep vcsa /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep vcsa +``` + diff --git a/src/go/collectors/go.d.plugin/modules/vcsa/metadata.yaml b/src/go/plugin/go.d/modules/vcsa/metadata.yaml index d619f3d9..d619f3d9 100644 --- a/src/go/collectors/go.d.plugin/modules/vcsa/metadata.yaml +++ b/src/go/plugin/go.d/modules/vcsa/metadata.yaml diff --git a/src/go/plugin/go.d/modules/vcsa/testdata/config.json b/src/go/plugin/go.d/modules/vcsa/testdata/config.json new file mode 100644 index 00000000..984c3ed6 --- /dev/null +++ b/src/go/plugin/go.d/modules/vcsa/testdata/config.json @@ -0,0 +1,20 @@ +{ + "update_every": 123, + "url": "ok", + "body": "ok", + "method": "ok", + "headers": { + "ok": "ok" + }, + "username": "ok", + "password": "ok", + "proxy_url": "ok", + "proxy_username": "ok", + "proxy_password": "ok", + "timeout": 123.123, + "not_follow_redirects": true, + "tls_ca": "ok", + "tls_cert": "ok", + "tls_key": "ok", + "tls_skip_verify": true +} diff --git a/src/go/plugin/go.d/modules/vcsa/testdata/config.yaml b/src/go/plugin/go.d/modules/vcsa/testdata/config.yaml new file mode 100644 index 00000000..8558b61c --- /dev/null +++ b/src/go/plugin/go.d/modules/vcsa/testdata/config.yaml @@ -0,0 +1,17 @@ +update_every: 123 +url: "ok" +body: "ok" +method: "ok" +headers: + ok: "ok" +username: "ok" +password: "ok" +proxy_url: "ok" +proxy_username: "ok" +proxy_password: "ok" +timeout: 123.123 +not_follow_redirects: yes +tls_ca: "ok" +tls_cert: "ok" +tls_key: "ok" +tls_skip_verify: yes diff --git a/src/go/collectors/go.d.plugin/modules/vcsa/vcsa.go b/src/go/plugin/go.d/modules/vcsa/vcsa.go index e13503bd..aa12d7c6 100644 --- a/src/go/collectors/go.d.plugin/modules/vcsa/vcsa.go +++ b/src/go/plugin/go.d/modules/vcsa/vcsa.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/vcsa/vcsa_test.go b/src/go/plugin/go.d/modules/vcsa/vcsa_test.go index ccd65966..2c51723d 100644 --- a/src/go/collectors/go.d.plugin/modules/vcsa/vcsa_test.go +++ b/src/go/plugin/go.d/modules/vcsa/vcsa_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/README.md b/src/go/plugin/go.d/modules/vernemq/README.md index 3d984de7..3d984de7 120000 --- a/src/go/collectors/go.d.plugin/modules/vernemq/README.md +++ b/src/go/plugin/go.d/modules/vernemq/README.md diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/charts.go b/src/go/plugin/go.d/modules/vernemq/charts.go index f94be082..5d81a26b 100644 --- a/src/go/collectors/go.d.plugin/modules/vernemq/charts.go +++ b/src/go/plugin/go.d/modules/vernemq/charts.go @@ -2,7 +2,7 @@ package vernemq -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( Charts = module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/collect.go b/src/go/plugin/go.d/modules/vernemq/collect.go index 4ec6a1bf..c6fb3ecb 100644 --- a/src/go/collectors/go.d.plugin/modules/vernemq/collect.go +++ b/src/go/plugin/go.d/modules/vernemq/collect.go @@ -6,8 +6,8 @@ import ( "errors" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) func isValidVerneMQMetrics(pms prometheus.Series) bool { diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/config_schema.json b/src/go/plugin/go.d/modules/vernemq/config_schema.json index aa89d52f..092d7f41 100644 --- a/src/go/collectors/go.d.plugin/modules/vernemq/config_schema.json +++ b/src/go/plugin/go.d/modules/vernemq/config_schema.json @@ -167,6 +167,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/init.go b/src/go/plugin/go.d/modules/vernemq/init.go index 24d077fb..64ed3418 100644 --- a/src/go/collectors/go.d.plugin/modules/vernemq/init.go +++ b/src/go/plugin/go.d/modules/vernemq/init.go @@ -5,8 +5,8 @@ package vernemq import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (v *VerneMQ) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/integrations/vernemq.md b/src/go/plugin/go.d/modules/vernemq/integrations/vernemq.md index 883cec26..f3b4c287 100644 --- a/src/go/collectors/go.d.plugin/modules/vernemq/integrations/vernemq.md +++ b/src/go/plugin/go.d/modules/vernemq/integrations/vernemq.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/vernemq/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/vernemq/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/vernemq/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/vernemq/metadata.yaml" sidebar_label: "VerneMQ" learn_status: "Published" learn_rel_path: "Collecting Metrics/Message Brokers" @@ -272,6 +272,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `vernemq` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -294,4 +296,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m vernemq ``` +### Getting Logs + +If you're encountering problems with the `vernemq` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep vernemq +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep vernemq /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep vernemq +``` + diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/metadata.yaml b/src/go/plugin/go.d/modules/vernemq/metadata.yaml index 2ec25fb7..2ec25fb7 100644 --- a/src/go/collectors/go.d.plugin/modules/vernemq/metadata.yaml +++ b/src/go/plugin/go.d/modules/vernemq/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/metrics.go b/src/go/plugin/go.d/modules/vernemq/metrics.go index 863cc635..863cc635 100644 --- a/src/go/collectors/go.d.plugin/modules/vernemq/metrics.go +++ b/src/go/plugin/go.d/modules/vernemq/metrics.go diff --git a/src/go/plugin/go.d/modules/vernemq/testdata/config.json b/src/go/plugin/go.d/modules/vernemq/testdata/config.json new file mode 100644 index 00000000..984c3ed6 --- /dev/null +++ b/src/go/plugin/go.d/modules/vernemq/testdata/config.json @@ -0,0 +1,20 @@ +{ + "update_every": 123, + "url": "ok", + "body": "ok", + "method": "ok", + "headers": { + "ok": "ok" + }, + "username": "ok", + "password": "ok", + "proxy_url": "ok", + "proxy_username": "ok", + "proxy_password": "ok", + "timeout": 123.123, + "not_follow_redirects": true, + "tls_ca": "ok", + "tls_cert": "ok", + "tls_key": "ok", + "tls_skip_verify": true +} diff --git a/src/go/plugin/go.d/modules/vernemq/testdata/config.yaml b/src/go/plugin/go.d/modules/vernemq/testdata/config.yaml new file mode 100644 index 00000000..8558b61c --- /dev/null +++ b/src/go/plugin/go.d/modules/vernemq/testdata/config.yaml @@ -0,0 +1,17 @@ +update_every: 123 +url: "ok" +body: "ok" +method: "ok" +headers: + ok: "ok" +username: "ok" +password: "ok" +proxy_url: "ok" +proxy_username: "ok" +proxy_password: "ok" +timeout: 123.123 +not_follow_redirects: yes +tls_ca: "ok" +tls_cert: "ok" +tls_key: "ok" +tls_skip_verify: yes diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/testdata/metrics-v1.10.1-mqtt5.txt b/src/go/plugin/go.d/modules/vernemq/testdata/metrics-v1.10.1-mqtt5.txt index 2e98a3e9..2e98a3e9 100644 --- a/src/go/collectors/go.d.plugin/modules/vernemq/testdata/metrics-v1.10.1-mqtt5.txt +++ b/src/go/plugin/go.d/modules/vernemq/testdata/metrics-v1.10.1-mqtt5.txt diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/testdata/non_vernemq.txt b/src/go/plugin/go.d/modules/vernemq/testdata/non_vernemq.txt index f5f0ae08..f5f0ae08 100644 --- a/src/go/collectors/go.d.plugin/modules/vernemq/testdata/non_vernemq.txt +++ b/src/go/plugin/go.d/modules/vernemq/testdata/non_vernemq.txt diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/vernemq.go b/src/go/plugin/go.d/modules/vernemq/vernemq.go index d5ea9e38..2f1de38f 100644 --- a/src/go/collectors/go.d.plugin/modules/vernemq/vernemq.go +++ b/src/go/plugin/go.d/modules/vernemq/vernemq.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/vernemq_test.go b/src/go/plugin/go.d/modules/vernemq/vernemq_test.go index 74974a26..13eb3dce 100644 --- a/src/go/collectors/go.d.plugin/modules/vernemq/vernemq_test.go +++ b/src/go/plugin/go.d/modules/vernemq/vernemq_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/README.md b/src/go/plugin/go.d/modules/vsphere/README.md index 0a6b0146..0a6b0146 120000 --- a/src/go/collectors/go.d.plugin/modules/vsphere/README.md +++ b/src/go/plugin/go.d/modules/vsphere/README.md diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/charts.go b/src/go/plugin/go.d/modules/vsphere/charts.go index ed4db941..3cc21bef 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/charts.go +++ b/src/go/plugin/go.d/modules/vsphere/charts.go @@ -6,8 +6,8 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - rs "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + rs "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/client/client.go b/src/go/plugin/go.d/modules/vsphere/client/client.go index 827351cf..ba74eca9 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/client/client.go +++ b/src/go/plugin/go.d/modules/vsphere/client/client.go @@ -8,7 +8,7 @@ import ( "net/url" "time" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" "github.com/vmware/govmomi" "github.com/vmware/govmomi/performance" diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/client/client_test.go b/src/go/plugin/go.d/modules/vsphere/client/client_test.go index 163829f4..c82ce199 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/client/client_test.go +++ b/src/go/plugin/go.d/modules/vsphere/client/client_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/client/keepalive.go b/src/go/plugin/go.d/modules/vsphere/client/keepalive.go index 0ce1ef5c..0ce1ef5c 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/client/keepalive.go +++ b/src/go/plugin/go.d/modules/vsphere/client/keepalive.go diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/collect.go b/src/go/plugin/go.d/modules/vsphere/collect.go index 1aa9af9c..e5672d3f 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/collect.go +++ b/src/go/plugin/go.d/modules/vsphere/collect.go @@ -7,7 +7,7 @@ import ( "fmt" "time" - rs "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" + rs "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" "github.com/vmware/govmomi/performance" ) diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/config_schema.json b/src/go/plugin/go.d/modules/vsphere/config_schema.json index b338102c..8902e73e 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/config_schema.json +++ b/src/go/plugin/go.d/modules/vsphere/config_schema.json @@ -220,6 +220,9 @@ "method": { "ui:widget": "hidden" }, + "update_every": { + "ui:help": "**Important**: vSphere generates real-time statistics every 20 seconds. Setting this value lower won't improve data accuracy. For larger vSphere deployments, consider increasing this value to ensure complete data collection during each cycle. To find the optimal value, run the collector in debug mode and see how long it takes to collect metrics." + }, "url": { "ui:placeholder": "https://203.0.113.0" }, @@ -233,7 +236,11 @@ "ui:listFlavour": "list" }, "username": { - "ui:placeholder": "admin@vsphere.local" + "ui:placeholder": "admin@vsphere.local", + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" }, "password": { "ui:widget": "password" diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/discover.go b/src/go/plugin/go.d/modules/vsphere/discover.go index 1ea0a4d6..1ea0a4d6 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/discover.go +++ b/src/go/plugin/go.d/modules/vsphere/discover.go diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/discover/build.go b/src/go/plugin/go.d/modules/vsphere/discover/build.go index 3bf9bfb4..dbd0baab 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/discover/build.go +++ b/src/go/plugin/go.d/modules/vsphere/discover/build.go @@ -5,7 +5,7 @@ package discover import ( "time" - rs "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" + rs "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" "github.com/vmware/govmomi/vim25/mo" ) diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/discover/discover.go b/src/go/plugin/go.d/modules/vsphere/discover/discover.go index 0d68b71c..f73c58c6 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/discover/discover.go +++ b/src/go/plugin/go.d/modules/vsphere/discover/discover.go @@ -7,10 +7,10 @@ import ( "strings" "time" - "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/match" - rs "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/match" + rs "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/discover/discover_test.go b/src/go/plugin/go.d/modules/vsphere/discover/discover_test.go index 01f83fd3..9d0df607 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/discover/discover_test.go +++ b/src/go/plugin/go.d/modules/vsphere/discover/discover_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/client" - rs "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/client" + rs "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/discover/filter.go b/src/go/plugin/go.d/modules/vsphere/discover/filter.go index 73c1481e..f9fb5ba9 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/discover/filter.go +++ b/src/go/plugin/go.d/modules/vsphere/discover/filter.go @@ -5,7 +5,7 @@ package discover import ( "time" - rs "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" + rs "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" ) func (d Discoverer) matchHost(host *rs.Host) bool { diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/discover/hierarchy.go b/src/go/plugin/go.d/modules/vsphere/discover/hierarchy.go index 4cea75dc..0f84da2d 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/discover/hierarchy.go +++ b/src/go/plugin/go.d/modules/vsphere/discover/hierarchy.go @@ -5,7 +5,7 @@ package discover import ( "time" - rs "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" + rs "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" ) func (d Discoverer) setHierarchy(res *rs.Resources) error { diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/discover/metric_lists.go b/src/go/plugin/go.d/modules/vsphere/discover/metric_lists.go index 0eecb81e..03ae6d53 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/discover/metric_lists.go +++ b/src/go/plugin/go.d/modules/vsphere/discover/metric_lists.go @@ -6,7 +6,7 @@ import ( "sort" "time" - rs "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" + rs "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" "github.com/vmware/govmomi/performance" "github.com/vmware/govmomi/vim25/types" diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/init.go b/src/go/plugin/go.d/modules/vsphere/init.go index eb98e92d..e9bfc4e5 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/init.go +++ b/src/go/plugin/go.d/modules/vsphere/init.go @@ -5,9 +5,9 @@ package vsphere import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/client" - "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/discover" - "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/scrape" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/client" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/discover" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/scrape" ) func (vs *VSphere) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/integrations/vmware_vcenter_server.md b/src/go/plugin/go.d/modules/vsphere/integrations/vmware_vcenter_server.md index 6d746555..3f05eadf 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/integrations/vmware_vcenter_server.md +++ b/src/go/plugin/go.d/modules/vsphere/integrations/vmware_vcenter_server.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/vsphere/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/vsphere/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/vsphere/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/vsphere/metadata.yaml" sidebar_label: "VMware vCenter Server" learn_status: "Published" learn_rel_path: "Collecting Metrics/Containers and VMs" @@ -297,6 +297,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `vsphere` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -319,4 +321,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m vsphere ``` +### Getting Logs + +If you're encountering problems with the `vsphere` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep vsphere +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep vsphere /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep vsphere +``` + diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/match/match.go b/src/go/plugin/go.d/modules/vsphere/match/match.go index 846e6f37..969b5d7c 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/match/match.go +++ b/src/go/plugin/go.d/modules/vsphere/match/match.go @@ -6,8 +6,8 @@ import ( "fmt" "strings" - rs "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + rs "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" ) type HostMatcher interface { diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/match/match_test.go b/src/go/plugin/go.d/modules/vsphere/match/match_test.go index 6bfe9185..c1169778 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/match/match_test.go +++ b/src/go/plugin/go.d/modules/vsphere/match/match_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" "github.com/stretchr/testify/assert" ) diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/metadata.yaml b/src/go/plugin/go.d/modules/vsphere/metadata.yaml index b40c7af9..b40c7af9 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/metadata.yaml +++ b/src/go/plugin/go.d/modules/vsphere/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/metrics.txt b/src/go/plugin/go.d/modules/vsphere/metrics.txt index 30c1f55e..30c1f55e 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/metrics.txt +++ b/src/go/plugin/go.d/modules/vsphere/metrics.txt diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/resources/resources.go b/src/go/plugin/go.d/modules/vsphere/resources/resources.go index 8f967f16..8f967f16 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/resources/resources.go +++ b/src/go/plugin/go.d/modules/vsphere/resources/resources.go diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/scrape/scrape.go b/src/go/plugin/go.d/modules/vsphere/scrape/scrape.go index adda665c..ef882d73 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/scrape/scrape.go +++ b/src/go/plugin/go.d/modules/vsphere/scrape/scrape.go @@ -9,9 +9,9 @@ import ( "sync" "time" - rs "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" + rs "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" "github.com/vmware/govmomi/performance" "github.com/vmware/govmomi/vim25/types" ) diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/scrape/scrape_test.go b/src/go/plugin/go.d/modules/vsphere/scrape/scrape_test.go index 0576850f..d6232ff6 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/scrape/scrape_test.go +++ b/src/go/plugin/go.d/modules/vsphere/scrape/scrape_test.go @@ -8,10 +8,10 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/client" - "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/discover" - rs "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/client" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/discover" + rs "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/scrape/throttled_caller.go b/src/go/plugin/go.d/modules/vsphere/scrape/throttled_caller.go index 5127c28c..5127c28c 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/scrape/throttled_caller.go +++ b/src/go/plugin/go.d/modules/vsphere/scrape/throttled_caller.go diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/scrape/throttled_caller_test.go b/src/go/plugin/go.d/modules/vsphere/scrape/throttled_caller_test.go index 545ed160..545ed160 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/scrape/throttled_caller_test.go +++ b/src/go/plugin/go.d/modules/vsphere/scrape/throttled_caller_test.go diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/task.go b/src/go/plugin/go.d/modules/vsphere/task.go index 103ca1ed..103ca1ed 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/task.go +++ b/src/go/plugin/go.d/modules/vsphere/task.go diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/task_test.go b/src/go/plugin/go.d/modules/vsphere/task_test.go index ed55a28a..ed55a28a 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/task_test.go +++ b/src/go/plugin/go.d/modules/vsphere/task_test.go diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/testdata/config.json b/src/go/plugin/go.d/modules/vsphere/testdata/config.json index 3e4a7739..3e4a7739 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/testdata/config.json +++ b/src/go/plugin/go.d/modules/vsphere/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/testdata/config.yaml b/src/go/plugin/go.d/modules/vsphere/testdata/config.yaml index d15e2346..d15e2346 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/vsphere/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/vsphere/vsphere.go b/src/go/plugin/go.d/modules/vsphere/vsphere.go index 6473ac58..8df3ce6f 100644 --- a/src/go/collectors/go.d.plugin/modules/vsphere/vsphere.go +++ b/src/go/plugin/go.d/modules/vsphere/vsphere.go @@ -7,10 +7,10 @@ import ( "sync" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/match" - rs "github.com/netdata/netdata/go/go.d.plugin/modules/vsphere/resources" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/match" + rs "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/vmware/govmomi/performance" ) diff --git a/src/go/plugin/go.d/modules/vsphere/vsphere_test.go b/src/go/plugin/go.d/modules/vsphere/vsphere_test.go new file mode 100644 index 00000000..c7a91e25 --- /dev/null +++ b/src/go/plugin/go.d/modules/vsphere/vsphere_test.go @@ -0,0 +1,489 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +package vsphere + +import ( + "crypto/tls" + "os" + "strings" + "testing" + "time" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/discover" + "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/match" + rs "github.com/netdata/netdata/go/plugins/plugin/go.d/modules/vsphere/resources" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/vmware/govmomi/performance" + "github.com/vmware/govmomi/simulator" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + } { + require.NotNil(t, data, name) + } +} + +func TestVSphere_ConfigurationSerialize(t *testing.T) { + module.TestConfigurationSerialize(t, &VSphere{}, dataConfigJSON, dataConfigYAML) +} + +func TestVSphere_Init(t *testing.T) { + vSphere, _, teardown := prepareVSphereSim(t) + defer teardown() + + assert.NoError(t, vSphere.Init()) + assert.NotNil(t, vSphere.discoverer) + assert.NotNil(t, vSphere.scraper) + assert.NotNil(t, vSphere.resources) + assert.NotNil(t, vSphere.discoveryTask) + assert.True(t, vSphere.discoveryTask.isRunning()) +} + +func TestVSphere_Init_ReturnsFalseIfURLNotSet(t *testing.T) { + vSphere, _, teardown := prepareVSphereSim(t) + defer teardown() + vSphere.URL = "" + + assert.Error(t, vSphere.Init()) +} + +func TestVSphere_Init_ReturnsFalseIfUsernameNotSet(t *testing.T) { + vSphere, _, teardown := prepareVSphereSim(t) + defer teardown() + vSphere.Username = "" + + assert.Error(t, vSphere.Init()) +} + +func TestVSphere_Init_ReturnsFalseIfPasswordNotSet(t *testing.T) { + vSphere, _, teardown := prepareVSphereSim(t) + defer teardown() + vSphere.Password = "" + + assert.Error(t, vSphere.Init()) +} + +func TestVSphere_Init_ReturnsFalseIfClientWrongTLSCA(t *testing.T) { + vSphere, _, teardown := prepareVSphereSim(t) + defer teardown() + vSphere.Client.TLSConfig.TLSCA = "testdata/tls" + + assert.Error(t, vSphere.Init()) +} + +func TestVSphere_Init_ReturnsFalseIfConnectionRefused(t *testing.T) { + vSphere, _, teardown := prepareVSphereSim(t) + defer teardown() + vSphere.URL = "http://127.0.0.1:32001" + + assert.Error(t, vSphere.Init()) +} + +func TestVSphere_Init_ReturnsFalseIfInvalidHostVMIncludeFormat(t *testing.T) { + vSphere, _, teardown := prepareVSphereSim(t) + defer teardown() + + vSphere.HostsInclude = match.HostIncludes{"invalid"} + assert.Error(t, vSphere.Init()) + + vSphere.HostsInclude = vSphere.HostsInclude[:0] + + vSphere.VMsInclude = match.VMIncludes{"invalid"} + assert.Error(t, vSphere.Init()) +} + +func TestVSphere_Check(t *testing.T) { + assert.NoError(t, New().Check()) +} + +func TestVSphere_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestVSphere_Cleanup(t *testing.T) { + vSphere, _, teardown := prepareVSphereSim(t) + defer teardown() + + require.NoError(t, vSphere.Init()) + + vSphere.Cleanup() + time.Sleep(time.Second) + assert.True(t, vSphere.discoveryTask.isStopped()) + assert.False(t, vSphere.discoveryTask.isRunning()) +} + +func TestVSphere_Cleanup_NotPanicsIfNotInitialized(t *testing.T) { + assert.NotPanics(t, New().Cleanup) +} + +func TestVSphere_Collect(t *testing.T) { + vSphere, model, teardown := prepareVSphereSim(t) + defer teardown() + + require.NoError(t, vSphere.Init()) + + vSphere.scraper = mockScraper{vSphere.scraper} + + expected := map[string]int64{ + "host-22_cpu.usage.average": 100, + "host-22_disk.maxTotalLatency.latest": 100, + "host-22_disk.read.average": 100, + "host-22_disk.write.average": 100, + "host-22_mem.active.average": 100, + "host-22_mem.consumed.average": 100, + "host-22_mem.granted.average": 100, + "host-22_mem.shared.average": 100, + "host-22_mem.sharedcommon.average": 100, + "host-22_mem.swapinRate.average": 100, + "host-22_mem.swapoutRate.average": 100, + "host-22_mem.usage.average": 100, + "host-22_net.bytesRx.average": 100, + "host-22_net.bytesTx.average": 100, + "host-22_net.droppedRx.summation": 100, + "host-22_net.droppedTx.summation": 100, + "host-22_net.errorsRx.summation": 100, + "host-22_net.errorsTx.summation": 100, + "host-22_net.packetsRx.summation": 100, + "host-22_net.packetsTx.summation": 100, + "host-22_overall.status.gray": 1, + "host-22_overall.status.green": 0, + "host-22_overall.status.red": 0, + "host-22_overall.status.yellow": 0, + "host-22_sys.uptime.latest": 100, + "host-38_cpu.usage.average": 100, + "host-38_disk.maxTotalLatency.latest": 100, + "host-38_disk.read.average": 100, + "host-38_disk.write.average": 100, + "host-38_mem.active.average": 100, + "host-38_mem.consumed.average": 100, + "host-38_mem.granted.average": 100, + "host-38_mem.shared.average": 100, + "host-38_mem.sharedcommon.average": 100, + "host-38_mem.swapinRate.average": 100, + "host-38_mem.swapoutRate.average": 100, + "host-38_mem.usage.average": 100, + "host-38_net.bytesRx.average": 100, + "host-38_net.bytesTx.average": 100, + "host-38_net.droppedRx.summation": 100, + "host-38_net.droppedTx.summation": 100, + "host-38_net.errorsRx.summation": 100, + "host-38_net.errorsTx.summation": 100, + "host-38_net.packetsRx.summation": 100, + "host-38_net.packetsTx.summation": 100, + "host-38_overall.status.gray": 1, + "host-38_overall.status.green": 0, + "host-38_overall.status.red": 0, + "host-38_overall.status.yellow": 0, + "host-38_sys.uptime.latest": 100, + "host-48_cpu.usage.average": 100, + "host-48_disk.maxTotalLatency.latest": 100, + "host-48_disk.read.average": 100, + "host-48_disk.write.average": 100, + "host-48_mem.active.average": 100, + "host-48_mem.consumed.average": 100, + "host-48_mem.granted.average": 100, + "host-48_mem.shared.average": 100, + "host-48_mem.sharedcommon.average": 100, + "host-48_mem.swapinRate.average": 100, + "host-48_mem.swapoutRate.average": 100, + "host-48_mem.usage.average": 100, + "host-48_net.bytesRx.average": 100, + "host-48_net.bytesTx.average": 100, + "host-48_net.droppedRx.summation": 100, + "host-48_net.droppedTx.summation": 100, + "host-48_net.errorsRx.summation": 100, + "host-48_net.errorsTx.summation": 100, + "host-48_net.packetsRx.summation": 100, + "host-48_net.packetsTx.summation": 100, + "host-48_overall.status.gray": 1, + "host-48_overall.status.green": 0, + "host-48_overall.status.red": 0, + "host-48_overall.status.yellow": 0, + "host-48_sys.uptime.latest": 100, + "host-58_cpu.usage.average": 100, + "host-58_disk.maxTotalLatency.latest": 100, + "host-58_disk.read.average": 100, + "host-58_disk.write.average": 100, + "host-58_mem.active.average": 100, + "host-58_mem.consumed.average": 100, + "host-58_mem.granted.average": 100, + "host-58_mem.shared.average": 100, + "host-58_mem.sharedcommon.average": 100, + "host-58_mem.swapinRate.average": 100, + "host-58_mem.swapoutRate.average": 100, + "host-58_mem.usage.average": 100, + "host-58_net.bytesRx.average": 100, + "host-58_net.bytesTx.average": 100, + "host-58_net.droppedRx.summation": 100, + "host-58_net.droppedTx.summation": 100, + "host-58_net.errorsRx.summation": 100, + "host-58_net.errorsTx.summation": 100, + "host-58_net.packetsRx.summation": 100, + "host-58_net.packetsTx.summation": 100, + "host-58_overall.status.gray": 1, + "host-58_overall.status.green": 0, + "host-58_overall.status.red": 0, + "host-58_overall.status.yellow": 0, + "host-58_sys.uptime.latest": 100, + "vm-63_cpu.usage.average": 200, + "vm-63_disk.maxTotalLatency.latest": 200, + "vm-63_disk.read.average": 200, + "vm-63_disk.write.average": 200, + "vm-63_mem.active.average": 200, + "vm-63_mem.consumed.average": 200, + "vm-63_mem.granted.average": 200, + "vm-63_mem.shared.average": 200, + "vm-63_mem.swapinRate.average": 200, + "vm-63_mem.swapoutRate.average": 200, + "vm-63_mem.swapped.average": 200, + "vm-63_mem.usage.average": 200, + "vm-63_net.bytesRx.average": 200, + "vm-63_net.bytesTx.average": 200, + "vm-63_net.droppedRx.summation": 200, + "vm-63_net.droppedTx.summation": 200, + "vm-63_net.packetsRx.summation": 200, + "vm-63_net.packetsTx.summation": 200, + "vm-63_overall.status.gray": 0, + "vm-63_overall.status.green": 1, + "vm-63_overall.status.red": 0, + "vm-63_overall.status.yellow": 0, + "vm-63_sys.uptime.latest": 200, + "vm-66_cpu.usage.average": 200, + "vm-66_disk.maxTotalLatency.latest": 200, + "vm-66_disk.read.average": 200, + "vm-66_disk.write.average": 200, + "vm-66_mem.active.average": 200, + "vm-66_mem.consumed.average": 200, + "vm-66_mem.granted.average": 200, + "vm-66_mem.shared.average": 200, + "vm-66_mem.swapinRate.average": 200, + "vm-66_mem.swapoutRate.average": 200, + "vm-66_mem.swapped.average": 200, + "vm-66_mem.usage.average": 200, + "vm-66_net.bytesRx.average": 200, + "vm-66_net.bytesTx.average": 200, + "vm-66_net.droppedRx.summation": 200, + "vm-66_net.droppedTx.summation": 200, + "vm-66_net.packetsRx.summation": 200, + "vm-66_net.packetsTx.summation": 200, + "vm-66_overall.status.gray": 0, + "vm-66_overall.status.green": 1, + "vm-66_overall.status.red": 0, + "vm-66_overall.status.yellow": 0, + "vm-66_sys.uptime.latest": 200, + "vm-69_cpu.usage.average": 200, + "vm-69_disk.maxTotalLatency.latest": 200, + "vm-69_disk.read.average": 200, + "vm-69_disk.write.average": 200, + "vm-69_mem.active.average": 200, + "vm-69_mem.consumed.average": 200, + "vm-69_mem.granted.average": 200, + "vm-69_mem.shared.average": 200, + "vm-69_mem.swapinRate.average": 200, + "vm-69_mem.swapoutRate.average": 200, + "vm-69_mem.swapped.average": 200, + "vm-69_mem.usage.average": 200, + "vm-69_net.bytesRx.average": 200, + "vm-69_net.bytesTx.average": 200, + "vm-69_net.droppedRx.summation": 200, + "vm-69_net.droppedTx.summation": 200, + "vm-69_net.packetsRx.summation": 200, + "vm-69_net.packetsTx.summation": 200, + "vm-69_overall.status.gray": 0, + "vm-69_overall.status.green": 1, + "vm-69_overall.status.red": 0, + "vm-69_overall.status.yellow": 0, + "vm-69_sys.uptime.latest": 200, + "vm-72_cpu.usage.average": 200, + "vm-72_disk.maxTotalLatency.latest": 200, + "vm-72_disk.read.average": 200, + "vm-72_disk.write.average": 200, + "vm-72_mem.active.average": 200, + "vm-72_mem.consumed.average": 200, + "vm-72_mem.granted.average": 200, + "vm-72_mem.shared.average": 200, + "vm-72_mem.swapinRate.average": 200, + "vm-72_mem.swapoutRate.average": 200, + "vm-72_mem.swapped.average": 200, + "vm-72_mem.usage.average": 200, + "vm-72_net.bytesRx.average": 200, + "vm-72_net.bytesTx.average": 200, + "vm-72_net.droppedRx.summation": 200, + "vm-72_net.droppedTx.summation": 200, + "vm-72_net.packetsRx.summation": 200, + "vm-72_net.packetsTx.summation": 200, + "vm-72_overall.status.gray": 0, + "vm-72_overall.status.green": 1, + "vm-72_overall.status.red": 0, + "vm-72_overall.status.yellow": 0, + "vm-72_sys.uptime.latest": 200, + } + + collected := vSphere.Collect() + + require.Equal(t, expected, collected) + + count := model.Count() + assert.Len(t, vSphere.discoveredHosts, count.Host) + assert.Len(t, vSphere.discoveredVMs, count.Machine) + assert.Len(t, vSphere.charted, count.Host+count.Machine) + + assert.Len(t, *vSphere.Charts(), count.Host*len(hostChartsTmpl)+count.Machine*len(vmChartsTmpl)) + ensureCollectedHasAllChartsDimsVarsIDs(t, vSphere, collected) +} + +func TestVSphere_Collect_RemoveHostsVMsInRuntime(t *testing.T) { + vSphere, _, teardown := prepareVSphereSim(t) + defer teardown() + + require.NoError(t, vSphere.Init()) + require.NoError(t, vSphere.Check()) + + okHostID := "host-58" + okVMID := "vm-63" + vSphere.discoverer.(*discover.Discoverer).HostMatcher = mockHostMatcher{okHostID} + vSphere.discoverer.(*discover.Discoverer).VMMatcher = mockVMMatcher{okVMID} + + require.NoError(t, vSphere.discoverOnce()) + + numOfRuns := 5 + for i := 0; i < numOfRuns; i++ { + vSphere.Collect() + } + + host := vSphere.resources.Hosts.Get(okHostID) + for k, v := range vSphere.discoveredHosts { + if k == host.ID { + assert.Equal(t, 0, v) + } else { + assert.Equal(t, numOfRuns, v) + } + } + + vm := vSphere.resources.VMs.Get(okVMID) + for id, fails := range vSphere.discoveredVMs { + if id == vm.ID { + assert.Equal(t, 0, fails) + } else { + assert.Equal(t, numOfRuns, fails) + } + + } + + for i := numOfRuns; i < failedUpdatesLimit; i++ { + vSphere.Collect() + } + + assert.Len(t, vSphere.discoveredHosts, 1) + assert.Len(t, vSphere.discoveredVMs, 1) + assert.Len(t, vSphere.charted, 2) + + for _, c := range *vSphere.Charts() { + if strings.HasPrefix(c.ID, okHostID) || strings.HasPrefix(c.ID, okVMID) { + assert.False(t, c.Obsolete) + } else { + assert.True(t, c.Obsolete) + } + } +} + +func TestVSphere_Collect_Run(t *testing.T) { + vSphere, model, teardown := prepareVSphereSim(t) + defer teardown() + + vSphere.DiscoveryInterval = web.Duration(time.Second * 2) + require.NoError(t, vSphere.Init()) + require.NoError(t, vSphere.Check()) + + runs := 20 + for i := 0; i < runs; i++ { + assert.True(t, len(vSphere.Collect()) > 0) + if i < 6 { + time.Sleep(time.Second) + } + } + + count := model.Count() + assert.Len(t, vSphere.discoveredHosts, count.Host) + assert.Len(t, vSphere.discoveredVMs, count.Machine) + assert.Len(t, vSphere.charted, count.Host+count.Machine) + assert.Len(t, *vSphere.charts, count.Host*len(hostChartsTmpl)+count.Machine*len(vmChartsTmpl)) +} + +func ensureCollectedHasAllChartsDimsVarsIDs(t *testing.T, vSphere *VSphere, collected map[string]int64) { + for _, chart := range *vSphere.Charts() { + for _, dim := range chart.Dims { + _, ok := collected[dim.ID] + assert.Truef(t, ok, "collected metrics has no data for dim '%s' chart '%s'", dim.ID, chart.ID) + } + for _, v := range chart.Vars { + _, ok := collected[v.ID] + assert.Truef(t, ok, "collected metrics has no data for var '%s' chart '%s'", v.ID, chart.ID) + } + } +} + +func prepareVSphereSim(t *testing.T) (vSphere *VSphere, model *simulator.Model, teardown func()) { + model, srv := createSim(t) + vSphere = New() + teardown = func() { model.Remove(); srv.Close(); vSphere.Cleanup() } + + vSphere.Username = "administrator" + vSphere.Password = "password" + vSphere.URL = srv.URL.String() + vSphere.TLSConfig.InsecureSkipVerify = true + + return vSphere, model, teardown +} + +func createSim(t *testing.T) (*simulator.Model, *simulator.Server) { + model := simulator.VPX() + err := model.Create() + require.NoError(t, err) + model.Service.TLS = new(tls.Config) + return model, model.Service.NewServer() +} + +type mockScraper struct { + scraper +} + +func (s mockScraper) ScrapeHosts(hosts rs.Hosts) []performance.EntityMetric { + ms := s.scraper.ScrapeHosts(hosts) + return populateMetrics(ms, 100) +} +func (s mockScraper) ScrapeVMs(vms rs.VMs) []performance.EntityMetric { + ms := s.scraper.ScrapeVMs(vms) + return populateMetrics(ms, 200) +} + +func populateMetrics(ms []performance.EntityMetric, value int64) []performance.EntityMetric { + for i := range ms { + for ii := range ms[i].Value { + v := &ms[i].Value[ii].Value + if *v == nil { + *v = append(*v, value) + } else { + (*v)[0] = value + } + } + } + return ms +} + +type mockHostMatcher struct{ name string } +type mockVMMatcher struct{ name string } + +func (m mockHostMatcher) Match(host *rs.Host) bool { return m.name == host.ID } +func (m mockVMMatcher) Match(vm *rs.VM) bool { return m.name == vm.ID } diff --git a/src/go/collectors/go.d.plugin/modules/weblog/README.md b/src/go/plugin/go.d/modules/weblog/README.md index 9da3f21c..9da3f21c 120000 --- a/src/go/collectors/go.d.plugin/modules/weblog/README.md +++ b/src/go/plugin/go.d/modules/weblog/README.md diff --git a/src/go/collectors/go.d.plugin/modules/weblog/charts.go b/src/go/plugin/go.d/modules/weblog/charts.go index 749a26ce..c7d5a767 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/charts.go +++ b/src/go/plugin/go.d/modules/weblog/charts.go @@ -6,7 +6,7 @@ import ( "errors" "fmt" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) type ( diff --git a/src/go/collectors/go.d.plugin/modules/weblog/collect.go b/src/go/plugin/go.d/modules/weblog/collect.go index fd7993f2..8f6bceb0 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/collect.go +++ b/src/go/plugin/go.d/modules/weblog/collect.go @@ -10,10 +10,10 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/logs" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/logs" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func (w *WebLog) logPanicStackIfAny() { diff --git a/src/go/collectors/go.d.plugin/modules/weblog/config_schema.json b/src/go/plugin/go.d/modules/weblog/config_schema.json index 845eecf4..61da661a 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/config_schema.json +++ b/src/go/plugin/go.d/modules/weblog/config_schema.json @@ -71,7 +71,7 @@ }, "match": { "title": "Pattern", - "description": "The [pattern string](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme) used to match against the full original request URI.", + "description": "The [pattern string](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme) used to match against the full original request URI.", "type": "string" } }, @@ -123,7 +123,7 @@ }, "match": { "title": "Pattern", - "description": "The [pattern string](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#readme) used to match against the field value.", + "description": "The [pattern string](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#readme) used to match against the field value.", "type": "string" } }, diff --git a/src/go/collectors/go.d.plugin/modules/weblog/init.go b/src/go/plugin/go.d/modules/weblog/init.go index b456c817..c76e43f3 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/init.go +++ b/src/go/plugin/go.d/modules/weblog/init.go @@ -7,8 +7,8 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/logs" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/logs" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" ) type pattern struct { diff --git a/src/go/collectors/go.d.plugin/modules/weblog/integrations/web_server_log_files.md b/src/go/plugin/go.d/modules/weblog/integrations/web_server_log_files.md index a433c6dd..740af5f1 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/integrations/web_server_log_files.md +++ b/src/go/plugin/go.d/modules/weblog/integrations/web_server_log_files.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/weblog/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/weblog/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/weblog/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/weblog/metadata.yaml" sidebar_label: "Web server log files" learn_status: "Published" learn_rel_path: "Collecting Metrics/Web Servers and Web Proxies" @@ -216,20 +216,19 @@ Notes: | exclude_path | Path to exclude. | *.gz | no | | url_patterns | List of URL patterns. | [] | no | | url_patterns.name | Used as a dimension name. | | yes | -| url_patterns.pattern | Used to match against full original request URI. Pattern syntax in [matcher](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#supported-format). | | yes | -| parser | Log parser configuration. | | no | -| parser.log_type | Log parser type. | auto | no | -| parser.csv_config | CSV log parser config. | | no | -| parser.csv_config.delimiter | CSV field delimiter. | , | no | -| parser.csv_config.format | CSV log format. | | no | -| parser.ltsv_config | LTSV log parser config. | | no | -| parser.ltsv_config.field_delimiter | LTSV field delimiter. | \t | no | -| parser.ltsv_config.value_delimiter | LTSV value delimiter. | : | no | -| parser.ltsv_config.mapping | LTSV fields mapping to **known fields**. | | yes | -| parser.json_config | JSON log parser config. | | no | -| parser.json_config.mapping | JSON fields mapping to **known fields**. | | yes | -| parser.regexp_config | RegExp log parser config. | | no | -| parser.regexp_config.pattern | RegExp pattern with named groups. | | yes | +| url_patterns.pattern | Used to match against full original request URI. Pattern syntax in [matcher](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#supported-format). | | yes | +| log_type | Log parser type. | auto | no | +| csv_config | CSV log parser config. | | no | +| csv_config.delimiter | CSV field delimiter. | , | no | +| csv_config.format | CSV log format. | | no | +| ltsv_config | LTSV log parser config. | | no | +| ltsv_config.field_delimiter | LTSV field delimiter. | \t | no | +| ltsv_config.value_delimiter | LTSV value delimiter. | : | no | +| ltsv_config.mapping | LTSV fields mapping to **known fields**. | | yes | +| json_config | JSON log parser config. | | no | +| json_config.mapping | JSON fields mapping to **known fields**. | | yes | +| regexp_config | RegExp log parser config. | | no | +| regexp_config.pattern | RegExp pattern with named groups. | | yes | ##### url_patterns @@ -246,7 +245,7 @@ url_patterns: ``` -##### parser.log_type +##### log_type Weblog supports 5 different log parsers: @@ -261,8 +260,7 @@ Weblog supports 5 different log parsers: Syntax: ```yaml -parser: - log_type: auto +log_type: auto ``` If `log_type` parameter set to `auto` (which is default), weblog will try to auto-detect appropriate log parser and log format using the last line of the log file. @@ -287,43 +285,41 @@ If `log_type` parameter set to `auto` (which is default), weblog will try to aut If you're using the default Apache/NGINX log format, auto-detect will work for you. If it doesn't work you need to set the format manually. -##### parser.csv_config.format +##### csv_config.format -##### parser.ltsv_config.mapping +##### ltsv_config.mapping The mapping is a dictionary where the key is a field, as in logs, and the value is the corresponding **known field**. > **Note**: don't use `$` and `%` prefixes for mapped field names. ```yaml -parser: - log_type: ltsv - ltsv_config: - mapping: - label1: field1 - label2: field2 +log_type: ltsv +ltsv_config: + mapping: + label1: field1 + label2: field2 ``` -##### parser.json_config.mapping +##### json_config.mapping The mapping is a dictionary where the key is a field, as in logs, and the value is the corresponding **known field**. > **Note**: don't use `$` and `%` prefixes for mapped field names. ```yaml -parser: - log_type: json - json_config: - mapping: - label1: field1 - label2: field2 +log_type: json +json_config: + mapping: + label1: field1 + label2: field2 ``` -##### parser.regexp_config.pattern +##### regexp_config.pattern Use pattern with subexpressions names. These names should be **known fields**. @@ -332,10 +328,9 @@ Use pattern with subexpressions names. These names should be **known fields**. Syntax: ```yaml -parser: - log_type: regexp - regexp_config: - pattern: PATTERN +log_type: regexp +regexp_config: + pattern: PATTERN ``` @@ -350,6 +345,8 @@ There are no configuration examples. ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `web_log` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -372,4 +369,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m web_log ``` +### Getting Logs + +If you're encountering problems with the `web_log` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep web_log +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep web_log /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep web_log +``` + diff --git a/src/go/collectors/go.d.plugin/modules/weblog/logline.go b/src/go/plugin/go.d/modules/weblog/logline.go index 5a69593b..5a69593b 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/logline.go +++ b/src/go/plugin/go.d/modules/weblog/logline.go diff --git a/src/go/collectors/go.d.plugin/modules/weblog/logline_test.go b/src/go/plugin/go.d/modules/weblog/logline_test.go index d3055863..d3055863 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/logline_test.go +++ b/src/go/plugin/go.d/modules/weblog/logline_test.go diff --git a/src/go/collectors/go.d.plugin/modules/weblog/metadata.yaml b/src/go/plugin/go.d/modules/weblog/metadata.yaml index 1cb4820a..7608b936 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/metadata.yaml +++ b/src/go/plugin/go.d/modules/weblog/metadata.yaml @@ -124,14 +124,10 @@ modules: default_value: "" required: true - name: url_patterns.pattern - description: Used to match against full original request URI. Pattern syntax in [matcher](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/matcher#supported-format). + description: Used to match against full original request URI. Pattern syntax in [matcher](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/matcher#supported-format). default_value: "" required: true - - name: parser - description: Log parser configuration. - default_value: "" - required: false - - name: parser.log_type + - name: log_type description: Log parser type. default_value: auto required: false @@ -149,8 +145,7 @@ modules: Syntax: ```yaml - parser: - log_type: auto + log_type: auto ``` If `log_type` parameter set to `auto` (which is default), weblog will try to auto-detect appropriate log parser and log format using the last line of the log file. @@ -173,32 +168,32 @@ modules: ``` If you're using the default Apache/NGINX log format, auto-detect will work for you. If it doesn't work you need to set the format manually. - - name: parser.csv_config + - name: csv_config description: CSV log parser config. default_value: "" required: false - - name: parser.csv_config.delimiter + - name: csv_config.delimiter description: CSV field delimiter. default_value: "," required: false - - name: parser.csv_config.format + - name: csv_config.format description: CSV log format. default_value: "" required: false detailed_description: "" - - name: parser.ltsv_config + - name: ltsv_config description: LTSV log parser config. default_value: "" required: false - - name: parser.ltsv_config.field_delimiter + - name: ltsv_config.field_delimiter description: LTSV field delimiter. default_value: "\\t" required: false - - name: parser.ltsv_config.value_delimiter + - name: ltsv_config.value_delimiter description: LTSV value delimiter. default_value: ":" required: false - - name: parser.ltsv_config.mapping + - name: ltsv_config.mapping description: LTSV fields mapping to **known fields**. default_value: "" required: true @@ -208,18 +203,17 @@ modules: > **Note**: don't use `$` and `%` prefixes for mapped field names. ```yaml - parser: - log_type: ltsv - ltsv_config: - mapping: - label1: field1 - label2: field2 + log_type: ltsv + ltsv_config: + mapping: + label1: field1 + label2: field2 ``` - - name: parser.json_config + - name: json_config description: JSON log parser config. default_value: "" required: false - - name: parser.json_config.mapping + - name: json_config.mapping description: JSON fields mapping to **known fields**. default_value: "" required: true @@ -229,18 +223,17 @@ modules: > **Note**: don't use `$` and `%` prefixes for mapped field names. ```yaml - parser: - log_type: json - json_config: - mapping: - label1: field1 - label2: field2 + log_type: json + json_config: + mapping: + label1: field1 + label2: field2 ``` - - name: parser.regexp_config + - name: regexp_config description: RegExp log parser config. default_value: "" required: false - - name: parser.regexp_config.pattern + - name: regexp_config.pattern description: RegExp pattern with named groups. default_value: "" required: true @@ -252,10 +245,9 @@ modules: Syntax: ```yaml - parser: - log_type: regexp - regexp_config: - pattern: PATTERN + log_type: regexp + regexp_config: + pattern: PATTERN ``` examples: folding: diff --git a/src/go/collectors/go.d.plugin/modules/weblog/metrics.go b/src/go/plugin/go.d/modules/weblog/metrics.go index 651221a9..30618df8 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/metrics.go +++ b/src/go/plugin/go.d/modules/weblog/metrics.go @@ -3,7 +3,7 @@ package weblog import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" ) func newWebLogSummary() metrics.Summary { diff --git a/src/go/collectors/go.d.plugin/modules/weblog/parser.go b/src/go/plugin/go.d/modules/weblog/parser.go index b152e412..f765b1e0 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/parser.go +++ b/src/go/plugin/go.d/modules/weblog/parser.go @@ -8,7 +8,7 @@ import ( "regexp" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/logs" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/logs" ) /* diff --git a/src/go/collectors/go.d.plugin/modules/weblog/parser_test.go b/src/go/plugin/go.d/modules/weblog/parser_test.go index 501df22a..1ccbc020 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/parser_test.go +++ b/src/go/plugin/go.d/modules/weblog/parser_test.go @@ -6,7 +6,7 @@ import ( "fmt" "testing" - "github.com/netdata/netdata/go/go.d.plugin/pkg/logs" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/logs" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/weblog/testdata/common.log b/src/go/plugin/go.d/modules/weblog/testdata/common.log index 6860d13e..6860d13e 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/testdata/common.log +++ b/src/go/plugin/go.d/modules/weblog/testdata/common.log diff --git a/src/go/collectors/go.d.plugin/modules/weblog/testdata/config.json b/src/go/plugin/go.d/modules/weblog/testdata/config.json index 80b51736..80b51736 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/testdata/config.json +++ b/src/go/plugin/go.d/modules/weblog/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/weblog/testdata/config.yaml b/src/go/plugin/go.d/modules/weblog/testdata/config.yaml index 64f60763..64f60763 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/weblog/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/weblog/testdata/custom.log b/src/go/plugin/go.d/modules/weblog/testdata/custom.log index f2ea80bd..f2ea80bd 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/testdata/custom.log +++ b/src/go/plugin/go.d/modules/weblog/testdata/custom.log diff --git a/src/go/collectors/go.d.plugin/modules/weblog/testdata/custom_time_fields.log b/src/go/plugin/go.d/modules/weblog/testdata/custom_time_fields.log index 9d01fb9b..9d01fb9b 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/testdata/custom_time_fields.log +++ b/src/go/plugin/go.d/modules/weblog/testdata/custom_time_fields.log diff --git a/src/go/collectors/go.d.plugin/modules/weblog/testdata/full.log b/src/go/plugin/go.d/modules/weblog/testdata/full.log index 460e6212..460e6212 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/testdata/full.log +++ b/src/go/plugin/go.d/modules/weblog/testdata/full.log diff --git a/src/go/collectors/go.d.plugin/modules/weblog/testdata/u_ex221107.log b/src/go/plugin/go.d/modules/weblog/testdata/u_ex221107.log index 38fa91cd..38fa91cd 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/testdata/u_ex221107.log +++ b/src/go/plugin/go.d/modules/weblog/testdata/u_ex221107.log diff --git a/src/go/collectors/go.d.plugin/modules/weblog/weblog.go b/src/go/plugin/go.d/modules/weblog/weblog.go index 09a07cc5..242999e6 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/weblog.go +++ b/src/go/plugin/go.d/modules/weblog/weblog.go @@ -5,8 +5,8 @@ package weblog import ( _ "embed" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/logs" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/logs" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/weblog/weblog_test.go b/src/go/plugin/go.d/modules/weblog/weblog_test.go index a756b6fb..1e36bbf6 100644 --- a/src/go/collectors/go.d.plugin/modules/weblog/weblog_test.go +++ b/src/go/plugin/go.d/modules/weblog/weblog_test.go @@ -11,9 +11,9 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/logs" - "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/logs" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/whoisquery/README.md b/src/go/plugin/go.d/modules/whoisquery/README.md index 8661481d..8661481d 120000 --- a/src/go/collectors/go.d.plugin/modules/whoisquery/README.md +++ b/src/go/plugin/go.d/modules/whoisquery/README.md diff --git a/src/go/collectors/go.d.plugin/modules/whoisquery/charts.go b/src/go/plugin/go.d/modules/whoisquery/charts.go index 49c50899..c234fcc5 100644 --- a/src/go/collectors/go.d.plugin/modules/whoisquery/charts.go +++ b/src/go/plugin/go.d/modules/whoisquery/charts.go @@ -2,7 +2,7 @@ package whoisquery -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" var baseCharts = module.Charts{ { diff --git a/src/go/collectors/go.d.plugin/modules/whoisquery/collect.go b/src/go/plugin/go.d/modules/whoisquery/collect.go index 7bd8ed70..7bd8ed70 100644 --- a/src/go/collectors/go.d.plugin/modules/whoisquery/collect.go +++ b/src/go/plugin/go.d/modules/whoisquery/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/whoisquery/config_schema.json b/src/go/plugin/go.d/modules/whoisquery/config_schema.json index e59fa885..fd3ef495 100644 --- a/src/go/collectors/go.d.plugin/modules/whoisquery/config_schema.json +++ b/src/go/plugin/go.d/modules/whoisquery/config_schema.json @@ -28,14 +28,14 @@ "description": "Number of days before the alarm status is set to warning.", "type": "integer", "minimum": 1, - "default": 90 + "default": 30 }, "days_until_expiration_critical": { "title": "Days until critical", "description": "Number of days before the alarm status is set to critical.", "type": "integer", "minimum": 1, - "default": 30 + "default": 15 } }, "required": [ diff --git a/src/go/collectors/go.d.plugin/modules/whoisquery/init.go b/src/go/plugin/go.d/modules/whoisquery/init.go index d4200209..a0560b73 100644 --- a/src/go/collectors/go.d.plugin/modules/whoisquery/init.go +++ b/src/go/plugin/go.d/modules/whoisquery/init.go @@ -5,7 +5,7 @@ package whoisquery import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func (w *WhoisQuery) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/whoisquery/integrations/domain_expiration_date.md b/src/go/plugin/go.d/modules/whoisquery/integrations/domain_expiration_date.md index 727a508f..78508e96 100644 --- a/src/go/collectors/go.d.plugin/modules/whoisquery/integrations/domain_expiration_date.md +++ b/src/go/plugin/go.d/modules/whoisquery/integrations/domain_expiration_date.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/whoisquery/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/whoisquery/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/whoisquery/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/whoisquery/metadata.yaml" sidebar_label: "Domain expiration date" learn_status: "Published" learn_rel_path: "Collecting Metrics/Synthetic Checks" @@ -162,6 +162,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `whoisquery` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -184,4 +186,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m whoisquery ``` +### Getting Logs + +If you're encountering problems with the `whoisquery` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep whoisquery +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep whoisquery /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep whoisquery +``` + diff --git a/src/go/collectors/go.d.plugin/modules/whoisquery/metadata.yaml b/src/go/plugin/go.d/modules/whoisquery/metadata.yaml index eb826ebd..eb826ebd 100644 --- a/src/go/collectors/go.d.plugin/modules/whoisquery/metadata.yaml +++ b/src/go/plugin/go.d/modules/whoisquery/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/whoisquery/provider.go b/src/go/plugin/go.d/modules/whoisquery/provider.go index f6164da7..f6164da7 100644 --- a/src/go/collectors/go.d.plugin/modules/whoisquery/provider.go +++ b/src/go/plugin/go.d/modules/whoisquery/provider.go diff --git a/src/go/collectors/go.d.plugin/modules/whoisquery/testdata/config.json b/src/go/plugin/go.d/modules/whoisquery/testdata/config.json index e633bd4e..e633bd4e 100644 --- a/src/go/collectors/go.d.plugin/modules/whoisquery/testdata/config.json +++ b/src/go/plugin/go.d/modules/whoisquery/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/whoisquery/testdata/config.yaml b/src/go/plugin/go.d/modules/whoisquery/testdata/config.yaml index ad4c501c..ad4c501c 100644 --- a/src/go/collectors/go.d.plugin/modules/whoisquery/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/whoisquery/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/whoisquery/whoisquery.go b/src/go/plugin/go.d/modules/whoisquery/whoisquery.go index 1982f910..1f59779b 100644 --- a/src/go/collectors/go.d.plugin/modules/whoisquery/whoisquery.go +++ b/src/go/plugin/go.d/modules/whoisquery/whoisquery.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/whoisquery/whoisquery_test.go b/src/go/plugin/go.d/modules/whoisquery/whoisquery_test.go index 59ec659b..4979c7f5 100644 --- a/src/go/collectors/go.d.plugin/modules/whoisquery/whoisquery_test.go +++ b/src/go/plugin/go.d/modules/whoisquery/whoisquery_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/windows/README.md b/src/go/plugin/go.d/modules/windows/README.md index 802d61bd..802d61bd 120000 --- a/src/go/collectors/go.d.plugin/modules/windows/README.md +++ b/src/go/plugin/go.d/modules/windows/README.md diff --git a/src/go/collectors/go.d.plugin/modules/windows/charts.go b/src/go/plugin/go.d/modules/windows/charts.go index 8ed5848c..cedc33fa 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/charts.go +++ b/src/go/plugin/go.d/modules/windows/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect.go b/src/go/plugin/go.d/modules/windows/collect.go index b20b08c2..22421e22 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect.go +++ b/src/go/plugin/go.d/modules/windows/collect.go @@ -3,7 +3,7 @@ package windows import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const precision = 1000 diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_ad.go b/src/go/plugin/go.d/modules/windows/collect_ad.go index 3c07a911..5a99ce5c 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_ad.go +++ b/src/go/plugin/go.d/modules/windows/collect_ad.go @@ -2,7 +2,7 @@ package windows -import "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" // Windows exporter: // https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.ad.md diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_adcs.go b/src/go/plugin/go.d/modules/windows/collect_adcs.go index 0142fcb9..115eddee 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_adcs.go +++ b/src/go/plugin/go.d/modules/windows/collect_adcs.go @@ -5,7 +5,7 @@ package windows import ( "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_adfs.go b/src/go/plugin/go.d/modules/windows/collect_adfs.go index 4ce0717b..1802a609 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_adfs.go +++ b/src/go/plugin/go.d/modules/windows/collect_adfs.go @@ -5,7 +5,7 @@ package windows import ( "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_collector.go b/src/go/plugin/go.d/modules/windows/collect_collector.go index 6950ff57..f182b9af 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_collector.go +++ b/src/go/plugin/go.d/modules/windows/collect_collector.go @@ -3,7 +3,7 @@ package windows import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_cpu.go b/src/go/plugin/go.d/modules/windows/collect_cpu.go index fc1412e3..6a324e5e 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_cpu.go +++ b/src/go/plugin/go.d/modules/windows/collect_cpu.go @@ -3,7 +3,7 @@ package windows import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_exchange.go b/src/go/plugin/go.d/modules/windows/collect_exchange.go index 040bae1e..bbbbfd53 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_exchange.go +++ b/src/go/plugin/go.d/modules/windows/collect_exchange.go @@ -5,7 +5,7 @@ package windows import ( "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_hyperv.go b/src/go/plugin/go.d/modules/windows/collect_hyperv.go index 8fecbf8f..f7cf2c60 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_hyperv.go +++ b/src/go/plugin/go.d/modules/windows/collect_hyperv.go @@ -5,7 +5,7 @@ package windows import ( "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_iis.go b/src/go/plugin/go.d/modules/windows/collect_iis.go index 3b15b6e8..5218e64e 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_iis.go +++ b/src/go/plugin/go.d/modules/windows/collect_iis.go @@ -5,7 +5,7 @@ package windows import ( "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_logical_disk.go b/src/go/plugin/go.d/modules/windows/collect_logical_disk.go index 9f5dab15..0db52f8c 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_logical_disk.go +++ b/src/go/plugin/go.d/modules/windows/collect_logical_disk.go @@ -5,7 +5,7 @@ package windows import ( "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_logon.go b/src/go/plugin/go.d/modules/windows/collect_logon.go index a4e14d10..7db0024c 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_logon.go +++ b/src/go/plugin/go.d/modules/windows/collect_logon.go @@ -3,7 +3,7 @@ package windows import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_memory.go b/src/go/plugin/go.d/modules/windows/collect_memory.go index 5b4ed191..36123e4d 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_memory.go +++ b/src/go/plugin/go.d/modules/windows/collect_memory.go @@ -3,7 +3,7 @@ package windows import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_mssql.go b/src/go/plugin/go.d/modules/windows/collect_mssql.go index 53d88f57..2a6078f2 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_mssql.go +++ b/src/go/plugin/go.d/modules/windows/collect_mssql.go @@ -5,7 +5,7 @@ package windows import ( "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_net.go b/src/go/plugin/go.d/modules/windows/collect_net.go index e72bf646..4fe5dd7d 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_net.go +++ b/src/go/plugin/go.d/modules/windows/collect_net.go @@ -5,7 +5,7 @@ package windows import ( "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_netframework.go b/src/go/plugin/go.d/modules/windows/collect_netframework.go index 84012f71..aab9364d 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_netframework.go +++ b/src/go/plugin/go.d/modules/windows/collect_netframework.go @@ -3,7 +3,7 @@ package windows import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_os.go b/src/go/plugin/go.d/modules/windows/collect_os.go index 17617f48..99113e97 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_os.go +++ b/src/go/plugin/go.d/modules/windows/collect_os.go @@ -3,7 +3,7 @@ package windows import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_process.go b/src/go/plugin/go.d/modules/windows/collect_process.go index b1c729f3..373db6c0 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_process.go +++ b/src/go/plugin/go.d/modules/windows/collect_process.go @@ -5,7 +5,7 @@ package windows import ( "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_service.go b/src/go/plugin/go.d/modules/windows/collect_service.go index fb58128e..c6d77c99 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_service.go +++ b/src/go/plugin/go.d/modules/windows/collect_service.go @@ -5,7 +5,7 @@ package windows import ( "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_system.go b/src/go/plugin/go.d/modules/windows/collect_system.go index 5f0bc913..8758e847 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_system.go +++ b/src/go/plugin/go.d/modules/windows/collect_system.go @@ -5,7 +5,7 @@ package windows import ( "time" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_tcp.go b/src/go/plugin/go.d/modules/windows/collect_tcp.go index 20c8f8df..7b462183 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_tcp.go +++ b/src/go/plugin/go.d/modules/windows/collect_tcp.go @@ -2,7 +2,7 @@ package windows -import "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" const ( metricTCPConnectionFailure = "windows_tcp_connection_failures_total" diff --git a/src/go/collectors/go.d.plugin/modules/windows/collect_thermalzone.go b/src/go/plugin/go.d/modules/windows/collect_thermalzone.go index 578ebef9..6dccb9fe 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/collect_thermalzone.go +++ b/src/go/plugin/go.d/modules/windows/collect_thermalzone.go @@ -5,7 +5,7 @@ package windows import ( "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/windows/config_schema.json b/src/go/plugin/go.d/modules/windows/config_schema.json index c112abe6..e1011e87 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/config_schema.json +++ b/src/go/plugin/go.d/modules/windows/config_schema.json @@ -174,6 +174,12 @@ "timeout": { "ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)." }, + "username": { + "ui:widget": "password" + }, + "proxy_username": { + "ui:widget": "password" + }, "password": { "ui:widget": "password" }, diff --git a/src/go/collectors/go.d.plugin/modules/windows/init.go b/src/go/plugin/go.d/modules/windows/init.go index 1e9a6a4e..87faf40b 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/init.go +++ b/src/go/plugin/go.d/modules/windows/init.go @@ -5,8 +5,8 @@ package windows import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) func (w *Windows) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/windows/integrations/active_directory.md b/src/go/plugin/go.d/modules/windows/integrations/active_directory.md index 4449fa94..6d255aba 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/integrations/active_directory.md +++ b/src/go/plugin/go.d/modules/windows/integrations/active_directory.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/windows/integrations/active_directory.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/windows/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/windows/integrations/active_directory.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/windows/metadata.yaml" sidebar_label: "Active Directory" learn_status: "Published" learn_rel_path: "Collecting Metrics/Windows Systems" @@ -783,6 +783,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `windows` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -805,4 +807,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m windows ``` +### Getting Logs + +If you're encountering problems with the `windows` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep windows +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep windows /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep windows +``` + diff --git a/src/go/collectors/go.d.plugin/modules/windows/integrations/hyperv.md b/src/go/plugin/go.d/modules/windows/integrations/hyperv.md index 3af02fb8..42e4f308 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/integrations/hyperv.md +++ b/src/go/plugin/go.d/modules/windows/integrations/hyperv.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/windows/integrations/hyperv.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/windows/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/windows/integrations/hyperv.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/windows/metadata.yaml" sidebar_label: "HyperV" learn_status: "Published" learn_rel_path: "Collecting Metrics/Windows Systems" @@ -783,6 +783,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `windows` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -805,4 +807,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m windows ``` +### Getting Logs + +If you're encountering problems with the `windows` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep windows +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep windows /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep windows +``` + diff --git a/src/go/collectors/go.d.plugin/modules/windows/integrations/ms_exchange.md b/src/go/plugin/go.d/modules/windows/integrations/ms_exchange.md index 740f68de..24d41602 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/integrations/ms_exchange.md +++ b/src/go/plugin/go.d/modules/windows/integrations/ms_exchange.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/windows/integrations/ms_exchange.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/windows/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/windows/integrations/ms_exchange.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/windows/metadata.yaml" sidebar_label: "MS Exchange" learn_status: "Published" learn_rel_path: "Collecting Metrics/Windows Systems" @@ -783,6 +783,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `windows` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -805,4 +807,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m windows ``` +### Getting Logs + +If you're encountering problems with the `windows` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep windows +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep windows /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep windows +``` + diff --git a/src/go/collectors/go.d.plugin/modules/windows/integrations/ms_sql_server.md b/src/go/plugin/go.d/modules/windows/integrations/ms_sql_server.md index f12ae825..1dd59c30 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/integrations/ms_sql_server.md +++ b/src/go/plugin/go.d/modules/windows/integrations/ms_sql_server.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/windows/integrations/ms_sql_server.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/windows/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/windows/integrations/ms_sql_server.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/windows/metadata.yaml" sidebar_label: "MS SQL Server" learn_status: "Published" learn_rel_path: "Collecting Metrics/Windows Systems" @@ -783,6 +783,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `windows` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -805,4 +807,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m windows ``` +### Getting Logs + +If you're encountering problems with the `windows` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep windows +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep windows /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep windows +``` + diff --git a/src/go/collectors/go.d.plugin/modules/windows/integrations/net_framework.md b/src/go/plugin/go.d/modules/windows/integrations/net_framework.md index 94262b16..01879dde 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/integrations/net_framework.md +++ b/src/go/plugin/go.d/modules/windows/integrations/net_framework.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/windows/integrations/net_framework.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/windows/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/windows/integrations/net_framework.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/windows/metadata.yaml" sidebar_label: "NET Framework" learn_status: "Published" learn_rel_path: "Collecting Metrics/Windows Systems" @@ -783,6 +783,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `windows` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -805,4 +807,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m windows ``` +### Getting Logs + +If you're encountering problems with the `windows` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep windows +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep windows /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep windows +``` + diff --git a/src/go/collectors/go.d.plugin/modules/windows/integrations/windows.md b/src/go/plugin/go.d/modules/windows/integrations/windows.md index 7c821585..60a3b7f3 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/integrations/windows.md +++ b/src/go/plugin/go.d/modules/windows/integrations/windows.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/windows/integrations/windows.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/windows/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/windows/integrations/windows.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/windows/metadata.yaml" sidebar_label: "Windows" learn_status: "Published" learn_rel_path: "Collecting Metrics/Windows Systems" @@ -783,6 +783,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `windows` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -805,4 +807,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m windows ``` +### Getting Logs + +If you're encountering problems with the `windows` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep windows +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep windows /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep windows +``` + diff --git a/src/go/collectors/go.d.plugin/modules/windows/metadata.yaml b/src/go/plugin/go.d/modules/windows/metadata.yaml index 87ac4cf6..87ac4cf6 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/metadata.yaml +++ b/src/go/plugin/go.d/modules/windows/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/windows/testdata/config.json b/src/go/plugin/go.d/modules/windows/testdata/config.json index 6f8c1084..6f8c1084 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/testdata/config.json +++ b/src/go/plugin/go.d/modules/windows/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/windows/testdata/config.yaml b/src/go/plugin/go.d/modules/windows/testdata/config.yaml index 4bbb7474..4bbb7474 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/windows/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/windows/testdata/v0.20.0/metrics.txt b/src/go/plugin/go.d/modules/windows/testdata/v0.20.0/metrics.txt index 02b68c3f..02b68c3f 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/testdata/v0.20.0/metrics.txt +++ b/src/go/plugin/go.d/modules/windows/testdata/v0.20.0/metrics.txt diff --git a/src/go/collectors/go.d.plugin/modules/windows/windows.go b/src/go/plugin/go.d/modules/windows/windows.go index 99bfecf1..55599078 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/windows.go +++ b/src/go/plugin/go.d/modules/windows/windows.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/windows/windows_test.go b/src/go/plugin/go.d/modules/windows/windows_test.go index 6322b098..05295024 100644 --- a/src/go/collectors/go.d.plugin/modules/windows/windows_test.go +++ b/src/go/plugin/go.d/modules/windows/windows_test.go @@ -10,8 +10,8 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/wireguard/README.md b/src/go/plugin/go.d/modules/wireguard/README.md index 389e494d..389e494d 120000 --- a/src/go/collectors/go.d.plugin/modules/wireguard/README.md +++ b/src/go/plugin/go.d/modules/wireguard/README.md diff --git a/src/go/collectors/go.d.plugin/modules/wireguard/charts.go b/src/go/plugin/go.d/modules/wireguard/charts.go index fe7f89e9..c2defa9b 100644 --- a/src/go/collectors/go.d.plugin/modules/wireguard/charts.go +++ b/src/go/plugin/go.d/modules/wireguard/charts.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( diff --git a/src/go/collectors/go.d.plugin/modules/wireguard/collect.go b/src/go/plugin/go.d/modules/wireguard/collect.go index cbcc180e..cbcc180e 100644 --- a/src/go/collectors/go.d.plugin/modules/wireguard/collect.go +++ b/src/go/plugin/go.d/modules/wireguard/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/wireguard/config_schema.json b/src/go/plugin/go.d/modules/wireguard/config_schema.json index 5ff8ff71..5ff8ff71 100644 --- a/src/go/collectors/go.d.plugin/modules/wireguard/config_schema.json +++ b/src/go/plugin/go.d/modules/wireguard/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/wireguard/integrations/wireguard.md b/src/go/plugin/go.d/modules/wireguard/integrations/wireguard.md index 11ff605b..2460cc83 100644 --- a/src/go/collectors/go.d.plugin/modules/wireguard/integrations/wireguard.md +++ b/src/go/plugin/go.d/modules/wireguard/integrations/wireguard.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/wireguard/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/wireguard/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/wireguard/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/wireguard/metadata.yaml" sidebar_label: "WireGuard" learn_status: "Published" learn_rel_path: "Collecting Metrics/VPNs" @@ -144,6 +144,8 @@ There are no configuration examples. ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `wireguard` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -166,4 +168,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m wireguard ``` +### Getting Logs + +If you're encountering problems with the `wireguard` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep wireguard +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep wireguard /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep wireguard +``` + diff --git a/src/go/collectors/go.d.plugin/modules/wireguard/metadata.yaml b/src/go/plugin/go.d/modules/wireguard/metadata.yaml index 0ac680d5..0ac680d5 100644 --- a/src/go/collectors/go.d.plugin/modules/wireguard/metadata.yaml +++ b/src/go/plugin/go.d/modules/wireguard/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/wireguard/testdata/config.json b/src/go/plugin/go.d/modules/wireguard/testdata/config.json index 0e3f7c40..0e3f7c40 100644 --- a/src/go/collectors/go.d.plugin/modules/wireguard/testdata/config.json +++ b/src/go/plugin/go.d/modules/wireguard/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/wireguard/testdata/config.yaml b/src/go/plugin/go.d/modules/wireguard/testdata/config.yaml index f21a3a7a..f21a3a7a 100644 --- a/src/go/collectors/go.d.plugin/modules/wireguard/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/wireguard/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/wireguard/wireguard.go b/src/go/plugin/go.d/modules/wireguard/wireguard.go index 59d3a5bc..fdd42e19 100644 --- a/src/go/collectors/go.d.plugin/modules/wireguard/wireguard.go +++ b/src/go/plugin/go.d/modules/wireguard/wireguard.go @@ -7,7 +7,7 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "golang.zx2c4.com/wireguard/wgctrl" "golang.zx2c4.com/wireguard/wgctrl/wgtypes" diff --git a/src/go/collectors/go.d.plugin/modules/wireguard/wireguard_test.go b/src/go/plugin/go.d/modules/wireguard/wireguard_test.go index 6f13d337..c9d27cbd 100644 --- a/src/go/collectors/go.d.plugin/modules/wireguard/wireguard_test.go +++ b/src/go/plugin/go.d/modules/wireguard/wireguard_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/x509check/README.md b/src/go/plugin/go.d/modules/x509check/README.md index 28978ccf..28978ccf 120000 --- a/src/go/collectors/go.d.plugin/modules/x509check/README.md +++ b/src/go/plugin/go.d/modules/x509check/README.md diff --git a/src/go/collectors/go.d.plugin/modules/x509check/charts.go b/src/go/plugin/go.d/modules/x509check/charts.go index 2a497dfe..5105c6d1 100644 --- a/src/go/collectors/go.d.plugin/modules/x509check/charts.go +++ b/src/go/plugin/go.d/modules/x509check/charts.go @@ -2,7 +2,7 @@ package x509check -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" var ( baseCharts = module.Charts{ @@ -36,6 +36,7 @@ var ( Ctx: "x509check.revocation_status", Opts: module.Opts{StoreFirst: true}, Dims: module.Dims{ + {ID: "not_revoked"}, {ID: "revoked"}, }, } diff --git a/src/go/collectors/go.d.plugin/modules/x509check/collect.go b/src/go/plugin/go.d/modules/x509check/collect.go index 3b5eebdb..fc98e3a2 100644 --- a/src/go/collectors/go.d.plugin/modules/x509check/collect.go +++ b/src/go/plugin/go.d/modules/x509check/collect.go @@ -46,9 +46,13 @@ func (x *X509Check) collectRevocation(mx map[string]int64, certs []*x509.Certifi if !ok { return } + + mx["revoked"] = 0 + mx["not_revoked"] = 0 + if rev { mx["revoked"] = 1 } else { - mx["revoked"] = 0 + mx["not_revoked"] = 1 } } diff --git a/src/go/collectors/go.d.plugin/modules/x509check/config_schema.json b/src/go/plugin/go.d/modules/x509check/config_schema.json index 7246cfa7..7246cfa7 100644 --- a/src/go/collectors/go.d.plugin/modules/x509check/config_schema.json +++ b/src/go/plugin/go.d/modules/x509check/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/x509check/init.go b/src/go/plugin/go.d/modules/x509check/init.go index f0df7fde..8d6dece2 100644 --- a/src/go/collectors/go.d.plugin/modules/x509check/init.go +++ b/src/go/plugin/go.d/modules/x509check/init.go @@ -5,7 +5,7 @@ package x509check import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) func (x *X509Check) validateConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/x509check/integrations/x.509_certificate.md b/src/go/plugin/go.d/modules/x509check/integrations/x.509_certificate.md index 6269d977..ccbe1294 100644 --- a/src/go/collectors/go.d.plugin/modules/x509check/integrations/x.509_certificate.md +++ b/src/go/plugin/go.d/modules/x509check/integrations/x.509_certificate.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/x509check/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/x509check/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/x509check/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/x509check/metadata.yaml" sidebar_label: "X.509 certificate" learn_status: "Published" learn_rel_path: "Collecting Metrics/Synthetic Checks" @@ -69,7 +69,7 @@ Metrics: | Metric | Dimensions | Unit | |:------|:----------|:----| | x509check.time_until_expiration | expiry | seconds | -| x509check.revocation_status | revoked | boolean | +| x509check.revocation_status | not_revoked, revoked | boolean | @@ -80,8 +80,8 @@ The following alerts are available: | Alert name | On metric | Description | |:------------|:----------|:------------| -| [ x509check_days_until_expiration ](https://github.com/netdata/netdata/blob/master/src/health/health.d/x509check.conf) | x509check.time_until_expiration | time until x509 certificate expires | -| [ x509check_revocation_status ](https://github.com/netdata/netdata/blob/master/src/health/health.d/x509check.conf) | x509check.revocation_status | x509 certificate revocation status (0: revoked, 1: valid) | +| [ x509check_days_until_expiration ](https://github.com/netdata/netdata/blob/master/src/health/health.d/x509check.conf) | x509check.time_until_expiration | Time until x509 certificate expires for ${label:source} | +| [ x509check_revocation_status ](https://github.com/netdata/netdata/blob/master/src/health/health.d/x509check.conf) | x509check.revocation_status | x509 certificate revocation status for ${label:source} | ## Setup @@ -200,6 +200,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `x509check` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -222,4 +224,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m x509check ``` +### Getting Logs + +If you're encountering problems with the `x509check` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep x509check +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep x509check /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep x509check +``` + diff --git a/src/go/collectors/go.d.plugin/modules/x509check/metadata.yaml b/src/go/plugin/go.d/modules/x509check/metadata.yaml index c9136822..e373f33d 100644 --- a/src/go/collectors/go.d.plugin/modules/x509check/metadata.yaml +++ b/src/go/plugin/go.d/modules/x509check/metadata.yaml @@ -138,11 +138,11 @@ modules: alerts: - name: x509check_days_until_expiration metric: x509check.time_until_expiration - info: time until x509 certificate expires + info: "Time until x509 certificate expires for ${label:source}" link: https://github.com/netdata/netdata/blob/master/src/health/health.d/x509check.conf - name: x509check_revocation_status metric: x509check.revocation_status - info: "x509 certificate revocation status (0: revoked, 1: valid)" + info: "x509 certificate revocation status for ${label:source}" link: https://github.com/netdata/netdata/blob/master/src/health/health.d/x509check.conf metrics: folding: @@ -168,4 +168,5 @@ modules: unit: boolean chart_type: line dimensions: + - name: not_revoked - name: revoked diff --git a/src/go/collectors/go.d.plugin/modules/x509check/provider.go b/src/go/plugin/go.d/modules/x509check/provider.go index 73e1e257..4a063570 100644 --- a/src/go/collectors/go.d.plugin/modules/x509check/provider.go +++ b/src/go/plugin/go.d/modules/x509check/provider.go @@ -13,7 +13,7 @@ import ( "os" "time" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" ) type provider interface { diff --git a/src/go/collectors/go.d.plugin/modules/x509check/testdata/config.json b/src/go/plugin/go.d/modules/x509check/testdata/config.json index 9bb2dade..9bb2dade 100644 --- a/src/go/collectors/go.d.plugin/modules/x509check/testdata/config.json +++ b/src/go/plugin/go.d/modules/x509check/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/x509check/testdata/config.yaml b/src/go/plugin/go.d/modules/x509check/testdata/config.yaml index e1f273f5..e1f273f5 100644 --- a/src/go/collectors/go.d.plugin/modules/x509check/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/x509check/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/x509check/x509check.go b/src/go/plugin/go.d/modules/x509check/x509check.go index 3ed1f1bb..c4fa70ea 100644 --- a/src/go/collectors/go.d.plugin/modules/x509check/x509check.go +++ b/src/go/plugin/go.d/modules/x509check/x509check.go @@ -7,11 +7,11 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" cfssllog "github.com/cloudflare/cfssl/log" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/x509check/x509check_test.go b/src/go/plugin/go.d/modules/x509check/x509check_test.go index 6d93bd3e..e0b28725 100644 --- a/src/go/collectors/go.d.plugin/modules/x509check/x509check_test.go +++ b/src/go/plugin/go.d/modules/x509check/x509check_test.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/modules/zfspool/README.md b/src/go/plugin/go.d/modules/zfspool/README.md index 8a292336..8a292336 120000 --- a/src/go/collectors/go.d.plugin/modules/zfspool/README.md +++ b/src/go/plugin/go.d/modules/zfspool/README.md diff --git a/src/go/collectors/go.d.plugin/modules/zfspool/charts.go b/src/go/plugin/go.d/modules/zfspool/charts.go index 45943c65..92a7d53b 100644 --- a/src/go/collectors/go.d.plugin/modules/zfspool/charts.go +++ b/src/go/plugin/go.d/modules/zfspool/charts.go @@ -6,26 +6,48 @@ import ( "fmt" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" ) const ( - prioZpoolSpaceUtilization = 2820 + iota + prioZpoolHealthState = 2820 + iota + prioVdevHealthState + + prioZpoolSpaceUtilization prioZpoolSpaceUsage + prioZpoolFragmentation - prioZpoolHealthState ) var zpoolChartsTmpl = module.Charts{ + zpoolHealthStateChartTmpl.Copy(), + zpoolSpaceUtilizationChartTmpl.Copy(), zpoolSpaceUsageChartTmpl.Copy(), zpoolFragmentationChartTmpl.Copy(), - - zpoolHealthStateChartTmpl.Copy(), } var ( + zpoolHealthStateChartTmpl = module.Chart{ + ID: "zfspool_%s_health_state", + Title: "Zpool health state", + Units: "state", + Fam: "health", + Ctx: "zfspool.pool_health_state", + Type: module.Line, + Priority: prioZpoolHealthState, + Dims: module.Dims{ + {ID: "zpool_%s_health_state_online", Name: "online"}, + {ID: "zpool_%s_health_state_degraded", Name: "degraded"}, + {ID: "zpool_%s_health_state_faulted", Name: "faulted"}, + {ID: "zpool_%s_health_state_offline", Name: "offline"}, + {ID: "zpool_%s_health_state_unavail", Name: "unavail"}, + {ID: "zpool_%s_health_state_removed", Name: "removed"}, + {ID: "zpool_%s_health_state_suspended", Name: "suspended"}, + }, + } + zpoolSpaceUtilizationChartTmpl = module.Chart{ ID: "zfspool_%s_space_utilization", Title: "Zpool space utilization", @@ -64,23 +86,29 @@ var ( {ID: "zpool_%s_frag", Name: "fragmentation"}, }, } +) - zpoolHealthStateChartTmpl = module.Chart{ - ID: "zfspool_%s_health_state", - Title: "Zpool health state", +var vdevChartsTmpl = module.Charts{ + vdevHealthStateChartTmpl.Copy(), +} + +var ( + vdevHealthStateChartTmpl = module.Chart{ + ID: "vdev_%s_health_state", + Title: "Zpool Vdev health state", Units: "state", Fam: "health", - Ctx: "zfspool.pool_health_state", + Ctx: "zfspool.vdev_health_state", Type: module.Line, - Priority: prioZpoolHealthState, + Priority: prioVdevHealthState, Dims: module.Dims{ - {ID: "zpool_%s_health_state_online", Name: "online"}, - {ID: "zpool_%s_health_state_degraded", Name: "degraded"}, - {ID: "zpool_%s_health_state_faulted", Name: "faulted"}, - {ID: "zpool_%s_health_state_offline", Name: "offline"}, - {ID: "zpool_%s_health_state_unavail", Name: "unavail"}, - {ID: "zpool_%s_health_state_removed", Name: "removed"}, - {ID: "zpool_%s_health_state_suspended", Name: "suspended"}, + {ID: "vdev_%s_health_state_online", Name: "online"}, + {ID: "vdev_%s_health_state_degraded", Name: "degraded"}, + {ID: "vdev_%s_health_state_faulted", Name: "faulted"}, + {ID: "vdev_%s_health_state_offline", Name: "offline"}, + {ID: "vdev_%s_health_state_unavail", Name: "unavail"}, + {ID: "vdev_%s_health_state_removed", Name: "removed"}, + {ID: "vdev_%s_health_state_suspended", Name: "suspended"}, }, } ) @@ -104,8 +132,35 @@ func (z *ZFSPool) addZpoolCharts(name string) { } func (z *ZFSPool) removeZpoolCharts(name string) { - px := fmt.Sprintf("zpool_%s_", name) + px := fmt.Sprintf("zfspool_%s_", name) + z.removeCharts(px) +} +func (z *ZFSPool) addVdevCharts(pool, vdev string) { + charts := vdevChartsTmpl.Copy() + + for _, chart := range *charts { + chart.ID = fmt.Sprintf(chart.ID, cleanVdev(vdev)) + chart.Labels = []module.Label{ + {Key: "pool", Value: pool}, + {Key: "vdev", Value: vdev}, + } + for _, dim := range chart.Dims { + dim.ID = fmt.Sprintf(dim.ID, vdev) + } + } + + if err := z.Charts().Add(*charts...); err != nil { + z.Warning(err) + } +} + +func (z *ZFSPool) removeVdevCharts(vdev string) { + px := fmt.Sprintf("vdev_%s_", cleanVdev(vdev)) + z.removeCharts(px) +} + +func (z *ZFSPool) removeCharts(px string) { for _, chart := range *z.Charts() { if strings.HasPrefix(chart.ID, px) { chart.MarkRemove() @@ -113,3 +168,8 @@ func (z *ZFSPool) removeZpoolCharts(name string) { } } } + +func cleanVdev(vdev string) string { + r := strings.NewReplacer(".", "_") + return r.Replace(vdev) +} diff --git a/src/go/plugin/go.d/modules/zfspool/collect.go b/src/go/plugin/go.d/modules/zfspool/collect.go new file mode 100644 index 00000000..b9b29058 --- /dev/null +++ b/src/go/plugin/go.d/modules/zfspool/collect.go @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package zfspool + +var zpoolHealthStates = []string{ + "online", + "degraded", + "faulted", + "offline", + "removed", + "unavail", + "suspended", +} + +func (z *ZFSPool) collect() (map[string]int64, error) { + + mx := make(map[string]int64) + + if err := z.collectZpoolList(mx); err != nil { + return nil, err + } + if err := z.collectZpoolListVdev(mx); err != nil { + return mx, err + } + + return mx, nil +} diff --git a/src/go/collectors/go.d.plugin/modules/zfspool/collect.go b/src/go/plugin/go.d/modules/zfspool/collect_zpool_list.go index 43994bfc..f5e1c081 100644 --- a/src/go/collectors/go.d.plugin/modules/zfspool/collect.go +++ b/src/go/plugin/go.d/modules/zfspool/collect_zpool_list.go @@ -5,22 +5,13 @@ package zfspool import ( "bufio" "bytes" + "errors" "fmt" "strconv" "strings" ) -var zpoolHealthStates = []string{ - "online", - "degraded", - "faulted", - "offline", - "removed", - "unavail", - "suspended", -} - -type zpoolStats struct { +type zpoolEntry struct { name string sizeBytes string allocBytes string @@ -31,33 +22,25 @@ type zpoolStats struct { health string } -func (z *ZFSPool) collect() (map[string]int64, error) { +func (z *ZFSPool) collectZpoolList(mx map[string]int64) error { bs, err := z.exec.list() if err != nil { - return nil, err + return err } zpools, err := parseZpoolListOutput(bs) if err != nil { - return nil, err + return fmt.Errorf("bad zpool list output: %v", err) } - mx := make(map[string]int64) - - z.collectZpoolListStats(mx, zpools) - - return mx, nil -} - -func (z *ZFSPool) collectZpoolListStats(mx map[string]int64, zpools []zpoolStats) { seen := make(map[string]bool) for _, zpool := range zpools { seen[zpool.name] = true - if !z.zpools[zpool.name] { + if !z.seenZpools[zpool.name] { z.addZpoolCharts(zpool.name) - z.zpools[zpool.name] = true + z.seenZpools[zpool.name] = true } px := "zpool_" + zpool.name + "_" @@ -83,34 +66,17 @@ func (z *ZFSPool) collectZpoolListStats(mx map[string]int64, zpools []zpoolStats mx[px+"health_state_"+zpool.health] = 1 } - for name := range z.zpools { + for name := range z.seenZpools { if !seen[name] { z.removeZpoolCharts(name) - delete(z.zpools, name) - } - } -} - -func parseZpoolListOutput(bs []byte) ([]zpoolStats, error) { - var lines []string - sc := bufio.NewScanner(bytes.NewReader(bs)) - for sc.Scan() { - if text := strings.TrimSpace(sc.Text()); text != "" { - lines = append(lines, text) + delete(z.seenZpools, name) } - - } - if len(lines) < 2 { - return nil, fmt.Errorf("unexpected data: wanted >= 2 lines, got %d", len(lines)) } - headers := strings.Fields(lines[0]) - if len(headers) == 0 { - return nil, fmt.Errorf("unexpected data: missing headers") - } - - var zpools []zpoolStats + return nil +} +func parseZpoolListOutput(bs []byte) ([]zpoolEntry, error) { /* # zpool list -p NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT @@ -118,13 +84,30 @@ func parseZpoolListOutput(bs []byte) ([]zpoolStats, error) { zion - - - - - - - FAULTED - */ - for _, line := range lines[1:] { + var headers []string + var zpools []zpoolEntry + sc := bufio.NewScanner(bytes.NewReader(bs)) + + for sc.Scan() { + line := strings.TrimSpace(sc.Text()) + if line == "" { + continue + } + + if len(headers) == 0 { + if !strings.HasPrefix(line, "NAME") { + return nil, fmt.Errorf("missing headers (line '%s')", line) + } + headers = strings.Fields(line) + continue + } + values := strings.Fields(line) if len(values) != len(headers) { return nil, fmt.Errorf("unequal columns: headers(%d) != values(%d)", len(headers), len(values)) } - var zpool zpoolStats + var zpool zpoolEntry for i, v := range values { v = strings.TrimSpace(v) @@ -146,15 +129,15 @@ func parseZpoolListOutput(bs []byte) ([]zpoolStats, error) { case "health": zpool.health = strings.ToLower(v) } + } - if last := i+1 == len(headers); last && zpool.name != "" && zpool.health != "" { - zpools = append(zpools, zpool) - } + if zpool.name != "" && zpool.health != "" { + zpools = append(zpools, zpool) } } if len(zpools) == 0 { - return nil, fmt.Errorf("unexpected data: missing pools") + return nil, errors.New("no pools found") } return zpools, nil diff --git a/src/go/plugin/go.d/modules/zfspool/collect_zpool_list_vdev.go b/src/go/plugin/go.d/modules/zfspool/collect_zpool_list_vdev.go new file mode 100644 index 00000000..30e1fe4e --- /dev/null +++ b/src/go/plugin/go.d/modules/zfspool/collect_zpool_list_vdev.go @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package zfspool + +import ( + "bufio" + "bytes" + "fmt" + "strings" +) + +type vdevEntry struct { + name string + vdev string // The full path of the vdev within the zpool hierarchy. + health string + + // Represents the nesting level of the vdev within the zpool hierarchy, based on indentation. + // A level of -1 indicates the root vdev (the pool itself). + level int +} + +func (z *ZFSPool) collectZpoolListVdev(mx map[string]int64) error { + seen := make(map[string]bool) + + for pool := range z.seenZpools { + bs, err := z.exec.listWithVdev(pool) + if err != nil { + return err + } + + vdevs, err := parseZpoolListVdevOutput(bs) + if err != nil { + return fmt.Errorf("bad zpool list vdev output (pool '%s'): %v", pool, err) + } + + for _, vdev := range vdevs { + if vdev.health == "" || vdev.health == "-" { + continue + } + + seen[vdev.vdev] = true + if !z.seenVdevs[vdev.vdev] { + z.seenVdevs[vdev.vdev] = true + z.addVdevCharts(pool, vdev.vdev) + } + + px := fmt.Sprintf("vdev_%s_", vdev.vdev) + + for _, s := range zpoolHealthStates { + mx[px+"health_state_"+s] = 0 + } + mx[px+"health_state_"+vdev.health] = 1 + } + } + + for name := range z.seenVdevs { + if !seen[name] { + z.removeVdevCharts(name) + delete(z.seenVdevs, name) + } + } + + return nil +} + +func parseZpoolListVdevOutput(bs []byte) ([]vdevEntry, error) { + var headers []string + var vdevs []vdevEntry + sc := bufio.NewScanner(bytes.NewReader(bs)) + + for sc.Scan() { + line := sc.Text() + if line == "" { + continue + } + + if len(headers) == 0 { + if !strings.HasPrefix(line, "NAME") { + return nil, fmt.Errorf("missing headers (line '%s')", line) + } + headers = strings.Fields(line) + continue + } + + values := strings.Fields(line) + if len(values) == 0 || len(values) > len(headers) { + return nil, fmt.Errorf("unexpected columns: headers(%d) values(%d) (line '%s')", len(headers), len(values), line) + } + + vdev := vdevEntry{ + level: len(line) - len(strings.TrimLeft(line, " ")), + } + + for i, v := range values { + switch strings.ToLower(headers[i]) { + case "name": + vdev.name = v + case "health": + vdev.health = strings.ToLower(v) + } + } + + if vdev.name != "" { + if len(vdevs) == 0 { + vdev.level = -1 // Pool + } + vdevs = append(vdevs, vdev) + } + } + + // set parent/child relationships + for i := range vdevs { + v := &vdevs[i] + + switch i { + case 0: + v.vdev = v.name + default: + // find parent with a lower level + for j := i - 1; j >= 0; j-- { + if vdevs[j].level < v.level { + v.vdev = fmt.Sprintf("%s/%s", vdevs[j].vdev, v.name) + break + } + } + if v.vdev == "" { + return nil, fmt.Errorf("no parent for vdev '%s'", v.name) + } + } + } + + // first is Pool + if len(vdevs) < 2 { + return nil, fmt.Errorf("no vdevs found") + } + + return vdevs[1:], nil +} diff --git a/src/go/collectors/go.d.plugin/modules/zfspool/config_schema.json b/src/go/plugin/go.d/modules/zfspool/config_schema.json index fcfcff1d..fcfcff1d 100644 --- a/src/go/collectors/go.d.plugin/modules/zfspool/config_schema.json +++ b/src/go/plugin/go.d/modules/zfspool/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/zfspool/exec.go b/src/go/plugin/go.d/modules/zfspool/exec.go index 0c155872..1a2bcf20 100644 --- a/src/go/collectors/go.d.plugin/modules/zfspool/exec.go +++ b/src/go/plugin/go.d/modules/zfspool/exec.go @@ -8,7 +8,7 @@ import ( "os/exec" "time" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" ) func newZpoolCLIExec(binPath string, timeout time.Duration) *zpoolCLIExec { @@ -39,3 +39,18 @@ func (e *zpoolCLIExec) list() ([]byte, error) { return bs, nil } + +func (e *zpoolCLIExec) listWithVdev(pool string) ([]byte, error) { + ctx, cancel := context.WithTimeout(context.Background(), e.timeout) + defer cancel() + + cmd := exec.CommandContext(ctx, e.binPath, "list", "-p", "-v", "-L", pool) + e.Debugf("executing '%s'", cmd) + + bs, err := cmd.Output() + if err != nil { + return nil, fmt.Errorf("error on '%s': %v", cmd, err) + } + + return bs, nil +} diff --git a/src/go/collectors/go.d.plugin/modules/zfspool/init.go b/src/go/plugin/go.d/modules/zfspool/init.go index f640801d..f640801d 100644 --- a/src/go/collectors/go.d.plugin/modules/zfspool/init.go +++ b/src/go/plugin/go.d/modules/zfspool/init.go diff --git a/src/go/collectors/go.d.plugin/modules/zfspool/integrations/zfs_pools.md b/src/go/plugin/go.d/modules/zfspool/integrations/zfs_pools.md index 827ae911..060e4fb7 100644 --- a/src/go/collectors/go.d.plugin/modules/zfspool/integrations/zfs_pools.md +++ b/src/go/plugin/go.d/modules/zfspool/integrations/zfs_pools.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/zfspool/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/zfspool/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/zfspool/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/zfspool/metadata.yaml" sidebar_label: "ZFS Pools" learn_status: "Published" learn_rel_path: "Collecting Metrics/Storage, Mount Points and Filesystems" @@ -73,6 +73,23 @@ Metrics: | zfspool.pool_fragmentation | fragmentation | % | | zfspool.pool_health_state | online, degraded, faulted, offline, unavail, removed, suspended | state | +### Per zfs pool vdev + +These metrics refer to the ZFS pool virtual device. + +Labels: + +| Label | Description | +|:-----------|:----------------| +| pool | Zpool name | +| vdev | Unique identifier for a virtual device (vdev) within a ZFS pool. | + +Metrics: + +| Metric | Dimensions | Unit | +|:------|:----------|:----| +| zfspool.vdev_health_state | online, degraded, faulted, offline, unavail, removed, suspended | state | + ## Alerts @@ -85,6 +102,7 @@ The following alerts are available: | [ zfs_pool_space_utilization ](https://github.com/netdata/netdata/blob/master/src/health/health.d/zfs.conf) | zfspool.pool_space_utilization | ZFS pool ${label:pool} is nearing capacity. Current space usage is above the threshold. | | [ zfs_pool_health_state_warn ](https://github.com/netdata/netdata/blob/master/src/health/health.d/zfs.conf) | zfspool.pool_health_state | ZFS pool ${label:pool} state is degraded | | [ zfs_pool_health_state_crit ](https://github.com/netdata/netdata/blob/master/src/health/health.d/zfs.conf) | zfspool.pool_health_state | ZFS pool ${label:pool} state is faulted or unavail | +| [ zfs_vdev_health_state ](https://github.com/netdata/netdata/blob/master/src/health/health.d/zfs.conf) | zfspool.vdev_health_state | ZFS vdev ${label:vdev} state is faulted or degraded | ## Setup @@ -144,6 +162,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `zfspool` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -166,4 +186,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m zfspool ``` +### Getting Logs + +If you're encountering problems with the `zfspool` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep zfspool +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep zfspool /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep zfspool +``` + diff --git a/src/go/collectors/go.d.plugin/modules/zfspool/metadata.yaml b/src/go/plugin/go.d/modules/zfspool/metadata.yaml index 847ee483..21cc307c 100644 --- a/src/go/collectors/go.d.plugin/modules/zfspool/metadata.yaml +++ b/src/go/plugin/go.d/modules/zfspool/metadata.yaml @@ -92,6 +92,10 @@ modules: metric: zfspool.pool_health_state info: "ZFS pool ${label:pool} state is faulted or unavail" link: https://github.com/netdata/netdata/blob/master/src/health/health.d/zfs.conf + - name: zfs_vdev_health_state + metric: zfspool.vdev_health_state + info: "ZFS vdev ${label:vdev} state is faulted or degraded" + link: https://github.com/netdata/netdata/blob/master/src/health/health.d/zfs.conf metrics: folding: title: Metrics @@ -136,3 +140,23 @@ modules: - name: unavail - name: removed - name: suspended + - name: zfs pool vdev + description: These metrics refer to the ZFS pool virtual device. + labels: + - name: pool + description: Zpool name + - name: vdev + description: Unique identifier for a virtual device (vdev) within a ZFS pool. + metrics: + - name: zfspool.vdev_health_state + description: Zpool Vdev health state + unit: 'state' + chart_type: line + dimensions: + - name: online + - name: degraded + - name: faulted + - name: offline + - name: unavail + - name: removed + - name: suspended diff --git a/src/go/plugin/go.d/modules/zfspool/testdata/config.json b/src/go/plugin/go.d/modules/zfspool/testdata/config.json new file mode 100644 index 00000000..09571319 --- /dev/null +++ b/src/go/plugin/go.d/modules/zfspool/testdata/config.json @@ -0,0 +1,5 @@ +{ + "update_every": 123, + "timeout": 123.123, + "binary_path": "ok" +} diff --git a/src/go/plugin/go.d/modules/zfspool/testdata/config.yaml b/src/go/plugin/go.d/modules/zfspool/testdata/config.yaml new file mode 100644 index 00000000..baf3bcd0 --- /dev/null +++ b/src/go/plugin/go.d/modules/zfspool/testdata/config.yaml @@ -0,0 +1,3 @@ +update_every: 123 +timeout: 123.123 +binary_path: "ok" diff --git a/src/go/plugin/go.d/modules/zfspool/testdata/zpool-list-vdev-logs-cache.txt b/src/go/plugin/go.d/modules/zfspool/testdata/zpool-list-vdev-logs-cache.txt new file mode 100644 index 00000000..061ca6cc --- /dev/null +++ b/src/go/plugin/go.d/modules/zfspool/testdata/zpool-list-vdev-logs-cache.txt @@ -0,0 +1,12 @@ +NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT +rpool 9981503995904 3046188658688 6935315337216 - - 9 30 1.00 DEGRADED - + mirror-0 9981503995904 3046188658688 6935315337216 - - 9 30 - ONLINE + sdc2 9998683602944 - - - - - - - ONLINE + sdd2 9998683602944 - - - - - - - ONLINE +logs - - - - - - - - - + mirror-1 17716740096 393216 17716346880 - - 0 0 - DEGRADED + sdb1 17951621120 - - - - - - - ONLINE + 14807975228228307538 - - - - - - - - UNAVAIL +cache - - - - - - - - - + sdb2 99000254464 98755866624 239665152 - - 0 99 - ONLINE + wwn-0x500151795954c095-part2 - - - - - - - - UNAVAIL diff --git a/src/go/plugin/go.d/modules/zfspool/testdata/zpool-list-vdev.txt b/src/go/plugin/go.d/modules/zfspool/testdata/zpool-list-vdev.txt new file mode 100644 index 00000000..ff78f8df --- /dev/null +++ b/src/go/plugin/go.d/modules/zfspool/testdata/zpool-list-vdev.txt @@ -0,0 +1,5 @@ +NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT +rpool 3985729650688 1647130456064 2338599194624 - - 55 41 1.00 ONLINE - + mirror-0 3985729650688 1647130456064 2338599194624 - - 55 41 - ONLINE + nvme2n1p3 4000249020416 - - - - - - - ONLINE + nvme0n1p3 4000249020416 - - - - - - - ONLINE diff --git a/src/go/collectors/go.d.plugin/modules/zfspool/testdata/zpool-list.txt b/src/go/plugin/go.d/modules/zfspool/testdata/zpool-list.txt index 06d9915c..06d9915c 100644 --- a/src/go/collectors/go.d.plugin/modules/zfspool/testdata/zpool-list.txt +++ b/src/go/plugin/go.d/modules/zfspool/testdata/zpool-list.txt diff --git a/src/go/collectors/go.d.plugin/modules/zfspool/zfspool.go b/src/go/plugin/go.d/modules/zfspool/zfspool.go index 154aacb2..02f1f7ce 100644 --- a/src/go/collectors/go.d.plugin/modules/zfspool/zfspool.go +++ b/src/go/plugin/go.d/modules/zfspool/zfspool.go @@ -7,8 +7,8 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" @@ -31,8 +31,9 @@ func New() *ZFSPool { BinaryPath: "/usr/bin/zpool", Timeout: web.Duration(time.Second * 2), }, - charts: &module.Charts{}, - zpools: make(map[string]bool), + charts: &module.Charts{}, + seenZpools: make(map[string]bool), + seenVdevs: make(map[string]bool), } } @@ -51,10 +52,12 @@ type ( exec zpoolCLI - zpools map[string]bool + seenZpools map[string]bool + seenVdevs map[string]bool } zpoolCLI interface { list() ([]byte, error) + listWithVdev(pool string) ([]byte, error) } ) diff --git a/src/go/plugin/go.d/modules/zfspool/zfspool_test.go b/src/go/plugin/go.d/modules/zfspool/zfspool_test.go new file mode 100644 index 00000000..bf64d171 --- /dev/null +++ b/src/go/plugin/go.d/modules/zfspool/zfspool_test.go @@ -0,0 +1,546 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package zfspool + +import ( + "errors" + "os" + "strings" + "testing" + + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + dataConfigJSON, _ = os.ReadFile("testdata/config.json") + dataConfigYAML, _ = os.ReadFile("testdata/config.yaml") + + dataZpoolList, _ = os.ReadFile("testdata/zpool-list.txt") + dataZpoolListWithVdev, _ = os.ReadFile("testdata/zpool-list-vdev.txt") + dataZpoolListWithVdevLogsCache, _ = os.ReadFile("testdata/zpool-list-vdev-logs-cache.txt") +) + +func Test_testDataIsValid(t *testing.T) { + for name, data := range map[string][]byte{ + "dataConfigJSON": dataConfigJSON, + "dataConfigYAML": dataConfigYAML, + + "dataZpoolList": dataZpoolList, + "dataZpoolListWithVdev": dataZpoolListWithVdev, + "dataZpoolListWithVdevLogsCache": dataZpoolListWithVdevLogsCache, + } { + require.NotNil(t, data, name) + + } +} + +func TestZFSPool_Configuration(t *testing.T) { + module.TestConfigurationSerialize(t, &ZFSPool{}, dataConfigJSON, dataConfigYAML) +} + +func TestZFSPool_Init(t *testing.T) { + tests := map[string]struct { + config Config + wantFail bool + }{ + "fails if 'binary_path' is not set": { + wantFail: true, + config: Config{ + BinaryPath: "", + }, + }, + "fails if failed to find binary": { + wantFail: true, + config: Config{ + BinaryPath: "zpool!!!", + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + zp := New() + zp.Config = test.config + + if test.wantFail { + assert.Error(t, zp.Init()) + } else { + assert.NoError(t, zp.Init()) + } + }) + } +} + +func TestZFSPool_Cleanup(t *testing.T) { + tests := map[string]struct { + prepare func() *ZFSPool + }{ + "not initialized exec": { + prepare: func() *ZFSPool { + return New() + }, + }, + "after check": { + prepare: func() *ZFSPool { + zp := New() + zp.exec = prepareMockOk() + _ = zp.Check() + return zp + }, + }, + "after collect": { + prepare: func() *ZFSPool { + zp := New() + zp.exec = prepareMockOk() + _ = zp.Collect() + return zp + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + zp := test.prepare() + + assert.NotPanics(t, zp.Cleanup) + }) + } +} + +func TestZFSPool_Charts(t *testing.T) { + assert.NotNil(t, New().Charts()) +} + +func TestZFSPool_Check(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockZpoolCLIExec + wantFail bool + }{ + "success case": { + prepareMock: prepareMockOk, + wantFail: false, + }, + "error on list call": { + prepareMock: prepareMockErrOnList, + wantFail: true, + }, + "empty response": { + prepareMock: prepareMockEmptyResponse, + wantFail: true, + }, + "unexpected response": { + prepareMock: prepareMockUnexpectedResponse, + wantFail: true, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + zp := New() + mock := test.prepareMock() + zp.exec = mock + + if test.wantFail { + assert.Error(t, zp.Check()) + } else { + assert.NoError(t, zp.Check()) + } + }) + } +} + +func TestZFSPool_Collect(t *testing.T) { + tests := map[string]struct { + prepareMock func() *mockZpoolCLIExec + wantMetrics map[string]int64 + }{ + "success case": { + prepareMock: prepareMockOk, + wantMetrics: map[string]int64{ + "vdev_rpool/mirror-0/nvme0n1p3_health_state_degraded": 0, + "vdev_rpool/mirror-0/nvme0n1p3_health_state_faulted": 0, + "vdev_rpool/mirror-0/nvme0n1p3_health_state_offline": 0, + "vdev_rpool/mirror-0/nvme0n1p3_health_state_online": 1, + "vdev_rpool/mirror-0/nvme0n1p3_health_state_removed": 0, + "vdev_rpool/mirror-0/nvme0n1p3_health_state_suspended": 0, + "vdev_rpool/mirror-0/nvme0n1p3_health_state_unavail": 0, + "vdev_rpool/mirror-0/nvme2n1p3_health_state_degraded": 0, + "vdev_rpool/mirror-0/nvme2n1p3_health_state_faulted": 0, + "vdev_rpool/mirror-0/nvme2n1p3_health_state_offline": 0, + "vdev_rpool/mirror-0/nvme2n1p3_health_state_online": 1, + "vdev_rpool/mirror-0/nvme2n1p3_health_state_removed": 0, + "vdev_rpool/mirror-0/nvme2n1p3_health_state_suspended": 0, + "vdev_rpool/mirror-0/nvme2n1p3_health_state_unavail": 0, + "vdev_rpool/mirror-0_health_state_degraded": 0, + "vdev_rpool/mirror-0_health_state_faulted": 0, + "vdev_rpool/mirror-0_health_state_offline": 0, + "vdev_rpool/mirror-0_health_state_online": 1, + "vdev_rpool/mirror-0_health_state_removed": 0, + "vdev_rpool/mirror-0_health_state_suspended": 0, + "vdev_rpool/mirror-0_health_state_unavail": 0, + "vdev_zion/mirror-0/nvme0n1p3_health_state_degraded": 0, + "vdev_zion/mirror-0/nvme0n1p3_health_state_faulted": 0, + "vdev_zion/mirror-0/nvme0n1p3_health_state_offline": 0, + "vdev_zion/mirror-0/nvme0n1p3_health_state_online": 1, + "vdev_zion/mirror-0/nvme0n1p3_health_state_removed": 0, + "vdev_zion/mirror-0/nvme0n1p3_health_state_suspended": 0, + "vdev_zion/mirror-0/nvme0n1p3_health_state_unavail": 0, + "vdev_zion/mirror-0/nvme2n1p3_health_state_degraded": 0, + "vdev_zion/mirror-0/nvme2n1p3_health_state_faulted": 0, + "vdev_zion/mirror-0/nvme2n1p3_health_state_offline": 0, + "vdev_zion/mirror-0/nvme2n1p3_health_state_online": 1, + "vdev_zion/mirror-0/nvme2n1p3_health_state_removed": 0, + "vdev_zion/mirror-0/nvme2n1p3_health_state_suspended": 0, + "vdev_zion/mirror-0/nvme2n1p3_health_state_unavail": 0, + "vdev_zion/mirror-0_health_state_degraded": 0, + "vdev_zion/mirror-0_health_state_faulted": 0, + "vdev_zion/mirror-0_health_state_offline": 0, + "vdev_zion/mirror-0_health_state_online": 1, + "vdev_zion/mirror-0_health_state_removed": 0, + "vdev_zion/mirror-0_health_state_suspended": 0, + "vdev_zion/mirror-0_health_state_unavail": 0, + "zpool_rpool_alloc": 9051643576, + "zpool_rpool_cap": 42, + "zpool_rpool_frag": 33, + "zpool_rpool_free": 12240656794, + "zpool_rpool_health_state_degraded": 0, + "zpool_rpool_health_state_faulted": 0, + "zpool_rpool_health_state_offline": 0, + "zpool_rpool_health_state_online": 1, + "zpool_rpool_health_state_removed": 0, + "zpool_rpool_health_state_suspended": 0, + "zpool_rpool_health_state_unavail": 0, + "zpool_rpool_size": 21367462298, + "zpool_zion_health_state_degraded": 0, + "zpool_zion_health_state_faulted": 1, + "zpool_zion_health_state_offline": 0, + "zpool_zion_health_state_online": 0, + "zpool_zion_health_state_removed": 0, + "zpool_zion_health_state_suspended": 0, + "zpool_zion_health_state_unavail": 0, + }, + }, + "success case vdev logs and cache": { + prepareMock: prepareMockOkVdevLogsCache, + wantMetrics: map[string]int64{ + "vdev_rpool/cache/sdb2_health_state_degraded": 0, + "vdev_rpool/cache/sdb2_health_state_faulted": 0, + "vdev_rpool/cache/sdb2_health_state_offline": 0, + "vdev_rpool/cache/sdb2_health_state_online": 1, + "vdev_rpool/cache/sdb2_health_state_removed": 0, + "vdev_rpool/cache/sdb2_health_state_suspended": 0, + "vdev_rpool/cache/sdb2_health_state_unavail": 0, + "vdev_rpool/cache/wwn-0x500151795954c095-part2_health_state_degraded": 0, + "vdev_rpool/cache/wwn-0x500151795954c095-part2_health_state_faulted": 0, + "vdev_rpool/cache/wwn-0x500151795954c095-part2_health_state_offline": 0, + "vdev_rpool/cache/wwn-0x500151795954c095-part2_health_state_online": 0, + "vdev_rpool/cache/wwn-0x500151795954c095-part2_health_state_removed": 0, + "vdev_rpool/cache/wwn-0x500151795954c095-part2_health_state_suspended": 0, + "vdev_rpool/cache/wwn-0x500151795954c095-part2_health_state_unavail": 1, + "vdev_rpool/logs/mirror-1/14807975228228307538_health_state_degraded": 0, + "vdev_rpool/logs/mirror-1/14807975228228307538_health_state_faulted": 0, + "vdev_rpool/logs/mirror-1/14807975228228307538_health_state_offline": 0, + "vdev_rpool/logs/mirror-1/14807975228228307538_health_state_online": 0, + "vdev_rpool/logs/mirror-1/14807975228228307538_health_state_removed": 0, + "vdev_rpool/logs/mirror-1/14807975228228307538_health_state_suspended": 0, + "vdev_rpool/logs/mirror-1/14807975228228307538_health_state_unavail": 1, + "vdev_rpool/logs/mirror-1/sdb1_health_state_degraded": 0, + "vdev_rpool/logs/mirror-1/sdb1_health_state_faulted": 0, + "vdev_rpool/logs/mirror-1/sdb1_health_state_offline": 0, + "vdev_rpool/logs/mirror-1/sdb1_health_state_online": 1, + "vdev_rpool/logs/mirror-1/sdb1_health_state_removed": 0, + "vdev_rpool/logs/mirror-1/sdb1_health_state_suspended": 0, + "vdev_rpool/logs/mirror-1/sdb1_health_state_unavail": 0, + "vdev_rpool/logs/mirror-1_health_state_degraded": 1, + "vdev_rpool/logs/mirror-1_health_state_faulted": 0, + "vdev_rpool/logs/mirror-1_health_state_offline": 0, + "vdev_rpool/logs/mirror-1_health_state_online": 0, + "vdev_rpool/logs/mirror-1_health_state_removed": 0, + "vdev_rpool/logs/mirror-1_health_state_suspended": 0, + "vdev_rpool/logs/mirror-1_health_state_unavail": 0, + "vdev_rpool/mirror-0/sdc2_health_state_degraded": 0, + "vdev_rpool/mirror-0/sdc2_health_state_faulted": 0, + "vdev_rpool/mirror-0/sdc2_health_state_offline": 0, + "vdev_rpool/mirror-0/sdc2_health_state_online": 1, + "vdev_rpool/mirror-0/sdc2_health_state_removed": 0, + "vdev_rpool/mirror-0/sdc2_health_state_suspended": 0, + "vdev_rpool/mirror-0/sdc2_health_state_unavail": 0, + "vdev_rpool/mirror-0/sdd2_health_state_degraded": 0, + "vdev_rpool/mirror-0/sdd2_health_state_faulted": 0, + "vdev_rpool/mirror-0/sdd2_health_state_offline": 0, + "vdev_rpool/mirror-0/sdd2_health_state_online": 1, + "vdev_rpool/mirror-0/sdd2_health_state_removed": 0, + "vdev_rpool/mirror-0/sdd2_health_state_suspended": 0, + "vdev_rpool/mirror-0/sdd2_health_state_unavail": 0, + "vdev_rpool/mirror-0_health_state_degraded": 0, + "vdev_rpool/mirror-0_health_state_faulted": 0, + "vdev_rpool/mirror-0_health_state_offline": 0, + "vdev_rpool/mirror-0_health_state_online": 1, + "vdev_rpool/mirror-0_health_state_removed": 0, + "vdev_rpool/mirror-0_health_state_suspended": 0, + "vdev_rpool/mirror-0_health_state_unavail": 0, + "vdev_zion/cache/sdb2_health_state_degraded": 0, + "vdev_zion/cache/sdb2_health_state_faulted": 0, + "vdev_zion/cache/sdb2_health_state_offline": 0, + "vdev_zion/cache/sdb2_health_state_online": 1, + "vdev_zion/cache/sdb2_health_state_removed": 0, + "vdev_zion/cache/sdb2_health_state_suspended": 0, + "vdev_zion/cache/sdb2_health_state_unavail": 0, + "vdev_zion/cache/wwn-0x500151795954c095-part2_health_state_degraded": 0, + "vdev_zion/cache/wwn-0x500151795954c095-part2_health_state_faulted": 0, + "vdev_zion/cache/wwn-0x500151795954c095-part2_health_state_offline": 0, + "vdev_zion/cache/wwn-0x500151795954c095-part2_health_state_online": 0, + "vdev_zion/cache/wwn-0x500151795954c095-part2_health_state_removed": 0, + "vdev_zion/cache/wwn-0x500151795954c095-part2_health_state_suspended": 0, + "vdev_zion/cache/wwn-0x500151795954c095-part2_health_state_unavail": 1, + "vdev_zion/logs/mirror-1/14807975228228307538_health_state_degraded": 0, + "vdev_zion/logs/mirror-1/14807975228228307538_health_state_faulted": 0, + "vdev_zion/logs/mirror-1/14807975228228307538_health_state_offline": 0, + "vdev_zion/logs/mirror-1/14807975228228307538_health_state_online": 0, + "vdev_zion/logs/mirror-1/14807975228228307538_health_state_removed": 0, + "vdev_zion/logs/mirror-1/14807975228228307538_health_state_suspended": 0, + "vdev_zion/logs/mirror-1/14807975228228307538_health_state_unavail": 1, + "vdev_zion/logs/mirror-1/sdb1_health_state_degraded": 0, + "vdev_zion/logs/mirror-1/sdb1_health_state_faulted": 0, + "vdev_zion/logs/mirror-1/sdb1_health_state_offline": 0, + "vdev_zion/logs/mirror-1/sdb1_health_state_online": 1, + "vdev_zion/logs/mirror-1/sdb1_health_state_removed": 0, + "vdev_zion/logs/mirror-1/sdb1_health_state_suspended": 0, + "vdev_zion/logs/mirror-1/sdb1_health_state_unavail": 0, + "vdev_zion/logs/mirror-1_health_state_degraded": 1, + "vdev_zion/logs/mirror-1_health_state_faulted": 0, + "vdev_zion/logs/mirror-1_health_state_offline": 0, + "vdev_zion/logs/mirror-1_health_state_online": 0, + "vdev_zion/logs/mirror-1_health_state_removed": 0, + "vdev_zion/logs/mirror-1_health_state_suspended": 0, + "vdev_zion/logs/mirror-1_health_state_unavail": 0, + "vdev_zion/mirror-0/sdc2_health_state_degraded": 0, + "vdev_zion/mirror-0/sdc2_health_state_faulted": 0, + "vdev_zion/mirror-0/sdc2_health_state_offline": 0, + "vdev_zion/mirror-0/sdc2_health_state_online": 1, + "vdev_zion/mirror-0/sdc2_health_state_removed": 0, + "vdev_zion/mirror-0/sdc2_health_state_suspended": 0, + "vdev_zion/mirror-0/sdc2_health_state_unavail": 0, + "vdev_zion/mirror-0/sdd2_health_state_degraded": 0, + "vdev_zion/mirror-0/sdd2_health_state_faulted": 0, + "vdev_zion/mirror-0/sdd2_health_state_offline": 0, + "vdev_zion/mirror-0/sdd2_health_state_online": 1, + "vdev_zion/mirror-0/sdd2_health_state_removed": 0, + "vdev_zion/mirror-0/sdd2_health_state_suspended": 0, + "vdev_zion/mirror-0/sdd2_health_state_unavail": 0, + "vdev_zion/mirror-0_health_state_degraded": 0, + "vdev_zion/mirror-0_health_state_faulted": 0, + "vdev_zion/mirror-0_health_state_offline": 0, + "vdev_zion/mirror-0_health_state_online": 1, + "vdev_zion/mirror-0_health_state_removed": 0, + "vdev_zion/mirror-0_health_state_suspended": 0, + "vdev_zion/mirror-0_health_state_unavail": 0, + "zpool_rpool_alloc": 9051643576, + "zpool_rpool_cap": 42, + "zpool_rpool_frag": 33, + "zpool_rpool_free": 12240656794, + "zpool_rpool_health_state_degraded": 0, + "zpool_rpool_health_state_faulted": 0, + "zpool_rpool_health_state_offline": 0, + "zpool_rpool_health_state_online": 1, + "zpool_rpool_health_state_removed": 0, + "zpool_rpool_health_state_suspended": 0, + "zpool_rpool_health_state_unavail": 0, + "zpool_rpool_size": 21367462298, + "zpool_zion_health_state_degraded": 0, + "zpool_zion_health_state_faulted": 1, + "zpool_zion_health_state_offline": 0, + "zpool_zion_health_state_online": 0, + "zpool_zion_health_state_removed": 0, + "zpool_zion_health_state_suspended": 0, + "zpool_zion_health_state_unavail": 0, + }, + }, + "error on list call": { + prepareMock: prepareMockErrOnList, + wantMetrics: nil, + }, + "empty response": { + prepareMock: prepareMockEmptyResponse, + wantMetrics: nil, + }, + "unexpected response": { + prepareMock: prepareMockUnexpectedResponse, + wantMetrics: nil, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + zp := New() + mock := test.prepareMock() + zp.exec = mock + + mx := zp.Collect() + + assert.Equal(t, test.wantMetrics, mx) + + if len(test.wantMetrics) > 0 { + want := len(zpoolChartsTmpl)*len(zp.seenZpools) + len(vdevChartsTmpl)*len(zp.seenVdevs) + + assert.Len(t, *zp.Charts(), want, "want charts") + + module.TestMetricsHasAllChartsDimsSkip(t, zp.Charts(), mx, func(chart *module.Chart) bool { + return strings.HasPrefix(chart.ID, "zfspool_zion") && !strings.HasSuffix(chart.ID, "health_state") + }) + } + }) + } +} + +func TestZFSPool_parseZpoolListDevOutput(t *testing.T) { + tests := map[string]struct { + input string + want []vdevEntry + }{ + "": { + input: ` +NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT +store 9981503995904 3046188658688 6935315337216 - - 9 30 1.00 DEGRADED - + mirror-0 9981503995904 3046188658688 6935315337216 - - 9 30 - ONLINE + sdc2 9998683602944 - - - - - - - ONLINE + sdd2 9998683602944 - - - - - - - ONLINE +logs - - - - - - - - - + mirror-1 17716740096 393216 17716346880 - - 0 0 - DEGRADED + sdb1 17951621120 - - - - - - - ONLINE + 14807975228228307538 - - - - - - - - UNAVAIL +cache - - - - - - - - - + sdb2 99000254464 98755866624 239665152 - - 0 99 - ONLINE + wwn-0x500151795954c095-part2 - - - - - - - - UNAVAIL +`, + want: []vdevEntry{ + { + name: "mirror-0", + health: "online", + vdev: "store/mirror-0", + level: 2, + }, + { + name: "sdc2", + health: "online", + vdev: "store/mirror-0/sdc2", + level: 4, + }, + { + name: "sdd2", + health: "online", + vdev: "store/mirror-0/sdd2", + level: 4, + }, + { + name: "logs", + health: "-", + vdev: "store/logs", + level: 0, + }, + { + name: "mirror-1", + health: "degraded", + vdev: "store/logs/mirror-1", + level: 2, + }, + { + name: "sdb1", + health: "online", + vdev: "store/logs/mirror-1/sdb1", + level: 4, + }, + { + name: "14807975228228307538", + health: "unavail", + vdev: "store/logs/mirror-1/14807975228228307538", + level: 4, + }, + { + name: "cache", + health: "-", + vdev: "store/cache", + level: 0, + }, + { + name: "sdb2", + health: "online", + vdev: "store/cache/sdb2", + level: 2, + }, + { + name: "wwn-0x500151795954c095-part2", + health: "unavail", + vdev: "store/cache/wwn-0x500151795954c095-part2", + level: 2, + }, + }, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + v, err := parseZpoolListVdevOutput([]byte(test.input)) + require.NoError(t, err) + assert.Equal(t, test.want, v) + }) + } +} + +func prepareMockOk() *mockZpoolCLIExec { + return &mockZpoolCLIExec{ + listData: dataZpoolList, + listWithVdevData: dataZpoolListWithVdev, + } +} + +func prepareMockOkVdevLogsCache() *mockZpoolCLIExec { + return &mockZpoolCLIExec{ + listData: dataZpoolList, + listWithVdevData: dataZpoolListWithVdevLogsCache, + } +} + +func prepareMockErrOnList() *mockZpoolCLIExec { + return &mockZpoolCLIExec{ + errOnList: true, + } +} + +func prepareMockEmptyResponse() *mockZpoolCLIExec { + return &mockZpoolCLIExec{} +} + +func prepareMockUnexpectedResponse() *mockZpoolCLIExec { + return &mockZpoolCLIExec{ + listData: []byte(` +Lorem ipsum dolor sit amet, consectetur adipiscing elit. +Nulla malesuada erat id magna mattis, eu viverra tellus rhoncus. +Fusce et felis pulvinar, posuere sem non, porttitor eros. +`), + } +} + +type mockZpoolCLIExec struct { + errOnList bool + listData []byte + listWithVdevData []byte +} + +func (m *mockZpoolCLIExec) list() ([]byte, error) { + if m.errOnList { + return nil, errors.New("mock.list() error") + } + + return m.listData, nil +} + +func (m *mockZpoolCLIExec) listWithVdev(pool string) ([]byte, error) { + s := string(m.listWithVdevData) + s = strings.Replace(s, "rpool", pool, 1) + + return []byte(s), nil +} diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/README.md b/src/go/plugin/go.d/modules/zookeeper/README.md index ae81b371..ae81b371 120000 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/README.md +++ b/src/go/plugin/go.d/modules/zookeeper/README.md diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/charts.go b/src/go/plugin/go.d/modules/zookeeper/charts.go index 2c2cf6a0..9f081a9c 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/charts.go +++ b/src/go/plugin/go.d/modules/zookeeper/charts.go @@ -2,7 +2,7 @@ package zookeeper -import "github.com/netdata/netdata/go/go.d.plugin/agent/module" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" type ( Charts = module.Charts diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/collect.go b/src/go/plugin/go.d/modules/zookeeper/collect.go index 86491e1b..86491e1b 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/collect.go +++ b/src/go/plugin/go.d/modules/zookeeper/collect.go diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/config_schema.json b/src/go/plugin/go.d/modules/zookeeper/config_schema.json index e07a27c2..e07a27c2 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/config_schema.json +++ b/src/go/plugin/go.d/modules/zookeeper/config_schema.json diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/fetcher.go b/src/go/plugin/go.d/modules/zookeeper/fetcher.go index be821e62..a6611b50 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/fetcher.go +++ b/src/go/plugin/go.d/modules/zookeeper/fetcher.go @@ -7,7 +7,7 @@ import ( "fmt" "unsafe" - "github.com/netdata/netdata/go/go.d.plugin/pkg/socket" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" ) const limitReadLines = 2000 diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/fetcher_test.go b/src/go/plugin/go.d/modules/zookeeper/fetcher_test.go index dbc5174b..d0931abb 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/fetcher_test.go +++ b/src/go/plugin/go.d/modules/zookeeper/fetcher_test.go @@ -5,7 +5,7 @@ package zookeeper import ( "testing" - "github.com/netdata/netdata/go/go.d.plugin/pkg/socket" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" "github.com/stretchr/testify/assert" ) diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/init.go b/src/go/plugin/go.d/modules/zookeeper/init.go index 1910e9a0..380f4bb3 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/init.go +++ b/src/go/plugin/go.d/modules/zookeeper/init.go @@ -7,8 +7,8 @@ import ( "errors" "fmt" - "github.com/netdata/netdata/go/go.d.plugin/pkg/socket" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/socket" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" ) func (z *Zookeeper) verifyConfig() error { diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/integrations/zookeeper.md b/src/go/plugin/go.d/modules/zookeeper/integrations/zookeeper.md index 45eeb0fc..8481ff8c 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/integrations/zookeeper.md +++ b/src/go/plugin/go.d/modules/zookeeper/integrations/zookeeper.md @@ -1,6 +1,6 @@ <!--startmeta -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/zookeeper/README.md" -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/zookeeper/metadata.yaml" +custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/zookeeper/README.md" +meta_yaml: "https://github.com/netdata/netdata/edit/master/src/go/plugin/go.d/modules/zookeeper/metadata.yaml" sidebar_label: "ZooKeeper" learn_status: "Published" learn_rel_path: "Collecting Metrics/Service Discovery / Registry" @@ -190,6 +190,8 @@ jobs: ### Debug Mode +**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature. + To troubleshoot issues with the `zookeeper` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. @@ -212,4 +214,37 @@ should give you clues as to why the collector isn't working. ./go.d.plugin -d -m zookeeper ``` +### Getting Logs + +If you're encountering problems with the `zookeeper` collector, follow these steps to retrieve logs and identify potential issues: + +- **Run the command** specific to your system (systemd, non-systemd, or Docker container). +- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem. + +#### System with systemd + +Use the following command to view logs generated since the last Netdata service restart: + +```bash +journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep zookeeper +``` + +#### System without systemd + +Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name: + +```bash +grep zookeeper /var/log/netdata/collector.log +``` + +**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues. + +#### Docker Container + +If your Netdata runs in a Docker container named "netdata" (replace if different), use this command: + +```bash +docker logs netdata 2>&1 | grep zookeeper +``` + diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/metadata.yaml b/src/go/plugin/go.d/modules/zookeeper/metadata.yaml index 527a55fb..527a55fb 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/metadata.yaml +++ b/src/go/plugin/go.d/modules/zookeeper/metadata.yaml diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/testdata/config.json b/src/go/plugin/go.d/modules/zookeeper/testdata/config.json index 0cf6c472..0cf6c472 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/testdata/config.json +++ b/src/go/plugin/go.d/modules/zookeeper/testdata/config.json diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/testdata/config.yaml b/src/go/plugin/go.d/modules/zookeeper/testdata/config.yaml index 54456cc8..54456cc8 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/testdata/config.yaml +++ b/src/go/plugin/go.d/modules/zookeeper/testdata/config.yaml diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/testdata/mntr.txt b/src/go/plugin/go.d/modules/zookeeper/testdata/mntr.txt index 8e10c287..8e10c287 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/testdata/mntr.txt +++ b/src/go/plugin/go.d/modules/zookeeper/testdata/mntr.txt diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/testdata/mntr_notinwhitelist.txt b/src/go/plugin/go.d/modules/zookeeper/testdata/mntr_notinwhitelist.txt index 1fd1983b..1fd1983b 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/testdata/mntr_notinwhitelist.txt +++ b/src/go/plugin/go.d/modules/zookeeper/testdata/mntr_notinwhitelist.txt diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/zookeeper.go b/src/go/plugin/go.d/modules/zookeeper/zookeeper.go index bf2a4331..6d004a40 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/zookeeper.go +++ b/src/go/plugin/go.d/modules/zookeeper/zookeeper.go @@ -7,9 +7,9 @@ import ( "errors" "time" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) //go:embed "config_schema.json" diff --git a/src/go/collectors/go.d.plugin/modules/zookeeper/zookeeper_test.go b/src/go/plugin/go.d/modules/zookeeper/zookeeper_test.go index d33673fc..3fc8ad5b 100644 --- a/src/go/collectors/go.d.plugin/modules/zookeeper/zookeeper_test.go +++ b/src/go/plugin/go.d/modules/zookeeper/zookeeper_test.go @@ -9,7 +9,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/agent/module" + "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/pkg/README.md b/src/go/plugin/go.d/pkg/README.md index 35ce81cc..34561395 100644 --- a/src/go/collectors/go.d.plugin/pkg/README.md +++ b/src/go/plugin/go.d/pkg/README.md @@ -1,6 +1,6 @@ <!-- title: "Helper Packages" -custom_edit_url: "/src/go/collectors/go.d.plugin/pkg/README.md" +custom_edit_url: "/src/go/plugin/go.d/pkg/README.md" sidebar_label: "Helper Packages" learn_status: "Published" learn_rel_path: "Developers/External plugins/go.d.plugin/Helper Packages" @@ -9,14 +9,14 @@ learn_rel_path: "Developers/External plugins/go.d.plugin/Helper Packages" # Helper Packages - if you need IP ranges consider to - use [`iprange`](/src/go/collectors/go.d.plugin/pkg/iprange/README.md). -- if you parse an application log files, then [`log`](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/logs) is + use [`iprange`](/src/go/plugin/go.d/pkg/iprange). +- if you parse an application log files, then [`log`](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/logs) is handy. - if you need filtering - check [`matcher`](/src/go/collectors/go.d.plugin/pkg/matcher/README.md). -- if you collect metrics from an HTTP endpoint use [`web`](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/web). + check [`matcher`](/src/go/plugin/go.d/pkg/matcher). +- if you collect metrics from an HTTP endpoint use [`web`](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/web). - if you collect metrics from a prometheus endpoint, - then [`prometheus`](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/prometheus) - and [`web`](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/web) is what you need. -- [`tlscfg`](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/tlscfg) provides TLS support. -- [`stm`](https://github.com/netdata/netdata/tree/master/src/go/collectors/go.d.plugin/pkg/stm) helps you to convert any struct to a `map[string]int64`. + then [`prometheus`](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/prometheus) + and [`web`](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/web) is what you need. +- [`tlscfg`](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/tlscfg) provides TLS support. +- [`stm`](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/pkg/stm) helps you to convert any struct to a `map[string]int64`. diff --git a/src/go/collectors/go.d.plugin/pkg/dockerhost/dockerhost.go b/src/go/plugin/go.d/pkg/dockerhost/dockerhost.go index eb26b18f..eb26b18f 100644 --- a/src/go/collectors/go.d.plugin/pkg/dockerhost/dockerhost.go +++ b/src/go/plugin/go.d/pkg/dockerhost/dockerhost.go diff --git a/src/go/collectors/go.d.plugin/pkg/iprange/README.md b/src/go/plugin/go.d/pkg/iprange/README.md index 0b9bdbee..ee777989 100644 --- a/src/go/collectors/go.d.plugin/pkg/iprange/README.md +++ b/src/go/plugin/go.d/pkg/iprange/README.md @@ -1,6 +1,6 @@ <!-- title: "iprange" -custom_edit_url: "/src/go/collectors/go.d.plugin/pkg/iprange/README.md" +custom_edit_url: "/src/go/plugin/go.d/pkg/iprange/README.md" sidebar_label: "iprange" learn_status: "Published" learn_rel_path: "Developers/External plugins/go.d.plugin/Helper Packages" diff --git a/src/go/collectors/go.d.plugin/pkg/iprange/parse.go b/src/go/plugin/go.d/pkg/iprange/parse.go index 3471702a..3471702a 100644 --- a/src/go/collectors/go.d.plugin/pkg/iprange/parse.go +++ b/src/go/plugin/go.d/pkg/iprange/parse.go diff --git a/src/go/collectors/go.d.plugin/pkg/iprange/parse_test.go b/src/go/plugin/go.d/pkg/iprange/parse_test.go index 8b4ab96b..8b4ab96b 100644 --- a/src/go/collectors/go.d.plugin/pkg/iprange/parse_test.go +++ b/src/go/plugin/go.d/pkg/iprange/parse_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/iprange/pool.go b/src/go/plugin/go.d/pkg/iprange/pool.go index 48ba5689..48ba5689 100644 --- a/src/go/collectors/go.d.plugin/pkg/iprange/pool.go +++ b/src/go/plugin/go.d/pkg/iprange/pool.go diff --git a/src/go/collectors/go.d.plugin/pkg/iprange/pool_test.go b/src/go/plugin/go.d/pkg/iprange/pool_test.go index 2864b671..2864b671 100644 --- a/src/go/collectors/go.d.plugin/pkg/iprange/pool_test.go +++ b/src/go/plugin/go.d/pkg/iprange/pool_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/iprange/range.go b/src/go/plugin/go.d/pkg/iprange/range.go index 1fe02eac..1fe02eac 100644 --- a/src/go/collectors/go.d.plugin/pkg/iprange/range.go +++ b/src/go/plugin/go.d/pkg/iprange/range.go diff --git a/src/go/collectors/go.d.plugin/pkg/iprange/range_test.go b/src/go/plugin/go.d/pkg/iprange/range_test.go index 631d012e..631d012e 100644 --- a/src/go/collectors/go.d.plugin/pkg/iprange/range_test.go +++ b/src/go/plugin/go.d/pkg/iprange/range_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/k8sclient/k8sclient.go b/src/go/plugin/go.d/pkg/k8sclient/k8sclient.go index 079239c1..079239c1 100644 --- a/src/go/collectors/go.d.plugin/pkg/k8sclient/k8sclient.go +++ b/src/go/plugin/go.d/pkg/k8sclient/k8sclient.go diff --git a/src/go/collectors/go.d.plugin/pkg/logs/csv.go b/src/go/plugin/go.d/pkg/logs/csv.go index 4057b8c2..4057b8c2 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/csv.go +++ b/src/go/plugin/go.d/pkg/logs/csv.go diff --git a/src/go/collectors/go.d.plugin/pkg/logs/csv_test.go b/src/go/plugin/go.d/pkg/logs/csv_test.go index d7baaa1b..d7baaa1b 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/csv_test.go +++ b/src/go/plugin/go.d/pkg/logs/csv_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/logs/json.go b/src/go/plugin/go.d/pkg/logs/json.go index ceb32e27..ceb32e27 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/json.go +++ b/src/go/plugin/go.d/pkg/logs/json.go diff --git a/src/go/collectors/go.d.plugin/pkg/logs/json_test.go b/src/go/plugin/go.d/pkg/logs/json_test.go index b8285003..b8285003 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/json_test.go +++ b/src/go/plugin/go.d/pkg/logs/json_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/logs/lastline.go b/src/go/plugin/go.d/pkg/logs/lastline.go index 911dbf49..911dbf49 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/lastline.go +++ b/src/go/plugin/go.d/pkg/logs/lastline.go diff --git a/src/go/collectors/go.d.plugin/pkg/logs/lastline_test.go b/src/go/plugin/go.d/pkg/logs/lastline_test.go index ea0a75e9..ea0a75e9 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/lastline_test.go +++ b/src/go/plugin/go.d/pkg/logs/lastline_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/logs/ltsv.go b/src/go/plugin/go.d/pkg/logs/ltsv.go index b7fbceb1..b7fbceb1 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/ltsv.go +++ b/src/go/plugin/go.d/pkg/logs/ltsv.go diff --git a/src/go/collectors/go.d.plugin/pkg/logs/ltsv_test.go b/src/go/plugin/go.d/pkg/logs/ltsv_test.go index f6d5ec2b..f6d5ec2b 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/ltsv_test.go +++ b/src/go/plugin/go.d/pkg/logs/ltsv_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/logs/parser.go b/src/go/plugin/go.d/pkg/logs/parser.go index f22047b0..f22047b0 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/parser.go +++ b/src/go/plugin/go.d/pkg/logs/parser.go diff --git a/src/go/collectors/go.d.plugin/pkg/logs/parser_test.go b/src/go/plugin/go.d/pkg/logs/parser_test.go index 88ef46c2..88ef46c2 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/parser_test.go +++ b/src/go/plugin/go.d/pkg/logs/parser_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/logs/reader.go b/src/go/plugin/go.d/pkg/logs/reader.go index 34544eac..55f0ee18 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/reader.go +++ b/src/go/plugin/go.d/pkg/logs/reader.go @@ -10,7 +10,7 @@ import ( "path/filepath" "sort" - "github.com/netdata/netdata/go/go.d.plugin/logger" + "github.com/netdata/netdata/go/plugins/logger" ) const ( diff --git a/src/go/collectors/go.d.plugin/pkg/logs/reader_test.go b/src/go/plugin/go.d/pkg/logs/reader_test.go index e6ef47fe..e6ef47fe 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/reader_test.go +++ b/src/go/plugin/go.d/pkg/logs/reader_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/logs/regexp.go b/src/go/plugin/go.d/pkg/logs/regexp.go index e0dee1d0..e0dee1d0 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/regexp.go +++ b/src/go/plugin/go.d/pkg/logs/regexp.go diff --git a/src/go/collectors/go.d.plugin/pkg/logs/regexp_test.go b/src/go/plugin/go.d/pkg/logs/regexp_test.go index fc7bacaa..fc7bacaa 100644 --- a/src/go/collectors/go.d.plugin/pkg/logs/regexp_test.go +++ b/src/go/plugin/go.d/pkg/logs/regexp_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/README.md b/src/go/plugin/go.d/pkg/matcher/README.md index 8c909426..971774ec 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/README.md +++ b/src/go/plugin/go.d/pkg/matcher/README.md @@ -1,6 +1,6 @@ <!-- title: "matcher" -custom_edit_url: "/src/go/collectors/go.d.plugin/pkg/matcher/README.md" +custom_edit_url: "/src/go/plugin/go.d/pkg/matcher/README.md" sidebar_label: "matcher" learn_status: "Published" learn_rel_path: "Developers/External plugins/go.d.plugin/Helper Packages" diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/cache.go b/src/go/plugin/go.d/pkg/matcher/cache.go index 4594fa06..4594fa06 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/cache.go +++ b/src/go/plugin/go.d/pkg/matcher/cache.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/cache_test.go b/src/go/plugin/go.d/pkg/matcher/cache_test.go index a545777b..a545777b 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/cache_test.go +++ b/src/go/plugin/go.d/pkg/matcher/cache_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/doc.go b/src/go/plugin/go.d/pkg/matcher/doc.go index 33b06988..33b06988 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/doc.go +++ b/src/go/plugin/go.d/pkg/matcher/doc.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/doc_test.go b/src/go/plugin/go.d/pkg/matcher/doc_test.go index d04b39a5..4cc3944d 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/doc_test.go +++ b/src/go/plugin/go.d/pkg/matcher/doc_test.go @@ -2,7 +2,7 @@ package matcher_test -import "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" func ExampleNew_string_format() { // create a string matcher, which perform full text match diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/expr.go b/src/go/plugin/go.d/pkg/matcher/expr.go index e5ea0cb2..e5ea0cb2 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/expr.go +++ b/src/go/plugin/go.d/pkg/matcher/expr.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/expr_test.go b/src/go/plugin/go.d/pkg/matcher/expr_test.go index 93a18322..93a18322 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/expr_test.go +++ b/src/go/plugin/go.d/pkg/matcher/expr_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/glob.go b/src/go/plugin/go.d/pkg/matcher/glob.go index 726c94c4..726c94c4 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/glob.go +++ b/src/go/plugin/go.d/pkg/matcher/glob.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/glob_test.go b/src/go/plugin/go.d/pkg/matcher/glob_test.go index 09d45610..09d45610 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/glob_test.go +++ b/src/go/plugin/go.d/pkg/matcher/glob_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/logical.go b/src/go/plugin/go.d/pkg/matcher/logical.go index af07be8f..af07be8f 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/logical.go +++ b/src/go/plugin/go.d/pkg/matcher/logical.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/logical_test.go b/src/go/plugin/go.d/pkg/matcher/logical_test.go index 64491f1a..64491f1a 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/logical_test.go +++ b/src/go/plugin/go.d/pkg/matcher/logical_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/matcher.go b/src/go/plugin/go.d/pkg/matcher/matcher.go index 76d90332..76d90332 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/matcher.go +++ b/src/go/plugin/go.d/pkg/matcher/matcher.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/matcher_test.go b/src/go/plugin/go.d/pkg/matcher/matcher_test.go index f304d983..f304d983 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/matcher_test.go +++ b/src/go/plugin/go.d/pkg/matcher/matcher_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/regexp.go b/src/go/plugin/go.d/pkg/matcher/regexp.go index 3a297f3b..3a297f3b 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/regexp.go +++ b/src/go/plugin/go.d/pkg/matcher/regexp.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/regexp_test.go b/src/go/plugin/go.d/pkg/matcher/regexp_test.go index fe644747..fe644747 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/regexp_test.go +++ b/src/go/plugin/go.d/pkg/matcher/regexp_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/simple_patterns.go b/src/go/plugin/go.d/pkg/matcher/simple_patterns.go index 91a0a3bb..91a0a3bb 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/simple_patterns.go +++ b/src/go/plugin/go.d/pkg/matcher/simple_patterns.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/simple_patterns_test.go b/src/go/plugin/go.d/pkg/matcher/simple_patterns_test.go index 016096d5..016096d5 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/simple_patterns_test.go +++ b/src/go/plugin/go.d/pkg/matcher/simple_patterns_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/string.go b/src/go/plugin/go.d/pkg/matcher/string.go index 43ba43eb..43ba43eb 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/string.go +++ b/src/go/plugin/go.d/pkg/matcher/string.go diff --git a/src/go/collectors/go.d.plugin/pkg/matcher/string_test.go b/src/go/plugin/go.d/pkg/matcher/string_test.go index 1694efbd..1694efbd 100644 --- a/src/go/collectors/go.d.plugin/pkg/matcher/string_test.go +++ b/src/go/plugin/go.d/pkg/matcher/string_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/metrics/counter.go b/src/go/plugin/go.d/pkg/metrics/counter.go index 7231fc7a..406bc879 100644 --- a/src/go/collectors/go.d.plugin/pkg/metrics/counter.go +++ b/src/go/plugin/go.d/pkg/metrics/counter.go @@ -5,7 +5,7 @@ package metrics import ( "errors" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) type ( diff --git a/src/go/collectors/go.d.plugin/pkg/metrics/counter_test.go b/src/go/plugin/go.d/pkg/metrics/counter_test.go index 61f50501..61f50501 100644 --- a/src/go/collectors/go.d.plugin/pkg/metrics/counter_test.go +++ b/src/go/plugin/go.d/pkg/metrics/counter_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/metrics/gauge.go b/src/go/plugin/go.d/pkg/metrics/gauge.go index 6f0930f6..20f0823a 100644 --- a/src/go/collectors/go.d.plugin/pkg/metrics/gauge.go +++ b/src/go/plugin/go.d/pkg/metrics/gauge.go @@ -5,7 +5,7 @@ package metrics import ( "time" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) type ( diff --git a/src/go/collectors/go.d.plugin/pkg/metrics/gauge_test.go b/src/go/plugin/go.d/pkg/metrics/gauge_test.go index 8940e330..8940e330 100644 --- a/src/go/collectors/go.d.plugin/pkg/metrics/gauge_test.go +++ b/src/go/plugin/go.d/pkg/metrics/gauge_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/metrics/histogram.go b/src/go/plugin/go.d/pkg/metrics/histogram.go index caabf09a..98c2302c 100644 --- a/src/go/collectors/go.d.plugin/pkg/metrics/histogram.go +++ b/src/go/plugin/go.d/pkg/metrics/histogram.go @@ -6,7 +6,7 @@ import ( "fmt" "sort" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) type ( diff --git a/src/go/collectors/go.d.plugin/pkg/metrics/histogram_test.go b/src/go/plugin/go.d/pkg/metrics/histogram_test.go index 91266915..91266915 100644 --- a/src/go/collectors/go.d.plugin/pkg/metrics/histogram_test.go +++ b/src/go/plugin/go.d/pkg/metrics/histogram_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/metrics/metrics.go b/src/go/plugin/go.d/pkg/metrics/metrics.go index 44a24056..9f6b7529 100644 --- a/src/go/collectors/go.d.plugin/pkg/metrics/metrics.go +++ b/src/go/plugin/go.d/pkg/metrics/metrics.go @@ -2,7 +2,7 @@ package metrics -import "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" +import "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" // Observer is an interface that wraps the Observe method, which is used by // Histogram and Summary to add observations. diff --git a/src/go/collectors/go.d.plugin/pkg/metrics/summary.go b/src/go/plugin/go.d/pkg/metrics/summary.go index 01b85f65..d72d968e 100644 --- a/src/go/collectors/go.d.plugin/pkg/metrics/summary.go +++ b/src/go/plugin/go.d/pkg/metrics/summary.go @@ -5,7 +5,7 @@ package metrics import ( "math" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) type ( diff --git a/src/go/collectors/go.d.plugin/pkg/metrics/summary_test.go b/src/go/plugin/go.d/pkg/metrics/summary_test.go index b9821836..b9821836 100644 --- a/src/go/collectors/go.d.plugin/pkg/metrics/summary_test.go +++ b/src/go/plugin/go.d/pkg/metrics/summary_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/metrics/unique_counter.go b/src/go/plugin/go.d/pkg/metrics/unique_counter.go index dfc96126..da80fd3d 100644 --- a/src/go/collectors/go.d.plugin/pkg/metrics/unique_counter.go +++ b/src/go/plugin/go.d/pkg/metrics/unique_counter.go @@ -4,7 +4,7 @@ package metrics import ( "github.com/axiomhq/hyperloglog" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" ) type ( diff --git a/src/go/collectors/go.d.plugin/pkg/metrics/unique_counter_test.go b/src/go/plugin/go.d/pkg/metrics/unique_counter_test.go index b9439c9a..b9439c9a 100644 --- a/src/go/collectors/go.d.plugin/pkg/metrics/unique_counter_test.go +++ b/src/go/plugin/go.d/pkg/metrics/unique_counter_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/multipath/multipath.go b/src/go/plugin/go.d/pkg/multipath/multipath.go index 6172def0..6172def0 100644 --- a/src/go/collectors/go.d.plugin/pkg/multipath/multipath.go +++ b/src/go/plugin/go.d/pkg/multipath/multipath.go diff --git a/src/go/collectors/go.d.plugin/pkg/multipath/multipath_test.go b/src/go/plugin/go.d/pkg/multipath/multipath_test.go index cd6c90d9..cd6c90d9 100644 --- a/src/go/collectors/go.d.plugin/pkg/multipath/multipath_test.go +++ b/src/go/plugin/go.d/pkg/multipath/multipath_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/multipath/testdata/data1/test-empty.conf b/src/go/plugin/go.d/pkg/multipath/testdata/data1/test-empty.conf index e69de29b..e69de29b 100644 --- a/src/go/collectors/go.d.plugin/pkg/multipath/testdata/data1/test-empty.conf +++ b/src/go/plugin/go.d/pkg/multipath/testdata/data1/test-empty.conf diff --git a/src/go/collectors/go.d.plugin/pkg/multipath/testdata/data1/test.conf b/src/go/plugin/go.d/pkg/multipath/testdata/data1/test.conf index aebe6473..aebe6473 100644 --- a/src/go/collectors/go.d.plugin/pkg/multipath/testdata/data1/test.conf +++ b/src/go/plugin/go.d/pkg/multipath/testdata/data1/test.conf diff --git a/src/go/collectors/go.d.plugin/pkg/multipath/testdata/data2/test-empty.conf b/src/go/plugin/go.d/pkg/multipath/testdata/data2/test-empty.conf index e69de29b..e69de29b 100644 --- a/src/go/collectors/go.d.plugin/pkg/multipath/testdata/data2/test-empty.conf +++ b/src/go/plugin/go.d/pkg/multipath/testdata/data2/test-empty.conf diff --git a/src/go/collectors/go.d.plugin/pkg/multipath/testdata/data2/test.conf b/src/go/plugin/go.d/pkg/multipath/testdata/data2/test.conf index aebe6473..aebe6473 100644 --- a/src/go/collectors/go.d.plugin/pkg/multipath/testdata/data2/test.conf +++ b/src/go/plugin/go.d/pkg/multipath/testdata/data2/test.conf diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/client.go b/src/go/plugin/go.d/pkg/prometheus/client.go index 3365b270..19d6bcfb 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/client.go +++ b/src/go/plugin/go.d/pkg/prometheus/client.go @@ -13,8 +13,8 @@ import ( "os" "path/filepath" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus/selector" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus/selector" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" ) type ( diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/client_test.go b/src/go/plugin/go.d/pkg/prometheus/client_test.go index 76199800..e6f61b9a 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/client_test.go +++ b/src/go/plugin/go.d/pkg/prometheus/client_test.go @@ -11,8 +11,8 @@ import ( "strings" "testing" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus/selector" - "github.com/netdata/netdata/go/go.d.plugin/pkg/web" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus/selector" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/metric_family.go b/src/go/plugin/go.d/pkg/prometheus/metric_family.go index dde08801..dde08801 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/metric_family.go +++ b/src/go/plugin/go.d/pkg/prometheus/metric_family.go diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/metric_family_test.go b/src/go/plugin/go.d/pkg/prometheus/metric_family_test.go index f373996d..f373996d 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/metric_family_test.go +++ b/src/go/plugin/go.d/pkg/prometheus/metric_family_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/metric_series.go b/src/go/plugin/go.d/pkg/prometheus/metric_series.go index 31914f4b..31914f4b 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/metric_series.go +++ b/src/go/plugin/go.d/pkg/prometheus/metric_series.go diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/metric_series_test.go b/src/go/plugin/go.d/pkg/prometheus/metric_series_test.go index 80c80547..80c80547 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/metric_series_test.go +++ b/src/go/plugin/go.d/pkg/prometheus/metric_series_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/parse.go b/src/go/plugin/go.d/pkg/prometheus/parse.go index 958d6628..2c7d2eb4 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/parse.go +++ b/src/go/plugin/go.d/pkg/prometheus/parse.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus/selector" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus/selector" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/parse_test.go b/src/go/plugin/go.d/pkg/prometheus/parse_test.go index 453011c0..cb128ffe 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/parse_test.go +++ b/src/go/plugin/go.d/pkg/prometheus/parse_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus/selector" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus/selector" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md b/src/go/plugin/go.d/pkg/prometheus/selector/README.md index 75682c38..601eb089 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md +++ b/src/go/plugin/go.d/pkg/prometheus/selector/README.md @@ -1,6 +1,6 @@ <!-- title: "Time series selector" -custom_edit_url: "/src/go/collectors/go.d.plugin/pkg/prometheus/selector/README.md" +custom_edit_url: "/src/go/plugin/go.d/pkg/prometheus/selector/README.md" sidebar_label: "Time series selector" learn_status: "Published" learn_rel_path: "Developers/External plugins/go.d.plugin/Helper Packages" diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/expr.go b/src/go/plugin/go.d/pkg/prometheus/selector/expr.go index 6f61cf3a..6f61cf3a 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/expr.go +++ b/src/go/plugin/go.d/pkg/prometheus/selector/expr.go diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/expr_test.go b/src/go/plugin/go.d/pkg/prometheus/selector/expr_test.go index 598cef9b..598cef9b 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/expr_test.go +++ b/src/go/plugin/go.d/pkg/prometheus/selector/expr_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/logical.go b/src/go/plugin/go.d/pkg/prometheus/selector/logical.go index 1556d171..1556d171 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/logical.go +++ b/src/go/plugin/go.d/pkg/prometheus/selector/logical.go diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/logical_test.go b/src/go/plugin/go.d/pkg/prometheus/selector/logical_test.go index 239c7f71..239c7f71 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/logical_test.go +++ b/src/go/plugin/go.d/pkg/prometheus/selector/logical_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/parse.go b/src/go/plugin/go.d/pkg/prometheus/selector/parse.go index 29c1d4fb..81e970c4 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/parse.go +++ b/src/go/plugin/go.d/pkg/prometheus/selector/parse.go @@ -7,7 +7,7 @@ import ( "regexp" "strings" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" ) var ( diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/parse_test.go b/src/go/plugin/go.d/pkg/prometheus/selector/parse_test.go index ba764e03..1a1f8ab7 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/parse_test.go +++ b/src/go/plugin/go.d/pkg/prometheus/selector/parse_test.go @@ -6,7 +6,7 @@ import ( "fmt" "testing" - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" "github.com/prometheus/prometheus/model/labels" "github.com/stretchr/testify/assert" diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/selector.go b/src/go/plugin/go.d/pkg/prometheus/selector/selector.go index 28203fca..a42b846f 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/selector.go +++ b/src/go/plugin/go.d/pkg/prometheus/selector/selector.go @@ -3,7 +3,7 @@ package selector import ( - "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/matcher" "github.com/prometheus/prometheus/model/labels" ) diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/selector_test.go b/src/go/plugin/go.d/pkg/prometheus/selector/selector_test.go index aa3110b0..aa3110b0 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/selector/selector_test.go +++ b/src/go/plugin/go.d/pkg/prometheus/selector/selector_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/counter-meta.txt b/src/go/plugin/go.d/pkg/prometheus/testdata/counter-meta.txt index 53eccda6..53eccda6 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/counter-meta.txt +++ b/src/go/plugin/go.d/pkg/prometheus/testdata/counter-meta.txt diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/counter-no-meta.txt b/src/go/plugin/go.d/pkg/prometheus/testdata/counter-no-meta.txt index afb11b9b..afb11b9b 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/counter-no-meta.txt +++ b/src/go/plugin/go.d/pkg/prometheus/testdata/counter-no-meta.txt diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/gauge-meta.txt b/src/go/plugin/go.d/pkg/prometheus/testdata/gauge-meta.txt index c0773a42..c0773a42 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/gauge-meta.txt +++ b/src/go/plugin/go.d/pkg/prometheus/testdata/gauge-meta.txt diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/gauge-no-meta.txt b/src/go/plugin/go.d/pkg/prometheus/testdata/gauge-no-meta.txt index e89e0e4d..e89e0e4d 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/gauge-no-meta.txt +++ b/src/go/plugin/go.d/pkg/prometheus/testdata/gauge-no-meta.txt diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/histogram-meta.txt b/src/go/plugin/go.d/pkg/prometheus/testdata/histogram-meta.txt index 9b4b8a96..9b4b8a96 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/histogram-meta.txt +++ b/src/go/plugin/go.d/pkg/prometheus/testdata/histogram-meta.txt diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/histogram-no-meta.txt b/src/go/plugin/go.d/pkg/prometheus/testdata/histogram-no-meta.txt index 49def677..49def677 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/histogram-no-meta.txt +++ b/src/go/plugin/go.d/pkg/prometheus/testdata/histogram-no-meta.txt diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/multiline-help.txt b/src/go/plugin/go.d/pkg/prometheus/testdata/multiline-help.txt index f1598fcc..f1598fcc 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/multiline-help.txt +++ b/src/go/plugin/go.d/pkg/prometheus/testdata/multiline-help.txt diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/summary-meta.txt b/src/go/plugin/go.d/pkg/prometheus/testdata/summary-meta.txt index 3056e807..3056e807 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/summary-meta.txt +++ b/src/go/plugin/go.d/pkg/prometheus/testdata/summary-meta.txt diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/summary-no-meta.txt b/src/go/plugin/go.d/pkg/prometheus/testdata/summary-no-meta.txt index e66564bb..e66564bb 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/summary-no-meta.txt +++ b/src/go/plugin/go.d/pkg/prometheus/testdata/summary-no-meta.txt diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/testdata.nometa.txt b/src/go/plugin/go.d/pkg/prometheus/testdata/testdata.nometa.txt index e760ad26..e760ad26 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/testdata.nometa.txt +++ b/src/go/plugin/go.d/pkg/prometheus/testdata/testdata.nometa.txt diff --git a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/testdata.txt b/src/go/plugin/go.d/pkg/prometheus/testdata/testdata.txt index c7f2a7af..c7f2a7af 100644 --- a/src/go/collectors/go.d.plugin/pkg/prometheus/testdata/testdata.txt +++ b/src/go/plugin/go.d/pkg/prometheus/testdata/testdata.txt diff --git a/src/go/collectors/go.d.plugin/pkg/socket/client.go b/src/go/plugin/go.d/pkg/socket/client.go index 26ae1dfa..26ae1dfa 100644 --- a/src/go/collectors/go.d.plugin/pkg/socket/client.go +++ b/src/go/plugin/go.d/pkg/socket/client.go diff --git a/src/go/collectors/go.d.plugin/pkg/socket/client_test.go b/src/go/plugin/go.d/pkg/socket/client_test.go index fa64f455..fa64f455 100644 --- a/src/go/collectors/go.d.plugin/pkg/socket/client_test.go +++ b/src/go/plugin/go.d/pkg/socket/client_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/socket/servers_test.go b/src/go/plugin/go.d/pkg/socket/servers_test.go index d6617816..d6617816 100644 --- a/src/go/collectors/go.d.plugin/pkg/socket/servers_test.go +++ b/src/go/plugin/go.d/pkg/socket/servers_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/socket/types.go b/src/go/plugin/go.d/pkg/socket/types.go index 693faf5b..693faf5b 100644 --- a/src/go/collectors/go.d.plugin/pkg/socket/types.go +++ b/src/go/plugin/go.d/pkg/socket/types.go diff --git a/src/go/collectors/go.d.plugin/pkg/socket/utils.go b/src/go/plugin/go.d/pkg/socket/utils.go index dcc48b38..dcc48b38 100644 --- a/src/go/collectors/go.d.plugin/pkg/socket/utils.go +++ b/src/go/plugin/go.d/pkg/socket/utils.go diff --git a/src/go/collectors/go.d.plugin/pkg/stm/stm.go b/src/go/plugin/go.d/pkg/stm/stm.go index 7d07ba9a..7d07ba9a 100644 --- a/src/go/collectors/go.d.plugin/pkg/stm/stm.go +++ b/src/go/plugin/go.d/pkg/stm/stm.go diff --git a/src/go/collectors/go.d.plugin/pkg/stm/stm_test.go b/src/go/plugin/go.d/pkg/stm/stm_test.go index 04d63b32..74ac6f3f 100644 --- a/src/go/collectors/go.d.plugin/pkg/stm/stm_test.go +++ b/src/go/plugin/go.d/pkg/stm/stm_test.go @@ -5,9 +5,9 @@ package stm_test import ( "testing" - "github.com/netdata/netdata/go/go.d.plugin/pkg/stm" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/stm" - "github.com/netdata/netdata/go/go.d.plugin/pkg/metrics" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics" "github.com/stretchr/testify/assert" ) diff --git a/src/go/collectors/go.d.plugin/pkg/tlscfg/config.go b/src/go/plugin/go.d/pkg/tlscfg/config.go index 7a227c4c..7a227c4c 100644 --- a/src/go/collectors/go.d.plugin/pkg/tlscfg/config.go +++ b/src/go/plugin/go.d/pkg/tlscfg/config.go diff --git a/src/go/collectors/go.d.plugin/pkg/tlscfg/config_test.go b/src/go/plugin/go.d/pkg/tlscfg/config_test.go index d95fe24b..d95fe24b 100644 --- a/src/go/collectors/go.d.plugin/pkg/tlscfg/config_test.go +++ b/src/go/plugin/go.d/pkg/tlscfg/config_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/web/client.go b/src/go/plugin/go.d/pkg/web/client.go index 1de75230..02dc17de 100644 --- a/src/go/collectors/go.d.plugin/pkg/web/client.go +++ b/src/go/plugin/go.d/pkg/web/client.go @@ -9,7 +9,7 @@ import ( "net/http" "net/url" - "github.com/netdata/netdata/go/go.d.plugin/pkg/tlscfg" + "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/tlscfg" ) // ErrRedirectAttempted indicates that a redirect occurred. diff --git a/src/go/collectors/go.d.plugin/pkg/web/client_test.go b/src/go/plugin/go.d/pkg/web/client_test.go index ead1486c..ead1486c 100644 --- a/src/go/collectors/go.d.plugin/pkg/web/client_test.go +++ b/src/go/plugin/go.d/pkg/web/client_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/web/doc.go b/src/go/plugin/go.d/pkg/web/doc.go index 4c6d3146..4c6d3146 100644 --- a/src/go/collectors/go.d.plugin/pkg/web/doc.go +++ b/src/go/plugin/go.d/pkg/web/doc.go diff --git a/src/go/collectors/go.d.plugin/pkg/web/doc_test.go b/src/go/plugin/go.d/pkg/web/doc_test.go index 137eed20..137eed20 100644 --- a/src/go/collectors/go.d.plugin/pkg/web/doc_test.go +++ b/src/go/plugin/go.d/pkg/web/doc_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/web/duration.go b/src/go/plugin/go.d/pkg/web/duration.go index 85d5ef65..85d5ef65 100644 --- a/src/go/collectors/go.d.plugin/pkg/web/duration.go +++ b/src/go/plugin/go.d/pkg/web/duration.go diff --git a/src/go/collectors/go.d.plugin/pkg/web/duration_test.go b/src/go/plugin/go.d/pkg/web/duration_test.go index b45063f1..b45063f1 100644 --- a/src/go/collectors/go.d.plugin/pkg/web/duration_test.go +++ b/src/go/plugin/go.d/pkg/web/duration_test.go diff --git a/src/go/collectors/go.d.plugin/pkg/web/request.go b/src/go/plugin/go.d/pkg/web/request.go index e8e4b742..20a6ec09 100644 --- a/src/go/collectors/go.d.plugin/pkg/web/request.go +++ b/src/go/plugin/go.d/pkg/web/request.go @@ -7,10 +7,11 @@ import ( "fmt" "io" "net/http" + "net/url" "strings" - "github.com/netdata/netdata/go/go.d.plugin/agent/executable" - "github.com/netdata/netdata/go/go.d.plugin/pkg/buildinfo" + "github.com/netdata/netdata/go/plugins/pkg/buildinfo" + "github.com/netdata/netdata/go/plugins/pkg/executable" ) // Request is the configuration of the HTTP request. @@ -90,3 +91,15 @@ func NewHTTPRequest(cfg Request) (*http.Request, error) { return req, nil } + +func NewHTTPRequestWithPath(cfg Request, urlPath string) (*http.Request, error) { + cfg = cfg.Copy() + + v, err := url.JoinPath(cfg.URL, urlPath) + if err != nil { + return nil, fmt.Errorf("failed to join URL path: %v", err) + } + cfg.URL = v + + return NewHTTPRequest(cfg) +} diff --git a/src/go/collectors/go.d.plugin/pkg/web/request_test.go b/src/go/plugin/go.d/pkg/web/request_test.go index 284cccb9..d39f9a36 100644 --- a/src/go/collectors/go.d.plugin/pkg/web/request_test.go +++ b/src/go/plugin/go.d/pkg/web/request_test.go @@ -159,6 +159,34 @@ func TestNewHTTPRequest(t *testing.T) { } } +func TestNewRequest(t *testing.T) { + tests := map[string]struct { + url string + path string + wantURL string + }{ + "base url": { + url: "http://127.0.0.1:65535", + path: "/bar", + wantURL: "http://127.0.0.1:65535/bar", + }, + "with path": { + url: "http://127.0.0.1:65535/foo/", + path: "/bar", + wantURL: "http://127.0.0.1:65535/foo/bar", + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + req, err := NewHTTPRequestWithPath(Request{URL: test.url}.Copy(), test.path) + require.NoError(t, err) + + assert.Equal(t, test.wantURL, req.URL.String()) + }) + } +} + func parseBasicAuth(auth string) (username, password string, ok bool) { const prefix = "Basic " if len(auth) < len(prefix) || !strings.EqualFold(auth[:len(prefix)], prefix) { diff --git a/src/go/collectors/go.d.plugin/pkg/web/web.go b/src/go/plugin/go.d/pkg/web/web.go index cbda396d..cbda396d 100644 --- a/src/go/collectors/go.d.plugin/pkg/web/web.go +++ b/src/go/plugin/go.d/pkg/web/web.go |