summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIlya Mashchenko <ilya@netdata.cloud>2024-04-22 13:53:56 +0300
committerGitHub <noreply@github.com>2024-04-22 13:53:56 +0300
commit93c0b0d82db4bb53c374aca87693cfcc28e5e78e (patch)
treef2eff5e6884c86a4b958b7c2bfb87eb5521e2f0b /src
parent5616663d04d83de071b399abad06baa82645e93d (diff)
go.d windows add "vnode" to config schema (#17478)
Diffstat (limited to 'src')
-rw-r--r--src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go8
-rw-r--r--src/go/collectors/go.d.plugin/modules/windows/config_schema.json10
-rw-r--r--src/go/collectors/go.d.plugin/modules/windows/testdata/config.json1
-rw-r--r--src/go/collectors/go.d.plugin/modules/windows/testdata/config.yaml1
-rw-r--r--src/go/collectors/go.d.plugin/modules/windows/windows.go3
5 files changed, 20 insertions, 3 deletions
diff --git a/src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go b/src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go
index b747546386..37a83b7485 100644
--- a/src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go
+++ b/src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go
@@ -178,6 +178,14 @@ func (m *Manager) dyncfgConfigTest(fn functions.Function) {
return
}
+ if cfg.Vnode() != "" {
+ if _, ok := m.Vnodes.Lookup(cfg.Vnode()); !ok {
+ m.Warningf("dyncfg: test: module %s: vnode %s not found", mn, cfg.Vnode())
+ m.dyncfgRespf(fn, 400, "The specified vnode '%s' is not registered.", cfg.Vnode())
+ return
+ }
+ }
+
cfg.SetModule(mn)
cfg.SetName("test")
diff --git a/src/go/collectors/go.d.plugin/modules/windows/config_schema.json b/src/go/collectors/go.d.plugin/modules/windows/config_schema.json
index 7fb5c299ee..c112abe66f 100644
--- a/src/go/collectors/go.d.plugin/modules/windows/config_schema.json
+++ b/src/go/collectors/go.d.plugin/modules/windows/config_schema.json
@@ -28,6 +28,11 @@
"description": "If set, the client will not follow HTTP redirects automatically.",
"type": "boolean"
},
+ "vnode": {
+ "title": "Vnode",
+ "description": "The hostname of the [virtual node](https://github.com/netdata/netdata/blob/master/docs/guides/using-host-labels.md#virtual-nodes) defined in the vnodes.conf configuration file.",
+ "type": "string"
+ },
"username": {
"title": "Username",
"description": "The username for basic authentication.",
@@ -118,7 +123,8 @@
"update_every",
"url",
"timeout",
- "not_follow_redirects"
+ "not_follow_redirects",
+ "vnode"
]
},
{
@@ -163,7 +169,7 @@
"ui:widget": "hidden"
},
"url": {
- "ui:placeholder": "http://203.0.113.0/metrics"
+ "ui:placeholder": "http://203.0.113.0:9182/metrics"
},
"timeout": {
"ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)."
diff --git a/src/go/collectors/go.d.plugin/modules/windows/testdata/config.json b/src/go/collectors/go.d.plugin/modules/windows/testdata/config.json
index 984c3ed6e7..6f8c1084e1 100644
--- a/src/go/collectors/go.d.plugin/modules/windows/testdata/config.json
+++ b/src/go/collectors/go.d.plugin/modules/windows/testdata/config.json
@@ -1,5 +1,6 @@
{
"update_every": 123,
+ "vnode": "ok",
"url": "ok",
"body": "ok",
"method": "ok",
diff --git a/src/go/collectors/go.d.plugin/modules/windows/testdata/config.yaml b/src/go/collectors/go.d.plugin/modules/windows/testdata/config.yaml
index 8558b61cc0..4bbb7474d0 100644
--- a/src/go/collectors/go.d.plugin/modules/windows/testdata/config.yaml
+++ b/src/go/collectors/go.d.plugin/modules/windows/testdata/config.yaml
@@ -1,4 +1,5 @@
update_every: 123
+vnode: "ok"
url: "ok"
body: "ok"
method: "ok"
diff --git a/src/go/collectors/go.d.plugin/modules/windows/windows.go b/src/go/collectors/go.d.plugin/modules/windows/windows.go
index a37a64dffb..cd6af9354b 100644
--- a/src/go/collectors/go.d.plugin/modules/windows/windows.go
+++ b/src/go/collectors/go.d.plugin/modules/windows/windows.go
@@ -69,7 +69,8 @@ func New() *Windows {
type Config struct {
web.HTTP `yaml:",inline" json:""`
- UpdateEvery int `yaml:"update_every" json:"update_every"`
+ UpdateEvery int `yaml:"update_every" json:"update_every"`
+ Vnode string `yaml:"vnode" json:"vnode"`
}
type (